Merge branches 'clk-airoha', 'clk-rockchip', 'clk-stm', 'clk-thead' and 'clk-bcm' into clk-next

* clk-airoha:
clk: en7523: Add clock for eMMC for EN7581
dt-bindings: clock: add ID for eMMC for EN7581
dt-bindings: clock: drop NUM_CLOCKS define for EN7581
clk: en7523: Rework clock handling for different clock numbers
clk: en7523: Initialize num before accessing hws in en7523_register_clocks()
clk: en7523: Fix wrong BUS clock for EN7581
clk: amlogic: axg-audio: revert reset implementation
Revert "clk: Fix invalid execution of clk_set_rate"

* clk-rockchip:
clk: rockchip: rk3588: make refclko25m_ethX critical
clk: rockchip: rk3588: drop RK3588_LINKED_CLK
clk: rockchip: implement linked gate clock support
clk: rockchip: expose rockchip_clk_set_lookup
clk: rockchip: rk3588: register GATE_LINK later
clk: rockchip: support clocks registered late

* clk-stm:
clk: stm32f4: support spread spectrum clock generation
clk: stm32f4: use FIELD helpers to access the PLLCFGR fields
dt-bindings: clock: st,stm32-rcc: support spread spectrum clocking
dt-bindings: clock: convert stm32 rcc bindings to json-schema

* clk-thead:
clk: thead: Fix cpu2vp_clk for TH1520 AP_SUBSYS clocks
clk: thead: Add CLK_IGNORE_UNUSED to fix TH1520 boot
clk: thead: Fix clk gate registration to pass flags

* clk-bcm:
clk: bcm: rpi: Add disp clock
clk: bcm: rpi: Create helper to retrieve private data
clk: bcm: rpi: Enable minimize for all firmware clocks
clk: bcm: rpi: Allow cpufreq driver to also adjust gpu clocks
clk: bcm: rpi: Add ISP to exported clocks

+742 -244
-138
Documentation/devicetree/bindings/clock/st,stm32-rcc.txt
··· 1 - STMicroelectronics STM32 Reset and Clock Controller 2 - =================================================== 3 - 4 - The RCC IP is both a reset and a clock controller. 5 - 6 - Please refer to clock-bindings.txt for common clock controller binding usage. 7 - Please also refer to reset.txt for common reset controller binding usage. 8 - 9 - Required properties: 10 - - compatible: Should be: 11 - "st,stm32f42xx-rcc" 12 - "st,stm32f469-rcc" 13 - "st,stm32f746-rcc" 14 - "st,stm32f769-rcc" 15 - 16 - - reg: should be register base and length as documented in the 17 - datasheet 18 - - #reset-cells: 1, see below 19 - - #clock-cells: 2, device nodes should specify the clock in their "clocks" 20 - property, containing a phandle to the clock device node, an index selecting 21 - between gated clocks and other clocks and an index specifying the clock to 22 - use. 23 - - clocks: External oscillator clock phandle 24 - - high speed external clock signal (HSE) 25 - - external I2S clock (I2S_CKIN) 26 - 27 - Example: 28 - 29 - rcc: rcc@40023800 { 30 - #reset-cells = <1>; 31 - #clock-cells = <2> 32 - compatible = "st,stm32f42xx-rcc", "st,stm32-rcc"; 33 - reg = <0x40023800 0x400>; 34 - clocks = <&clk_hse>, <&clk_i2s_ckin>; 35 - }; 36 - 37 - Specifying gated clocks 38 - ======================= 39 - 40 - The primary index must be set to 0. 41 - 42 - The secondary index is the bit number within the RCC register bank, starting 43 - from the first RCC clock enable register (RCC_AHB1ENR, address offset 0x30). 44 - 45 - It is calculated as: index = register_offset / 4 * 32 + bit_offset. 46 - Where bit_offset is the bit offset within the register (LSB is 0, MSB is 31). 47 - 48 - To simplify the usage and to share bit definition with the reset and clock 49 - drivers of the RCC IP, macros are available to generate the index in 50 - human-readble format. 51 - 52 - For STM32F4 series, the macro are available here: 53 - - include/dt-bindings/mfd/stm32f4-rcc.h 54 - 55 - Example: 56 - 57 - /* Gated clock, AHB1 bit 0 (GPIOA) */ 58 - ... { 59 - clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOA)> 60 - }; 61 - 62 - /* Gated clock, AHB2 bit 4 (CRYP) */ 63 - ... { 64 - clocks = <&rcc 0 STM32F4_AHB2_CLOCK(CRYP)> 65 - }; 66 - 67 - Specifying other clocks 68 - ======================= 69 - 70 - The primary index must be set to 1. 71 - 72 - The secondary index is bound with the following magic numbers: 73 - 74 - 0 SYSTICK 75 - 1 FCLK 76 - 2 CLK_LSI (low-power clock source) 77 - 3 CLK_LSE (generated from a 32.768 kHz low-speed external 78 - crystal or ceramic resonator) 79 - 4 CLK_HSE_RTC (HSE division factor for RTC clock) 80 - 5 CLK_RTC (real-time clock) 81 - 6 PLL_VCO_I2S (vco frequency of I2S pll) 82 - 7 PLL_VCO_SAI (vco frequency of SAI pll) 83 - 8 CLK_LCD (LCD-TFT) 84 - 9 CLK_I2S (I2S clocks) 85 - 10 CLK_SAI1 (audio clocks) 86 - 11 CLK_SAI2 87 - 12 CLK_I2SQ_PDIV (post divisor of pll i2s q divisor) 88 - 13 CLK_SAIQ_PDIV (post divisor of pll sai q divisor) 89 - 90 - 14 CLK_HSI (Internal ocscillator clock) 91 - 15 CLK_SYSCLK (System Clock) 92 - 16 CLK_HDMI_CEC (HDMI-CEC clock) 93 - 17 CLK_SPDIF (SPDIF-Rx clock) 94 - 18 CLK_USART1 (U(s)arts clocks) 95 - 19 CLK_USART2 96 - 20 CLK_USART3 97 - 21 CLK_UART4 98 - 22 CLK_UART5 99 - 23 CLK_USART6 100 - 24 CLK_UART7 101 - 25 CLK_UART8 102 - 26 CLK_I2C1 (I2S clocks) 103 - 27 CLK_I2C2 104 - 28 CLK_I2C3 105 - 29 CLK_I2C4 106 - 30 CLK_LPTIMER (LPTimer1 clock) 107 - 31 CLK_PLL_SRC 108 - 32 CLK_DFSDM1 109 - 33 CLK_ADFSDM1 110 - 34 CLK_F769_DSI 111 - ) 112 - 113 - Example: 114 - 115 - /* Misc clock, FCLK */ 116 - ... { 117 - clocks = <&rcc 1 STM32F4_APB1_CLOCK(TIM2)> 118 - }; 119 - 120 - 121 - Specifying softreset control of devices 122 - ======================================= 123 - 124 - Device nodes should specify the reset channel required in their "resets" 125 - property, containing a phandle to the reset device node and an index specifying 126 - which channel to use. 127 - The index is the bit number within the RCC registers bank, starting from RCC 128 - base address. 129 - It is calculated as: index = register_offset / 4 * 32 + bit_offset. 130 - Where bit_offset is the bit offset within the register. 131 - For example, for CRC reset: 132 - crc = AHB1RSTR_offset / 4 * 32 + CRCRST_bit_offset = 0x10 / 4 * 32 + 12 = 140 133 - 134 - example: 135 - 136 - timer2 { 137 - resets = <&rcc STM32F4_APB1_RESET(TIM2)>; 138 - };
+144
Documentation/devicetree/bindings/clock/st,stm32-rcc.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/st,stm32-rcc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: STMicroelectronics STM32 Reset Clock Controller 8 + 9 + maintainers: 10 + - Dario Binacchi <dario.binacchi@amarulasolutions.com> 11 + 12 + description: | 13 + The RCC IP is both a reset and a clock controller. 14 + The reset phandle argument is the bit number within the RCC registers bank, 15 + starting from RCC base address. 16 + 17 + properties: 18 + compatible: 19 + oneOf: 20 + - items: 21 + - enum: 22 + - st,stm32f42xx-rcc 23 + - st,stm32f746-rcc 24 + - st,stm32h743-rcc 25 + - const: st,stm32-rcc 26 + - items: 27 + - enum: 28 + - st,stm32f469-rcc 29 + - const: st,stm32f42xx-rcc 30 + - const: st,stm32-rcc 31 + - items: 32 + - enum: 33 + - st,stm32f769-rcc 34 + - const: st,stm32f746-rcc 35 + - const: st,stm32-rcc 36 + 37 + reg: 38 + maxItems: 1 39 + 40 + '#reset-cells': 41 + const: 1 42 + 43 + '#clock-cells': 44 + enum: [1, 2] 45 + 46 + clocks: 47 + minItems: 2 48 + maxItems: 3 49 + 50 + st,syscfg: 51 + $ref: /schemas/types.yaml#/definitions/phandle 52 + description: 53 + Phandle to system configuration controller. It can be used to control the 54 + power domain circuitry. 55 + 56 + st,ssc-modfreq-hz: 57 + description: 58 + The modulation frequency for main PLL (in Hz) 59 + 60 + st,ssc-moddepth-permyriad: 61 + $ref: /schemas/types.yaml#/definitions/uint32 62 + description: 63 + The modulation rate for main PLL (in permyriad, i.e. 0.01%) 64 + minimum: 25 65 + maximum: 200 66 + 67 + st,ssc-modmethod: 68 + $ref: /schemas/types.yaml#/definitions/string 69 + description: 70 + The modulation techniques for main PLL. 71 + items: 72 + enum: 73 + - center-spread 74 + - down-spread 75 + 76 + required: 77 + - compatible 78 + - reg 79 + - '#reset-cells' 80 + - '#clock-cells' 81 + - clocks 82 + - st,syscfg 83 + 84 + allOf: 85 + - if: 86 + properties: 87 + compatible: 88 + contains: 89 + const: st,stm32h743-rcc 90 + then: 91 + properties: 92 + '#clock-cells': 93 + const: 1 94 + description: | 95 + The clock index for the specified type. 96 + clocks: 97 + items: 98 + - description: high speed external (HSE) clock input 99 + - description: low speed external (LSE) clock input 100 + - description: Inter-IC sound (I2S) clock input 101 + st,ssc-modfreq-hz: false 102 + st,ssc-moddepth-permyriad: false 103 + st,ssc-modmethod: false 104 + 105 + else: 106 + properties: 107 + '#clock-cells': 108 + const: 2 109 + description: | 110 + - The first cell is the clock type, possible values are 0 for 111 + gated clocks and 1 otherwise. 112 + - The second cell is the clock index for the specified type. 113 + clocks: 114 + items: 115 + - description: high speed external (HSE) clock input 116 + - description: Inter-IC sound (I2S) clock input 117 + 118 + additionalProperties: false 119 + 120 + examples: 121 + # Reset and Clock Control Module node: 122 + - | 123 + clock-controller@40023800 { 124 + compatible = "st,stm32f42xx-rcc", "st,stm32-rcc"; 125 + reg = <0x40023800 0x400>; 126 + #clock-cells = <2>; 127 + #reset-cells = <1>; 128 + clocks = <&clk_hse>, <&clk_i2s_ckin>; 129 + st,syscfg = <&pwrcfg>; 130 + st,ssc-modfreq-hz = <10000>; 131 + st,ssc-moddepth-permyriad = <200>; 132 + st,ssc-modmethod = "center-spread"; 133 + }; 134 + - | 135 + clock-controller@58024400 { 136 + compatible = "st,stm32h743-rcc", "st,stm32-rcc"; 137 + reg = <0x58024400 0x400>; 138 + #clock-cells = <1>; 139 + #reset-cells = <1>; 140 + clocks = <&clk_hse>, <&clk_lse>, <&clk_i2s>; 141 + st,syscfg = <&pwrcfg>; 142 + }; 143 + 144 + ...
+1 -1
Documentation/devicetree/bindings/reset/st,stm32-rcc.txt
··· 3 3 4 4 The RCC IP is both a reset and a clock controller. 5 5 6 - Please see Documentation/devicetree/bindings/clock/st,stm32-rcc.txt 6 + Please see Documentation/devicetree/bindings/clock/st,stm32-rcc.yaml
+24 -9
drivers/clk/bcm/clk-raspberrypi.c
··· 34 34 [RPI_FIRMWARE_M2MC_CLK_ID] = "m2mc", 35 35 [RPI_FIRMWARE_PIXEL_BVB_CLK_ID] = "pixel-bvb", 36 36 [RPI_FIRMWARE_VEC_CLK_ID] = "vec", 37 + [RPI_FIRMWARE_DISP_CLK_ID] = "disp", 37 38 }; 38 39 39 40 #define RPI_FIRMWARE_STATE_ENABLE_BIT BIT(0) ··· 56 55 57 56 struct raspberrypi_clk *rpi; 58 57 }; 58 + 59 + static inline 60 + const struct raspberrypi_clk_data *clk_hw_to_data(const struct clk_hw *hw) 61 + { 62 + return container_of(hw, struct raspberrypi_clk_data, hw); 63 + } 59 64 60 65 struct raspberrypi_clk_variant { 61 66 bool export; ··· 118 111 }, 119 112 [RPI_FIRMWARE_V3D_CLK_ID] = { 120 113 .export = true, 114 + .minimize = true, 121 115 }, 122 116 [RPI_FIRMWARE_PIXEL_CLK_ID] = { 123 117 .export = true, 118 + .minimize = true, 124 119 }, 125 120 [RPI_FIRMWARE_HEVC_CLK_ID] = { 126 121 .export = true, 122 + .minimize = true, 123 + }, 124 + [RPI_FIRMWARE_ISP_CLK_ID] = { 125 + .export = true, 126 + .minimize = true, 127 127 }, 128 128 [RPI_FIRMWARE_PIXEL_BVB_CLK_ID] = { 129 129 .export = true, 130 + .minimize = true, 130 131 }, 131 132 [RPI_FIRMWARE_VEC_CLK_ID] = { 132 133 .export = true, 134 + .minimize = true, 135 + }, 136 + [RPI_FIRMWARE_DISP_CLK_ID] = { 137 + .export = true, 138 + .minimize = true, 133 139 }, 134 140 }; 135 141 ··· 173 153 struct raspberrypi_firmware_prop msg = { 174 154 .id = cpu_to_le32(data->id), 175 155 .val = cpu_to_le32(*val), 176 - .disable_turbo = cpu_to_le32(1), 177 156 }; 178 157 int ret; 179 158 ··· 187 168 188 169 static int raspberrypi_fw_is_prepared(struct clk_hw *hw) 189 170 { 190 - struct raspberrypi_clk_data *data = 191 - container_of(hw, struct raspberrypi_clk_data, hw); 171 + const struct raspberrypi_clk_data *data = clk_hw_to_data(hw); 192 172 struct raspberrypi_clk *rpi = data->rpi; 193 173 u32 val = 0; 194 174 int ret; ··· 204 186 static unsigned long raspberrypi_fw_get_rate(struct clk_hw *hw, 205 187 unsigned long parent_rate) 206 188 { 207 - struct raspberrypi_clk_data *data = 208 - container_of(hw, struct raspberrypi_clk_data, hw); 189 + const struct raspberrypi_clk_data *data = clk_hw_to_data(hw); 209 190 struct raspberrypi_clk *rpi = data->rpi; 210 191 u32 val = 0; 211 192 int ret; ··· 220 203 static int raspberrypi_fw_set_rate(struct clk_hw *hw, unsigned long rate, 221 204 unsigned long parent_rate) 222 205 { 223 - struct raspberrypi_clk_data *data = 224 - container_of(hw, struct raspberrypi_clk_data, hw); 206 + const struct raspberrypi_clk_data *data = clk_hw_to_data(hw); 225 207 struct raspberrypi_clk *rpi = data->rpi; 226 208 u32 _rate = rate; 227 209 int ret; ··· 237 221 static int raspberrypi_fw_dumb_determine_rate(struct clk_hw *hw, 238 222 struct clk_rate_request *req) 239 223 { 240 - struct raspberrypi_clk_data *data = 241 - container_of(hw, struct raspberrypi_clk_data, hw); 224 + const struct raspberrypi_clk_data *data = clk_hw_to_data(hw); 242 225 struct raspberrypi_clk_variant *variant = data->variant; 243 226 244 227 /*
+21 -8
drivers/clk/clk-en7523.c
··· 75 75 }; 76 76 77 77 struct en_clk_soc_data { 78 + u32 num_clocks; 78 79 const struct clk_ops pcie_ops; 79 80 int (*hw_init)(struct platform_device *pdev, 80 81 struct clk_hw_onecell_data *clk_data); ··· 88 87 static const u32 npu_base[] = { 333000000, 400000000, 500000000 }; 89 88 /* EN7581 */ 90 89 static const u32 emi7581_base[] = { 540000000, 480000000, 400000000, 300000000 }; 90 + static const u32 bus7581_base[] = { 600000000, 540000000 }; 91 91 static const u32 npu7581_base[] = { 800000000, 750000000, 720000000, 600000000 }; 92 92 static const u32 crypto_base[] = { 540000000, 480000000 }; 93 + static const u32 emmc7581_base[] = { 200000000, 150000000 }; 93 94 94 95 static const struct en_clk_desc en7523_base_clks[] = { 95 96 { ··· 225 222 .base_reg = REG_BUS_CLK_DIV_SEL, 226 223 .base_bits = 1, 227 224 .base_shift = 8, 228 - .base_values = bus_base, 229 - .n_base_values = ARRAY_SIZE(bus_base), 225 + .base_values = bus7581_base, 226 + .n_base_values = ARRAY_SIZE(bus7581_base), 230 227 231 228 .div_bits = 3, 232 229 .div_shift = 0, ··· 282 279 .base_shift = 0, 283 280 .base_values = crypto_base, 284 281 .n_base_values = ARRAY_SIZE(crypto_base), 282 + }, { 283 + .id = EN7581_CLK_EMMC, 284 + .name = "emmc", 285 + 286 + .base_reg = REG_CRYPTO_CLKSRC2, 287 + .base_bits = 1, 288 + .base_shift = 12, 289 + .base_values = emmc7581_base, 290 + .n_base_values = ARRAY_SIZE(emmc7581_base), 285 291 } 286 292 }; 287 293 ··· 536 524 537 525 hw = en7523_register_pcie_clk(dev, np_base); 538 526 clk_data->hws[EN7523_CLK_PCIE] = hw; 539 - 540 - clk_data->num = EN7523_NUM_CLOCKS; 541 527 } 542 528 543 529 static int en7523_clk_hw_init(struct platform_device *pdev, ··· 596 586 597 587 hw = en7523_register_pcie_clk(dev, base); 598 588 clk_data->hws[EN7523_CLK_PCIE] = hw; 599 - 600 - clk_data->num = EN7523_NUM_CLOCKS; 601 589 } 602 590 603 591 static int en7523_reset_update(struct reset_controller_dev *rcdev, ··· 709 701 struct clk_hw_onecell_data *clk_data; 710 702 int r; 711 703 704 + soc_data = device_get_match_data(&pdev->dev); 705 + 712 706 clk_data = devm_kzalloc(&pdev->dev, 713 - struct_size(clk_data, hws, EN7523_NUM_CLOCKS), 707 + struct_size(clk_data, hws, soc_data->num_clocks), 714 708 GFP_KERNEL); 715 709 if (!clk_data) 716 710 return -ENOMEM; 717 711 718 - soc_data = device_get_match_data(&pdev->dev); 712 + clk_data->num = soc_data->num_clocks; 719 713 r = soc_data->hw_init(pdev, clk_data); 720 714 if (r) 721 715 return r; ··· 726 716 } 727 717 728 718 static const struct en_clk_soc_data en7523_data = { 719 + .num_clocks = ARRAY_SIZE(en7523_base_clks) + 1, 729 720 .pcie_ops = { 730 721 .is_enabled = en7523_pci_is_enabled, 731 722 .prepare = en7523_pci_prepare, ··· 736 725 }; 737 726 738 727 static const struct en_clk_soc_data en7581_data = { 728 + /* We increment num_clocks by 1 to account for additional PCIe clock */ 729 + .num_clocks = ARRAY_SIZE(en7581_base_clks) + 1, 739 730 .pcie_ops = { 740 731 .is_enabled = en7581_pci_is_enabled, 741 732 .enable = en7581_pci_enable,
+149 -6
drivers/clk/clk-stm32f4.c
··· 5 5 * Inspired by clk-asm9260.c . 6 6 */ 7 7 8 + #include <linux/bitfield.h> 8 9 #include <linux/clk-provider.h> 9 10 #include <linux/err.h> 10 11 #include <linux/io.h> ··· 35 34 #define STM32F4_RCC_APB2ENR 0x44 36 35 #define STM32F4_RCC_BDCR 0x70 37 36 #define STM32F4_RCC_CSR 0x74 37 + #define STM32F4_RCC_SSCGR 0x80 38 38 #define STM32F4_RCC_PLLI2SCFGR 0x84 39 39 #define STM32F4_RCC_PLLSAICFGR 0x88 40 40 #define STM32F4_RCC_DCKCFGR 0x8c 41 41 #define STM32F7_RCC_DCKCFGR2 0x90 42 + 43 + #define STM32F4_RCC_PLLCFGR_N_MASK GENMASK(14, 6) 44 + 45 + #define STM32F4_RCC_SSCGR_SSCGEN BIT(31) 46 + #define STM32F4_RCC_SSCGR_SPREADSEL BIT(30) 47 + #define STM32F4_RCC_SSCGR_RESERVED_MASK GENMASK(29, 28) 48 + #define STM32F4_RCC_SSCGR_INCSTEP_MASK GENMASK(27, 13) 49 + #define STM32F4_RCC_SSCGR_MODPER_MASK GENMASK(12, 0) 42 50 43 51 #define NONE -1 44 52 #define NO_IDX NONE ··· 374 364 { STM32F4_RCC_APB2ENR, 30, "mdio", "apb2_div" }, 375 365 }; 376 366 367 + enum stm32f4_pll_ssc_mod_type { 368 + STM32F4_PLL_SSC_CENTER_SPREAD, 369 + STM32F4_PLL_SSC_DOWN_SPREAD, 370 + }; 371 + 372 + static const char * const stm32f4_ssc_mod_methods[] __initconst = { 373 + [STM32F4_PLL_SSC_DOWN_SPREAD] = "down-spread", 374 + [STM32F4_PLL_SSC_CENTER_SPREAD] = "center-spread", 375 + }; 376 + 377 377 /* 378 378 * This bitmask tells us which bit offsets (0..192) on STM32F4[23]xxx 379 379 * have gate bits associated with them. Its combined hweight is 71. ··· 529 509 { 2, 2 }, { 3, 3 }, { 4, 4 }, { 5, 5 }, { 6, 6 }, { 7, 7 }, { 0 } 530 510 }; 531 511 512 + struct stm32f4_pll_ssc { 513 + unsigned int mod_freq; 514 + unsigned int mod_depth; 515 + enum stm32f4_pll_ssc_mod_type mod_type; 516 + }; 517 + 532 518 struct stm32f4_pll { 533 519 spinlock_t *lock; 534 520 struct clk_gate gate; ··· 542 516 u8 bit_rdy_idx; 543 517 u8 status; 544 518 u8 n_start; 519 + bool ssc_enable; 520 + struct stm32f4_pll_ssc ssc_conf; 545 521 }; 546 522 547 523 #define to_stm32f4_pll(_gate) container_of(_gate, struct stm32f4_pll, gate) ··· 566 538 u8 offset; 567 539 u8 bit_idx; 568 540 u8 bit_rdy_idx; 541 + bool sscg; 569 542 }; 570 543 571 544 static const struct stm32f4_vco_data vco_data[] = { ··· 661 632 { 662 633 struct clk_gate *gate = to_clk_gate(hw); 663 634 struct stm32f4_pll *pll = to_stm32f4_pll(gate); 635 + unsigned long val; 664 636 unsigned long n; 665 637 666 - n = (readl(base + pll->offset) >> 6) & 0x1ff; 638 + val = readl(base + pll->offset); 639 + n = FIELD_GET(STM32F4_RCC_PLLCFGR_N_MASK, val); 667 640 668 641 return parent_rate * n; 669 642 } ··· 687 656 return *prate * n; 688 657 } 689 658 659 + static void stm32f4_pll_set_ssc(struct clk_hw *hw, unsigned long parent_rate, 660 + unsigned int ndiv) 661 + { 662 + struct clk_gate *gate = to_clk_gate(hw); 663 + struct stm32f4_pll *pll = to_stm32f4_pll(gate); 664 + struct stm32f4_pll_ssc *ssc = &pll->ssc_conf; 665 + u32 modeper, incstep; 666 + u32 sscgr; 667 + 668 + sscgr = readl(base + STM32F4_RCC_SSCGR); 669 + /* reserved field must be kept at reset value */ 670 + sscgr &= STM32F4_RCC_SSCGR_RESERVED_MASK; 671 + 672 + modeper = DIV_ROUND_CLOSEST(parent_rate, 4 * ssc->mod_freq); 673 + incstep = DIV_ROUND_CLOSEST(((1 << 15) - 1) * ssc->mod_depth * ndiv, 674 + 5 * 10000 * modeper); 675 + sscgr |= STM32F4_RCC_SSCGR_SSCGEN | 676 + FIELD_PREP(STM32F4_RCC_SSCGR_INCSTEP_MASK, incstep) | 677 + FIELD_PREP(STM32F4_RCC_SSCGR_MODPER_MASK, modeper); 678 + 679 + if (ssc->mod_type) 680 + sscgr |= STM32F4_RCC_SSCGR_SPREADSEL; 681 + 682 + writel(sscgr, base + STM32F4_RCC_SSCGR); 683 + } 684 + 690 685 static int stm32f4_pll_set_rate(struct clk_hw *hw, unsigned long rate, 691 686 unsigned long parent_rate) 692 687 { ··· 730 673 731 674 n = rate / parent_rate; 732 675 733 - val = readl(base + pll->offset) & ~(0x1ff << 6); 676 + val = readl(base + pll->offset) & ~STM32F4_RCC_PLLCFGR_N_MASK; 677 + val |= FIELD_PREP(STM32F4_RCC_PLLCFGR_N_MASK, n); 734 678 735 - writel(val | ((n & 0x1ff) << 6), base + pll->offset); 679 + writel(val, base + pll->offset); 680 + 681 + if (pll->ssc_enable) 682 + stm32f4_pll_set_ssc(hw, parent_rate, n); 736 683 737 684 if (pll_state) 738 685 stm32f4_pll_enable(hw); ··· 841 780 } 842 781 843 782 return hw; 783 + } 784 + 785 + static int __init stm32f4_pll_init_ssc(struct clk_hw *hw, 786 + const struct stm32f4_pll_ssc *conf) 787 + { 788 + struct clk_gate *gate = to_clk_gate(hw); 789 + struct stm32f4_pll *pll = to_stm32f4_pll(gate); 790 + struct clk_hw *parent; 791 + unsigned long parent_rate; 792 + int pll_state; 793 + unsigned long n, val; 794 + 795 + parent = clk_hw_get_parent(hw); 796 + if (!parent) { 797 + pr_err("%s: failed to get clock parent\n", __func__); 798 + return -ENODEV; 799 + } 800 + 801 + parent_rate = clk_hw_get_rate(parent); 802 + 803 + pll->ssc_enable = true; 804 + memcpy(&pll->ssc_conf, conf, sizeof(pll->ssc_conf)); 805 + 806 + pll_state = stm32f4_pll_is_enabled(hw); 807 + 808 + if (pll_state) 809 + stm32f4_pll_disable(hw); 810 + 811 + val = readl(base + pll->offset); 812 + n = FIELD_GET(STM32F4_RCC_PLLCFGR_N_MASK, val); 813 + 814 + pr_debug("%s: pll: %s, parent: %s, parent-rate: %lu, n: %lu\n", 815 + __func__, clk_hw_get_name(hw), clk_hw_get_name(parent), 816 + parent_rate, n); 817 + 818 + stm32f4_pll_set_ssc(hw, parent_rate, n); 819 + 820 + if (pll_state) 821 + stm32f4_pll_enable(hw); 822 + 823 + return 0; 824 + } 825 + 826 + static int __init stm32f4_pll_ssc_parse_dt(struct device_node *np, 827 + struct stm32f4_pll_ssc *conf) 828 + { 829 + int ret; 830 + const char *s; 831 + 832 + if (!conf) 833 + return -EINVAL; 834 + 835 + ret = of_property_read_u32(np, "st,ssc-modfreq-hz", &conf->mod_freq); 836 + if (ret) 837 + return ret; 838 + 839 + ret = of_property_read_u32(np, "st,ssc-moddepth-permyriad", 840 + &conf->mod_depth); 841 + if (ret) { 842 + pr_err("%pOF: missing st,ssc-moddepth-permyriad\n", np); 843 + return ret; 844 + } 845 + 846 + ret = fwnode_property_match_property_string(of_fwnode_handle(np), 847 + "st,ssc-modmethod", 848 + stm32f4_ssc_mod_methods, 849 + ARRAY_SIZE(stm32f4_ssc_mod_methods)); 850 + if (ret < 0) { 851 + pr_err("%pOF: failed to get st,ssc-modmethod\n", np); 852 + return ret; 853 + } 854 + 855 + conf->mod_type = ret; 856 + 857 + pr_debug("%pOF: SSCG settings: mod_freq: %d, mod_depth: %d mod_method: %s [%d]\n", 858 + np, conf->mod_freq, conf->mod_depth, s, conf->mod_type); 859 + 860 + return 0; 844 861 } 845 862 846 863 static struct clk_hw *stm32f4_rcc_register_pll(const char *pllsrc, ··· 1828 1689 const struct of_device_id *match; 1829 1690 const struct stm32f4_clk_data *data; 1830 1691 unsigned long pllm; 1831 - struct clk_hw *pll_src_hw; 1692 + struct clk_hw *pll_src_hw, *pll_vco_hw; 1693 + struct stm32f4_pll_ssc ssc_conf; 1832 1694 1833 1695 base = of_iomap(np, 0); 1834 1696 if (!base) { ··· 1888 1748 clk_hw_register_fixed_factor(NULL, "vco_in", pll_src, 1889 1749 0, 1, pllm); 1890 1750 1891 - stm32f4_rcc_register_pll("vco_in", &data->pll_data[0], 1892 - &stm32f4_clk_lock); 1751 + pll_vco_hw = stm32f4_rcc_register_pll("vco_in", &data->pll_data[0], 1752 + &stm32f4_clk_lock); 1893 1753 1894 1754 clks[PLL_VCO_I2S] = stm32f4_rcc_register_pll("vco_in", 1895 1755 &data->pll_data[1], &stm32f4_clk_lock); ··· 2033 1893 } 2034 1894 2035 1895 of_clk_add_hw_provider(np, stm32f4_rcc_lookup_clk, NULL); 1896 + 1897 + if (!stm32f4_pll_ssc_parse_dt(np, &ssc_conf)) 1898 + stm32f4_pll_init_ssc(pll_vco_hw, &ssc_conf); 2036 1899 2037 1900 return; 2038 1901 fail:
+1 -1
drivers/clk/clk.c
··· 2530 2530 rate = clk_core_req_round_rate_nolock(core, req_rate); 2531 2531 2532 2532 /* bail early if nothing to do */ 2533 - if (rate == clk_core_get_rate_recalc(core)) 2533 + if (rate == clk_core_get_rate_nolock(core)) 2534 2534 return 0; 2535 2535 2536 2536 /* fail on a direct rate set of a protected provider */
+1 -1
drivers/clk/meson/Kconfig
··· 106 106 select COMMON_CLK_MESON_SCLK_DIV 107 107 select COMMON_CLK_MESON_CLKC_UTILS 108 108 select REGMAP_MMIO 109 - depends on RESET_MESON_AUX 109 + select RESET_CONTROLLER 110 110 help 111 111 Support for the audio clock controller on AmLogic A113D devices, 112 112 aka axg, Say Y if you want audio subsystem to work.
+100 -9
drivers/clk/meson/axg-audio.c
··· 15 15 #include <linux/reset-controller.h> 16 16 #include <linux/slab.h> 17 17 18 - #include <soc/amlogic/reset-meson-aux.h> 19 - 20 18 #include "meson-clkc-utils.h" 21 19 #include "axg-audio.h" 22 20 #include "clk-regmap.h" ··· 1678 1680 &sm1_earcrx_dmac_clk, 1679 1681 }; 1680 1682 1683 + struct axg_audio_reset_data { 1684 + struct reset_controller_dev rstc; 1685 + struct regmap *map; 1686 + unsigned int offset; 1687 + }; 1688 + 1689 + static void axg_audio_reset_reg_and_bit(struct axg_audio_reset_data *rst, 1690 + unsigned long id, 1691 + unsigned int *reg, 1692 + unsigned int *bit) 1693 + { 1694 + unsigned int stride = regmap_get_reg_stride(rst->map); 1695 + 1696 + *reg = (id / (stride * BITS_PER_BYTE)) * stride; 1697 + *reg += rst->offset; 1698 + *bit = id % (stride * BITS_PER_BYTE); 1699 + } 1700 + 1701 + static int axg_audio_reset_update(struct reset_controller_dev *rcdev, 1702 + unsigned long id, bool assert) 1703 + { 1704 + struct axg_audio_reset_data *rst = 1705 + container_of(rcdev, struct axg_audio_reset_data, rstc); 1706 + unsigned int offset, bit; 1707 + 1708 + axg_audio_reset_reg_and_bit(rst, id, &offset, &bit); 1709 + 1710 + regmap_update_bits(rst->map, offset, BIT(bit), 1711 + assert ? BIT(bit) : 0); 1712 + 1713 + return 0; 1714 + } 1715 + 1716 + static int axg_audio_reset_status(struct reset_controller_dev *rcdev, 1717 + unsigned long id) 1718 + { 1719 + struct axg_audio_reset_data *rst = 1720 + container_of(rcdev, struct axg_audio_reset_data, rstc); 1721 + unsigned int val, offset, bit; 1722 + 1723 + axg_audio_reset_reg_and_bit(rst, id, &offset, &bit); 1724 + 1725 + regmap_read(rst->map, offset, &val); 1726 + 1727 + return !!(val & BIT(bit)); 1728 + } 1729 + 1730 + static int axg_audio_reset_assert(struct reset_controller_dev *rcdev, 1731 + unsigned long id) 1732 + { 1733 + return axg_audio_reset_update(rcdev, id, true); 1734 + } 1735 + 1736 + static int axg_audio_reset_deassert(struct reset_controller_dev *rcdev, 1737 + unsigned long id) 1738 + { 1739 + return axg_audio_reset_update(rcdev, id, false); 1740 + } 1741 + 1742 + static int axg_audio_reset_toggle(struct reset_controller_dev *rcdev, 1743 + unsigned long id) 1744 + { 1745 + int ret; 1746 + 1747 + ret = axg_audio_reset_assert(rcdev, id); 1748 + if (ret) 1749 + return ret; 1750 + 1751 + return axg_audio_reset_deassert(rcdev, id); 1752 + } 1753 + 1754 + static const struct reset_control_ops axg_audio_rstc_ops = { 1755 + .assert = axg_audio_reset_assert, 1756 + .deassert = axg_audio_reset_deassert, 1757 + .reset = axg_audio_reset_toggle, 1758 + .status = axg_audio_reset_status, 1759 + }; 1760 + 1681 1761 static struct regmap_config axg_audio_regmap_cfg = { 1682 1762 .reg_bits = 32, 1683 1763 .val_bits = 32, ··· 1766 1690 struct clk_regmap *const *regmap_clks; 1767 1691 unsigned int regmap_clk_num; 1768 1692 struct meson_clk_hw_data hw_clks; 1693 + unsigned int reset_offset; 1694 + unsigned int reset_num; 1769 1695 unsigned int max_register; 1770 - const char *rst_drvname; 1771 1696 }; 1772 1697 1773 1698 static int axg_audio_clkc_probe(struct platform_device *pdev) 1774 1699 { 1775 1700 struct device *dev = &pdev->dev; 1776 1701 const struct audioclk_data *data; 1702 + struct axg_audio_reset_data *rst; 1777 1703 struct regmap *map; 1778 1704 void __iomem *regs; 1779 1705 struct clk_hw *hw; ··· 1834 1756 if (ret) 1835 1757 return ret; 1836 1758 1837 - /* Register auxiliary reset driver when applicable */ 1838 - if (data->rst_drvname) 1839 - ret = devm_meson_rst_aux_register(dev, map, data->rst_drvname); 1759 + /* Stop here if there is no reset */ 1760 + if (!data->reset_num) 1761 + return 0; 1840 1762 1841 - return ret; 1763 + rst = devm_kzalloc(dev, sizeof(*rst), GFP_KERNEL); 1764 + if (!rst) 1765 + return -ENOMEM; 1766 + 1767 + rst->map = map; 1768 + rst->offset = data->reset_offset; 1769 + rst->rstc.nr_resets = data->reset_num; 1770 + rst->rstc.ops = &axg_audio_rstc_ops; 1771 + rst->rstc.of_node = dev->of_node; 1772 + rst->rstc.owner = THIS_MODULE; 1773 + 1774 + return devm_reset_controller_register(dev, &rst->rstc); 1842 1775 } 1843 1776 1844 1777 static const struct audioclk_data axg_audioclk_data = { ··· 1869 1780 .hws = g12a_audio_hw_clks, 1870 1781 .num = ARRAY_SIZE(g12a_audio_hw_clks), 1871 1782 }, 1783 + .reset_offset = AUDIO_SW_RESET, 1784 + .reset_num = 26, 1872 1785 .max_register = AUDIO_CLK_SPDIFOUT_B_CTRL, 1873 - .rst_drvname = "rst-g12a", 1874 1786 }; 1875 1787 1876 1788 static const struct audioclk_data sm1_audioclk_data = { ··· 1881 1791 .hws = sm1_audio_hw_clks, 1882 1792 .num = ARRAY_SIZE(sm1_audio_hw_clks), 1883 1793 }, 1794 + .reset_offset = AUDIO_SM1_SW_RESET0, 1795 + .reset_num = 39, 1884 1796 .max_register = AUDIO_EARCRX_DMAC_CLK_CTRL, 1885 - .rst_drvname = "rst-sm1", 1886 1797 }; 1887 1798 1888 1799 static const struct of_device_id clkc_match_table[] = {
+1
drivers/clk/rockchip/Makefile
··· 13 13 clk-rockchip-y += clk-mmc-phase.o 14 14 clk-rockchip-y += clk-muxgrf.o 15 15 clk-rockchip-y += clk-ddr.o 16 + clk-rockchip-y += gate-link.o 16 17 clk-rockchip-$(CONFIG_RESET_CONTROLLER) += softrst.o 17 18 18 19 obj-$(CONFIG_CLK_PX30) += clk-px30.o
+77 -49
drivers/clk/rockchip/clk-rk3588.c
··· 12 12 #include <dt-bindings/clock/rockchip,rk3588-cru.h> 13 13 #include "clk.h" 14 14 15 - /* 16 - * Recent Rockchip SoCs have a new hardware block called Native Interface 17 - * Unit (NIU), which gates clocks to devices behind them. These effectively 18 - * need two parent clocks. 19 - * 20 - * Downstream enables the linked clock via runtime PM whenever the gate is 21 - * enabled. This implementation uses separate clock nodes for each of the 22 - * linked gate clocks, which leaks parts of the clock tree into DT. 23 - * 24 - * The GATE_LINK macro instead takes the second parent via 'linkname', but 25 - * ignores the information. Once the clock framework is ready to handle it, the 26 - * information should be passed on here. But since these clocks are required to 27 - * access multiple relevant IP blocks, such as PCIe or USB, we mark all linked 28 - * clocks critical until a better solution is available. This will waste some 29 - * power, but avoids leaking implementation details into DT or hanging the 30 - * system. 31 - */ 32 - #define GATE_LINK(_id, cname, pname, linkedclk, f, o, b, gf) \ 33 - GATE(_id, cname, pname, f, o, b, gf) 34 - #define RK3588_LINKED_CLK CLK_IS_CRITICAL 35 - 36 - 37 15 #define RK3588_GRF_SOC_STATUS0 0x600 38 16 #define RK3588_PHYREF_ALT_GATE 0xc38 39 17 ··· 243 265 RK3588_CORE_L_SEL1(_seldsu, _divdsu), \ 244 266 }, \ 245 267 } 268 + 269 + static struct rockchip_clk_provider *early_ctx; 246 270 247 271 static struct rockchip_cpuclk_rate_table rk3588_cpub0clk_rates[] __initdata = { 248 272 RK3588_CPUB01CLK_RATE(2496000000, 1), ··· 674 694 RK3588_MODE_CON0, 10, 15, 0, rk3588_pll_rates), 675 695 }; 676 696 677 - static struct rockchip_clk_branch rk3588_clk_branches[] __initdata = { 697 + static struct rockchip_clk_branch rk3588_early_clk_branches[] __initdata = { 678 698 /* 679 699 * CRU Clock-Architecture 680 700 */ ··· 772 792 COMPOSITE(MCLK_GMAC0_OUT, "mclk_gmac0_out", gpll_cpll_p, 0, 773 793 RK3588_CLKSEL_CON(15), 7, 1, MFLAGS, 0, 7, DFLAGS, 774 794 RK3588_CLKGATE_CON(5), 3, GFLAGS), 775 - COMPOSITE(REFCLKO25M_ETH0_OUT, "refclko25m_eth0_out", gpll_cpll_p, 0, 795 + COMPOSITE(REFCLKO25M_ETH0_OUT, "refclko25m_eth0_out", gpll_cpll_p, CLK_IS_CRITICAL, 776 796 RK3588_CLKSEL_CON(15), 15, 1, MFLAGS, 8, 7, DFLAGS, 777 797 RK3588_CLKGATE_CON(5), 4, GFLAGS), 778 - COMPOSITE(REFCLKO25M_ETH1_OUT, "refclko25m_eth1_out", gpll_cpll_p, 0, 798 + COMPOSITE(REFCLKO25M_ETH1_OUT, "refclko25m_eth1_out", gpll_cpll_p, CLK_IS_CRITICAL, 779 799 RK3588_CLKSEL_CON(16), 7, 1, MFLAGS, 0, 7, DFLAGS, 780 800 RK3588_CLKGATE_CON(5), 5, GFLAGS), 781 801 COMPOSITE(CLK_CIFOUT_OUT, "clk_cifout_out", gpll_cpll_24m_spll_p, 0, ··· 1436 1456 COMPOSITE_NODIV(HCLK_NVM_ROOT, "hclk_nvm_root", mux_200m_100m_50m_24m_p, 0, 1437 1457 RK3588_CLKSEL_CON(77), 0, 2, MFLAGS, 1438 1458 RK3588_CLKGATE_CON(31), 0, GFLAGS), 1439 - COMPOSITE(ACLK_NVM_ROOT, "aclk_nvm_root", gpll_cpll_p, RK3588_LINKED_CLK, 1459 + COMPOSITE(ACLK_NVM_ROOT, "aclk_nvm_root", gpll_cpll_p, 0, 1440 1460 RK3588_CLKSEL_CON(77), 7, 1, MFLAGS, 2, 5, DFLAGS, 1441 1461 RK3588_CLKGATE_CON(31), 1, GFLAGS), 1442 1462 GATE(ACLK_EMMC, "aclk_emmc", "aclk_nvm_root", 0, ··· 1665 1685 RK3588_CLKGATE_CON(42), 9, GFLAGS), 1666 1686 1667 1687 /* vdpu */ 1668 - COMPOSITE(ACLK_VDPU_ROOT, "aclk_vdpu_root", gpll_cpll_aupll_p, RK3588_LINKED_CLK, 1688 + COMPOSITE(ACLK_VDPU_ROOT, "aclk_vdpu_root", gpll_cpll_aupll_p, 0, 1669 1689 RK3588_CLKSEL_CON(98), 5, 2, MFLAGS, 0, 5, DFLAGS, 1670 1690 RK3588_CLKGATE_CON(44), 0, GFLAGS), 1671 1691 COMPOSITE_NODIV(ACLK_VDPU_LOW_ROOT, "aclk_vdpu_low_root", mux_400m_200m_100m_24m_p, 0, 1672 1692 RK3588_CLKSEL_CON(98), 7, 2, MFLAGS, 1673 1693 RK3588_CLKGATE_CON(44), 1, GFLAGS), 1674 - COMPOSITE_NODIV(HCLK_VDPU_ROOT, "hclk_vdpu_root", mux_200m_100m_50m_24m_p, RK3588_LINKED_CLK, 1694 + COMPOSITE_NODIV(HCLK_VDPU_ROOT, "hclk_vdpu_root", mux_200m_100m_50m_24m_p, 0, 1675 1695 RK3588_CLKSEL_CON(98), 9, 2, MFLAGS, 1676 1696 RK3588_CLKGATE_CON(44), 2, GFLAGS), 1677 1697 COMPOSITE(ACLK_JPEG_DECODER_ROOT, "aclk_jpeg_decoder_root", gpll_cpll_aupll_spll_p, 0, ··· 1722 1742 COMPOSITE(ACLK_RKVENC0_ROOT, "aclk_rkvenc0_root", gpll_cpll_npll_p, 0, 1723 1743 RK3588_CLKSEL_CON(102), 7, 2, MFLAGS, 2, 5, DFLAGS, 1724 1744 RK3588_CLKGATE_CON(47), 1, GFLAGS), 1725 - GATE(HCLK_RKVENC0, "hclk_rkvenc0", "hclk_rkvenc0_root", RK3588_LINKED_CLK, 1745 + GATE(HCLK_RKVENC0, "hclk_rkvenc0", "hclk_rkvenc0_root", 0, 1726 1746 RK3588_CLKGATE_CON(47), 4, GFLAGS), 1727 - GATE(ACLK_RKVENC0, "aclk_rkvenc0", "aclk_rkvenc0_root", RK3588_LINKED_CLK, 1747 + GATE(ACLK_RKVENC0, "aclk_rkvenc0", "aclk_rkvenc0_root", 0, 1728 1748 RK3588_CLKGATE_CON(47), 5, GFLAGS), 1729 1749 COMPOSITE(CLK_RKVENC0_CORE, "clk_rkvenc0_core", gpll_cpll_aupll_npll_p, 0, 1730 1750 RK3588_CLKSEL_CON(102), 14, 2, MFLAGS, 9, 5, DFLAGS, ··· 1734 1754 RK3588_CLKGATE_CON(48), 6, GFLAGS), 1735 1755 1736 1756 /* vi */ 1737 - COMPOSITE(ACLK_VI_ROOT, "aclk_vi_root", gpll_cpll_npll_aupll_spll_p, RK3588_LINKED_CLK, 1757 + COMPOSITE(ACLK_VI_ROOT, "aclk_vi_root", gpll_cpll_npll_aupll_spll_p, 0, 1738 1758 RK3588_CLKSEL_CON(106), 5, 3, MFLAGS, 0, 5, DFLAGS, 1739 1759 RK3588_CLKGATE_CON(49), 0, GFLAGS), 1740 - COMPOSITE_NODIV(HCLK_VI_ROOT, "hclk_vi_root", mux_200m_100m_50m_24m_p, RK3588_LINKED_CLK, 1760 + COMPOSITE_NODIV(HCLK_VI_ROOT, "hclk_vi_root", mux_200m_100m_50m_24m_p, 0, 1741 1761 RK3588_CLKSEL_CON(106), 8, 2, MFLAGS, 1742 1762 RK3588_CLKGATE_CON(49), 1, GFLAGS), 1743 1763 COMPOSITE_NODIV(PCLK_VI_ROOT, "pclk_vi_root", mux_100m_50m_24m_p, 0, ··· 1907 1927 COMPOSITE(ACLK_VOP_ROOT, "aclk_vop_root", gpll_cpll_dmyaupll_npll_spll_p, 0, 1908 1928 RK3588_CLKSEL_CON(110), 5, 3, MFLAGS, 0, 5, DFLAGS, 1909 1929 RK3588_CLKGATE_CON(52), 0, GFLAGS), 1910 - COMPOSITE_NODIV(ACLK_VOP_LOW_ROOT, "aclk_vop_low_root", mux_400m_200m_100m_24m_p, RK3588_LINKED_CLK, 1930 + COMPOSITE_NODIV(ACLK_VOP_LOW_ROOT, "aclk_vop_low_root", mux_400m_200m_100m_24m_p, 0, 1911 1931 RK3588_CLKSEL_CON(110), 8, 2, MFLAGS, 1912 1932 RK3588_CLKGATE_CON(52), 1, GFLAGS), 1913 - COMPOSITE_NODIV(HCLK_VOP_ROOT, "hclk_vop_root", mux_200m_100m_50m_24m_p, RK3588_LINKED_CLK, 1933 + COMPOSITE_NODIV(HCLK_VOP_ROOT, "hclk_vop_root", mux_200m_100m_50m_24m_p, 0, 1914 1934 RK3588_CLKSEL_CON(110), 10, 2, MFLAGS, 1915 1935 RK3588_CLKGATE_CON(52), 2, GFLAGS), 1916 1936 COMPOSITE_NODIV(PCLK_VOP_ROOT, "pclk_vop_root", mux_100m_50m_24m_p, 0, ··· 2408 2428 RK3588_CLKGATE_CON(68), 5, GFLAGS), 2409 2429 GATE(ACLK_AV1, "aclk_av1", "aclk_av1_pre", 0, 2410 2430 RK3588_CLKGATE_CON(68), 2, GFLAGS), 2431 + }; 2411 2432 2433 + static struct rockchip_clk_branch rk3588_clk_branches[] = { 2412 2434 GATE_LINK(ACLK_ISP1_PRE, "aclk_isp1_pre", "aclk_isp1_root", ACLK_VI_ROOT, 0, RK3588_CLKGATE_CON(26), 6, GFLAGS), 2413 2435 GATE_LINK(HCLK_ISP1_PRE, "hclk_isp1_pre", "hclk_isp1_root", HCLK_VI_ROOT, 0, RK3588_CLKGATE_CON(26), 8, GFLAGS), 2414 - GATE_LINK(HCLK_NVM, "hclk_nvm", "hclk_nvm_root", ACLK_NVM_ROOT, RK3588_LINKED_CLK, RK3588_CLKGATE_CON(31), 2, GFLAGS), 2436 + GATE_LINK(HCLK_NVM, "hclk_nvm", "hclk_nvm_root", ACLK_NVM_ROOT, 0, RK3588_CLKGATE_CON(31), 2, GFLAGS), 2415 2437 GATE_LINK(ACLK_USB, "aclk_usb", "aclk_usb_root", ACLK_VO1USB_TOP_ROOT, 0, RK3588_CLKGATE_CON(42), 2, GFLAGS), 2416 2438 GATE_LINK(HCLK_USB, "hclk_usb", "hclk_usb_root", HCLK_VO1USB_TOP_ROOT, 0, RK3588_CLKGATE_CON(42), 3, GFLAGS), 2417 2439 GATE_LINK(ACLK_JPEG_DECODER_PRE, "aclk_jpeg_decoder_pre", "aclk_jpeg_decoder_root", ACLK_VDPU_ROOT, 0, RK3588_CLKGATE_CON(44), 7, GFLAGS), ··· 2425 2443 GATE_LINK(HCLK_RKVDEC1_PRE, "hclk_rkvdec1_pre", "hclk_rkvdec1_root", HCLK_VDPU_ROOT, 0, RK3588_CLKGATE_CON(41), 4, GFLAGS), 2426 2444 GATE_LINK(ACLK_RKVDEC1_PRE, "aclk_rkvdec1_pre", "aclk_rkvdec1_root", ACLK_VDPU_ROOT, 0, RK3588_CLKGATE_CON(41), 5, GFLAGS), 2427 2445 GATE_LINK(ACLK_HDCP0_PRE, "aclk_hdcp0_pre", "aclk_vo0_root", ACLK_VOP_LOW_ROOT, 0, RK3588_CLKGATE_CON(55), 9, GFLAGS), 2428 - GATE_LINK(HCLK_VO0, "hclk_vo0", "hclk_vo0_root", HCLK_VOP_ROOT, RK3588_LINKED_CLK, RK3588_CLKGATE_CON(55), 5, GFLAGS), 2446 + GATE_LINK(HCLK_VO0, "hclk_vo0", "hclk_vo0_root", HCLK_VOP_ROOT, 0, RK3588_CLKGATE_CON(55), 5, GFLAGS), 2429 2447 GATE_LINK(ACLK_HDCP1_PRE, "aclk_hdcp1_pre", "aclk_hdcp1_root", ACLK_VO1USB_TOP_ROOT, 0, RK3588_CLKGATE_CON(59), 6, GFLAGS), 2430 - GATE_LINK(HCLK_VO1, "hclk_vo1", "hclk_vo1_root", HCLK_VO1USB_TOP_ROOT, RK3588_LINKED_CLK, RK3588_CLKGATE_CON(59), 9, GFLAGS), 2448 + GATE_LINK(HCLK_VO1, "hclk_vo1", "hclk_vo1_root", HCLK_VO1USB_TOP_ROOT, 0, RK3588_CLKGATE_CON(59), 9, GFLAGS), 2431 2449 GATE_LINK(ACLK_AV1_PRE, "aclk_av1_pre", "aclk_av1_root", ACLK_VDPU_ROOT, 0, RK3588_CLKGATE_CON(68), 1, GFLAGS), 2432 2450 GATE_LINK(PCLK_AV1_PRE, "pclk_av1_pre", "pclk_av1_root", HCLK_VDPU_ROOT, 0, RK3588_CLKGATE_CON(68), 4, GFLAGS), 2433 2451 GATE_LINK(HCLK_SDIO_PRE, "hclk_sdio_pre", "hclk_sdio_root", HCLK_NVM, 0, RK3588_CLKGATE_CON(75), 1, GFLAGS), ··· 2435 2453 GATE_LINK(PCLK_VO1GRF, "pclk_vo1grf", "pclk_vo1_root", HCLK_VO1, CLK_IGNORE_UNUSED, RK3588_CLKGATE_CON(59), 12, GFLAGS), 2436 2454 }; 2437 2455 2438 - static void __init rk3588_clk_init(struct device_node *np) 2456 + static void __init rk3588_clk_early_init(struct device_node *np) 2439 2457 { 2440 2458 struct rockchip_clk_provider *ctx; 2441 - unsigned long clk_nr_clks; 2459 + unsigned long clk_nr_clks, max_clk_id1, max_clk_id2; 2442 2460 void __iomem *reg_base; 2443 2461 2444 - clk_nr_clks = rockchip_clk_find_max_clk_id(rk3588_clk_branches, 2445 - ARRAY_SIZE(rk3588_clk_branches)) + 1; 2462 + max_clk_id1 = rockchip_clk_find_max_clk_id(rk3588_clk_branches, 2463 + ARRAY_SIZE(rk3588_clk_branches)); 2464 + max_clk_id2 = rockchip_clk_find_max_clk_id(rk3588_early_clk_branches, 2465 + ARRAY_SIZE(rk3588_early_clk_branches)); 2466 + clk_nr_clks = max(max_clk_id1, max_clk_id2) + 1; 2467 + 2446 2468 reg_base = of_iomap(np, 0); 2447 2469 if (!reg_base) { 2448 2470 pr_err("%s: could not map cru region\n", __func__); 2449 2471 return; 2450 2472 } 2451 2473 2452 - ctx = rockchip_clk_init(np, reg_base, clk_nr_clks); 2474 + ctx = rockchip_clk_init_early(np, reg_base, clk_nr_clks); 2453 2475 if (IS_ERR(ctx)) { 2454 2476 pr_err("%s: rockchip clk init failed\n", __func__); 2455 2477 iounmap(reg_base); 2456 2478 return; 2457 2479 } 2480 + early_ctx = ctx; 2458 2481 2459 2482 rockchip_clk_register_plls(ctx, rk3588_pll_clks, 2460 2483 ARRAY_SIZE(rk3588_pll_clks), ··· 2478 2491 &rk3588_cpub1clk_data, rk3588_cpub1clk_rates, 2479 2492 ARRAY_SIZE(rk3588_cpub1clk_rates)); 2480 2493 2481 - rockchip_clk_register_branches(ctx, rk3588_clk_branches, 2482 - ARRAY_SIZE(rk3588_clk_branches)); 2483 - 2484 - rk3588_rst_init(np, reg_base); 2485 - 2486 - rockchip_register_restart_notifier(ctx, RK3588_GLB_SRST_FST, NULL); 2494 + rockchip_clk_register_branches(ctx, rk3588_early_clk_branches, 2495 + ARRAY_SIZE(rk3588_early_clk_branches)); 2487 2496 2488 2497 rockchip_clk_of_add_provider(np, ctx); 2489 2498 } 2499 + CLK_OF_DECLARE_DRIVER(rk3588_cru, "rockchip,rk3588-cru", rk3588_clk_early_init); 2490 2500 2491 - CLK_OF_DECLARE(rk3588_cru, "rockchip,rk3588-cru", rk3588_clk_init); 2501 + static int clk_rk3588_probe(struct platform_device *pdev) 2502 + { 2503 + struct rockchip_clk_provider *ctx = early_ctx; 2504 + struct device *dev = &pdev->dev; 2505 + struct device_node *np = dev->of_node; 2506 + 2507 + rockchip_clk_register_late_branches(dev, ctx, rk3588_clk_branches, 2508 + ARRAY_SIZE(rk3588_clk_branches)); 2509 + 2510 + rockchip_clk_finalize(ctx); 2511 + 2512 + rk3588_rst_init(np, ctx->reg_base); 2513 + rockchip_register_restart_notifier(ctx, RK3588_GLB_SRST_FST, NULL); 2514 + 2515 + /* 2516 + * Re-add clock provider, so that the newly added clocks are also 2517 + * re-parented and get their defaults configured. 2518 + */ 2519 + of_clk_del_provider(np); 2520 + rockchip_clk_of_add_provider(np, ctx); 2521 + 2522 + return 0; 2523 + } 2524 + 2525 + static const struct of_device_id clk_rk3588_match_table[] = { 2526 + { 2527 + .compatible = "rockchip,rk3588-cru", 2528 + }, 2529 + { } 2530 + }; 2531 + 2532 + static struct platform_driver clk_rk3588_driver = { 2533 + .probe = clk_rk3588_probe, 2534 + .driver = { 2535 + .name = "clk-rk3588", 2536 + .of_match_table = clk_rk3588_match_table, 2537 + .suppress_bind_attrs = true, 2538 + }, 2539 + }; 2540 + 2541 + static int __init rockchip_clk_rk3588_drv_register(void) 2542 + { 2543 + return platform_driver_register(&clk_rk3588_driver); 2544 + } 2545 + core_initcall(rockchip_clk_rk3588_drv_register);
+88 -14
drivers/clk/rockchip/clk.c
··· 19 19 #include <linux/clk-provider.h> 20 20 #include <linux/io.h> 21 21 #include <linux/mfd/syscon.h> 22 + #include <linux/platform_device.h> 22 23 #include <linux/regmap.h> 23 24 #include <linux/reboot.h> 24 25 ··· 198 197 clk_fractional_divider_general_approximation(hw, rate, parent_rate, m, n); 199 198 } 200 199 201 - static void rockchip_clk_add_lookup(struct rockchip_clk_provider *ctx, 202 - struct clk *clk, unsigned int id) 203 - { 204 - ctx->clk_data.clks[id] = clk; 205 - } 206 - 207 200 static struct clk *rockchip_clk_register_frac_branch( 208 201 struct rockchip_clk_provider *ctx, const char *name, 209 202 const char *const *parent_names, u8 num_parents, ··· 287 292 return mux_clk; 288 293 } 289 294 290 - rockchip_clk_add_lookup(ctx, mux_clk, child->id); 295 + rockchip_clk_set_lookup(ctx, mux_clk, child->id); 291 296 292 297 /* notifier on the fraction divider to catch rate changes */ 293 298 if (frac->mux_frac_idx >= 0) { ··· 354 359 return hw->clk; 355 360 } 356 361 357 - struct rockchip_clk_provider *rockchip_clk_init(struct device_node *np, 358 - void __iomem *base, 359 - unsigned long nr_clks) 362 + static struct rockchip_clk_provider *rockchip_clk_init_base( 363 + struct device_node *np, void __iomem *base, 364 + unsigned long nr_clks, bool has_late_clocks) 360 365 { 361 366 struct rockchip_clk_provider *ctx; 362 367 struct clk **clk_table; 368 + struct clk *default_clk_val; 363 369 int i; 370 + 371 + default_clk_val = ERR_PTR(has_late_clocks ? -EPROBE_DEFER : -ENOENT); 364 372 365 373 ctx = kzalloc(sizeof(struct rockchip_clk_provider), GFP_KERNEL); 366 374 if (!ctx) ··· 374 376 goto err_free; 375 377 376 378 for (i = 0; i < nr_clks; ++i) 377 - clk_table[i] = ERR_PTR(-ENOENT); 379 + clk_table[i] = default_clk_val; 378 380 379 381 ctx->reg_base = base; 380 382 ctx->clk_data.clks = clk_table; ··· 391 393 kfree(ctx); 392 394 return ERR_PTR(-ENOMEM); 393 395 } 396 + 397 + struct rockchip_clk_provider *rockchip_clk_init(struct device_node *np, 398 + void __iomem *base, 399 + unsigned long nr_clks) 400 + { 401 + return rockchip_clk_init_base(np, base, nr_clks, false); 402 + } 394 403 EXPORT_SYMBOL_GPL(rockchip_clk_init); 404 + 405 + struct rockchip_clk_provider *rockchip_clk_init_early(struct device_node *np, 406 + void __iomem *base, 407 + unsigned long nr_clks) 408 + { 409 + return rockchip_clk_init_base(np, base, nr_clks, true); 410 + } 411 + EXPORT_SYMBOL_GPL(rockchip_clk_init_early); 412 + 413 + void rockchip_clk_finalize(struct rockchip_clk_provider *ctx) 414 + { 415 + int i; 416 + 417 + for (i = 0; i < ctx->clk_data.clk_num; ++i) 418 + if (ctx->clk_data.clks[i] == ERR_PTR(-EPROBE_DEFER)) 419 + ctx->clk_data.clks[i] = ERR_PTR(-ENOENT); 420 + } 421 + EXPORT_SYMBOL_GPL(rockchip_clk_finalize); 395 422 396 423 void rockchip_clk_of_add_provider(struct device_node *np, 397 424 struct rockchip_clk_provider *ctx) ··· 447 424 continue; 448 425 } 449 426 450 - rockchip_clk_add_lookup(ctx, clk, list->id); 427 + rockchip_clk_set_lookup(ctx, clk, list->id); 451 428 } 452 429 } 453 430 EXPORT_SYMBOL_GPL(rockchip_clk_register_plls); ··· 468 445 return max; 469 446 } 470 447 EXPORT_SYMBOL_GPL(rockchip_clk_find_max_clk_id); 448 + 449 + static struct platform_device *rockchip_clk_register_gate_link( 450 + struct device *parent_dev, 451 + struct rockchip_clk_provider *ctx, 452 + struct rockchip_clk_branch *clkbr) 453 + { 454 + struct rockchip_gate_link_platdata gate_link_pdata = { 455 + .ctx = ctx, 456 + .clkbr = clkbr, 457 + }; 458 + 459 + struct platform_device_info pdevinfo = { 460 + .parent = parent_dev, 461 + .name = "rockchip-gate-link-clk", 462 + .id = clkbr->id, 463 + .fwnode = dev_fwnode(parent_dev), 464 + .of_node_reused = true, 465 + .data = &gate_link_pdata, 466 + .size_data = sizeof(gate_link_pdata), 467 + }; 468 + 469 + return platform_device_register_full(&pdevinfo); 470 + } 471 471 472 472 void rockchip_clk_register_branches(struct rockchip_clk_provider *ctx, 473 473 struct rockchip_clk_branch *list, ··· 617 571 list->div_width, list->div_flags, 618 572 ctx->reg_base, &ctx->lock); 619 573 break; 574 + case branch_linked_gate: 575 + /* must be registered late, fall-through for error message */ 576 + break; 620 577 } 621 578 622 579 /* none of the cases above matched */ ··· 635 586 continue; 636 587 } 637 588 638 - rockchip_clk_add_lookup(ctx, clk, list->id); 589 + rockchip_clk_set_lookup(ctx, clk, list->id); 639 590 } 640 591 } 641 592 EXPORT_SYMBOL_GPL(rockchip_clk_register_branches); 593 + 594 + void rockchip_clk_register_late_branches(struct device *dev, 595 + struct rockchip_clk_provider *ctx, 596 + struct rockchip_clk_branch *list, 597 + unsigned int nr_clk) 598 + { 599 + unsigned int idx; 600 + 601 + for (idx = 0; idx < nr_clk; idx++, list++) { 602 + struct platform_device *pdev = NULL; 603 + 604 + switch (list->branch_type) { 605 + case branch_linked_gate: 606 + pdev = rockchip_clk_register_gate_link(dev, ctx, list); 607 + break; 608 + default: 609 + dev_err(dev, "unknown clock type %d\n", list->branch_type); 610 + break; 611 + } 612 + 613 + if (!pdev) 614 + dev_err(dev, "failed to register device for clock %s\n", list->name); 615 + } 616 + } 617 + EXPORT_SYMBOL_GPL(rockchip_clk_register_late_branches); 642 618 643 619 void rockchip_clk_register_armclk(struct rockchip_clk_provider *ctx, 644 620 unsigned int lookup_id, ··· 684 610 return; 685 611 } 686 612 687 - rockchip_clk_add_lookup(ctx, clk, lookup_id); 613 + rockchip_clk_set_lookup(ctx, clk, lookup_id); 688 614 } 689 615 EXPORT_SYMBOL_GPL(rockchip_clk_register_armclk); 690 616
+40
drivers/clk/rockchip/clk.h
··· 570 570 branch_divider, 571 571 branch_fraction_divider, 572 572 branch_gate, 573 + branch_linked_gate, 573 574 branch_mmc, 574 575 branch_inverter, 575 576 branch_factor, ··· 598 597 int gate_offset; 599 598 u8 gate_shift; 600 599 u8 gate_flags; 600 + unsigned int linked_clk_id; 601 601 struct rockchip_clk_branch *child; 602 602 }; 603 603 ··· 897 895 .gate_flags = gf, \ 898 896 } 899 897 898 + #define GATE_LINK(_id, cname, pname, linkedclk, f, o, b, gf) \ 899 + { \ 900 + .id = _id, \ 901 + .branch_type = branch_linked_gate, \ 902 + .name = cname, \ 903 + .parent_names = (const char *[]){ pname }, \ 904 + .linked_clk_id = linkedclk, \ 905 + .num_parents = 1, \ 906 + .flags = f, \ 907 + .gate_offset = o, \ 908 + .gate_shift = b, \ 909 + .gate_flags = gf, \ 910 + } 911 + 900 912 #define MMC(_id, cname, pname, offset, shift) \ 901 913 { \ 902 914 .id = _id, \ ··· 1038 1022 #define SGRF_GATE(_id, cname, pname) \ 1039 1023 FACTOR(_id, cname, pname, 0, 1, 1) 1040 1024 1025 + static inline struct clk *rockchip_clk_get_lookup(struct rockchip_clk_provider *ctx, 1026 + unsigned int id) 1027 + { 1028 + return ctx->clk_data.clks[id]; 1029 + } 1030 + 1031 + static inline void rockchip_clk_set_lookup(struct rockchip_clk_provider *ctx, 1032 + struct clk *clk, unsigned int id) 1033 + { 1034 + ctx->clk_data.clks[id] = clk; 1035 + } 1036 + 1037 + struct rockchip_gate_link_platdata { 1038 + struct rockchip_clk_provider *ctx; 1039 + struct rockchip_clk_branch *clkbr; 1040 + }; 1041 + 1041 1042 struct rockchip_clk_provider *rockchip_clk_init(struct device_node *np, 1042 1043 void __iomem *base, unsigned long nr_clks); 1044 + struct rockchip_clk_provider *rockchip_clk_init_early(struct device_node *np, 1045 + void __iomem *base, unsigned long nr_clks); 1046 + void rockchip_clk_finalize(struct rockchip_clk_provider *ctx); 1043 1047 void rockchip_clk_of_add_provider(struct device_node *np, 1044 1048 struct rockchip_clk_provider *ctx); 1045 1049 unsigned long rockchip_clk_find_max_clk_id(struct rockchip_clk_branch *list, ··· 1067 1031 void rockchip_clk_register_branches(struct rockchip_clk_provider *ctx, 1068 1032 struct rockchip_clk_branch *list, 1069 1033 unsigned int nr_clk); 1034 + void rockchip_clk_register_late_branches(struct device *dev, 1035 + struct rockchip_clk_provider *ctx, 1036 + struct rockchip_clk_branch *list, 1037 + unsigned int nr_clk); 1070 1038 void rockchip_clk_register_plls(struct rockchip_clk_provider *ctx, 1071 1039 struct rockchip_pll_clock *pll_list, 1072 1040 unsigned int nr_pll, int grf_lock_offset);
+85
drivers/clk/rockchip/gate-link.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-or-later 2 + /* 3 + * Copyright (c) 2024 Collabora Ltd. 4 + * Author: Sebastian Reichel <sebastian.reichel@collabora.com> 5 + */ 6 + 7 + #include <linux/clk.h> 8 + #include <linux/platform_device.h> 9 + #include <linux/pm_clock.h> 10 + #include <linux/pm_runtime.h> 11 + #include <linux/property.h> 12 + #include "clk.h" 13 + 14 + static int rk_clk_gate_link_register(struct device *dev, 15 + struct rockchip_clk_provider *ctx, 16 + struct rockchip_clk_branch *clkbr) 17 + { 18 + unsigned long flags = clkbr->flags | CLK_SET_RATE_PARENT; 19 + struct clk *clk; 20 + 21 + clk = clk_register_gate(dev, clkbr->name, clkbr->parent_names[0], 22 + flags, ctx->reg_base + clkbr->gate_offset, 23 + clkbr->gate_shift, clkbr->gate_flags, 24 + &ctx->lock); 25 + 26 + if (IS_ERR(clk)) 27 + return PTR_ERR(clk); 28 + 29 + rockchip_clk_set_lookup(ctx, clk, clkbr->id); 30 + return 0; 31 + } 32 + 33 + static int rk_clk_gate_link_probe(struct platform_device *pdev) 34 + { 35 + struct rockchip_gate_link_platdata *pdata; 36 + struct device *dev = &pdev->dev; 37 + struct clk *linked_clk; 38 + int ret; 39 + 40 + pdata = dev_get_platdata(dev); 41 + if (!pdata) 42 + return dev_err_probe(dev, -ENODEV, "missing platform data"); 43 + 44 + ret = devm_pm_runtime_enable(dev); 45 + if (ret) 46 + return ret; 47 + 48 + ret = devm_pm_clk_create(dev); 49 + if (ret) 50 + return ret; 51 + 52 + linked_clk = rockchip_clk_get_lookup(pdata->ctx, pdata->clkbr->linked_clk_id); 53 + ret = pm_clk_add_clk(dev, linked_clk); 54 + if (ret) 55 + return ret; 56 + 57 + ret = rk_clk_gate_link_register(dev, pdata->ctx, pdata->clkbr); 58 + if (ret) 59 + goto err; 60 + 61 + return 0; 62 + 63 + err: 64 + pm_clk_remove_clk(dev, linked_clk); 65 + return ret; 66 + } 67 + 68 + static const struct dev_pm_ops rk_clk_gate_link_pm_ops = { 69 + SET_RUNTIME_PM_OPS(pm_clk_suspend, pm_clk_resume, NULL) 70 + }; 71 + 72 + static struct platform_driver rk_clk_gate_link_driver = { 73 + .probe = rk_clk_gate_link_probe, 74 + .driver = { 75 + .name = "rockchip-gate-link-clk", 76 + .pm = &rk_clk_gate_link_pm_ops, 77 + .suppress_bind_attrs = true, 78 + }, 79 + }; 80 + 81 + static int __init rk_clk_gate_link_drv_register(void) 82 + { 83 + return platform_driver_register(&rk_clk_gate_link_driver); 84 + } 85 + core_initcall(rk_clk_gate_link_drv_register);
+7 -6
drivers/clk/thead/clk-th1520-ap.c
··· 657 657 .hw.init = CLK_HW_INIT_PARENTS_DATA("apb-pclk", 658 658 apb_parents, 659 659 &ccu_div_ops, 660 - 0), 660 + CLK_IGNORE_UNUSED), 661 661 }, 662 662 }; 663 663 ··· 787 787 0x134, BIT(7), 0); 788 788 static CCU_GATE(CLK_CPU2AON_X2H, cpu2aon_x2h_clk, "cpu2aon-x2h", axi_aclk_pd, 0x138, BIT(8), 0); 789 789 static CCU_GATE(CLK_CPU2PERI_X2H, cpu2peri_x2h_clk, "cpu2peri-x2h", axi4_cpusys2_aclk_pd, 790 - 0x140, BIT(9), 0); 790 + 0x140, BIT(9), CLK_IGNORE_UNUSED); 791 791 static CCU_GATE(CLK_PERISYS_APB1_HCLK, perisys_apb1_hclk, "perisys-apb1-hclk", perisys_ahb_hclk_pd, 792 792 0x150, BIT(9), 0); 793 793 static CCU_GATE(CLK_PERISYS_APB2_HCLK, perisys_apb2_hclk, "perisys-apb2-hclk", perisys_ahb_hclk_pd, 794 - 0x150, BIT(10), 0); 794 + 0x150, BIT(10), CLK_IGNORE_UNUSED); 795 795 static CCU_GATE(CLK_PERISYS_APB3_HCLK, perisys_apb3_hclk, "perisys-apb3-hclk", perisys_ahb_hclk_pd, 796 - 0x150, BIT(11), 0); 796 + 0x150, BIT(11), CLK_IGNORE_UNUSED); 797 797 static CCU_GATE(CLK_PERISYS_APB4_HCLK, perisys_apb4_hclk, "perisys-apb4-hclk", perisys_ahb_hclk_pd, 798 798 0x150, BIT(12), 0); 799 799 static CCU_GATE(CLK_NPU_AXI, npu_axi_clk, "npu-axi", axi_aclk_pd, 0x1c8, BIT(5), 0); ··· 889 889 &vo_axi_clk.common, 890 890 &vp_apb_clk.common, 891 891 &vp_axi_clk.common, 892 - &cpu2vp_clk.common, 893 892 &venc_clk.common, 894 893 &dpu0_clk.common, 895 894 &dpu1_clk.common, ··· 908 909 &bmu_clk.common, 909 910 &cpu2aon_x2h_clk.common, 910 911 &cpu2peri_x2h_clk.common, 912 + &cpu2vp_clk.common, 911 913 &perisys_apb1_hclk.common, 912 914 &perisys_apb2_hclk.common, 913 915 &perisys_apb3_hclk.common, ··· 1041 1041 hw = devm_clk_hw_register_gate_parent_data(dev, 1042 1042 cg->common.hw.init->name, 1043 1043 cg->common.hw.init->parent_data, 1044 - 0, base + cg->common.cfg0, 1044 + cg->common.hw.init->flags, 1045 + base + cg->common.cfg0, 1045 1046 ffs(cg->enable) - 1, 0, NULL); 1046 1047 if (IS_ERR(hw)) 1047 1048 return PTR_ERR(hw);
+1 -1
include/dt-bindings/clock/en7523-clk.h
··· 12 12 #define EN7523_CLK_CRYPTO 6 13 13 #define EN7523_CLK_PCIE 7 14 14 15 - #define EN7523_NUM_CLOCKS 8 15 + #define EN7581_CLK_EMMC 8 16 16 17 17 #endif /* _DT_BINDINGS_CLOCK_AIROHA_EN7523_H_ */
+1 -1
include/dt-bindings/clock/stm32fx-clock.h
··· 10 10 * List of clocks which are not derived from system clock (SYSCLOCK) 11 11 * 12 12 * The index of these clocks is the secondary index of DT bindings 13 - * (see Documentation/devicetree/bindings/clock/st,stm32-rcc.txt) 13 + * (see Documentation/devicetree/bindings/clock/st,stm32-rcc.yaml) 14 14 * 15 15 * e.g: 16 16 <assigned-clocks = <&rcc 1 CLK_LSE>;
+1
include/soc/bcm2835/raspberrypi-firmware.h
··· 152 152 RPI_FIRMWARE_M2MC_CLK_ID, 153 153 RPI_FIRMWARE_PIXEL_BVB_CLK_ID, 154 154 RPI_FIRMWARE_VEC_CLK_ID, 155 + RPI_FIRMWARE_DISP_CLK_ID, 155 156 RPI_FIRMWARE_NUM_CLK_ID, 156 157 }; 157 158