Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branches 'clk-aspeed', 'clk-keystone', 'clk-mobileye' and 'clk-allwinner' into clk-next

* clk-aspeed:
clk: ast2600: Add FSI parent clock with correct rate
dt-bindings: clock: ast2600: Add FSI clock

* clk-keystone:
clk: keystone: sci-clk: Adding support for non contiguous clocks

* clk-mobileye:
dt-bindings: reset: mobileye,eyeq5-reset: add bindings
dt-bindings: clock: mobileye,eyeq5-clk: add bindings
clk: fixed-factor: add fwname-based constructor functions
clk: fixed-factor: add optional accuracy support

* clk-allwinner:
clk: sunxi: usb: fix kernel-doc warnings
clk: sunxi: sun9i-cpus: fix kernel-doc warnings
clk: sunxi: a20-gmac: fix kernel-doc warnings

+265 -35
+51
Documentation/devicetree/bindings/clock/mobileye,eyeq5-clk.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/clock/mobileye,eyeq5-clk.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Mobileye EyeQ5 clock controller 8 + 9 + description: 10 + The EyeQ5 clock controller handles 10 read-only PLLs derived from the main 11 + crystal clock. It also exposes one divider clock, a child of one of the PLLs. 12 + Its registers live in a shared region called OLB. 13 + 14 + maintainers: 15 + - Grégory Clement <gregory.clement@bootlin.com> 16 + - Théo Lebrun <theo.lebrun@bootlin.com> 17 + - Vladimir Kondratiev <vladimir.kondratiev@mobileye.com> 18 + 19 + properties: 20 + compatible: 21 + const: mobileye,eyeq5-clk 22 + 23 + reg: 24 + maxItems: 2 25 + 26 + reg-names: 27 + items: 28 + - const: plls 29 + - const: ospi 30 + 31 + "#clock-cells": 32 + const: 1 33 + 34 + clocks: 35 + maxItems: 1 36 + description: 37 + Input parent clock to all PLLs. Expected to be the main crystal. 38 + 39 + clock-names: 40 + items: 41 + - const: ref 42 + 43 + required: 44 + - compatible 45 + - reg 46 + - reg-names 47 + - "#clock-cells" 48 + - clocks 49 + - clock-names 50 + 51 + additionalProperties: false
+43
Documentation/devicetree/bindings/reset/mobileye,eyeq5-reset.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/reset/mobileye,eyeq5-reset.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Mobileye EyeQ5 reset controller 8 + 9 + description: 10 + The EyeQ5 reset driver handles three reset domains. Its registers live in a 11 + shared region called OLB. 12 + 13 + maintainers: 14 + - Grégory Clement <gregory.clement@bootlin.com> 15 + - Théo Lebrun <theo.lebrun@bootlin.com> 16 + - Vladimir Kondratiev <vladimir.kondratiev@mobileye.com> 17 + 18 + properties: 19 + compatible: 20 + const: mobileye,eyeq5-reset 21 + 22 + reg: 23 + maxItems: 3 24 + 25 + reg-names: 26 + items: 27 + - const: d0 28 + - const: d1 29 + - const: d2 30 + 31 + "#reset-cells": 32 + const: 2 33 + description: 34 + The first cell is the domain (0 to 2 inclusive) and the second one is the 35 + reset index inside that domain. 36 + 37 + required: 38 + - compatible 39 + - reg 40 + - reg-names 41 + - "#reset-cells" 42 + 43 + additionalProperties: false
+5 -2
drivers/clk/clk-ast2600.c
··· 19 19 * This includes the gates (configured from aspeed_g6_gates), plus the 20 20 * explicitly-configured clocks (ASPEED_CLK_HPLL and up). 21 21 */ 22 - #define ASPEED_G6_NUM_CLKS 72 22 + #define ASPEED_G6_NUM_CLKS 73 23 23 24 24 #define ASPEED_G6_SILICON_REV 0x014 25 25 #define CHIP_REVISION_ID GENMASK(23, 16) ··· 157 157 [ASPEED_CLK_GATE_UART11CLK] = { 59, -1, "uart11clk-gate", "uartx", 0 }, /* UART11 */ 158 158 [ASPEED_CLK_GATE_UART12CLK] = { 60, -1, "uart12clk-gate", "uartx", 0 }, /* UART12 */ 159 159 [ASPEED_CLK_GATE_UART13CLK] = { 61, -1, "uart13clk-gate", "uartx", 0 }, /* UART13 */ 160 - [ASPEED_CLK_GATE_FSICLK] = { 62, 59, "fsiclk-gate", NULL, 0 }, /* FSI */ 160 + [ASPEED_CLK_GATE_FSICLK] = { 62, 59, "fsiclk-gate", "fsiclk", 0 }, /* FSI */ 161 161 }; 162 162 163 163 static const struct clk_div_table ast2600_eclk_div_table[] = { ··· 821 821 822 822 hw = clk_hw_register_fixed_factor(NULL, "i3cclk", "apll", 0, 1, 8); 823 823 aspeed_g6_clk_data->hws[ASPEED_CLK_I3C] = hw; 824 + 825 + hw = clk_hw_register_fixed_factor(NULL, "fsiclk", "apll", 0, 1, 4); 826 + aspeed_g6_clk_data->hws[ASPEED_CLK_FSI] = hw; 824 827 }; 825 828 826 829 static void __init aspeed_g6_cc_init(struct device_node *np)
+87 -16
drivers/clk/clk-fixed-factor.c
··· 57 57 return 0; 58 58 } 59 59 60 + static unsigned long clk_factor_recalc_accuracy(struct clk_hw *hw, 61 + unsigned long parent_accuracy) 62 + { 63 + struct clk_fixed_factor *fix = to_clk_fixed_factor(hw); 64 + 65 + if (fix->flags & CLK_FIXED_FACTOR_FIXED_ACCURACY) 66 + return fix->acc; 67 + 68 + return parent_accuracy; 69 + } 70 + 60 71 const struct clk_ops clk_fixed_factor_ops = { 61 72 .round_rate = clk_factor_round_rate, 62 73 .set_rate = clk_factor_set_rate, 63 74 .recalc_rate = clk_factor_recalc_rate, 75 + .recalc_accuracy = clk_factor_recalc_accuracy, 64 76 }; 65 77 EXPORT_SYMBOL_GPL(clk_fixed_factor_ops); 66 78 ··· 91 79 static struct clk_hw * 92 80 __clk_hw_register_fixed_factor(struct device *dev, struct device_node *np, 93 81 const char *name, const char *parent_name, 94 - const struct clk_hw *parent_hw, int index, 82 + const struct clk_hw *parent_hw, const struct clk_parent_data *pdata, 95 83 unsigned long flags, unsigned int mult, unsigned int div, 96 - bool devm) 84 + unsigned long acc, unsigned int fixflags, bool devm) 97 85 { 98 86 struct clk_fixed_factor *fix; 99 87 struct clk_init_data init = { }; 100 - struct clk_parent_data pdata = { .index = index }; 101 88 struct clk_hw *hw; 102 89 int ret; 103 90 ··· 116 105 fix->mult = mult; 117 106 fix->div = div; 118 107 fix->hw.init = &init; 108 + fix->acc = acc; 109 + fix->flags = fixflags; 119 110 120 111 init.name = name; 121 112 init.ops = &clk_fixed_factor_ops; ··· 127 114 else if (parent_hw) 128 115 init.parent_hws = &parent_hw; 129 116 else 130 - init.parent_data = &pdata; 117 + init.parent_data = pdata; 131 118 init.num_parents = 1; 132 119 133 120 hw = &fix->hw; ··· 164 151 const char *name, unsigned int index, unsigned long flags, 165 152 unsigned int mult, unsigned int div) 166 153 { 167 - return __clk_hw_register_fixed_factor(dev, NULL, name, NULL, NULL, index, 168 - flags, mult, div, true); 154 + const struct clk_parent_data pdata = { .index = index }; 155 + 156 + return __clk_hw_register_fixed_factor(dev, NULL, name, NULL, NULL, &pdata, 157 + flags, mult, div, 0, 0, true); 169 158 } 170 159 EXPORT_SYMBOL_GPL(devm_clk_hw_register_fixed_factor_index); 171 160 ··· 188 173 const char *name, const struct clk_hw *parent_hw, 189 174 unsigned long flags, unsigned int mult, unsigned int div) 190 175 { 176 + const struct clk_parent_data pdata = { .index = -1 }; 177 + 191 178 return __clk_hw_register_fixed_factor(dev, NULL, name, NULL, parent_hw, 192 - -1, flags, mult, div, true); 179 + &pdata, flags, mult, div, 0, 0, true); 193 180 } 194 181 EXPORT_SYMBOL_GPL(devm_clk_hw_register_fixed_factor_parent_hw); 195 182 ··· 199 182 const char *name, const struct clk_hw *parent_hw, 200 183 unsigned long flags, unsigned int mult, unsigned int div) 201 184 { 202 - return __clk_hw_register_fixed_factor(dev, NULL, name, NULL, 203 - parent_hw, -1, flags, mult, div, 204 - false); 185 + const struct clk_parent_data pdata = { .index = -1 }; 186 + 187 + return __clk_hw_register_fixed_factor(dev, NULL, name, NULL, parent_hw, 188 + &pdata, flags, mult, div, 0, 0, false); 205 189 } 206 190 EXPORT_SYMBOL_GPL(clk_hw_register_fixed_factor_parent_hw); 207 191 ··· 210 192 const char *name, const char *parent_name, unsigned long flags, 211 193 unsigned int mult, unsigned int div) 212 194 { 213 - return __clk_hw_register_fixed_factor(dev, NULL, name, parent_name, NULL, -1, 214 - flags, mult, div, false); 195 + const struct clk_parent_data pdata = { .index = -1 }; 196 + 197 + return __clk_hw_register_fixed_factor(dev, NULL, name, parent_name, NULL, 198 + &pdata, flags, mult, div, 0, 0, false); 215 199 } 216 200 EXPORT_SYMBOL_GPL(clk_hw_register_fixed_factor); 201 + 202 + struct clk_hw *clk_hw_register_fixed_factor_fwname(struct device *dev, 203 + struct device_node *np, const char *name, const char *fw_name, 204 + unsigned long flags, unsigned int mult, unsigned int div) 205 + { 206 + const struct clk_parent_data pdata = { .index = -1, .fw_name = fw_name }; 207 + 208 + return __clk_hw_register_fixed_factor(dev, np, name, NULL, NULL, 209 + &pdata, flags, mult, div, 0, 0, false); 210 + } 211 + EXPORT_SYMBOL_GPL(clk_hw_register_fixed_factor_fwname); 212 + 213 + struct clk_hw *clk_hw_register_fixed_factor_with_accuracy_fwname(struct device *dev, 214 + struct device_node *np, const char *name, const char *fw_name, 215 + unsigned long flags, unsigned int mult, unsigned int div, 216 + unsigned long acc) 217 + { 218 + const struct clk_parent_data pdata = { .index = -1, .fw_name = fw_name }; 219 + 220 + return __clk_hw_register_fixed_factor(dev, np, name, NULL, NULL, 221 + &pdata, flags, mult, div, acc, 222 + CLK_FIXED_FACTOR_FIXED_ACCURACY, false); 223 + } 224 + EXPORT_SYMBOL_GPL(clk_hw_register_fixed_factor_with_accuracy_fwname); 217 225 218 226 struct clk *clk_register_fixed_factor(struct device *dev, const char *name, 219 227 const char *parent_name, unsigned long flags, ··· 283 239 const char *name, const char *parent_name, unsigned long flags, 284 240 unsigned int mult, unsigned int div) 285 241 { 286 - return __clk_hw_register_fixed_factor(dev, NULL, name, parent_name, NULL, -1, 287 - flags, mult, div, true); 242 + const struct clk_parent_data pdata = { .index = -1 }; 243 + 244 + return __clk_hw_register_fixed_factor(dev, NULL, name, parent_name, NULL, 245 + &pdata, flags, mult, div, 0, 0, true); 288 246 } 289 247 EXPORT_SYMBOL_GPL(devm_clk_hw_register_fixed_factor); 248 + 249 + struct clk_hw *devm_clk_hw_register_fixed_factor_fwname(struct device *dev, 250 + struct device_node *np, const char *name, const char *fw_name, 251 + unsigned long flags, unsigned int mult, unsigned int div) 252 + { 253 + const struct clk_parent_data pdata = { .index = -1, .fw_name = fw_name }; 254 + 255 + return __clk_hw_register_fixed_factor(dev, np, name, NULL, NULL, 256 + &pdata, flags, mult, div, 0, 0, true); 257 + } 258 + EXPORT_SYMBOL_GPL(devm_clk_hw_register_fixed_factor_fwname); 259 + 260 + struct clk_hw *devm_clk_hw_register_fixed_factor_with_accuracy_fwname(struct device *dev, 261 + struct device_node *np, const char *name, const char *fw_name, 262 + unsigned long flags, unsigned int mult, unsigned int div, 263 + unsigned long acc) 264 + { 265 + const struct clk_parent_data pdata = { .index = -1, .fw_name = fw_name }; 266 + 267 + return __clk_hw_register_fixed_factor(dev, np, name, NULL, NULL, 268 + &pdata, flags, mult, div, acc, 269 + CLK_FIXED_FACTOR_FIXED_ACCURACY, true); 270 + } 271 + EXPORT_SYMBOL_GPL(devm_clk_hw_register_fixed_factor_with_accuracy_fwname); 290 272 291 273 #ifdef CONFIG_OF 292 274 static struct clk_hw *_of_fixed_factor_clk_setup(struct device_node *node) 293 275 { 294 276 struct clk_hw *hw; 295 277 const char *clk_name = node->name; 278 + const struct clk_parent_data pdata = { .index = 0 }; 296 279 u32 div, mult; 297 280 int ret; 298 281 ··· 337 266 338 267 of_property_read_string(node, "clock-output-names", &clk_name); 339 268 340 - hw = __clk_hw_register_fixed_factor(NULL, node, clk_name, NULL, NULL, 0, 341 - 0, mult, div, false); 269 + hw = __clk_hw_register_fixed_factor(NULL, node, clk_name, NULL, NULL, 270 + &pdata, 0, mult, div, 0, 0, false); 342 271 if (IS_ERR(hw)) { 343 272 /* 344 273 * Clear OF_POPULATED flag so that clock registration can be
+10
drivers/clk/keystone/sci-clk.c
··· 516 516 struct sci_clk *sci_clk, *prev; 517 517 int num_clks = 0; 518 518 int num_parents; 519 + bool state; 519 520 int clk_id; 520 521 const char * const clk_names[] = { 521 522 "clocks", "assigned-clocks", "assigned-clock-parents", NULL ··· 587 586 clk_id = args.args[1] + 1; 588 587 589 588 while (num_parents--) { 589 + /* Check if this clock id is valid */ 590 + ret = provider->ops->is_auto(provider->sci, 591 + sci_clk->dev_id, clk_id, &state); 592 + 593 + if (ret) { 594 + clk_id++; 595 + continue; 596 + } 597 + 590 598 sci_clk = devm_kzalloc(dev, 591 599 sizeof(*sci_clk), 592 600 GFP_KERNEL);
+11 -10
drivers/clk/sunxi/clk-a20-gmac.c
··· 15 15 16 16 static DEFINE_SPINLOCK(gmac_lock); 17 17 18 + 19 + #define SUN7I_A20_GMAC_GPIT 2 20 + #define SUN7I_A20_GMAC_MASK 0x3 21 + #define SUN7I_A20_GMAC_PARENTS 2 22 + 23 + static u32 sun7i_a20_gmac_mux_table[SUN7I_A20_GMAC_PARENTS] = { 24 + 0x00, /* Select mii_phy_tx_clk */ 25 + 0x02, /* Select gmac_int_tx_clk */ 26 + }; 27 + 18 28 /** 19 29 * sun7i_a20_gmac_clk_setup - Setup function for A20/A31 GMAC clock module 30 + * @node: &struct device_node for the clock 20 31 * 21 32 * This clock looks something like this 22 33 * ________________________ ··· 50 39 * enable/disable this clock to configure the required state. The clock 51 40 * driver then responds by auto-reparenting the clock. 52 41 */ 53 - 54 - #define SUN7I_A20_GMAC_GPIT 2 55 - #define SUN7I_A20_GMAC_MASK 0x3 56 - #define SUN7I_A20_GMAC_PARENTS 2 57 - 58 - static u32 sun7i_a20_gmac_mux_table[SUN7I_A20_GMAC_PARENTS] = { 59 - 0x00, /* Select mii_phy_tx_clk */ 60 - 0x02, /* Select gmac_int_tx_clk */ 61 - }; 62 - 63 42 static void __init sun7i_a20_gmac_clk_setup(struct device_node *node) 64 43 { 65 44 struct clk *clk;
+4 -3
drivers/clk/sunxi/clk-sun9i-cpus.c
··· 18 18 19 19 static DEFINE_SPINLOCK(sun9i_a80_cpus_lock); 20 20 21 - /** 22 - * sun9i_a80_cpus_clk_setup() - Setup function for a80 cpus composite clk 23 - */ 24 21 25 22 #define SUN9I_CPUS_MAX_PARENTS 4 26 23 #define SUN9I_CPUS_MUX_PARENT_PLL4 3 ··· 177 180 .set_rate = sun9i_a80_cpus_clk_set_rate, 178 181 }; 179 182 183 + /** 184 + * sun9i_a80_cpus_setup() - Setup function for a80 cpus composite clk 185 + * @node: &struct device_node for the clock 186 + */ 180 187 static void sun9i_a80_cpus_setup(struct device_node *node) 181 188 { 182 189 const char *clk_name = node->name;
+6 -3
drivers/clk/sunxi/clk-usb.c
··· 73 73 .deassert = sunxi_usb_reset_deassert, 74 74 }; 75 75 76 - /** 77 - * sunxi_usb_clk_setup() - Setup function for usb gate clocks 78 - */ 79 76 80 77 #define SUNXI_USB_MAX_SIZE 32 81 78 ··· 82 85 bool reset_needs_clk; 83 86 }; 84 87 88 + /** 89 + * sunxi_usb_clk_setup() - Setup function for usb gate clocks 90 + * @node: &struct device_node for the clock 91 + * @data: &struct usb_clk_data for the clock 92 + * @lock: spinlock for the clock 93 + */ 85 94 static void __init sunxi_usb_clk_setup(struct device_node *node, 86 95 const struct usb_clk_data *data, 87 96 spinlock_t *lock)
+1
include/dt-bindings/clock/ast2600-clock.h
··· 86 86 #define ASPEED_CLK_MAC3RCLK 69 87 87 #define ASPEED_CLK_MAC4RCLK 70 88 88 #define ASPEED_CLK_I3C 71 89 + #define ASPEED_CLK_FSI 72 89 90 90 91 /* Only list resets here that are not part of a clock gate + reset pair */ 91 92 #define ASPEED_RESET_ADC 55
+22
include/dt-bindings/clock/mobileye,eyeq5-clk.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 2 + /* 3 + * Copyright (C) 2024 Mobileye Vision Technologies Ltd. 4 + */ 5 + 6 + #ifndef _DT_BINDINGS_CLOCK_MOBILEYE_EYEQ5_CLK_H 7 + #define _DT_BINDINGS_CLOCK_MOBILEYE_EYEQ5_CLK_H 8 + 9 + #define EQ5C_PLL_CPU 0 10 + #define EQ5C_PLL_VMP 1 11 + #define EQ5C_PLL_PMA 2 12 + #define EQ5C_PLL_VDI 3 13 + #define EQ5C_PLL_DDR0 4 14 + #define EQ5C_PLL_PCI 5 15 + #define EQ5C_PLL_PER 6 16 + #define EQ5C_PLL_PMAC 7 17 + #define EQ5C_PLL_MPC 8 18 + #define EQ5C_PLL_DDR1 9 19 + 20 + #define EQ5C_DIV_OSPI 10 21 + 22 + #endif
+25 -1
include/linux/clk-provider.h
··· 1084 1084 * @hw: handle between common and hardware-specific interfaces 1085 1085 * @mult: multiplier 1086 1086 * @div: divider 1087 + * @acc: fixed accuracy in ppb 1088 + * @flags: behavior modifying flags 1087 1089 * 1088 1090 * Clock with a fixed multiplier and divider. The output frequency is the 1089 1091 * parent clock rate divided by div and multiplied by mult. 1090 - * Implements .recalc_rate, .set_rate and .round_rate 1092 + * Implements .recalc_rate, .set_rate, .round_rate and .recalc_accuracy 1093 + * 1094 + * Flags: 1095 + * * CLK_FIXED_FACTOR_FIXED_ACCURACY - Use the value in @acc instead of the 1096 + * parent clk accuracy. 1091 1097 */ 1092 1098 1093 1099 struct clk_fixed_factor { 1094 1100 struct clk_hw hw; 1095 1101 unsigned int mult; 1096 1102 unsigned int div; 1103 + unsigned long acc; 1104 + unsigned int flags; 1097 1105 }; 1106 + 1107 + #define CLK_FIXED_FACTOR_FIXED_ACCURACY BIT(0) 1098 1108 1099 1109 #define to_clk_fixed_factor(_hw) container_of(_hw, struct clk_fixed_factor, hw) 1100 1110 ··· 1116 1106 struct clk_hw *clk_hw_register_fixed_factor(struct device *dev, 1117 1107 const char *name, const char *parent_name, unsigned long flags, 1118 1108 unsigned int mult, unsigned int div); 1109 + struct clk_hw *clk_hw_register_fixed_factor_fwname(struct device *dev, 1110 + struct device_node *np, const char *name, const char *fw_name, 1111 + unsigned long flags, unsigned int mult, unsigned int div); 1112 + struct clk_hw *clk_hw_register_fixed_factor_with_accuracy_fwname(struct device *dev, 1113 + struct device_node *np, const char *name, const char *fw_name, 1114 + unsigned long flags, unsigned int mult, unsigned int div, 1115 + unsigned long acc); 1119 1116 void clk_hw_unregister_fixed_factor(struct clk_hw *hw); 1120 1117 struct clk_hw *devm_clk_hw_register_fixed_factor(struct device *dev, 1121 1118 const char *name, const char *parent_name, unsigned long flags, 1122 1119 unsigned int mult, unsigned int div); 1120 + struct clk_hw *devm_clk_hw_register_fixed_factor_fwname(struct device *dev, 1121 + struct device_node *np, const char *name, const char *fw_name, 1122 + unsigned long flags, unsigned int mult, unsigned int div); 1123 + struct clk_hw *devm_clk_hw_register_fixed_factor_with_accuracy_fwname(struct device *dev, 1124 + struct device_node *np, const char *name, const char *fw_name, 1125 + unsigned long flags, unsigned int mult, unsigned int div, 1126 + unsigned long acc); 1123 1127 struct clk_hw *devm_clk_hw_register_fixed_factor_index(struct device *dev, 1124 1128 const char *name, unsigned int index, unsigned long flags, 1125 1129 unsigned int mult, unsigned int div);