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

Merge branches 'clk-bindings', 'clk-cleanup', 'clk-pwm', 'clk-hw-device', 'clk-xilinx' and 'clk-adi' into clk-next

- Support atomic PWMs in the PWM clk driver
- clk_hw_get_dev() and clk_hw_get_of_node() helpers

* clk-bindings: (30 commits)
dt-bindings: clock: convert lpc1850-cgu.txt to yaml format
dt-bindings: clock: Convert qca,ath79-pll to DT schema
dt-bindings: clock: Convert nuvoton,npcm750-clk to DT schema
dt-bindings: clock: Convert moxa,moxart-clock to DT schema
dt-bindings: clock: Convert microchip,pic32mzda-clk to DT schema
dt-bindings: clock: Convert maxim,max9485 to DT schema
dt-bindings: clock: Convert qcom,krait-cc to DT schema
dt-bindings: clock: qcom: Remove double colon from description
dt-bindings: clock: convert lpc1850-ccu.txt to yaml format
dt-bindings: clock: Convert alphascale,asm9260-clock-controller to DT schema
dt-bindings: clock: Convert marvell,armada-370-corediv-clock to DT schema
dt-bindings: clock: Convert marvell,armada-3700-periph-clock to DT schema
dt-bindings: clock: Convert marvell,mvebu-core-clock to DT schema
dt-bindings: clock: Convert marvell,berlin2-clk to DT schema
dt-bindings: clock: Convert marvell,dove-divider-clock to DT schema
dt-bindings: clock: Convert marvell,armada-3700-tbg-clock to DT schema
dt-bindings: clock: Convert marvell-armada-370-gating-clock to DT schema
dt-bindings: clock: Convert marvell,armada-xp-cpu-clock to DT schema
dt-bindings: clock: Convert TI-NSPIRE clocks to DT schema
dt-bindings: clock: Convert lsi,axm5516-clks to DT schema
...

* clk-cleanup: (29 commits)
clk: clocking-wizard: Fix the round rate handling for versal
clk: Fix typos
clk: tegra: periph: Make tegra_clk_periph_ops static
clk: tegra: periph: Fix error handling and resolve unsigned compare warning
clk: imx: scu: convert from round_rate() to determine_rate()
clk: imx: pllv4: convert from round_rate() to determine_rate()
clk: imx: pllv3: convert from round_rate() to determine_rate()
clk: imx: pllv2: convert from round_rate() to determine_rate()
clk: imx: pll14xx: convert from round_rate() to determine_rate()
clk: imx: pfd: convert from round_rate() to determine_rate()
clk: imx: frac-pll: convert from round_rate() to determine_rate()
clk: imx: fracn-gppll: convert from round_rate() to determine_rate()
clk: imx: fixup-div: convert from round_rate() to determine_rate()
clk: imx: cpu: convert from round_rate() to determine_rate()
clk: imx: busy: convert from round_rate() to determine_rate()
clk: imx: composite-93: remove round_rate() in favor of determine_rate()
clk: imx: composite-8m: remove round_rate() in favor of determine_rate()
clk: bcm: bcm2835: convert from round_rate() to determine_rate()
MAINTAINERS: Include clk.py under COMMON CLK FRAMEWORK entry
clk: ti: Simplify ti_find_clock_provider()
...

* clk-pwm:
clk: pwm: Make use of non-sleeping PWMs
clk: pwm: Don't reconfigure running PWM at probe time
clk: pwm: Convert to use pwm_apply_might_sleep()
clk: pwm: Let .get_duty_cycle() return the real duty cycle

* clk-hw-device:
clk: tests: add clk_hw_get_dev() and clk_hw_get_of_node() tests
clk: tests: Make clk_register_clk_parent_data_device_driver() common
clk: add a clk_hw helpers to get the clock device or device_node

* clk-xilinx:
clk: xilinx: vcu: Update vcu init/reset sequence
clk: xilinx: vcu: unregister pll_post only if registered correctly

* clk-adi:
clk: clk-axi-clkgen: fix coding style issues
clk: clk-axi-clkgen move to min/max()
clk: clk-axi-clkgen: detect axi_clkgen_limits at runtime
include: adi-axi-common: add new helper macros
include: linux: move adi-axi-common.h out of fpga
clk: clk-axi-clkgen: make sure to include mod_devicetable.h
clk: clk-axi-clkgen: fix fpfd_max frequency for zynq

+2790 -2195
-114
Documentation/devicetree/bindings/clock/alphascale,acc.txt
··· 1 - Alphascale Clock Controller 2 - 3 - The ACC (Alphascale Clock Controller) is responsible for choosing proper 4 - clock source, setting dividers and clock gates. 5 - 6 - Required properties for the ACC node: 7 - - compatible: must be "alphascale,asm9260-clock-controller" 8 - - reg: must contain the ACC register base and size 9 - - #clock-cells : shall be set to 1. 10 - 11 - Simple one-cell clock specifier format is used, where the only cell is used 12 - as an index of the clock inside the provider. 13 - It is encouraged to use dt-binding for clock index definitions. SoC specific 14 - dt-binding should be included to the device tree descriptor. For example 15 - Alphascale ASM9260: 16 - #include <dt-bindings/clock/alphascale,asm9260.h> 17 - 18 - This binding contains two types of clock providers: 19 - _AHB_ - AHB gate; 20 - _SYS_ - adjustable clock source. Not all peripheral have _SYS_ clock provider. 21 - All clock specific details can be found in the SoC documentation. 22 - CLKID_AHB_ROM 0 23 - CLKID_AHB_RAM 1 24 - CLKID_AHB_GPIO 2 25 - CLKID_AHB_MAC 3 26 - CLKID_AHB_EMI 4 27 - CLKID_AHB_USB0 5 28 - CLKID_AHB_USB1 6 29 - CLKID_AHB_DMA0 7 30 - CLKID_AHB_DMA1 8 31 - CLKID_AHB_UART0 9 32 - CLKID_AHB_UART1 10 33 - CLKID_AHB_UART2 11 34 - CLKID_AHB_UART3 12 35 - CLKID_AHB_UART4 13 36 - CLKID_AHB_UART5 14 37 - CLKID_AHB_UART6 15 38 - CLKID_AHB_UART7 16 39 - CLKID_AHB_UART8 17 40 - CLKID_AHB_UART9 18 41 - CLKID_AHB_I2S0 19 42 - CLKID_AHB_I2C0 20 43 - CLKID_AHB_I2C1 21 44 - CLKID_AHB_SSP0 22 45 - CLKID_AHB_IOCONFIG 23 46 - CLKID_AHB_WDT 24 47 - CLKID_AHB_CAN0 25 48 - CLKID_AHB_CAN1 26 49 - CLKID_AHB_MPWM 27 50 - CLKID_AHB_SPI0 28 51 - CLKID_AHB_SPI1 29 52 - CLKID_AHB_QEI 30 53 - CLKID_AHB_QUADSPI0 31 54 - CLKID_AHB_CAMIF 32 55 - CLKID_AHB_LCDIF 33 56 - CLKID_AHB_TIMER0 34 57 - CLKID_AHB_TIMER1 35 58 - CLKID_AHB_TIMER2 36 59 - CLKID_AHB_TIMER3 37 60 - CLKID_AHB_IRQ 38 61 - CLKID_AHB_RTC 39 62 - CLKID_AHB_NAND 40 63 - CLKID_AHB_ADC0 41 64 - CLKID_AHB_LED 42 65 - CLKID_AHB_DAC0 43 66 - CLKID_AHB_LCD 44 67 - CLKID_AHB_I2S1 45 68 - CLKID_AHB_MAC1 46 69 - 70 - CLKID_SYS_CPU 47 71 - CLKID_SYS_AHB 48 72 - CLKID_SYS_I2S0M 49 73 - CLKID_SYS_I2S0S 50 74 - CLKID_SYS_I2S1M 51 75 - CLKID_SYS_I2S1S 52 76 - CLKID_SYS_UART0 53 77 - CLKID_SYS_UART1 54 78 - CLKID_SYS_UART2 55 79 - CLKID_SYS_UART3 56 80 - CLKID_SYS_UART4 56 81 - CLKID_SYS_UART5 57 82 - CLKID_SYS_UART6 58 83 - CLKID_SYS_UART7 59 84 - CLKID_SYS_UART8 60 85 - CLKID_SYS_UART9 61 86 - CLKID_SYS_SPI0 62 87 - CLKID_SYS_SPI1 63 88 - CLKID_SYS_QUADSPI 64 89 - CLKID_SYS_SSP0 65 90 - CLKID_SYS_NAND 66 91 - CLKID_SYS_TRACE 67 92 - CLKID_SYS_CAMM 68 93 - CLKID_SYS_WDT 69 94 - CLKID_SYS_CLKOUT 70 95 - CLKID_SYS_MAC 71 96 - CLKID_SYS_LCD 72 97 - CLKID_SYS_ADCANA 73 98 - 99 - Example of clock consumer with _SYS_ and _AHB_ sinks. 100 - uart4: serial@80010000 { 101 - compatible = "alphascale,asm9260-uart"; 102 - reg = <0x80010000 0x4000>; 103 - clocks = <&acc CLKID_SYS_UART4>, <&acc CLKID_AHB_UART4>; 104 - interrupts = <19>; 105 - }; 106 - 107 - Clock consumer with only one, _AHB_ sink. 108 - timer0: timer@80088000 { 109 - compatible = "alphascale,asm9260-timer"; 110 - reg = <0x80088000 0x4000>; 111 - clocks = <&acc CLKID_AHB_TIMER0>; 112 - interrupts = <29>; 113 - }; 114 -
+49
Documentation/devicetree/bindings/clock/alphascale,asm9260-clock-controller.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/alphascale,asm9260-clock-controller.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Alphascale Clock Controller 8 + 9 + maintainers: 10 + - Oleksij Rempel <linux@rempel-privat.de> 11 + 12 + description: | 13 + The ACC (Alphascale Clock Controller) is responsible for choosing proper 14 + clock source, setting dividers and clock gates. 15 + 16 + Simple one-cell clock specifier format is used, where the only cell is used 17 + as an index of the clock inside the provider. 18 + It is encouraged to use dt-binding for clock index definitions. SoC specific 19 + dt-binding should be included to the device tree descriptor. For example 20 + Alphascale ASM9260: 21 + 22 + #include <dt-bindings/clock/alphascale,asm9260.h> 23 + 24 + This binding contains two types of clock providers: 25 + 26 + _AHB_ - AHB gate; 27 + _SYS_ - adjustable clock source. Not all peripheral have _SYS_ clock provider. 28 + 29 + All clock specific details can be found in the SoC documentation. 30 + 31 + properties: 32 + compatible: 33 + const: alphascale,asm9260-clock-controller 34 + 35 + reg: 36 + maxItems: 1 37 + 38 + '#clock-cells': 39 + const: 1 40 + 41 + clocks: 42 + maxItems: 1 43 + 44 + required: 45 + - compatible 46 + - reg 47 + - '#clock-cells' 48 + 49 + additionalProperties: false
+80
Documentation/devicetree/bindings/clock/apm,xgene-device-clock.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/apm,xgene-device-clock.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: APM X-Gene SoC device clocks 8 + 9 + maintainers: 10 + - Khuong Dinh <khuong@os.amperecomputing.com> 11 + 12 + properties: 13 + compatible: 14 + const: apm,xgene-device-clock 15 + 16 + reg: 17 + minItems: 1 18 + maxItems: 2 19 + 20 + reg-names: 21 + items: 22 + - enum: [ csr-reg, div-reg ] 23 + - const: div-reg 24 + minItems: 1 25 + 26 + clocks: 27 + maxItems: 1 28 + 29 + "#clock-cells": 30 + const: 1 31 + 32 + clock-output-names: 33 + maxItems: 1 34 + 35 + clock-names: 36 + maxItems: 1 37 + 38 + csr-offset: 39 + description: Offset to the CSR reset register 40 + $ref: /schemas/types.yaml#/definitions/uint32 41 + default: 0 42 + 43 + csr-mask: 44 + description: CSR reset mask bit 45 + $ref: /schemas/types.yaml#/definitions/uint32 46 + default: 0xf 47 + 48 + enable-offset: 49 + description: Offset to the enable register 50 + $ref: /schemas/types.yaml#/definitions/uint32 51 + default: 8 52 + 53 + enable-mask: 54 + description: CSR enable mask bit 55 + $ref: /schemas/types.yaml#/definitions/uint32 56 + default: 0xf 57 + 58 + divider-offset: 59 + description: Offset to the divider register 60 + $ref: /schemas/types.yaml#/definitions/uint32 61 + default: 0 62 + 63 + divider-width: 64 + description: Width of the divider register 65 + $ref: /schemas/types.yaml#/definitions/uint32 66 + default: 0 67 + 68 + divider-shift: 69 + description: Bit shift of the divider register 70 + $ref: /schemas/types.yaml#/definitions/uint32 71 + default: 0 72 + 73 + required: 74 + - compatible 75 + - reg 76 + - clocks 77 + - '#clock-cells' 78 + - clock-output-names 79 + 80 + additionalProperties: false
+50
Documentation/devicetree/bindings/clock/apm,xgene-socpll-clock.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/apm,xgene-socpll-clock.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: APM X-Gene SoC PLL, PCPPLL, and PMD clocks 8 + 9 + maintainers: 10 + - Khuong Dinh <khuong@os.amperecomputing.com> 11 + 12 + properties: 13 + compatible: 14 + items: 15 + - enum: 16 + - apm,xgene-pcppll-clock 17 + - apm,xgene-pcppll-v2-clock 18 + - apm,xgene-pmd-clock 19 + - apm,xgene-socpll-clock 20 + - apm,xgene-socpll-v2-clock 21 + 22 + reg: 23 + maxItems: 1 24 + 25 + reg-names: 26 + items: 27 + - enum: [ csr-reg, div-reg ] 28 + - const: div-reg 29 + minItems: 1 30 + 31 + clocks: 32 + maxItems: 1 33 + 34 + clock-names: 35 + enum: [ pcppll, socpll ] 36 + 37 + "#clock-cells": 38 + const: 1 39 + 40 + clock-output-names: 41 + maxItems: 1 42 + 43 + required: 44 + - compatible 45 + - reg 46 + - clocks 47 + - '#clock-cells' 48 + - clock-output-names 49 + 50 + additionalProperties: false
-71
Documentation/devicetree/bindings/clock/armada3700-periph-clock.txt
··· 1 - * Peripheral Clock bindings for Marvell Armada 37xx SoCs 2 - 3 - Marvell Armada 37xx SoCs provide peripheral clocks which are 4 - used as clock source for the peripheral of the SoC. 5 - 6 - There are two different blocks associated to north bridge and south 7 - bridge. 8 - 9 - The peripheral clock consumer should specify the desired clock by 10 - having the clock ID in its "clocks" phandle cell. 11 - 12 - The following is a list of provided IDs for Armada 3700 North bridge clocks: 13 - ID Clock name Description 14 - ----------------------------------- 15 - 0 mmc MMC controller 16 - 1 sata_host Sata Host 17 - 2 sec_at Security AT 18 - 3 sac_dap Security DAP 19 - 4 tsecm Security Engine 20 - 5 setm_tmx Serial Embedded Trace Module 21 - 6 avs Adaptive Voltage Scaling 22 - 7 sqf SPI 23 - 8 pwm PWM 24 - 9 i2c_2 I2C 2 25 - 10 i2c_1 I2C 1 26 - 11 ddr_phy DDR PHY 27 - 12 ddr_fclk DDR F clock 28 - 13 trace Trace 29 - 14 counter Counter 30 - 15 eip97 EIP 97 31 - 16 cpu CPU 32 - 33 - The following is a list of provided IDs for Armada 3700 South bridge clocks: 34 - ID Clock name Description 35 - ----------------------------------- 36 - 0 gbe-50 50 MHz parent clock for Gigabit Ethernet 37 - 1 gbe-core parent clock for Gigabit Ethernet core 38 - 2 gbe-125 125 MHz parent clock for Gigabit Ethernet 39 - 3 gbe1-50 50 MHz clock for Gigabit Ethernet port 1 40 - 4 gbe0-50 50 MHz clock for Gigabit Ethernet port 0 41 - 5 gbe1-125 125 MHz clock for Gigabit Ethernet port 1 42 - 6 gbe0-125 125 MHz clock for Gigabit Ethernet port 0 43 - 7 gbe1-core Gigabit Ethernet core port 1 44 - 8 gbe0-core Gigabit Ethernet core port 0 45 - 9 gbe-bm Gigabit Ethernet Buffer Manager 46 - 10 sdio SDIO 47 - 11 usb32-sub2-sys USB 2 clock 48 - 12 usb32-ss-sys USB 3 clock 49 - 13 pcie PCIe controller 50 - 51 - Required properties: 52 - 53 - - compatible : shall be "marvell,armada-3700-periph-clock-nb" for the 54 - north bridge block, or 55 - "marvell,armada-3700-periph-clock-sb" for the south bridge block 56 - - reg : must be the register address of North/South Bridge Clock register 57 - - #clock-cells : from common clock binding; shall be set to 1 58 - 59 - - clocks : list of the parent clock phandle in the following order: 60 - TBG-A P, TBG-B P, TBG-A S, TBG-B S and finally the xtal clock. 61 - 62 - 63 - Example: 64 - 65 - nb_perih_clk: nb-periph-clk@13000{ 66 - compatible = "marvell,armada-3700-periph-clock-nb"; 67 - reg = <0x13000 0x1000>; 68 - clocks = <&tbg 0>, <&tbg 1>, <&tbg 2>, 69 - <&tbg 3>, <&xtalclk>; 70 - #clock-cells = <1>; 71 - };
-27
Documentation/devicetree/bindings/clock/armada3700-tbg-clock.txt
··· 1 - * Time Base Generator Clock bindings for Marvell Armada 37xx SoCs 2 - 3 - Marvell Armada 37xx SoCs provide Time Base Generator clocks which are 4 - used as parent clocks for the peripheral clocks. 5 - 6 - The TBG clock consumer should specify the desired clock by having the 7 - clock ID in its "clocks" phandle cell. 8 - 9 - The following is a list of provided IDs and clock names on Armada 3700: 10 - 0 = TBG A P 11 - 1 = TBG B P 12 - 2 = TBG A S 13 - 3 = TBG B S 14 - 15 - Required properties: 16 - - compatible : shall be "marvell,armada-3700-tbg-clock" 17 - - reg : must be the register address of North Bridge PLL register 18 - - #clock-cells : from common clock binding; shall be set to 1 19 - 20 - Example: 21 - 22 - tbg: tbg@13200 { 23 - compatible = "marvell,armada-3700-tbg-clock"; 24 - reg = <0x13200 0x1000>; 25 - clocks = <&xtalclk>; 26 - #clock-cells = <1>; 27 - };
-41
Documentation/devicetree/bindings/clock/artpec6.txt
··· 1 - * Clock bindings for Axis ARTPEC-6 chip 2 - 3 - The bindings are based on the clock provider binding in 4 - Documentation/devicetree/bindings/clock/clock-bindings.txt 5 - 6 - External clocks: 7 - ---------------- 8 - 9 - There are two external inputs to the main clock controller which should be 10 - provided using the common clock bindings. 11 - - "sys_refclk": External 50 Mhz oscillator (required) 12 - - "i2s_refclk": Alternate audio reference clock (optional). 13 - 14 - Main clock controller 15 - --------------------- 16 - 17 - Required properties: 18 - - #clock-cells: Should be <1> 19 - See dt-bindings/clock/axis,artpec6-clkctrl.h for the list of valid identifiers. 20 - - compatible: Should be "axis,artpec6-clkctrl" 21 - - reg: Must contain the base address and length of the system controller 22 - - clocks: Must contain a phandle entry for each clock in clock-names 23 - - clock-names: Must include the external oscillator ("sys_refclk"). Optional 24 - ones are the audio reference clock ("i2s_refclk") and the audio fractional 25 - dividers ("frac_clk0" and "frac_clk1"). 26 - 27 - Examples: 28 - 29 - ext_clk: ext_clk { 30 - #clock-cells = <0>; 31 - compatible = "fixed-clock"; 32 - clock-frequency = <50000000>; 33 - }; 34 - 35 - clkctrl: clkctrl@f8000000 { 36 - #clock-cells = <1>; 37 - compatible = "axis,artpec6-clkctrl"; 38 - reg = <0xf8000000 0x48>; 39 - clocks = <&ext_clk>; 40 - clock-names = "sys_refclk"; 41 - };
+55
Documentation/devicetree/bindings/clock/axis,artpec6-clkctrl.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/axis,artpec6-clkctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Axis ARTPEC-6 clock controller 8 + 9 + maintainers: 10 + - Lars Persson <lars.persson@axis.com> 11 + 12 + properties: 13 + compatible: 14 + const: axis,artpec6-clkctrl 15 + 16 + reg: 17 + maxItems: 1 18 + 19 + "#clock-cells": 20 + const: 1 21 + 22 + clocks: 23 + minItems: 1 24 + items: 25 + - description: external 50 MHz oscillator. 26 + - description: optional audio reference clock. 27 + - description: fractional audio clock divider 0. 28 + - description: fractional audio clock divider 1. 29 + 30 + clock-names: 31 + minItems: 1 32 + items: 33 + - const: sys_refclk 34 + - const: i2s_refclk 35 + - const: frac_clk0 36 + - const: frac_clk1 37 + 38 + required: 39 + - compatible 40 + - reg 41 + - "#clock-cells" 42 + - clocks 43 + - clock-names 44 + 45 + additionalProperties: false 46 + 47 + examples: 48 + - | 49 + clock-controller@f8000000 { 50 + compatible = "axis,artpec6-clkctrl"; 51 + reg = <0xf8000000 0x48>; 52 + #clock-cells = <1>; 53 + clocks = <&ext_clk>; 54 + clock-names = "sys_refclk"; 55 + };
-60
Documentation/devicetree/bindings/clock/brcm,bcm2835-cprman.txt
··· 1 - Broadcom BCM2835 CPRMAN clocks 2 - 3 - This binding uses the common clock binding: 4 - Documentation/devicetree/bindings/clock/clock-bindings.txt 5 - 6 - The CPRMAN clock controller generates clocks in the audio power domain 7 - of the BCM2835. There is a level of PLLs deriving from an external 8 - oscillator, a level of PLL dividers that produce channels off of the 9 - few PLLs, and a level of mostly-generic clock generators sourcing from 10 - the PLL channels. Most other hardware components source from the 11 - clock generators, but a few (like the ARM or HDMI) will source from 12 - the PLL dividers directly. 13 - 14 - Required properties: 15 - - compatible: should be one of the following, 16 - "brcm,bcm2711-cprman" 17 - "brcm,bcm2835-cprman" 18 - - #clock-cells: Should be <1>. The permitted clock-specifier values can be 19 - found in include/dt-bindings/clock/bcm2835.h 20 - - reg: Specifies base physical address and size of the registers 21 - - clocks: phandles to the parent clocks used as input to the module, in 22 - the following order: 23 - 24 - - External oscillator 25 - - DSI0 byte clock 26 - - DSI0 DDR2 clock 27 - - DSI0 DDR clock 28 - - DSI1 byte clock 29 - - DSI1 DDR2 clock 30 - - DSI1 DDR clock 31 - 32 - Only external oscillator is required. The DSI clocks may 33 - not be present, in which case their children will be 34 - unusable. 35 - 36 - Example: 37 - 38 - clk_osc: clock@3 { 39 - compatible = "fixed-clock"; 40 - reg = <3>; 41 - #clock-cells = <0>; 42 - clock-output-names = "osc"; 43 - clock-frequency = <19200000>; 44 - }; 45 - 46 - clocks: cprman@7e101000 { 47 - compatible = "brcm,bcm2835-cprman"; 48 - #clock-cells = <1>; 49 - reg = <0x7e101000 0x2000>; 50 - clocks = <&clk_osc>; 51 - }; 52 - 53 - i2c0: i2c@7e205000 { 54 - compatible = "brcm,bcm2835-i2c"; 55 - reg = <0x7e205000 0x1000>; 56 - interrupts = <2 21>; 57 - clocks = <&clocks BCM2835_CLOCK_VPU>; 58 - #address-cells = <1>; 59 - #size-cells = <0>; 60 - };
+59
Documentation/devicetree/bindings/clock/brcm,bcm2835-cprman.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/brcm,bcm2835-cprman.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Broadcom BCM2835 CPRMAN clocks 8 + 9 + maintainers: 10 + - Stefan Wahren <wahrenst@gmx.net> 11 + - Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com> 12 + 13 + description: 14 + The CPRMAN clock controller generates clocks in the audio power domain of the 15 + BCM2835. There is a level of PLLs deriving from an external oscillator, a 16 + level of PLL dividers that produce channels off of the few PLLs, and a level 17 + of mostly-generic clock generators sourcing from the PLL channels. Most other 18 + hardware components source from the clock generators, but a few (like the ARM 19 + or HDMI) will source from the PLL dividers directly. 20 + 21 + properties: 22 + compatible: 23 + enum: 24 + - brcm,bcm2711-cprman 25 + - brcm,bcm2835-cprman 26 + 27 + reg: 28 + maxItems: 1 29 + 30 + '#clock-cells': 31 + const: 1 32 + 33 + clocks: 34 + minItems: 1 35 + items: 36 + - description: External oscillator clock. 37 + - description: DSI0 byte clock. 38 + - description: DSI0 DDR2 clock. 39 + - description: DSI0 DDR clock. 40 + - description: DSI1 byte clock. 41 + - description: DSI1 DDR2 clock. 42 + - description: DSI1 DDR clock. 43 + 44 + additionalProperties: false 45 + 46 + required: 47 + - compatible 48 + - '#clock-cells' 49 + - reg 50 + - clocks 51 + 52 + examples: 53 + - | 54 + clock-controller@7e101000 { 55 + compatible = "brcm,bcm2835-cprman"; 56 + reg = <0x7e101000 0x2000>; 57 + #clock-cells = <1>; 58 + clocks = <&clk_osc>; 59 + };
-36
Documentation/devicetree/bindings/clock/brcm,bcm53573-ilp.txt
··· 1 - Broadcom BCM53573 ILP clock 2 - =========================== 3 - 4 - This binding uses the common clock binding: 5 - Documentation/devicetree/bindings/clock/clock-bindings.txt 6 - 7 - This binding is used for ILP clock (sometimes referred as "slow clock") 8 - on Broadcom BCM53573 devices using Cortex-A7 CPU. 9 - 10 - ILP's rate has to be calculated on runtime and it depends on ALP clock 11 - which has to be referenced. 12 - 13 - This clock is part of PMU (Power Management Unit), a Broadcom's device 14 - handing power-related aspects. Its node must be sub-node of the PMU 15 - device. 16 - 17 - Required properties: 18 - - compatible: "brcm,bcm53573-ilp" 19 - - clocks: has to reference an ALP clock 20 - - #clock-cells: should be <0> 21 - - clock-output-names: from common clock bindings, should contain clock 22 - name 23 - 24 - Example: 25 - 26 - pmu@18012000 { 27 - compatible = "simple-mfd", "syscon"; 28 - reg = <0x18012000 0x00001000>; 29 - 30 - ilp { 31 - compatible = "brcm,bcm53573-ilp"; 32 - clocks = <&alp>; 33 - #clock-cells = <0>; 34 - clock-output-names = "ilp"; 35 - }; 36 - };
+46
Documentation/devicetree/bindings/clock/brcm,bcm53573-ilp.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/brcm,bcm53573-ilp.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Broadcom BCM53573 ILP clock 8 + 9 + maintainers: 10 + - Rafał Miłecki <rafal@milecki.pl> 11 + 12 + description: > 13 + ILP clock (sometimes referred as "slow clock") on Broadcom BCM53573 devices 14 + using Cortex-A7 CPU. 15 + 16 + ILP's rate has to be calculated on runtime and it depends on ALP clock which 17 + has to be referenced. 18 + 19 + This clock is part of PMU (Power Management Unit), a Broadcom device handling 20 + power-related aspects. Its node must be sub-node of the PMU device. 21 + 22 + properties: 23 + compatible: 24 + items: 25 + - const: brcm,bcm53573-ilp 26 + 27 + clocks: 28 + maxItems: 1 29 + 30 + '#clock-cells': 31 + const: 0 32 + 33 + clock-output-names: 34 + items: 35 + - const: ilp 36 + 37 + additionalProperties: false 38 + 39 + examples: 40 + - | 41 + ilp { 42 + compatible = "brcm,bcm53573-ilp"; 43 + clocks = <&alp>; 44 + #clock-cells = <0>; 45 + clock-output-names = "ilp"; 46 + };
-24
Documentation/devicetree/bindings/clock/brcm,bcm63xx-clocks.txt
··· 1 - Gated Clock Controller Bindings for MIPS based BCM63XX SoCs 2 - 3 - Required properties: 4 - - compatible: must be one of: 5 - "brcm,bcm3368-clocks" 6 - "brcm,bcm6318-clocks" 7 - "brcm,bcm6318-ubus-clocks" 8 - "brcm,bcm6328-clocks" 9 - "brcm,bcm6358-clocks" 10 - "brcm,bcm6362-clocks" 11 - "brcm,bcm6368-clocks" 12 - "brcm,bcm63268-clocks" 13 - 14 - - reg: Address and length of the register set 15 - - #clock-cells: must be <1> 16 - 17 - 18 - Example: 19 - 20 - clkctl: clock-controller@10000004 { 21 - compatible = "brcm,bcm6328-clocks"; 22 - reg = <0x10000004 0x4>; 23 - #clock-cells = <1>; 24 - };
+44
Documentation/devicetree/bindings/clock/brcm,bcm63xx-clocks.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/brcm,bcm63xx-clocks.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: MIPS based BCM63XX SoCs Gated Clock Controller 8 + 9 + maintainers: 10 + - Álvaro Fernández Rojas <noltari@gmail.com> 11 + - Jonas Gorski <jonas.gorski@gmail.com> 12 + 13 + properties: 14 + compatible: 15 + enum: 16 + - brcm,bcm3368-clocks 17 + - brcm,bcm6318-clocks 18 + - brcm,bcm6318-ubus-clocks 19 + - brcm,bcm6328-clocks 20 + - brcm,bcm6358-clocks 21 + - brcm,bcm6362-clocks 22 + - brcm,bcm6368-clocks 23 + - brcm,bcm63268-clocks 24 + 25 + reg: 26 + maxItems: 1 27 + 28 + '#clock-cells': 29 + const: 1 30 + 31 + required: 32 + - compatible 33 + - reg 34 + - '#clock-cells' 35 + 36 + additionalProperties: false 37 + 38 + examples: 39 + - | 40 + clock-controller@10000004 { 41 + compatible = "brcm,bcm6328-clocks"; 42 + reg = <0x10000004 0x4>; 43 + #clock-cells = <1>; 44 + };
+47
Documentation/devicetree/bindings/clock/cirrus,ep7209-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/cirrus,ep7209-clk.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Cirrus Logic CLPS711X Clock Controller 8 + 9 + maintainers: 10 + - Alexander Shiyan <shc_work@mail.ru> 11 + 12 + description: 13 + See include/dt-bindings/clock/clps711x-clock.h for the full list of CLPS711X 14 + clock IDs. 15 + 16 + properties: 17 + compatible: 18 + items: 19 + - const: cirrus,ep7312-clk 20 + - const: cirrus,ep7209-clk 21 + 22 + reg: 23 + maxItems: 1 24 + 25 + startup-frequency: 26 + description: Factory set CPU startup frequency in HZ. 27 + $ref: /schemas/types.yaml#/definitions/uint32 28 + 29 + "#clock-cells": 30 + const: 1 31 + 32 + required: 33 + - compatible 34 + - reg 35 + - startup-frequency 36 + - "#clock-cells" 37 + 38 + additionalProperties: false 39 + 40 + examples: 41 + - | 42 + clock-controller@80000000 { 43 + compatible = "cirrus,ep7312-clk", "cirrus,ep7209-clk"; 44 + reg = <0x80000000 0xc000>; 45 + #clock-cells = <1>; 46 + startup-frequency = <73728000>; 47 + };
-19
Documentation/devicetree/bindings/clock/clps711x-clock.txt
··· 1 - * Clock bindings for the Cirrus Logic CLPS711X CPUs 2 - 3 - Required properties: 4 - - compatible : Shall contain "cirrus,ep7209-clk". 5 - - reg : Address of the internal register set. 6 - - startup-frequency: Factory set CPU startup frequency in HZ. 7 - - #clock-cells : Should be <1>. 8 - 9 - The clock consumer should specify the desired clock by having the clock 10 - ID in its "clocks" phandle cell. See include/dt-bindings/clock/clps711x-clock.h 11 - for the full list of CLPS711X clock IDs. 12 - 13 - Example: 14 - clks: clks@80000000 { 15 - #clock-cells = <1>; 16 - compatible = "cirrus,ep7312-clk", "cirrus,ep7209-clk"; 17 - reg = <0x80000000 0xc000>; 18 - startup-frequency = <73728000>; 19 - };
-28
Documentation/devicetree/bindings/clock/dove-divider-clock.txt
··· 1 - PLL divider based Dove clocks 2 - 3 - Marvell Dove has a 2GHz PLL, which feeds into a set of dividers to provide 4 - high speed clocks for a number of peripherals. These dividers are part of 5 - the PMU, and thus this node should be a child of the PMU node. 6 - 7 - The following clocks are provided: 8 - 9 - ID Clock 10 - ------------- 11 - 0 AXI bus clock 12 - 1 GPU clock 13 - 2 VMeta clock 14 - 3 LCD clock 15 - 16 - Required properties: 17 - - compatible : shall be "marvell,dove-divider-clock" 18 - - reg : shall be the register address of the Core PLL and Clock Divider 19 - Control 0 register. This will cover that register, as well as the 20 - Core PLL and Clock Divider Control 1 register. Thus, it will have 21 - a size of 8. 22 - - #clock-cells : from common clock binding; shall be set to 1 23 - 24 - divider_clk: core-clock@64 { 25 - compatible = "marvell,dove-divider-clock"; 26 - reg = <0x0064 0x8>; 27 - #clock-cells = <1>; 28 - };
+136
Documentation/devicetree/bindings/clock/img,pistachio-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/img,pistachio-clk.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Imagination Technologies Pistachio SoC clock controllers 8 + 9 + maintainers: 10 + - Andrew Bresticker <abrestic@chromium.org> 11 + 12 + description: | 13 + Pistachio has four clock controllers (core clock, peripheral clock, peripheral 14 + general control, and top general control) which are instantiated individually 15 + from the device-tree. 16 + 17 + Core clock controller: 18 + 19 + The core clock controller generates clocks for the CPU, RPU (WiFi + BT 20 + co-processor), audio, and several peripherals. 21 + 22 + Peripheral clock controller: 23 + 24 + The peripheral clock controller generates clocks for the DDR, ROM, and other 25 + peripherals. The peripheral system clock ("periph_sys") generated by the core 26 + clock controller is the input clock to the peripheral clock controller. 27 + 28 + Peripheral general control: 29 + 30 + The peripheral general control block generates system interface clocks and 31 + resets for various peripherals. It also contains miscellaneous peripheral 32 + control registers. 33 + 34 + Top-level general control: 35 + 36 + The top-level general control block contains miscellaneous control registers 37 + and gates for the external clocks "audio_clk_in" and "enet_clk_in". 38 + 39 + properties: 40 + compatible: 41 + items: 42 + - enum: 43 + - img,pistachio-clk 44 + - img,pistachio-clk-periph 45 + - img,pistachio-cr-periph 46 + - img,pistachio-cr-top 47 + 48 + reg: 49 + maxItems: 1 50 + 51 + '#clock-cells': 52 + const: 1 53 + 54 + clocks: 55 + minItems: 1 56 + maxItems: 3 57 + 58 + clock-names: 59 + minItems: 1 60 + maxItems: 3 61 + 62 + required: 63 + - compatible 64 + - reg 65 + - '#clock-cells' 66 + - clocks 67 + - clock-names 68 + 69 + allOf: 70 + - if: 71 + properties: 72 + compatible: 73 + contains: 74 + const: img,pistachio-clk 75 + then: 76 + properties: 77 + clocks: 78 + items: 79 + - description: External 52Mhz oscillator 80 + - description: Alternate audio reference clock 81 + - description: Alternate ethernet PHY clock 82 + 83 + clock-names: 84 + items: 85 + - const: xtal 86 + - const: audio_refclk_ext_gate 87 + - const: ext_enet_in_gate 88 + 89 + - if: 90 + properties: 91 + compatible: 92 + contains: 93 + const: img,pistachio-clk-periph 94 + then: 95 + properties: 96 + clocks: 97 + items: 98 + - description: Peripheral system clock 99 + 100 + clock-names: 101 + items: 102 + - const: periph_sys_core 103 + 104 + - if: 105 + properties: 106 + compatible: 107 + contains: 108 + const: img,pistachio-cr-periph 109 + then: 110 + properties: 111 + clocks: 112 + items: 113 + - description: System interface clock 114 + 115 + clock-names: 116 + items: 117 + - const: sys 118 + 119 + - if: 120 + properties: 121 + compatible: 122 + contains: 123 + const: img,pistachio-cr-top 124 + then: 125 + properties: 126 + clocks: 127 + items: 128 + - description: External audio reference clock 129 + - description: External ethernet PHY clock 130 + 131 + clock-names: 132 + items: 133 + - const: audio_clk_in 134 + - const: enet_clk_in 135 + 136 + additionalProperties: false
-77
Documentation/devicetree/bindings/clock/lpc1850-ccu.txt
··· 1 - * NXP LPC1850 Clock Control Unit (CCU) 2 - 3 - Each CGU base clock has several clock branches which can be turned on 4 - or off independently by the Clock Control Units CCU1 or CCU2. The 5 - branch clocks are distributed between CCU1 and CCU2. 6 - 7 - - Above text taken from NXP LPC1850 User Manual. 8 - 9 - This binding uses the common clock binding: 10 - Documentation/devicetree/bindings/clock/clock-bindings.txt 11 - 12 - Required properties: 13 - - compatible: 14 - Should be "nxp,lpc1850-ccu" 15 - - reg: 16 - Shall define the base and range of the address space 17 - containing clock control registers 18 - - #clock-cells: 19 - Shall have value <1>. The permitted clock-specifier values 20 - are the branch clock names defined in table below. 21 - - clocks: 22 - Shall contain a list of phandles for the base clocks routed 23 - from the CGU to the specific CCU. See mapping of base clocks 24 - and CCU in table below. 25 - - clock-names: 26 - Shall contain a list of names for the base clock routed 27 - from the CGU to the specific CCU. Valid CCU clock names: 28 - "base_usb0_clk", "base_periph_clk", "base_usb1_clk", 29 - "base_cpu_clk", "base_spifi_clk", "base_spi_clk", 30 - "base_apb1_clk", "base_apb3_clk", "base_adchs_clk", 31 - "base_sdio_clk", "base_ssp0_clk", "base_ssp1_clk", 32 - "base_uart0_clk", "base_uart1_clk", "base_uart2_clk", 33 - "base_uart3_clk", "base_audio_clk" 34 - 35 - Which branch clocks that are available on the CCU depends on the 36 - specific LPC part. Check the user manual for your specific part. 37 - 38 - A list of CCU clocks can be found in dt-bindings/clock/lpc18xx-ccu.h. 39 - 40 - Example board file: 41 - 42 - soc { 43 - ccu1: clock-controller@40051000 { 44 - compatible = "nxp,lpc1850-ccu"; 45 - reg = <0x40051000 0x1000>; 46 - #clock-cells = <1>; 47 - clocks = <&cgu BASE_APB3_CLK>, <&cgu BASE_APB1_CLK>, 48 - <&cgu BASE_SPIFI_CLK>, <&cgu BASE_CPU_CLK>, 49 - <&cgu BASE_PERIPH_CLK>, <&cgu BASE_USB0_CLK>, 50 - <&cgu BASE_USB1_CLK>, <&cgu BASE_SPI_CLK>; 51 - clock-names = "base_apb3_clk", "base_apb1_clk", 52 - "base_spifi_clk", "base_cpu_clk", 53 - "base_periph_clk", "base_usb0_clk", 54 - "base_usb1_clk", "base_spi_clk"; 55 - }; 56 - 57 - ccu2: clock-controller@40052000 { 58 - compatible = "nxp,lpc1850-ccu"; 59 - reg = <0x40052000 0x1000>; 60 - #clock-cells = <1>; 61 - clocks = <&cgu BASE_AUDIO_CLK>, <&cgu BASE_UART3_CLK>, 62 - <&cgu BASE_UART2_CLK>, <&cgu BASE_UART1_CLK>, 63 - <&cgu BASE_UART0_CLK>, <&cgu BASE_SSP1_CLK>, 64 - <&cgu BASE_SSP0_CLK>, <&cgu BASE_SDIO_CLK>; 65 - clock-names = "base_audio_clk", "base_uart3_clk", 66 - "base_uart2_clk", "base_uart1_clk", 67 - "base_uart0_clk", "base_ssp1_clk", 68 - "base_ssp0_clk", "base_sdio_clk"; 69 - }; 70 - 71 - /* A user of CCU branch clocks */ 72 - uart1: serial@40082000 { 73 - ... 74 - clocks = <&ccu2 CLK_APB0_UART1>, <&ccu1 CLK_CPU_UART1>; 75 - ... 76 - }; 77 - };
-131
Documentation/devicetree/bindings/clock/lpc1850-cgu.txt
··· 1 - * NXP LPC1850 Clock Generation Unit (CGU) 2 - 3 - The CGU generates multiple independent clocks for the core and the 4 - peripheral blocks of the LPC18xx. Each independent clock is called 5 - a base clock and itself is one of the inputs to the two Clock 6 - Control Units (CCUs) which control the branch clocks to the 7 - individual peripherals. 8 - 9 - The CGU selects the inputs to the clock generators from multiple 10 - clock sources, controls the clock generation, and routes the outputs 11 - of the clock generators through the clock source bus to the output 12 - stages. Each output stage provides an independent clock source and 13 - corresponds to one of the base clocks for the LPC18xx. 14 - 15 - - Above text taken from NXP LPC1850 User Manual. 16 - 17 - 18 - This binding uses the common clock binding: 19 - Documentation/devicetree/bindings/clock/clock-bindings.txt 20 - 21 - Required properties: 22 - - compatible: 23 - Should be "nxp,lpc1850-cgu" 24 - - reg: 25 - Shall define the base and range of the address space 26 - containing clock control registers 27 - - #clock-cells: 28 - Shall have value <1>. The permitted clock-specifier values 29 - are the base clock numbers defined below. 30 - - clocks: 31 - Shall contain a list of phandles for the external input 32 - sources to the CGU. The list shall be in the following 33 - order: xtal, 32khz, enet_rx_clk, enet_tx_clk, gp_clkin. 34 - - clock-indices: 35 - Shall be an ordered list of numbers defining the base clock 36 - number provided by the CGU. 37 - - clock-output-names: 38 - Shall be an ordered list of strings defining the names of 39 - the clocks provided by the CGU. 40 - 41 - Which base clocks that are available on the CGU depends on the 42 - specific LPC part. Base clocks are numbered from 0 to 27. 43 - 44 - Number: Name: Description: 45 - 0 BASE_SAFE_CLK Base safe clock (always on) for WWDT 46 - 1 BASE_USB0_CLK Base clock for USB0 47 - 2 BASE_PERIPH_CLK Base clock for Cortex-M0SUB subsystem, 48 - SPI, and SGPIO 49 - 3 BASE_USB1_CLK Base clock for USB1 50 - 4 BASE_CPU_CLK System base clock for ARM Cortex-M core 51 - and APB peripheral blocks #0 and #2 52 - 5 BASE_SPIFI_CLK Base clock for SPIFI 53 - 6 BASE_SPI_CLK Base clock for SPI 54 - 7 BASE_PHY_RX_CLK Base clock for Ethernet PHY Receive clock 55 - 8 BASE_PHY_TX_CLK Base clock for Ethernet PHY Transmit clock 56 - 9 BASE_APB1_CLK Base clock for APB peripheral block # 1 57 - 10 BASE_APB3_CLK Base clock for APB peripheral block # 3 58 - 11 BASE_LCD_CLK Base clock for LCD 59 - 12 BASE_ADCHS_CLK Base clock for ADCHS 60 - 13 BASE_SDIO_CLK Base clock for SD/MMC 61 - 14 BASE_SSP0_CLK Base clock for SSP0 62 - 15 BASE_SSP1_CLK Base clock for SSP1 63 - 16 BASE_UART0_CLK Base clock for UART0 64 - 17 BASE_UART1_CLK Base clock for UART1 65 - 18 BASE_UART2_CLK Base clock for UART2 66 - 19 BASE_UART3_CLK Base clock for UART3 67 - 20 BASE_OUT_CLK Base clock for CLKOUT pin 68 - 24-21 - Reserved 69 - 25 BASE_AUDIO_CLK Base clock for audio system (I2S) 70 - 26 BASE_CGU_OUT0_CLK Base clock for CGU_OUT0 clock output 71 - 27 BASE_CGU_OUT1_CLK Base clock for CGU_OUT1 clock output 72 - 73 - BASE_PERIPH_CLK and BASE_SPI_CLK is only available on LPC43xx. 74 - BASE_ADCHS_CLK is only available on LPC4370. 75 - 76 - 77 - Example board file: 78 - 79 - / { 80 - clocks { 81 - xtal: xtal { 82 - compatible = "fixed-clock"; 83 - #clock-cells = <0>; 84 - clock-frequency = <12000000>; 85 - }; 86 - 87 - xtal32: xtal32 { 88 - compatible = "fixed-clock"; 89 - #clock-cells = <0>; 90 - clock-frequency = <32768>; 91 - }; 92 - 93 - enet_rx_clk: enet_rx_clk { 94 - compatible = "fixed-clock"; 95 - #clock-cells = <0>; 96 - clock-frequency = <0>; 97 - clock-output-names = "enet_rx_clk"; 98 - }; 99 - 100 - enet_tx_clk: enet_tx_clk { 101 - compatible = "fixed-clock"; 102 - #clock-cells = <0>; 103 - clock-frequency = <0>; 104 - clock-output-names = "enet_tx_clk"; 105 - }; 106 - 107 - gp_clkin: gp_clkin { 108 - compatible = "fixed-clock"; 109 - #clock-cells = <0>; 110 - clock-frequency = <0>; 111 - clock-output-names = "gp_clkin"; 112 - }; 113 - }; 114 - 115 - soc { 116 - cgu: clock-controller@40050000 { 117 - compatible = "nxp,lpc1850-cgu"; 118 - reg = <0x40050000 0x1000>; 119 - #clock-cells = <1>; 120 - clocks = <&xtal>, <&creg_clk 1>, <&enet_rx_clk>, <&enet_tx_clk>, <&gp_clkin>; 121 - }; 122 - 123 - /* A CGU and CCU clock consumer */ 124 - lcdc: lcdc@40008000 { 125 - ... 126 - clocks = <&cgu BASE_LCD_CLK>, <&ccu1 CLK_CPU_LCD>; 127 - clock-names = "clcdclk", "apb_pclk"; 128 - ... 129 - }; 130 - }; 131 - };
-29
Documentation/devicetree/bindings/clock/lsi,axm5516-clks.txt
··· 1 - AXM5516 clock driver bindings 2 - ----------------------------- 3 - 4 - Required properties : 5 - - compatible : shall contain "lsi,axm5516-clks" 6 - - reg : shall contain base register location and length 7 - - #clock-cells : shall contain 1 8 - 9 - The consumer specifies the desired clock by having the clock ID in its "clocks" 10 - phandle cell. See <dt-bindings/clock/lsi,axxia-clock.h> for the list of 11 - supported clock IDs. 12 - 13 - Example: 14 - 15 - clks: clock-controller@2010020000 { 16 - compatible = "lsi,axm5516-clks"; 17 - #clock-cells = <1>; 18 - reg = <0x20 0x10020000 0 0x20000>; 19 - }; 20 - 21 - serial0: uart@2010080000 { 22 - compatible = "arm,pl011", "arm,primecell"; 23 - reg = <0x20 0x10080000 0 0x1000>; 24 - interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>; 25 - clocks = <&clks AXXIA_CLK_PER>; 26 - clock-names = "apb_pclk"; 27 - }; 28 - }; 29 -
+43
Documentation/devicetree/bindings/clock/lsi,axm5516-clks.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + # Copyright 2025 LSI 3 + %YAML 1.2 4 + --- 5 + $id: http://devicetree.org/schemas/clock/lsi,axm5516-clks.yaml# 6 + $schema: http://devicetree.org/meta-schemas/core.yaml# 7 + 8 + title: LSI AXM5516 Clock Controller 9 + 10 + maintainers: 11 + - Anders Berg <anders.berg@lsi.com> 12 + 13 + description: 14 + See <dt-bindings/clock/lsi,axxia-clock.h> for the list of supported clock IDs. 15 + 16 + properties: 17 + compatible: 18 + const: lsi,axm5516-clks 19 + 20 + reg: 21 + maxItems: 1 22 + 23 + '#clock-cells': 24 + const: 1 25 + 26 + required: 27 + - compatible 28 + - reg 29 + - '#clock-cells' 30 + 31 + additionalProperties: false 32 + 33 + examples: 34 + - | 35 + bus { 36 + #address-cells = <2>; 37 + #size-cells = <1>; 38 + clock-controller@2010020000 { 39 + compatible = "lsi,axm5516-clks"; 40 + #clock-cells = <1>; 41 + reg = <0x20 0x10020000 0x20000>; 42 + }; 43 + };
+33
Documentation/devicetree/bindings/clock/lsi,nspire-cx-clock.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/lsi,nspire-cx-clock.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: TI-NSPIRE Clocks 8 + 9 + maintainers: 10 + - Daniel Tang <dt.tangr@gmail.com> 11 + 12 + properties: 13 + compatible: 14 + enum: 15 + - lsi,nspire-cx-ahb-divider 16 + - lsi,nspire-classic-ahb-divider 17 + - lsi,nspire-cx-clock 18 + - lsi,nspire-classic-clock 19 + 20 + reg: 21 + maxItems: 1 22 + 23 + clocks: 24 + maxItems: 1 25 + 26 + '#clock-cells': 27 + const: 0 28 + 29 + additionalProperties: false 30 + 31 + required: 32 + - compatible 33 + - reg
+52
Documentation/devicetree/bindings/clock/marvell,armada-370-corediv-clock.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/marvell,armada-370-corediv-clock.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Marvell MVEBU Core Divider Clock 8 + 9 + maintainers: 10 + - Andrew Lunn <andrew@lunn.ch> 11 + - Gregory Clement <gregory.clement@bootlin.com> 12 + 13 + properties: 14 + compatible: 15 + oneOf: 16 + - enum: 17 + - marvell,armada-370-corediv-clock 18 + - marvell,armada-375-corediv-clock 19 + - marvell,armada-380-corediv-clock 20 + - marvell,mv98dx3236-corediv-clock 21 + - items: 22 + - const: marvell,armada-390-corediv-clock 23 + - const: marvell,armada-380-corediv-clock 24 + 25 + reg: 26 + maxItems: 1 27 + 28 + "#clock-cells": 29 + const: 1 30 + 31 + clocks: 32 + maxItems: 1 33 + 34 + clock-output-names: 35 + maxItems: 1 36 + 37 + required: 38 + - compatible 39 + - reg 40 + - "#clock-cells" 41 + - clocks 42 + 43 + additionalProperties: false 44 + 45 + examples: 46 + - | 47 + clock-controller@18740 { 48 + compatible = "marvell,armada-370-corediv-clock"; 49 + reg = <0x18740 0xc>; 50 + #clock-cells = <1>; 51 + clocks = <&pll>; 52 + };
+96
Documentation/devicetree/bindings/clock/marvell,armada-3700-periph-clock.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/marvell,armada-3700-periph-clock.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Marvell Armada 37xx SoCs Peripheral Clocks 8 + 9 + maintainers: 10 + - Andrew Lunn <andrew@lunn.ch> 11 + - Gregory Clement <gregory.clement@bootlin.com> 12 + 13 + description: > 14 + Marvell Armada 37xx SoCs provide peripheral clocks which are used as clock 15 + source for the peripheral of the SoC. 16 + 17 + There are two different blocks associated to north bridge and south bridge. 18 + 19 + The following is a list of provided IDs for Armada 3700 North bridge clocks: 20 + 21 + ID Clock name Description 22 + ----------------------------------- 23 + 0 mmc MMC controller 24 + 1 sata_host Sata Host 25 + 2 sec_at Security AT 26 + 3 sac_dap Security DAP 27 + 4 tsecm Security Engine 28 + 5 setm_tmx Serial Embedded Trace Module 29 + 6 avs Adaptive Voltage Scaling 30 + 7 sqf SPI 31 + 8 pwm PWM 32 + 9 i2c_2 I2C 2 33 + 10 i2c_1 I2C 1 34 + 11 ddr_phy DDR PHY 35 + 12 ddr_fclk DDR F clock 36 + 13 trace Trace 37 + 14 counter Counter 38 + 15 eip97 EIP 97 39 + 16 cpu CPU 40 + 41 + The following is a list of provided IDs for Armada 3700 South bridge clocks: 42 + 43 + ID Clock name Description 44 + ----------------------------------- 45 + 0 gbe-50 50 MHz parent clock for Gigabit Ethernet 46 + 1 gbe-core parent clock for Gigabit Ethernet core 47 + 2 gbe-125 125 MHz parent clock for Gigabit Ethernet 48 + 3 gbe1-50 50 MHz clock for Gigabit Ethernet port 1 49 + 4 gbe0-50 50 MHz clock for Gigabit Ethernet port 0 50 + 5 gbe1-125 125 MHz clock for Gigabit Ethernet port 1 51 + 6 gbe0-125 125 MHz clock for Gigabit Ethernet port 0 52 + 7 gbe1-core Gigabit Ethernet core port 1 53 + 8 gbe0-core Gigabit Ethernet core port 0 54 + 9 gbe-bm Gigabit Ethernet Buffer Manager 55 + 10 sdio SDIO 56 + 11 usb32-sub2-sys USB 2 clock 57 + 12 usb32-ss-sys USB 3 clock 58 + 13 pcie PCIe controller 59 + 60 + properties: 61 + compatible: 62 + oneOf: 63 + - const: marvell,armada-3700-periph-clock-sb 64 + - items: 65 + - const: marvell,armada-3700-periph-clock-nb 66 + - const: syscon 67 + reg: 68 + maxItems: 1 69 + 70 + clocks: 71 + items: 72 + - description: TBG-A P clock and specifier 73 + - description: TBG-B P clock and specifier 74 + - description: TBG-A S clock and specifier 75 + - description: TBG-B S clock and specifier 76 + - description: Xtal clock and specifier 77 + 78 + '#clock-cells': 79 + const: 1 80 + 81 + required: 82 + - compatible 83 + - reg 84 + - clocks 85 + - '#clock-cells' 86 + 87 + additionalProperties: false 88 + 89 + examples: 90 + - | 91 + clock-controller@13000{ 92 + compatible = "marvell,armada-3700-periph-clock-sb"; 93 + reg = <0x13000 0x1000>; 94 + clocks = <&tbg 0>, <&tbg 1>, <&tbg 2>, <&tbg 3>, <&xtalclk>; 95 + #clock-cells = <1>; 96 + };
+54
Documentation/devicetree/bindings/clock/marvell,armada-3700-tbg-clock.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/marvell,armada-3700-tbg-clock.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Marvell Armada 3700 Time Base Generator Clock 8 + 9 + maintainers: 10 + - Andrew Lunn <andrew@lunn.ch> 11 + - Gregory Clement <gregory.clement@bootlin.com> 12 + 13 + description: > 14 + Marvell Armada 37xx SoCs provide Time Base Generator clocks which are used as 15 + parent clocks for the peripheral clocks. 16 + 17 + The TBG clock consumer should specify the desired clock by having the clock ID 18 + in its "clocks" phandle cell. 19 + 20 + The following is a list of provided IDs and clock names on Armada 3700: 21 + 22 + 0 = TBG A P 23 + 1 = TBG B P 24 + 2 = TBG A S 25 + 3 = TBG B S 26 + 27 + properties: 28 + compatible: 29 + const: marvell,armada-3700-tbg-clock 30 + 31 + reg: 32 + maxItems: 1 33 + 34 + clocks: 35 + maxItems: 1 36 + 37 + '#clock-cells': 38 + const: 1 39 + 40 + required: 41 + - compatible 42 + - reg 43 + - '#clock-cells' 44 + 45 + additionalProperties: false 46 + 47 + examples: 48 + - | 49 + clock-controller@13200 { 50 + compatible = "marvell,armada-3700-tbg-clock"; 51 + reg = <0x13200 0x1000>; 52 + clocks = <&xtalclk>; 53 + #clock-cells = <1>; 54 + };
+44
Documentation/devicetree/bindings/clock/marvell,armada-xp-cpu-clock.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + --- 3 + $schema: http://devicetree.org/meta-schemas/core.yaml# 4 + $id: http://devicetree.org/schemas/clock/marvell,armada-xp-cpu-clock.yaml# 5 + 6 + title: Marvell EBU CPU Clock 7 + 8 + maintainers: 9 + - Andrew Lunn <andrew@lunn.ch> 10 + - Gregory Clement <gregory.clement@bootlin.com> 11 + 12 + properties: 13 + compatible: 14 + enum: 15 + - marvell,armada-xp-cpu-clock 16 + - marvell,mv98dx3236-cpu-clock 17 + 18 + reg: 19 + items: 20 + - description: Clock complex registers 21 + - description: PMU DFS registers 22 + 23 + '#clock-cells': 24 + const: 1 25 + 26 + clocks: 27 + maxItems: 1 28 + 29 + required: 30 + - compatible 31 + - reg 32 + - '#clock-cells' 33 + - clocks 34 + 35 + additionalProperties: false 36 + 37 + examples: 38 + - | 39 + clock-controller@d0018700 { 40 + #clock-cells = <1>; 41 + compatible = "marvell,armada-xp-cpu-clock"; 42 + reg = <0xd0018700 0xa0>, <0x1c054 0x10>; 43 + clocks = <&coreclk 1>; 44 + };
-31
Documentation/devicetree/bindings/clock/marvell,berlin.txt
··· 1 - Device Tree Clock bindings for Marvell Berlin 2 - 3 - This binding uses the common clock binding[1]. 4 - 5 - [1] Documentation/devicetree/bindings/clock/clock-bindings.txt 6 - 7 - Clock related registers are spread among the chip control registers. Berlin 8 - clock node should be a sub-node of the chip controller node. Marvell Berlin2 9 - (BG2, BG2CD, BG2Q) SoCs share the same IP for PLLs and clocks, with some 10 - minor differences in features and register layout. 11 - 12 - Required properties: 13 - - compatible: must be "marvell,berlin2-clk" or "marvell,berlin2q-clk" 14 - - #clock-cells: must be 1 15 - - clocks: must be the input parent clock phandle 16 - - clock-names: name of the input parent clock 17 - Allowed clock-names for the reference clocks are 18 - "refclk" for the SoCs oscillator input on all SoCs, 19 - and SoC-specific input clocks for 20 - BG2/BG2CD: "video_ext0" for the external video clock input 21 - 22 - 23 - Example: 24 - 25 - chip_clk: clock { 26 - compatible = "marvell,berlin2q-clk"; 27 - 28 - #clock-cells = <1>; 29 - clocks = <&refclk>; 30 - clock-names = "refclk"; 31 - };
+51
Documentation/devicetree/bindings/clock/marvell,berlin2-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/marvell,berlin2-clk.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Marvell Berlin Clock Controller 8 + 9 + maintainers: 10 + - Jisheng Zhang <jszhang@kernel.org> 11 + 12 + description: 13 + Clock related registers are spread among the chip control registers. Berlin 14 + clock node should be a sub-node of the chip controller node. Marvell Berlin2 15 + (BG2, BG2CD, BG2Q) SoCs share the same IP for PLLs and clocks, with some minor 16 + differences in features and register layout. 17 + 18 + properties: 19 + compatible: 20 + enum: 21 + - marvell,berlin2-clk 22 + - marvell,berlin2q-clk 23 + 24 + '#clock-cells': 25 + const: 1 26 + 27 + clocks: 28 + maxItems: 1 29 + 30 + clock-names: 31 + items: 32 + - enum: 33 + - refclk 34 + - video_ext0 35 + 36 + required: 37 + - compatible 38 + - '#clock-cells' 39 + - clocks 40 + - clock-names 41 + 42 + additionalProperties: false 43 + 44 + examples: 45 + - | 46 + clock-controller { 47 + compatible = "marvell,berlin2q-clk"; 48 + #clock-cells = <1>; 49 + clocks = <&refclk>; 50 + clock-names = "refclk"; 51 + };
+50
Documentation/devicetree/bindings/clock/marvell,dove-divider-clock.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/marvell,dove-divider-clock.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Marvell Dove PLL Divider Clock 8 + 9 + maintainers: 10 + - Andrew Lunn <andrew@lunn.ch> 11 + - Gregory Clement <gregory.clement@bootlin.com> 12 + 13 + description: > 14 + Marvell Dove has a 2GHz PLL, which feeds into a set of dividers to provide 15 + high speed clocks for a number of peripherals. These dividers are part of the 16 + PMU, and thus this node should be a child of the PMU node. 17 + 18 + The following clocks are provided: 19 + 20 + ID Clock 21 + ------------- 22 + 0 AXI bus clock 23 + 1 GPU clock 24 + 2 VMeta clock 25 + 3 LCD clock 26 + 27 + properties: 28 + compatible: 29 + const: marvell,dove-divider-clock 30 + 31 + reg: 32 + maxItems: 1 33 + 34 + '#clock-cells': 35 + const: 1 36 + 37 + required: 38 + - compatible 39 + - reg 40 + - '#clock-cells' 41 + 42 + additionalProperties: false 43 + 44 + examples: 45 + - | 46 + clock-controller@64 { 47 + compatible = "marvell,dove-divider-clock"; 48 + reg = <0x0064 0x8>; 49 + #clock-cells = <1>; 50 + };
+94
Documentation/devicetree/bindings/clock/marvell,mvebu-core-clock.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/marvell,mvebu-core-clock.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Marvell MVEBU SoC core clock 8 + 9 + maintainers: 10 + - Andrew Lunn <andrew@lunn.ch> 11 + - Gregory Clement <gregory.clement@bootlin.com> 12 + 13 + description: > 14 + Marvell MVEBU SoCs usually allow to determine core clock frequencies by 15 + reading the Sample-At-Reset (SAR) register. The core clock consumer should 16 + specify the desired clock by having the clock ID in its "clocks" phandle cell. 17 + 18 + The following is a list of provided IDs and clock names on Armada 370/XP: 19 + 0 = tclk (Internal Bus clock) 20 + 1 = cpuclk (CPU clock) 21 + 2 = nbclk (L2 Cache clock) 22 + 3 = hclk (DRAM control clock) 23 + 4 = dramclk (DDR clock) 24 + 25 + The following is a list of provided IDs and clock names on Armada 375: 26 + 0 = tclk (Internal Bus clock) 27 + 1 = cpuclk (CPU clock) 28 + 2 = l2clk (L2 Cache clock) 29 + 3 = ddrclk (DDR clock) 30 + 31 + The following is a list of provided IDs and clock names on Armada 380/385: 32 + 0 = tclk (Internal Bus clock) 33 + 1 = cpuclk (CPU clock) 34 + 2 = l2clk (L2 Cache clock) 35 + 3 = ddrclk (DDR clock) 36 + 37 + The following is a list of provided IDs and clock names on Armada 39x: 38 + 0 = tclk (Internal Bus clock) 39 + 1 = cpuclk (CPU clock) 40 + 2 = nbclk (Coherent Fabric clock) 41 + 3 = hclk (SDRAM Controller Internal Clock) 42 + 4 = dclk (SDRAM Interface Clock) 43 + 5 = refclk (Reference Clock) 44 + 45 + The following is a list of provided IDs and clock names on 98dx3236: 46 + 0 = tclk (Internal Bus clock) 47 + 1 = cpuclk (CPU clock) 48 + 2 = ddrclk (DDR clock) 49 + 3 = mpll (MPLL Clock) 50 + 51 + The following is a list of provided IDs and clock names on Kirkwood and Dove: 52 + 0 = tclk (Internal Bus clock) 53 + 1 = cpuclk (CPU0 clock) 54 + 2 = l2clk (L2 Cache clock derived from CPU0 clock) 55 + 3 = ddrclk (DDR controller clock derived from CPU0 clock) 56 + 57 + The following is a list of provided IDs and clock names on Orion5x: 58 + 0 = tclk (Internal Bus clock) 59 + 1 = cpuclk (CPU0 clock) 60 + 2 = ddrclk (DDR controller clock derived from CPU0 clock) 61 + 62 + properties: 63 + compatible: 64 + enum: 65 + - marvell,armada-370-core-clock 66 + - marvell,armada-375-core-clock 67 + - marvell,armada-380-core-clock 68 + - marvell,armada-390-core-clock 69 + - marvell,armada-xp-core-clock 70 + - marvell,dove-core-clock 71 + - marvell,kirkwood-core-clock 72 + - marvell,mv88f5181-core-clock 73 + - marvell,mv88f5182-core-clock 74 + - marvell,mv88f5281-core-clock 75 + - marvell,mv88f6180-core-clock 76 + - marvell,mv88f6183-core-clock 77 + - marvell,mv98dx1135-core-clock 78 + - marvell,mv98dx3236-core-clock 79 + 80 + reg: 81 + maxItems: 1 82 + 83 + '#clock-cells': 84 + const: 1 85 + 86 + clock-output-names: 87 + description: Overwrite default clock output names. 88 + 89 + required: 90 + - compatible 91 + - reg 92 + - '#clock-cells' 93 + 94 + additionalProperties: false
+227
Documentation/devicetree/bindings/clock/marvell-armada-370-gating-clock.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + --- 3 + $id: http://devicetree.org/schemas/clock/marvell-armada-370-gating-clock.yaml# 4 + $schema: http://devicetree.org/meta-schemas/core.yaml# 5 + 6 + title: Marvell EBU SoC gating-clock 7 + 8 + maintainers: 9 + - Andrew Lunn <andrew@lunn.ch> 10 + - Gregory Clement <gregory.clement@bootlin.com> 11 + 12 + description: > 13 + Marvell Armada 370/375/380/385/39x/XP, Dove and Kirkwood allow some peripheral 14 + clocks to be gated to save some power. The clock ID is directly mapped to the 15 + corresponding clock gating control bit in HW to ease manual clock lookup in 16 + datasheet. 17 + 18 + The following is a list of provided IDs for Armada 370: 19 + 20 + ID Clock Peripheral 21 + ----------------------------------- 22 + 0 Audio AC97 Cntrl 23 + 1 pex0_en PCIe 0 Clock out 24 + 2 pex1_en PCIe 1 Clock out 25 + 3 ge1 Gigabit Ethernet 1 26 + 4 ge0 Gigabit Ethernet 0 27 + 5 pex0 PCIe Cntrl 0 28 + 9 pex1 PCIe Cntrl 1 29 + 15 sata0 SATA Host 0 30 + 17 sdio SDHCI Host 31 + 23 crypto CESA (crypto engine) 32 + 25 tdm Time Division Mplx 33 + 28 ddr DDR Cntrl 34 + 30 sata1 SATA Host 0 35 + 36 + The following is a list of provided IDs for Armada 375: 37 + 38 + ID Clock Peripheral 39 + ----------------------------------- 40 + 2 mu Management Unit 41 + 3 pp Packet Processor 42 + 4 ptp PTP 43 + 5 pex0 PCIe 0 Clock out 44 + 6 pex1 PCIe 1 Clock out 45 + 8 audio Audio Cntrl 46 + 11 nd_clk Nand Flash Cntrl 47 + 14 sata0_link SATA 0 Link 48 + 15 sata0_core SATA 0 Core 49 + 16 usb3 USB3 Host 50 + 17 sdio SDHCI Host 51 + 18 usb USB Host 52 + 19 gop Gigabit Ethernet MAC 53 + 20 sata1_link SATA 1 Link 54 + 21 sata1_core SATA 1 Core 55 + 22 xor0 XOR DMA 0 56 + 23 xor1 XOR DMA 0 57 + 24 copro Coprocessor 58 + 25 tdm Time Division Mplx 59 + 28 crypto0_enc Cryptographic Unit Port 0 Encryption 60 + 29 crypto0_core Cryptographic Unit Port 0 Core 61 + 30 crypto1_enc Cryptographic Unit Port 1 Encryption 62 + 31 crypto1_core Cryptographic Unit Port 1 Core 63 + 64 + The following is a list of provided IDs for Armada 380/385: 65 + 66 + ID Clock Peripheral 67 + ----------------------------------- 68 + 0 audio Audio 69 + 2 ge2 Gigabit Ethernet 2 70 + 3 ge1 Gigabit Ethernet 1 71 + 4 ge0 Gigabit Ethernet 0 72 + 5 pex1 PCIe 1 73 + 6 pex2 PCIe 2 74 + 7 pex3 PCIe 3 75 + 8 pex0 PCIe 0 76 + 9 usb3h0 USB3 Host 0 77 + 10 usb3h1 USB3 Host 1 78 + 11 usb3d USB3 Device 79 + 13 bm Buffer Management 80 + 14 crypto0z Cryptographic 0 Z 81 + 15 sata0 SATA 0 82 + 16 crypto1z Cryptographic 1 Z 83 + 17 sdio SDIO 84 + 18 usb2 USB 2 85 + 21 crypto1 Cryptographic 1 86 + 22 xor0 XOR 0 87 + 23 crypto0 Cryptographic 0 88 + 25 tdm Time Division Multiplexing 89 + 28 xor1 XOR 1 90 + 30 sata1 SATA 1 91 + 92 + The following is a list of provided IDs for Armada 39x: 93 + 94 + ID Clock Peripheral 95 + ----------------------------------- 96 + 5 pex1 PCIe 1 97 + 6 pex2 PCIe 2 98 + 7 pex3 PCIe 3 99 + 8 pex0 PCIe 0 100 + 9 usb3h0 USB3 Host 0 101 + 10 usb3h1 USB3 Host 1 102 + 15 sata0 SATA 0 103 + 17 sdio SDIO 104 + 22 xor0 XOR 0 105 + 28 xor1 XOR 1 106 + 107 + The following is a list of provided IDs for Armada XP: 108 + 109 + ID Clock Peripheral 110 + ----------------------------------- 111 + 0 audio Audio Cntrl 112 + 1 ge3 Gigabit Ethernet 3 113 + 2 ge2 Gigabit Ethernet 2 114 + 3 ge1 Gigabit Ethernet 1 115 + 4 ge0 Gigabit Ethernet 0 116 + 5 pex0 PCIe Cntrl 0 117 + 6 pex1 PCIe Cntrl 1 118 + 7 pex2 PCIe Cntrl 2 119 + 8 pex3 PCIe Cntrl 3 120 + 13 bp 121 + 14 sata0lnk 122 + 15 sata0 SATA Host 0 123 + 16 lcd LCD Cntrl 124 + 17 sdio SDHCI Host 125 + 18 usb0 USB Host 0 126 + 19 usb1 USB Host 1 127 + 20 usb2 USB Host 2 128 + 22 xor0 XOR DMA 0 129 + 23 crypto CESA engine 130 + 25 tdm Time Division Mplx 131 + 28 xor1 XOR DMA 1 132 + 29 sata1lnk 133 + 30 sata1 SATA Host 1 134 + 135 + The following is a list of provided IDs for 98dx3236: 136 + 137 + ID Clock Peripheral 138 + ----------------------------------- 139 + 3 ge1 Gigabit Ethernet 1 140 + 4 ge0 Gigabit Ethernet 0 141 + 5 pex0 PCIe Cntrl 0 142 + 17 sdio SDHCI Host 143 + 18 usb0 USB Host 0 144 + 22 xor0 XOR DMA 0 145 + 146 + The following is a list of provided IDs for Dove: 147 + 148 + ID Clock Peripheral 149 + ----------------------------------- 150 + 0 usb0 USB Host 0 151 + 1 usb1 USB Host 1 152 + 2 ge Gigabit Ethernet 153 + 3 sata SATA Host 154 + 4 pex0 PCIe Cntrl 0 155 + 5 pex1 PCIe Cntrl 1 156 + 8 sdio0 SDHCI Host 0 157 + 9 sdio1 SDHCI Host 1 158 + 10 nand NAND Cntrl 159 + 11 camera Camera Cntrl 160 + 12 i2s0 I2S Cntrl 0 161 + 13 i2s1 I2S Cntrl 1 162 + 15 crypto CESA engine 163 + 21 ac97 AC97 Cntrl 164 + 22 pdma Peripheral DMA 165 + 23 xor0 XOR DMA 0 166 + 24 xor1 XOR DMA 1 167 + 30 gephy Gigabit Ethernet PHY 168 + Note: gephy(30) is implemented as a parent clock of ge(2) 169 + 170 + The following is a list of provided IDs for Kirkwood: 171 + 172 + ID Clock Peripheral 173 + ----------------------------------- 174 + 0 ge0 Gigabit Ethernet 0 175 + 2 pex0 PCIe Cntrl 0 176 + 3 usb0 USB Host 0 177 + 4 sdio SDIO Cntrl 178 + 5 tsu Transp. Stream Unit 179 + 6 dunit SDRAM Cntrl 180 + 7 runit Runit 181 + 8 xor0 XOR DMA 0 182 + 9 audio I2S Cntrl 0 183 + 14 sata0 SATA Host 0 184 + 15 sata1 SATA Host 1 185 + 16 xor1 XOR DMA 1 186 + 17 crypto CESA engine 187 + 18 pex1 PCIe Cntrl 1 188 + 19 ge1 Gigabit Ethernet 1 189 + 20 tdm Time Division Mplx 190 + 191 + properties: 192 + compatible: 193 + enum: 194 + - marvell,armada-370-gating-clock 195 + - marvell,armada-375-gating-clock 196 + - marvell,armada-380-gating-clock 197 + - marvell,armada-390-gating-clock 198 + - marvell,armada-xp-gating-clock 199 + - marvell,mv98dx3236-gating-clock 200 + - marvell,dove-gating-clock 201 + - marvell,kirkwood-gating-clock 202 + 203 + reg: 204 + maxItems: 1 205 + 206 + clocks: 207 + maxItems: 1 208 + 209 + '#clock-cells': 210 + const: 1 211 + 212 + required: 213 + - compatible 214 + - reg 215 + - '#clock-cells' 216 + 217 + additionalProperties: false 218 + 219 + examples: 220 + - | 221 + clock-controller@d0038 { 222 + compatible = "marvell,dove-gating-clock"; 223 + reg = <0xd0038 0x4>; 224 + /* default parent clock is tclk */ 225 + clocks = <&core_clk 0>; 226 + #clock-cells = <1>; 227 + };
-59
Documentation/devicetree/bindings/clock/maxim,max9485.txt
··· 1 - Devicetree bindings for Maxim MAX9485 Programmable Audio Clock Generator 2 - 3 - This device exposes 4 clocks in total: 4 - 5 - - MAX9485_MCLKOUT: A gated, buffered output of the input clock of 27 MHz 6 - - MAX9485_CLKOUT: A PLL that can be configured to 16 different discrete 7 - frequencies 8 - - MAX9485_CLKOUT[1,2]: Two gated outputs for MAX9485_CLKOUT 9 - 10 - MAX9485_CLKOUT[1,2] are children of MAX9485_CLKOUT which upchain all rate set 11 - requests. 12 - 13 - Required properties: 14 - - compatible: "maxim,max9485" 15 - - clocks: Input clock, must provide 27.000 MHz 16 - - clock-names: Must be set to "xclk" 17 - - #clock-cells: From common clock binding; shall be set to 1 18 - 19 - Optional properties: 20 - - reset-gpios: GPIO descriptor connected to the #RESET input pin 21 - - vdd-supply: A regulator node for Vdd 22 - - clock-output-names: Name of output clocks, as defined in common clock 23 - bindings 24 - 25 - If not explicitly set, the output names are "mclkout", "clkout", "clkout1" 26 - and "clkout2". 27 - 28 - Clocks are defined as preprocessor macros in the dt-binding header. 29 - 30 - Example: 31 - 32 - #include <dt-bindings/clock/maxim,max9485.h> 33 - 34 - xo-27mhz: xo-27mhz { 35 - compatible = "fixed-clock"; 36 - #clock-cells = <0>; 37 - clock-frequency = <27000000>; 38 - }; 39 - 40 - &i2c0 { 41 - max9485: audio-clock@63 { 42 - reg = <0x63>; 43 - compatible = "maxim,max9485"; 44 - clock-names = "xclk"; 45 - clocks = <&xo-27mhz>; 46 - reset-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; 47 - vdd-supply = <&3v3-reg>; 48 - #clock-cells = <1>; 49 - }; 50 - }; 51 - 52 - // Clock consumer node 53 - 54 - foo@0 { 55 - compatible = "bar,foo"; 56 - /* ... */ 57 - clock-names = "foo-input-clk"; 58 - clocks = <&max9485 MAX9485_CLKOUT1>; 59 - };
+82
Documentation/devicetree/bindings/clock/maxim,max9485.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/maxim,max9485.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Maxim MAX9485 Programmable Audio Clock Generator 8 + 9 + maintainers: 10 + - Daniel Mack <daniel@zonque.org> 11 + 12 + description: > 13 + Maxim MAX9485 Programmable Audio Clock Generator exposes 4 clocks in total: 14 + 15 + - MAX9485_MCLKOUT: A gated, buffered output of the input clock of 27 MHz 16 + - MAX9485_CLKOUT: A PLL that can be configured to 16 different discrete 17 + frequencies 18 + - MAX9485_CLKOUT[1,2]: Two gated outputs for MAX9485_CLKOUT 19 + 20 + MAX9485_CLKOUT[1,2] are children of MAX9485_CLKOUT which upchain all rate set 21 + requests. 22 + 23 + properties: 24 + compatible: 25 + const: maxim,max9485 26 + 27 + reg: 28 + maxItems: 1 29 + 30 + clocks: 31 + description: Input clock. Must provide 27 MHz 32 + maxItems: 1 33 + 34 + clock-names: 35 + items: 36 + - const: xclk 37 + 38 + '#clock-cells': 39 + const: 1 40 + 41 + reset-gpios: 42 + description: > 43 + GPIO descriptor connected to the #RESET input pin 44 + 45 + vdd-supply: 46 + description: A regulator node for Vdd 47 + 48 + clock-output-names: 49 + description: Name of output clocks, as defined in common clock bindings 50 + items: 51 + - const: mclkout 52 + - const: clkout 53 + - const: clkout1 54 + - const: clkout2 55 + 56 + required: 57 + - compatible 58 + - reg 59 + - clocks 60 + - clock-names 61 + - '#clock-cells' 62 + 63 + additionalProperties: false 64 + 65 + examples: 66 + - | 67 + #include <dt-bindings/gpio/gpio.h> 68 + 69 + i2c { 70 + #address-cells = <1>; 71 + #size-cells = <0>; 72 + 73 + clock-controller@63 { 74 + compatible = "maxim,max9485"; 75 + reg = <0x63>; 76 + #clock-cells = <1>; 77 + clock-names = "xclk"; 78 + clocks = <&xo_27mhz>; 79 + reset-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; 80 + vdd-supply = <&reg_3v3>; 81 + }; 82 + };
-39
Documentation/devicetree/bindings/clock/microchip,pic32.txt
··· 1 - Microchip PIC32 Clock Controller Binding 2 - ---------------------------------------- 3 - Microchip clock controller is consists of few oscillators, PLL, multiplexer 4 - and few divider modules. 5 - 6 - This binding uses common clock bindings. 7 - [1] Documentation/devicetree/bindings/clock/clock-bindings.txt 8 - 9 - Required properties: 10 - - compatible: shall be "microchip,pic32mzda-clk". 11 - - reg: shall contain base address and length of clock registers. 12 - - #clock-cells: shall be 1. 13 - 14 - Optional properties: 15 - - microchip,pic32mzda-sosc: shall be added only if platform has 16 - secondary oscillator connected. 17 - 18 - Example: 19 - rootclk: clock-controller@1f801200 { 20 - compatible = "microchip,pic32mzda-clk"; 21 - reg = <0x1f801200 0x200>; 22 - #clock-cells = <1>; 23 - /* optional */ 24 - microchip,pic32mzda-sosc; 25 - }; 26 - 27 - 28 - The clock consumer shall specify the desired clock-output of the clock 29 - controller (as defined in [2]) by specifying output-id in its "clock" 30 - phandle cell. 31 - [2] include/dt-bindings/clock/microchip,pic32-clock.h 32 - 33 - For example for UART2: 34 - uart2: serial@2 { 35 - compatible = "microchip,pic32mzda-uart"; 36 - reg = <>; 37 - interrupts = <>; 38 - clocks = <&rootclk PB2CLK>; 39 - };
+45
Documentation/devicetree/bindings/clock/microchip,pic32mzda-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/microchip,pic32mzda-clk.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Microchip PIC32MZDA Clock Controller 8 + 9 + maintainers: 10 + - Purna Chandra Mandal <purna.mandal@microchip.com> 11 + 12 + description: 13 + Microchip clock controller consists of a few oscillators, PLL, multiplexer 14 + and divider modules. 15 + 16 + properties: 17 + compatible: 18 + const: microchip,pic32mzda-clk 19 + 20 + reg: 21 + maxItems: 1 22 + 23 + '#clock-cells': 24 + const: 1 25 + 26 + microchip,pic32mzda-sosc: 27 + description: Presence of secondary oscillator. 28 + type: boolean 29 + 30 + required: 31 + - compatible 32 + - reg 33 + - "#clock-cells" 34 + 35 + additionalProperties: false 36 + 37 + examples: 38 + - | 39 + clock-controller@1f801200 { 40 + compatible = "microchip,pic32mzda-clk"; 41 + reg = <0x1f801200 0x200>; 42 + #clock-cells = <1>; 43 + /* optional */ 44 + microchip,pic32mzda-sosc; 45 + };
-48
Documentation/devicetree/bindings/clock/moxa,moxart-clock.txt
··· 1 - Device Tree Clock bindings for arch-moxart 2 - 3 - This binding uses the common clock binding[1]. 4 - 5 - [1] Documentation/devicetree/bindings/clock/clock-bindings.txt 6 - 7 - MOXA ART SoCs allow to determine PLL output and APB frequencies 8 - by reading registers holding multiplier and divisor information. 9 - 10 - 11 - PLL: 12 - 13 - Required properties: 14 - - compatible : Must be "moxa,moxart-pll-clock" 15 - - #clock-cells : Should be 0 16 - - reg : Should contain registers location and length 17 - - clocks : Should contain phandle + clock-specifier for the parent clock 18 - 19 - Optional properties: 20 - - clock-output-names : Should contain clock name 21 - 22 - 23 - APB: 24 - 25 - Required properties: 26 - - compatible : Must be "moxa,moxart-apb-clock" 27 - - #clock-cells : Should be 0 28 - - reg : Should contain registers location and length 29 - - clocks : Should contain phandle + clock-specifier for the parent clock 30 - 31 - Optional properties: 32 - - clock-output-names : Should contain clock name 33 - 34 - 35 - For example: 36 - 37 - clk_pll: clk_pll@98100000 { 38 - compatible = "moxa,moxart-pll-clock"; 39 - #clock-cells = <0>; 40 - reg = <0x98100000 0x34>; 41 - }; 42 - 43 - clk_apb: clk_apb@98100000 { 44 - compatible = "moxa,moxart-apb-clock"; 45 - #clock-cells = <0>; 46 - reg = <0x98100000 0x34>; 47 - clocks = <&clk_pll>; 48 - };
+38
Documentation/devicetree/bindings/clock/moxa,moxart-clock.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/moxa,moxart-clock.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: MOXA ART Clock Controllers 8 + 9 + maintainers: 10 + - Krzysztof Kozlowski <krzk@kernel.org> 11 + 12 + description: 13 + MOXA ART SoCs allow to determine PLL output and APB frequencies by reading 14 + registers holding multiplier and divisor information. 15 + 16 + properties: 17 + compatible: 18 + enum: 19 + - moxa,moxart-apb-clock 20 + - moxa,moxart-pll-clock 21 + 22 + "#clock-cells": 23 + const: 0 24 + 25 + reg: 26 + maxItems: 1 27 + 28 + clocks: 29 + maxItems: 1 30 + 31 + clock-output-names: true 32 + 33 + additionalProperties: false 34 + 35 + required: 36 + - compatible 37 + - "#clock-cells" 38 + - reg
-87
Documentation/devicetree/bindings/clock/mvebu-core-clock.txt
··· 1 - * Core Clock bindings for Marvell MVEBU SoCs 2 - 3 - Marvell MVEBU SoCs usually allow to determine core clock frequencies by 4 - reading the Sample-At-Reset (SAR) register. The core clock consumer should 5 - specify the desired clock by having the clock ID in its "clocks" phandle cell. 6 - 7 - The following is a list of provided IDs and clock names on Armada 370/XP: 8 - 0 = tclk (Internal Bus clock) 9 - 1 = cpuclk (CPU clock) 10 - 2 = nbclk (L2 Cache clock) 11 - 3 = hclk (DRAM control clock) 12 - 4 = dramclk (DDR clock) 13 - 14 - The following is a list of provided IDs and clock names on Armada 375: 15 - 0 = tclk (Internal Bus clock) 16 - 1 = cpuclk (CPU clock) 17 - 2 = l2clk (L2 Cache clock) 18 - 3 = ddrclk (DDR clock) 19 - 20 - The following is a list of provided IDs and clock names on Armada 380/385: 21 - 0 = tclk (Internal Bus clock) 22 - 1 = cpuclk (CPU clock) 23 - 2 = l2clk (L2 Cache clock) 24 - 3 = ddrclk (DDR clock) 25 - 26 - The following is a list of provided IDs and clock names on Armada 39x: 27 - 0 = tclk (Internal Bus clock) 28 - 1 = cpuclk (CPU clock) 29 - 2 = nbclk (Coherent Fabric clock) 30 - 3 = hclk (SDRAM Controller Internal Clock) 31 - 4 = dclk (SDRAM Interface Clock) 32 - 5 = refclk (Reference Clock) 33 - 34 - The following is a list of provided IDs and clock names on 98dx3236: 35 - 0 = tclk (Internal Bus clock) 36 - 1 = cpuclk (CPU clock) 37 - 2 = ddrclk (DDR clock) 38 - 3 = mpll (MPLL Clock) 39 - 40 - The following is a list of provided IDs and clock names on Kirkwood and Dove: 41 - 0 = tclk (Internal Bus clock) 42 - 1 = cpuclk (CPU0 clock) 43 - 2 = l2clk (L2 Cache clock derived from CPU0 clock) 44 - 3 = ddrclk (DDR controller clock derived from CPU0 clock) 45 - 46 - The following is a list of provided IDs and clock names on Orion5x: 47 - 0 = tclk (Internal Bus clock) 48 - 1 = cpuclk (CPU0 clock) 49 - 2 = ddrclk (DDR controller clock derived from CPU0 clock) 50 - 51 - Required properties: 52 - - compatible : shall be one of the following: 53 - "marvell,armada-370-core-clock" - For Armada 370 SoC core clocks 54 - "marvell,armada-375-core-clock" - For Armada 375 SoC core clocks 55 - "marvell,armada-380-core-clock" - For Armada 380/385 SoC core clocks 56 - "marvell,armada-390-core-clock" - For Armada 39x SoC core clocks 57 - "marvell,armada-xp-core-clock" - For Armada XP SoC core clocks 58 - "marvell,mv98dx3236-core-clock" - For 98dx3236 family SoC core clocks 59 - "marvell,dove-core-clock" - for Dove SoC core clocks 60 - "marvell,kirkwood-core-clock" - for Kirkwood SoC (except mv88f6180) 61 - "marvell,mv88f6180-core-clock" - for Kirkwood MV88f6180 SoC 62 - "marvell,mv98dx1135-core-clock" - for Kirkwood 98dx1135 SoC 63 - "marvell,mv88f5181-core-clock" - for Orion MV88F5181 SoC 64 - "marvell,mv88f5182-core-clock" - for Orion MV88F5182 SoC 65 - "marvell,mv88f5281-core-clock" - for Orion MV88F5281 SoC 66 - "marvell,mv88f6183-core-clock" - for Orion MV88F6183 SoC 67 - - reg : shall be the register address of the Sample-At-Reset (SAR) register 68 - - #clock-cells : from common clock binding; shall be set to 1 69 - 70 - Optional properties: 71 - - clock-output-names : from common clock binding; allows overwrite default clock 72 - output names ("tclk", "cpuclk", "l2clk", "ddrclk") 73 - 74 - Example: 75 - 76 - core_clk: core-clocks@d0214 { 77 - compatible = "marvell,dove-core-clock"; 78 - reg = <0xd0214 0x4>; 79 - #clock-cells = <1>; 80 - }; 81 - 82 - spi0: spi@10600 { 83 - compatible = "marvell,orion-spi"; 84 - /* ... */ 85 - /* get tclk from core clock provider */ 86 - clocks = <&core_clk 0>; 87 - };
-23
Documentation/devicetree/bindings/clock/mvebu-corediv-clock.txt
··· 1 - * Core Divider Clock bindings for Marvell MVEBU SoCs 2 - 3 - The following is a list of provided IDs and clock names on Armada 370/XP: 4 - 0 = nand (NAND clock) 5 - 6 - Required properties: 7 - - compatible : must be "marvell,armada-370-corediv-clock", 8 - "marvell,armada-375-corediv-clock", 9 - "marvell,armada-380-corediv-clock", 10 - "marvell,mv98dx3236-corediv-clock", 11 - 12 - - reg : must be the register address of Core Divider control register 13 - - #clock-cells : from common clock binding; shall be set to 1 14 - - clocks : must be set to the parent's phandle 15 - 16 - Example: 17 - 18 - corediv_clk: corediv-clocks@18740 { 19 - compatible = "marvell,armada-370-corediv-clock"; 20 - reg = <0x18740 0xc>; 21 - #clock-cells = <1>; 22 - clocks = <&pll>; 23 - };
-23
Documentation/devicetree/bindings/clock/mvebu-cpu-clock.txt
··· 1 - Device Tree Clock bindings for cpu clock of Marvell EBU platforms 2 - 3 - Required properties: 4 - - compatible : shall be one of the following: 5 - "marvell,armada-xp-cpu-clock" - cpu clocks for Armada XP 6 - "marvell,mv98dx3236-cpu-clock" - cpu clocks for 98DX3236 SoC 7 - - reg : Address and length of the clock complex register set, followed 8 - by address and length of the PMU DFS registers 9 - - #clock-cells : should be set to 1. 10 - - clocks : shall be the input parent clock phandle for the clock. 11 - 12 - cpuclk: clock-complex@d0018700 { 13 - #clock-cells = <1>; 14 - compatible = "marvell,armada-xp-cpu-clock"; 15 - reg = <0xd0018700 0xA0>, <0x1c054 0x10>; 16 - clocks = <&coreclk 1>; 17 - } 18 - 19 - cpu@0 { 20 - compatible = "marvell,sheeva-v7"; 21 - reg = <0>; 22 - clocks = <&cpuclk 0>; 23 - };
-205
Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt
··· 1 - * Gated Clock bindings for Marvell EBU SoCs 2 - 3 - Marvell Armada 370/375/380/385/39x/XP, Dove and Kirkwood allow some 4 - peripheral clocks to be gated to save some power. The clock consumer 5 - should specify the desired clock by having the clock ID in its 6 - "clocks" phandle cell. The clock ID is directly mapped to the 7 - corresponding clock gating control bit in HW to ease manual clock 8 - lookup in datasheet. 9 - 10 - The following is a list of provided IDs for Armada 370: 11 - ID Clock Peripheral 12 - ----------------------------------- 13 - 0 Audio AC97 Cntrl 14 - 1 pex0_en PCIe 0 Clock out 15 - 2 pex1_en PCIe 1 Clock out 16 - 3 ge1 Gigabit Ethernet 1 17 - 4 ge0 Gigabit Ethernet 0 18 - 5 pex0 PCIe Cntrl 0 19 - 9 pex1 PCIe Cntrl 1 20 - 15 sata0 SATA Host 0 21 - 17 sdio SDHCI Host 22 - 23 crypto CESA (crypto engine) 23 - 25 tdm Time Division Mplx 24 - 28 ddr DDR Cntrl 25 - 30 sata1 SATA Host 0 26 - 27 - The following is a list of provided IDs for Armada 375: 28 - ID Clock Peripheral 29 - ----------------------------------- 30 - 2 mu Management Unit 31 - 3 pp Packet Processor 32 - 4 ptp PTP 33 - 5 pex0 PCIe 0 Clock out 34 - 6 pex1 PCIe 1 Clock out 35 - 8 audio Audio Cntrl 36 - 11 nd_clk Nand Flash Cntrl 37 - 14 sata0_link SATA 0 Link 38 - 15 sata0_core SATA 0 Core 39 - 16 usb3 USB3 Host 40 - 17 sdio SDHCI Host 41 - 18 usb USB Host 42 - 19 gop Gigabit Ethernet MAC 43 - 20 sata1_link SATA 1 Link 44 - 21 sata1_core SATA 1 Core 45 - 22 xor0 XOR DMA 0 46 - 23 xor1 XOR DMA 0 47 - 24 copro Coprocessor 48 - 25 tdm Time Division Mplx 49 - 28 crypto0_enc Cryptographic Unit Port 0 Encryption 50 - 29 crypto0_core Cryptographic Unit Port 0 Core 51 - 30 crypto1_enc Cryptographic Unit Port 1 Encryption 52 - 31 crypto1_core Cryptographic Unit Port 1 Core 53 - 54 - The following is a list of provided IDs for Armada 380/385: 55 - ID Clock Peripheral 56 - ----------------------------------- 57 - 0 audio Audio 58 - 2 ge2 Gigabit Ethernet 2 59 - 3 ge1 Gigabit Ethernet 1 60 - 4 ge0 Gigabit Ethernet 0 61 - 5 pex1 PCIe 1 62 - 6 pex2 PCIe 2 63 - 7 pex3 PCIe 3 64 - 8 pex0 PCIe 0 65 - 9 usb3h0 USB3 Host 0 66 - 10 usb3h1 USB3 Host 1 67 - 11 usb3d USB3 Device 68 - 13 bm Buffer Management 69 - 14 crypto0z Cryptographic 0 Z 70 - 15 sata0 SATA 0 71 - 16 crypto1z Cryptographic 1 Z 72 - 17 sdio SDIO 73 - 18 usb2 USB 2 74 - 21 crypto1 Cryptographic 1 75 - 22 xor0 XOR 0 76 - 23 crypto0 Cryptographic 0 77 - 25 tdm Time Division Multiplexing 78 - 28 xor1 XOR 1 79 - 30 sata1 SATA 1 80 - 81 - The following is a list of provided IDs for Armada 39x: 82 - ID Clock Peripheral 83 - ----------------------------------- 84 - 5 pex1 PCIe 1 85 - 6 pex2 PCIe 2 86 - 7 pex3 PCIe 3 87 - 8 pex0 PCIe 0 88 - 9 usb3h0 USB3 Host 0 89 - 10 usb3h1 USB3 Host 1 90 - 15 sata0 SATA 0 91 - 17 sdio SDIO 92 - 22 xor0 XOR 0 93 - 28 xor1 XOR 1 94 - 95 - The following is a list of provided IDs for Armada XP: 96 - ID Clock Peripheral 97 - ----------------------------------- 98 - 0 audio Audio Cntrl 99 - 1 ge3 Gigabit Ethernet 3 100 - 2 ge2 Gigabit Ethernet 2 101 - 3 ge1 Gigabit Ethernet 1 102 - 4 ge0 Gigabit Ethernet 0 103 - 5 pex0 PCIe Cntrl 0 104 - 6 pex1 PCIe Cntrl 1 105 - 7 pex2 PCIe Cntrl 2 106 - 8 pex3 PCIe Cntrl 3 107 - 13 bp 108 - 14 sata0lnk 109 - 15 sata0 SATA Host 0 110 - 16 lcd LCD Cntrl 111 - 17 sdio SDHCI Host 112 - 18 usb0 USB Host 0 113 - 19 usb1 USB Host 1 114 - 20 usb2 USB Host 2 115 - 22 xor0 XOR DMA 0 116 - 23 crypto CESA engine 117 - 25 tdm Time Division Mplx 118 - 28 xor1 XOR DMA 1 119 - 29 sata1lnk 120 - 30 sata1 SATA Host 1 121 - 122 - The following is a list of provided IDs for 98dx3236: 123 - ID Clock Peripheral 124 - ----------------------------------- 125 - 3 ge1 Gigabit Ethernet 1 126 - 4 ge0 Gigabit Ethernet 0 127 - 5 pex0 PCIe Cntrl 0 128 - 17 sdio SDHCI Host 129 - 18 usb0 USB Host 0 130 - 22 xor0 XOR DMA 0 131 - 132 - The following is a list of provided IDs for Dove: 133 - ID Clock Peripheral 134 - ----------------------------------- 135 - 0 usb0 USB Host 0 136 - 1 usb1 USB Host 1 137 - 2 ge Gigabit Ethernet 138 - 3 sata SATA Host 139 - 4 pex0 PCIe Cntrl 0 140 - 5 pex1 PCIe Cntrl 1 141 - 8 sdio0 SDHCI Host 0 142 - 9 sdio1 SDHCI Host 1 143 - 10 nand NAND Cntrl 144 - 11 camera Camera Cntrl 145 - 12 i2s0 I2S Cntrl 0 146 - 13 i2s1 I2S Cntrl 1 147 - 15 crypto CESA engine 148 - 21 ac97 AC97 Cntrl 149 - 22 pdma Peripheral DMA 150 - 23 xor0 XOR DMA 0 151 - 24 xor1 XOR DMA 1 152 - 30 gephy Gigabit Ethernel PHY 153 - Note: gephy(30) is implemented as a parent clock of ge(2) 154 - 155 - The following is a list of provided IDs for Kirkwood: 156 - ID Clock Peripheral 157 - ----------------------------------- 158 - 0 ge0 Gigabit Ethernet 0 159 - 2 pex0 PCIe Cntrl 0 160 - 3 usb0 USB Host 0 161 - 4 sdio SDIO Cntrl 162 - 5 tsu Transp. Stream Unit 163 - 6 dunit SDRAM Cntrl 164 - 7 runit Runit 165 - 8 xor0 XOR DMA 0 166 - 9 audio I2S Cntrl 0 167 - 14 sata0 SATA Host 0 168 - 15 sata1 SATA Host 1 169 - 16 xor1 XOR DMA 1 170 - 17 crypto CESA engine 171 - 18 pex1 PCIe Cntrl 1 172 - 19 ge1 Gigabit Ethernet 1 173 - 20 tdm Time Division Mplx 174 - 175 - Required properties: 176 - - compatible : shall be one of the following: 177 - "marvell,armada-370-gating-clock" - for Armada 370 SoC clock gating 178 - "marvell,armada-375-gating-clock" - for Armada 375 SoC clock gating 179 - "marvell,armada-380-gating-clock" - for Armada 380/385 SoC clock gating 180 - "marvell,armada-390-gating-clock" - for Armada 39x SoC clock gating 181 - "marvell,armada-xp-gating-clock" - for Armada XP SoC clock gating 182 - "marvell,mv98dx3236-gating-clock" - for 98dx3236 SoC clock gating 183 - "marvell,dove-gating-clock" - for Dove SoC clock gating 184 - "marvell,kirkwood-gating-clock" - for Kirkwood SoC clock gating 185 - - reg : shall be the register address of the Clock Gating Control register 186 - - #clock-cells : from common clock binding; shall be set to 1 187 - 188 - Optional properties: 189 - - clocks : default parent clock phandle (e.g. tclk) 190 - 191 - Example: 192 - 193 - gate_clk: clock-gating-control@d0038 { 194 - compatible = "marvell,dove-gating-clock"; 195 - reg = <0xd0038 0x4>; 196 - /* default parent clock is tclk */ 197 - clocks = <&core_clk 0>; 198 - #clock-cells = <1>; 199 - }; 200 - 201 - sdio0: sdio@92000 { 202 - compatible = "marvell,dove-sdhci"; 203 - /* get clk gate bit 8 (sdio0) */ 204 - clocks = <&gate_clk 8>; 205 - };
-24
Documentation/devicetree/bindings/clock/nspire-clock.txt
··· 1 - TI-NSPIRE Clocks 2 - 3 - Required properties: 4 - - compatible: Valid compatible properties include: 5 - "lsi,nspire-cx-ahb-divider" for the AHB divider in the CX model 6 - "lsi,nspire-classic-ahb-divider" for the AHB divider in the older model 7 - "lsi,nspire-cx-clock" for the base clock in the CX model 8 - "lsi,nspire-classic-clock" for the base clock in the older model 9 - 10 - - reg: Physical base address of the controller and length of memory mapped 11 - region. 12 - 13 - Optional: 14 - - clocks: For the "nspire-*-ahb-divider" compatible clocks, this is the parent 15 - clock where it divides the rate from. 16 - 17 - Example: 18 - 19 - ahb_clk { 20 - #clock-cells = <0>; 21 - compatible = "lsi,nspire-cx-clock"; 22 - reg = <0x900B0000 0x4>; 23 - clocks = <&base_clk>; 24 - };
-100
Documentation/devicetree/bindings/clock/nuvoton,npcm750-clk.txt
··· 1 - * Nuvoton NPCM7XX Clock Controller 2 - 3 - Nuvoton Poleg BMC NPCM7XX contains an integrated clock controller, which 4 - generates and supplies clocks to all modules within the BMC. 5 - 6 - External clocks: 7 - 8 - There are six fixed clocks that are generated outside the BMC. All clocks are of 9 - a known fixed value that cannot be changed. clk_refclk, clk_mcbypck and 10 - clk_sysbypck are inputs to the clock controller. 11 - clk_rg1refck, clk_rg2refck and clk_xin are external clocks suppling the 12 - network. They are set on the device tree, but not used by the clock module. The 13 - network devices use them directly. 14 - Example can be found below. 15 - 16 - All available clocks are defined as preprocessor macros in: 17 - dt-bindings/clock/nuvoton,npcm7xx-clock.h 18 - and can be reused as DT sources. 19 - 20 - Required Properties of clock controller: 21 - 22 - - compatible: "nuvoton,npcm750-clk" : for clock controller of Nuvoton 23 - Poleg BMC NPCM750 24 - 25 - - reg: physical base address of the clock controller and length of 26 - memory mapped region. 27 - 28 - - #clock-cells: should be 1. 29 - 30 - Example: Clock controller node: 31 - 32 - clk: clock-controller@f0801000 { 33 - compatible = "nuvoton,npcm750-clk"; 34 - #clock-cells = <1>; 35 - reg = <0xf0801000 0x1000>; 36 - clock-names = "refclk", "sysbypck", "mcbypck"; 37 - clocks = <&clk_refclk>, <&clk_sysbypck>, <&clk_mcbypck>; 38 - }; 39 - 40 - Example: Required external clocks for network: 41 - 42 - /* external reference clock */ 43 - clk_refclk: clk-refclk { 44 - compatible = "fixed-clock"; 45 - #clock-cells = <0>; 46 - clock-frequency = <25000000>; 47 - clock-output-names = "refclk"; 48 - }; 49 - 50 - /* external reference clock for cpu. float in normal operation */ 51 - clk_sysbypck: clk-sysbypck { 52 - compatible = "fixed-clock"; 53 - #clock-cells = <0>; 54 - clock-frequency = <800000000>; 55 - clock-output-names = "sysbypck"; 56 - }; 57 - 58 - /* external reference clock for MC. float in normal operation */ 59 - clk_mcbypck: clk-mcbypck { 60 - compatible = "fixed-clock"; 61 - #clock-cells = <0>; 62 - clock-frequency = <800000000>; 63 - clock-output-names = "mcbypck"; 64 - }; 65 - 66 - /* external clock signal rg1refck, supplied by the phy */ 67 - clk_rg1refck: clk-rg1refck { 68 - compatible = "fixed-clock"; 69 - #clock-cells = <0>; 70 - clock-frequency = <125000000>; 71 - clock-output-names = "clk_rg1refck"; 72 - }; 73 - 74 - /* external clock signal rg2refck, supplied by the phy */ 75 - clk_rg2refck: clk-rg2refck { 76 - compatible = "fixed-clock"; 77 - #clock-cells = <0>; 78 - clock-frequency = <125000000>; 79 - clock-output-names = "clk_rg2refck"; 80 - }; 81 - 82 - clk_xin: clk-xin { 83 - compatible = "fixed-clock"; 84 - #clock-cells = <0>; 85 - clock-frequency = <50000000>; 86 - clock-output-names = "clk_xin"; 87 - }; 88 - 89 - 90 - Example: GMAC controller node that consumes two clocks: a generated clk by the 91 - clock controller and a fixed clock from DT (clk_rg1refck). 92 - 93 - ethernet0: ethernet@f0802000 { 94 - compatible = "snps,dwmac"; 95 - reg = <0xf0802000 0x2000>; 96 - interrupts = <0 14 4>; 97 - interrupt-names = "macirq"; 98 - clocks = <&clk_rg1refck>, <&clk NPCM7XX_CLK_AHB>; 99 - clock-names = "stmmaceth", "clk_gmac"; 100 - };
+66
Documentation/devicetree/bindings/clock/nuvoton,npcm750-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/nuvoton,npcm750-clk.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Nuvoton NPCM7XX Clock Controller 8 + 9 + maintainers: 10 + - Tali Perry <tali.perry1@gmail.com> 11 + 12 + description: > 13 + Nuvoton Poleg BMC NPCM7XX contains an integrated clock controller, which 14 + generates and supplies clocks to all modules within the BMC. 15 + 16 + External clocks: 17 + 18 + There are six fixed clocks that are generated outside the BMC. All clocks are of 19 + a known fixed value that cannot be changed. clk_refclk, clk_mcbypck and 20 + clk_sysbypck are inputs to the clock controller. 21 + clk_rg1refck, clk_rg2refck and clk_xin are external clocks suppling the 22 + network. They are set on the device tree, but not used by the clock module. The 23 + network devices use them directly. 24 + 25 + All available clocks are defined as preprocessor macros in: 26 + dt-bindings/clock/nuvoton,npcm7xx-clock.h 27 + and can be reused as DT sources. 28 + 29 + properties: 30 + compatible: 31 + const: nuvoton,npcm750-clk 32 + 33 + reg: 34 + maxItems: 1 35 + 36 + '#clock-cells': 37 + const: 1 38 + 39 + clock-names: 40 + items: 41 + - const: refclk 42 + - const: sysbypck 43 + - const: mcbypck 44 + 45 + clocks: 46 + items: 47 + - description: refclk 48 + - description: sysbypck 49 + - description: mcbypck 50 + 51 + required: 52 + - compatible 53 + - reg 54 + - '#clock-cells' 55 + 56 + additionalProperties: false 57 + 58 + examples: 59 + - | 60 + clock-controller@f0801000 { 61 + compatible = "nuvoton,npcm750-clk"; 62 + #clock-cells = <1>; 63 + reg = <0xf0801000 0x1000>; 64 + clock-names = "refclk", "sysbypck", "mcbypck"; 65 + clocks = <&clk_refclk>, <&clk_sysbypck>, <&clk_mcbypck>; 66 + };
+104
Documentation/devicetree/bindings/clock/nxp,lpc1850-ccu.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/nxp,lpc1850-ccu.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: NXP LPC1850 Clock Control Unit (CCU) 8 + 9 + description: 10 + Each CGU base clock has several clock branches which can be turned on 11 + or off independently by the Clock Control Units CCU1 or CCU2. The 12 + branch clocks are distributed between CCU1 and CCU2. 13 + 14 + Above text taken from NXP LPC1850 User Manual 15 + 16 + maintainers: 17 + - Frank Li <Frank.Li@nxp.com> 18 + 19 + properties: 20 + compatible: 21 + const: nxp,lpc1850-ccu 22 + 23 + reg: 24 + maxItems: 1 25 + 26 + '#clock-cells': 27 + const: 1 28 + 29 + clocks: 30 + minItems: 1 31 + maxItems: 8 32 + 33 + clock-names: 34 + minItems: 1 35 + maxItems: 8 36 + items: 37 + enum: 38 + - base_usb0_clk 39 + - base_periph_clk 40 + - base_usb1_clk 41 + - base_cpu_clk 42 + - base_spifi_clk 43 + - base_spi_clk 44 + - base_apb1_clk 45 + - base_apb3_clk 46 + - base_adchs_clk 47 + - base_sdio_clk 48 + - base_ssp0_clk 49 + - base_ssp1_clk 50 + - base_uart0_clk 51 + - base_uart1_clk 52 + - base_uart2_clk 53 + - base_uart3_clk 54 + - base_audio_clk 55 + description: 56 + Which branch clocks that are available on the CCU depends on the 57 + specific LPC part. Check the user manual for your specific part. 58 + 59 + A list of CCU clocks can be found in dt-bindings/clock/lpc18xx-ccu.h. 60 + 61 + required: 62 + - compatible 63 + - reg 64 + - '#clock-cells' 65 + - clocks 66 + - clock-names 67 + 68 + additionalProperties: false 69 + 70 + examples: 71 + - | 72 + #include <dt-bindings/clock/lpc18xx-cgu.h> 73 + 74 + clock-controller@40051000 { 75 + compatible = "nxp,lpc1850-ccu"; 76 + reg = <0x40051000 0x1000>; 77 + #clock-cells = <1>; 78 + clocks = <&cgu BASE_APB3_CLK>, <&cgu BASE_APB1_CLK>, 79 + <&cgu BASE_SPIFI_CLK>, <&cgu BASE_CPU_CLK>, 80 + <&cgu BASE_PERIPH_CLK>, <&cgu BASE_USB0_CLK>, 81 + <&cgu BASE_USB1_CLK>, <&cgu BASE_SPI_CLK>; 82 + clock-names = "base_apb3_clk", "base_apb1_clk", 83 + "base_spifi_clk", "base_cpu_clk", 84 + "base_periph_clk", "base_usb0_clk", 85 + "base_usb1_clk", "base_spi_clk"; 86 + }; 87 + 88 + - | 89 + #include <dt-bindings/clock/lpc18xx-cgu.h> 90 + 91 + clock-controller@40052000 { 92 + compatible = "nxp,lpc1850-ccu"; 93 + reg = <0x40052000 0x1000>; 94 + #clock-cells = <1>; 95 + clocks = <&cgu BASE_AUDIO_CLK>, <&cgu BASE_UART3_CLK>, 96 + <&cgu BASE_UART2_CLK>, <&cgu BASE_UART1_CLK>, 97 + <&cgu BASE_UART0_CLK>, <&cgu BASE_SSP1_CLK>, 98 + <&cgu BASE_SSP0_CLK>, <&cgu BASE_SDIO_CLK>; 99 + clock-names = "base_audio_clk", "base_uart3_clk", 100 + "base_uart2_clk", "base_uart1_clk", 101 + "base_uart0_clk", "base_ssp1_clk", 102 + "base_ssp0_clk", "base_sdio_clk"; 103 + }; 104 +
+99
Documentation/devicetree/bindings/clock/nxp,lpc1850-cgu.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/nxp,lpc1850-cgu.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: NXP LPC1850 Clock Generation Unit (CGU) 8 + 9 + description: > 10 + The CGU generates multiple independent clocks for the core and the 11 + peripheral blocks of the LPC18xx. Each independent clock is called 12 + a base clock and itself is one of the inputs to the two Clock 13 + Control Units (CCUs) which control the branch clocks to the 14 + individual peripherals. 15 + 16 + The CGU selects the inputs to the clock generators from multiple 17 + clock sources, controls the clock generation, and routes the outputs 18 + of the clock generators through the clock source bus to the output 19 + stages. Each output stage provides an independent clock source and 20 + corresponds to one of the base clocks for the LPC18xx. 21 + 22 + Above text taken from NXP LPC1850 User Manual. 23 + 24 + maintainers: 25 + - Frank Li <Frank.Li@nxp.com> 26 + 27 + properties: 28 + compatible: 29 + const: nxp,lpc1850-cgu 30 + 31 + reg: 32 + maxItems: 1 33 + 34 + '#clock-cells': 35 + const: 1 36 + description: | 37 + Which base clocks that are available on the CGU depends on the 38 + specific LPC part. Base clocks are numbered from 0 to 27. 39 + 40 + Number: Name: Description: 41 + 0 BASE_SAFE_CLK Base safe clock (always on) for WWDT 42 + 1 BASE_USB0_CLK Base clock for USB0 43 + 2 BASE_PERIPH_CLK Base clock for Cortex-M0SUB subsystem, 44 + SPI, and SGPIO 45 + 3 BASE_USB1_CLK Base clock for USB1 46 + 4 BASE_CPU_CLK System base clock for ARM Cortex-M core 47 + and APB peripheral blocks #0 and #2 48 + 5 BASE_SPIFI_CLK Base clock for SPIFI 49 + 6 BASE_SPI_CLK Base clock for SPI 50 + 7 BASE_PHY_RX_CLK Base clock for Ethernet PHY Receive clock 51 + 8 BASE_PHY_TX_CLK Base clock for Ethernet PHY Transmit clock 52 + 9 BASE_APB1_CLK Base clock for APB peripheral block # 1 53 + 10 BASE_APB3_CLK Base clock for APB peripheral block # 3 54 + 11 BASE_LCD_CLK Base clock for LCD 55 + 12 BASE_ADCHS_CLK Base clock for ADCHS 56 + 13 BASE_SDIO_CLK Base clock for SD/MMC 57 + 14 BASE_SSP0_CLK Base clock for SSP0 58 + 15 BASE_SSP1_CLK Base clock for SSP1 59 + 16 BASE_UART0_CLK Base clock for UART0 60 + 17 BASE_UART1_CLK Base clock for UART1 61 + 18 BASE_UART2_CLK Base clock for UART2 62 + 19 BASE_UART3_CLK Base clock for UART3 63 + 20 BASE_OUT_CLK Base clock for CLKOUT pin 64 + 24-21 - Reserved 65 + 25 BASE_AUDIO_CLK Base clock for audio system (I2S) 66 + 26 BASE_CGU_OUT0_CLK Base clock for CGU_OUT0 clock output 67 + 27 BASE_CGU_OUT1_CLK Base clock for CGU_OUT1 clock output 68 + 69 + BASE_PERIPH_CLK and BASE_SPI_CLK is only available on LPC43xx. 70 + BASE_ADCHS_CLK is only available on LPC4370. 71 + 72 + clocks: 73 + maxItems: 5 74 + 75 + clock-indices: 76 + minItems: 1 77 + maxItems: 28 78 + 79 + clock-output-names: 80 + minItems: 1 81 + maxItems: 28 82 + 83 + required: 84 + - compatible 85 + - reg 86 + - clocks 87 + - '#clock-cells' 88 + 89 + additionalProperties: false 90 + 91 + examples: 92 + - | 93 + clock-controller@40050000 { 94 + compatible = "nxp,lpc1850-cgu"; 95 + reg = <0x40050000 0x1000>; 96 + #clock-cells = <1>; 97 + clocks = <&xtal>, <&creg_clk 1>, <&enet_rx_clk>, <&enet_tx_clk>, <&gp_clkin>; 98 + }; 99 +
-123
Documentation/devicetree/bindings/clock/pistachio-clock.txt
··· 1 - Imagination Technologies Pistachio SoC clock controllers 2 - ======================================================== 3 - 4 - Pistachio has four clock controllers (core clock, peripheral clock, peripheral 5 - general control, and top general control) which are instantiated individually 6 - from the device-tree. 7 - 8 - External clocks: 9 - ---------------- 10 - 11 - There are three external inputs to the clock controllers which should be 12 - defined with the following clock-output-names: 13 - - "xtal": External 52Mhz oscillator (required) 14 - - "audio_clk_in": Alternate audio reference clock (optional) 15 - - "enet_clk_in": Alternate ethernet PHY clock (optional) 16 - 17 - Core clock controller: 18 - ---------------------- 19 - 20 - The core clock controller generates clocks for the CPU, RPU (WiFi + BT 21 - co-processor), audio, and several peripherals. 22 - 23 - Required properties: 24 - - compatible: Must be "img,pistachio-clk". 25 - - reg: Must contain the base address and length of the core clock controller. 26 - - #clock-cells: Must be 1. The single cell is the clock identifier. 27 - See dt-bindings/clock/pistachio-clk.h for the list of valid identifiers. 28 - - clocks: Must contain an entry for each clock in clock-names. 29 - - clock-names: Must include "xtal" (see "External clocks") and 30 - "audio_clk_in_gate", "enet_clk_in_gate" which are generated by the 31 - top-level general control. 32 - 33 - Example: 34 - clk_core: clock-controller@18144000 { 35 - compatible = "img,pistachio-clk"; 36 - reg = <0x18144000 0x800>; 37 - clocks = <&xtal>, <&cr_top EXT_CLK_AUDIO_IN>, 38 - <&cr_top EXT_CLK_ENET_IN>; 39 - clock-names = "xtal", "audio_clk_in_gate", "enet_clk_in_gate"; 40 - 41 - #clock-cells = <1>; 42 - }; 43 - 44 - Peripheral clock controller: 45 - ---------------------------- 46 - 47 - The peripheral clock controller generates clocks for the DDR, ROM, and other 48 - peripherals. The peripheral system clock ("periph_sys") generated by the core 49 - clock controller is the input clock to the peripheral clock controller. 50 - 51 - Required properties: 52 - - compatible: Must be "img,pistachio-periph-clk". 53 - - reg: Must contain the base address and length of the peripheral clock 54 - controller. 55 - - #clock-cells: Must be 1. The single cell is the clock identifier. 56 - See dt-bindings/clock/pistachio-clk.h for the list of valid identifiers. 57 - - clocks: Must contain an entry for each clock in clock-names. 58 - - clock-names: Must include "periph_sys", the peripheral system clock generated 59 - by the core clock controller. 60 - 61 - Example: 62 - clk_periph: clock-controller@18144800 { 63 - compatible = "img,pistachio-clk-periph"; 64 - reg = <0x18144800 0x800>; 65 - clocks = <&clk_core CLK_PERIPH_SYS>; 66 - clock-names = "periph_sys"; 67 - 68 - #clock-cells = <1>; 69 - }; 70 - 71 - Peripheral general control: 72 - --------------------------- 73 - 74 - The peripheral general control block generates system interface clocks and 75 - resets for various peripherals. It also contains miscellaneous peripheral 76 - control registers. The system clock ("sys") generated by the peripheral clock 77 - controller is the input clock to the system clock controller. 78 - 79 - Required properties: 80 - - compatible: Must include "img,pistachio-periph-cr" and "syscon". 81 - - reg: Must contain the base address and length of the peripheral general 82 - control registers. 83 - - #clock-cells: Must be 1. The single cell is the clock identifier. 84 - See dt-bindings/clock/pistachio-clk.h for the list of valid identifiers. 85 - - clocks: Must contain an entry for each clock in clock-names. 86 - - clock-names: Must include "sys", the system clock generated by the peripheral 87 - clock controller. 88 - 89 - Example: 90 - cr_periph: syscon@18144800 { 91 - compatible = "img,pistachio-cr-periph", "syscon"; 92 - reg = <0x18148000 0x1000>; 93 - clocks = <&clock_periph PERIPH_CLK_PERIPH_SYS>; 94 - clock-names = "sys"; 95 - 96 - #clock-cells = <1>; 97 - }; 98 - 99 - Top-level general control: 100 - -------------------------- 101 - 102 - The top-level general control block contains miscellaneous control registers and 103 - gates for the external clocks "audio_clk_in" and "enet_clk_in". 104 - 105 - Required properties: 106 - - compatible: Must include "img,pistachio-cr-top" and "syscon". 107 - - reg: Must contain the base address and length of the top-level 108 - control registers. 109 - - clocks: Must contain an entry for each clock in clock-names. 110 - - clock-names: Two optional clocks, "audio_clk_in" and "enet_clk_in" (see 111 - "External clocks"). 112 - - #clock-cells: Must be 1. The single cell is the clock identifier. 113 - See dt-bindings/clock/pistachio-clk.h for the list of valid identifiers. 114 - 115 - Example: 116 - cr_top: syscon@18144800 { 117 - compatible = "img,pistachio-cr-top", "syscon"; 118 - reg = <0x18149000 0x200>; 119 - clocks = <&audio_refclk>, <&ext_enet_in>; 120 - clock-names = "audio_clk_in", "enet_clk_in"; 121 - 122 - #clock-cells = <1>; 123 - };
-33
Documentation/devicetree/bindings/clock/qca,ath79-pll.txt
··· 1 - Binding for Qualcomm Atheros AR7xxx/AR9XXX PLL controller 2 - 3 - The PPL controller provides the 3 main clocks of the SoC: CPU, DDR and AHB. 4 - 5 - Required Properties: 6 - - compatible: has to be "qca,<soctype>-pll" and one of the following 7 - fallbacks: 8 - - "qca,ar7100-pll" 9 - - "qca,ar7240-pll" 10 - - "qca,ar9130-pll" 11 - - "qca,ar9330-pll" 12 - - "qca,ar9340-pll" 13 - - "qca,qca9550-pll" 14 - - reg: Base address and size of the controllers memory area 15 - - clock-names: Name of the input clock, has to be "ref" 16 - - clocks: phandle of the external reference clock 17 - - #clock-cells: has to be one 18 - 19 - Optional properties: 20 - - clock-output-names: should be "cpu", "ddr", "ahb" 21 - 22 - Example: 23 - 24 - pll-controller@18050000 { 25 - compatible = "qca,ar9132-pll", "qca,ar9130-pll"; 26 - reg = <0x18050000 0x20>; 27 - 28 - clock-names = "ref"; 29 - clocks = <&extosc>; 30 - 31 - #clock-cells = <1>; 32 - clock-output-names = "cpu", "ddr", "ahb"; 33 - };
+70
Documentation/devicetree/bindings/clock/qca,ath79-pll.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/qca,ath79-pll.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm Atheros ATH79 PLL controller 8 + 9 + maintainers: 10 + - Alban Bedel <albeu@free.fr> 11 + - Antony Pavlov <antonynpavlov@gmail.com> 12 + 13 + description: > 14 + The PLL controller provides the 3 main clocks of the SoC: CPU, DDR and AHB. 15 + 16 + properties: 17 + compatible: 18 + oneOf: 19 + - items: 20 + - const: qca,ar9132-pll 21 + - const: qca,ar9130-pll 22 + - items: 23 + - enum: 24 + - qca,ar7100-pll 25 + - qca,ar7240-pll 26 + - qca,ar9130-pll 27 + - qca,ar9330-pll 28 + - qca,ar9340-pll 29 + - qca,qca9530-pll 30 + - qca,qca9550-pll 31 + - qca,qca9560-pll 32 + 33 + reg: 34 + maxItems: 1 35 + 36 + clock-names: 37 + items: 38 + - const: ref 39 + 40 + clocks: 41 + maxItems: 1 42 + 43 + '#clock-cells': 44 + const: 1 45 + 46 + clock-output-names: 47 + items: 48 + - const: cpu 49 + - const: ddr 50 + - const: ahb 51 + 52 + required: 53 + - compatible 54 + - reg 55 + - clock-names 56 + - clocks 57 + - '#clock-cells' 58 + 59 + additionalProperties: false 60 + 61 + examples: 62 + - | 63 + clock-controller@18050000 { 64 + compatible = "qca,ar9132-pll", "qca,ar9130-pll"; 65 + reg = <0x18050000 0x20>; 66 + clock-names = "ref"; 67 + clocks = <&extosc>; 68 + #clock-cells = <1>; 69 + clock-output-names = "cpu", "ddr", "ahb"; 70 + };
+1 -1
Documentation/devicetree/bindings/clock/qcom,camcc-sm8250.yaml
··· 13 13 Qualcomm camera clock control module provides the clocks, resets and 14 14 power domains on SM8250. 15 15 16 - See also:: include/dt-bindings/clock/qcom,camcc-sm8250.h 16 + See also: include/dt-bindings/clock/qcom,camcc-sm8250.h 17 17 18 18 allOf: 19 19 - $ref: qcom,gcc.yaml#
+1 -1
Documentation/devicetree/bindings/clock/qcom,dispcc-sm6125.yaml
··· 13 13 Qualcomm display clock control module provides the clocks and power domains 14 14 on SM6125. 15 15 16 - See also:: include/dt-bindings/clock/qcom,dispcc-sm6125.h 16 + See also: include/dt-bindings/clock/qcom,dispcc-sm6125.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,dispcc-sm6350.yaml
··· 13 13 Qualcomm display clock control module provides the clocks, resets and power 14 14 domains on SM6350. 15 15 16 - See also:: include/dt-bindings/clock/qcom,dispcc-sm6350.h 16 + See also: include/dt-bindings/clock/qcom,dispcc-sm6350.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-ipq4019.yaml
··· 15 15 Qualcomm global clock control module provides the clocks, resets and power 16 16 domains on IPQ4019. 17 17 18 - See also:: include/dt-bindings/clock/qcom,gcc-ipq4019.h 18 + See also: include/dt-bindings/clock/qcom,gcc-ipq4019.h 19 19 20 20 allOf: 21 21 - $ref: qcom,gcc.yaml#
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-ipq8074.yaml
··· 14 14 Qualcomm global clock control module provides the clocks, resets and power 15 15 domains on IPQ8074. 16 16 17 - See also:: include/dt-bindings/clock/qcom,gcc-ipq8074.h 17 + See also: include/dt-bindings/clock/qcom,gcc-ipq8074.h 18 18 19 19 allOf: 20 20 - $ref: qcom,gcc.yaml#
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-msm8976.yaml
··· 14 14 Qualcomm global clock control module provides the clocks, resets and power 15 15 domains on MSM8976. 16 16 17 - See also:: include/dt-bindings/clock/qcom,gcc-msm8976.h 17 + See also: include/dt-bindings/clock/qcom,gcc-msm8976.h 18 18 19 19 properties: 20 20 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-msm8994.yaml
··· 13 13 Qualcomm global clock control module provides the clocks, resets and power 14 14 domains on MSM8994 and MSM8992. 15 15 16 - See also:: include/dt-bindings/clock/qcom,gcc-msm8994.h 16 + See also: include/dt-bindings/clock/qcom,gcc-msm8994.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-msm8996.yaml
··· 14 14 Qualcomm global clock control module which provides the clocks, resets and 15 15 power domains on MSM8996. 16 16 17 - See also:: include/dt-bindings/clock/qcom,gcc-msm8996.h 17 + See also: include/dt-bindings/clock/qcom,gcc-msm8996.h 18 18 19 19 properties: 20 20 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-msm8998.yaml
··· 14 14 Qualcomm global clock control module provides the clocks, resets and power 15 15 domains on MSM8998. 16 16 17 - See also:: include/dt-bindings/clock/qcom,gcc-msm8998.h 17 + See also: include/dt-bindings/clock/qcom,gcc-msm8998.h 18 18 19 19 properties: 20 20 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-qcm2290.yaml
··· 13 13 Qualcomm global clock control module provides the clocks, resets and power 14 14 domains on QCM2290. 15 15 16 - See also:: include/dt-bindings/clock/qcom,gcc-qcm2290.h 16 + See also: include/dt-bindings/clock/qcom,gcc-qcm2290.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-qcs404.yaml
··· 14 14 Qualcomm global clock control module provides the clocks, resets and power 15 15 domains on QCS404. 16 16 17 - See also:: include/dt-bindings/clock/qcom,gcc-qcs404.h 17 + See also: include/dt-bindings/clock/qcom,gcc-qcs404.h 18 18 19 19 properties: 20 20 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-sc7180.yaml
··· 14 14 Qualcomm global clock control module provides the clocks, resets and power 15 15 domains on SC7180. 16 16 17 - See also:: include/dt-bindings/clock/qcom,gcc-sc7180.h 17 + See also: include/dt-bindings/clock/qcom,gcc-sc7180.h 18 18 19 19 properties: 20 20 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-sc7280.yaml
··· 13 13 Qualcomm global clock control module provides the clocks, resets and power 14 14 domains on SC7280. 15 15 16 - See also:: include/dt-bindings/clock/qcom,gcc-sc7280.h 16 + See also: include/dt-bindings/clock/qcom,gcc-sc7280.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-sc8180x.yaml
··· 13 13 Qualcomm global clock control module provides the clocks, resets and power 14 14 domains on SC8180x. 15 15 16 - See also:: include/dt-bindings/clock/qcom,gcc-sc8180x.h 16 + See also: include/dt-bindings/clock/qcom,gcc-sc8180x.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-sc8280xp.yaml
··· 13 13 Qualcomm global clock control module provides the clocks, resets and 14 14 power domains on SC8280xp. 15 15 16 - See also:: include/dt-bindings/clock/qcom,gcc-sc8280xp.h 16 + See also: include/dt-bindings/clock/qcom,gcc-sc8280xp.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-sdm845.yaml
··· 14 14 Qualcomm global clock control module provides the clocks, resets and power 15 15 domains on SDM670 and SDM845 16 16 17 - See also:: include/dt-bindings/clock/qcom,gcc-sdm845.h 17 + See also: include/dt-bindings/clock/qcom,gcc-sdm845.h 18 18 19 19 properties: 20 20 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-sdx55.yaml
··· 14 14 Qualcomm global clock control module provides the clocks, resets and 15 15 power domains on SDX55 16 16 17 - See also:: include/dt-bindings/clock/qcom,gcc-sdx55.h 17 + See also: include/dt-bindings/clock/qcom,gcc-sdx55.h 18 18 19 19 properties: 20 20 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-sdx65.yaml
··· 13 13 Qualcomm global clock control module provides the clocks, resets and power 14 14 domains on SDX65 15 15 16 - See also:: include/dt-bindings/clock/qcom,gcc-sdx65.h 16 + See also: include/dt-bindings/clock/qcom,gcc-sdx65.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-sm6115.yaml
··· 13 13 Qualcomm global clock control module provides the clocks, resets and power 14 14 domains on SM4250/6115. 15 15 16 - See also:: include/dt-bindings/clock/qcom,gcc-sm6115.h 16 + See also: include/dt-bindings/clock/qcom,gcc-sm6115.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-sm6125.yaml
··· 13 13 Qualcomm global clock control module provides the clocks, resets and power 14 14 domains on SM6125. 15 15 16 - See also:: include/dt-bindings/clock/qcom,gcc-sm6125.h 16 + See also: include/dt-bindings/clock/qcom,gcc-sm6125.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-sm6350.yaml
··· 13 13 Qualcomm global clock control module provides the clocks, resets and power 14 14 domains on SM6350. 15 15 16 - See also:: include/dt-bindings/clock/qcom,gcc-sm6350.h 16 + See also: include/dt-bindings/clock/qcom,gcc-sm6350.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-sm8150.yaml
··· 14 14 Qualcomm global clock control module provides the clocks, resets and power 15 15 domains on SM8150. 16 16 17 - See also:: include/dt-bindings/clock/qcom,gcc-sm8150.h 17 + See also: include/dt-bindings/clock/qcom,gcc-sm8150.h 18 18 19 19 properties: 20 20 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-sm8250.yaml
··· 14 14 Qualcomm global clock control module provides the clocks, resets and power 15 15 domains on SM8250. 16 16 17 - See also:: include/dt-bindings/clock/qcom,gcc-sm8250.h 17 + See also: include/dt-bindings/clock/qcom,gcc-sm8250.h 18 18 19 19 properties: 20 20 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-sm8350.yaml
··· 13 13 Qualcomm global clock control module provides the clocks, resets and power 14 14 domains on SM8350. 15 15 16 - See also:: include/dt-bindings/clock/qcom,gcc-sm8350.h 16 + See also: include/dt-bindings/clock/qcom,gcc-sm8350.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,gcc-sm8450.yaml
··· 13 13 Qualcomm global clock control module provides the clocks, resets and power 14 14 domains on SM8450 15 15 16 - See also:: include/dt-bindings/clock/qcom,gcc-sm8450.h 16 + See also: include/dt-bindings/clock/qcom,gcc-sm8450.h 17 17 18 18 properties: 19 19 compatible:
-34
Documentation/devicetree/bindings/clock/qcom,krait-cc.txt
··· 1 - Krait Clock Controller 2 - 3 - PROPERTIES 4 - 5 - - compatible: 6 - Usage: required 7 - Value type: <string> 8 - Definition: must be one of: 9 - "qcom,krait-cc-v1" 10 - "qcom,krait-cc-v2" 11 - 12 - - #clock-cells: 13 - Usage: required 14 - Value type: <u32> 15 - Definition: must be 1 16 - 17 - - clocks: 18 - Usage: required 19 - Value type: <prop-encoded-array> 20 - Definition: reference to the clock parents of hfpll, secondary muxes. 21 - 22 - - clock-names: 23 - Usage: required 24 - Value type: <stringlist> 25 - Definition: must be "hfpll0", "hfpll1", "acpu0_aux", "acpu1_aux", "qsb". 26 - 27 - Example: 28 - 29 - kraitcc: clock-controller { 30 - compatible = "qcom,krait-cc-v1"; 31 - clocks = <&hfpll0>, <&hfpll1>, <&acpu0_aux>, <&acpu1_aux>, <qsb>; 32 - clock-names = "hfpll0", "hfpll1", "acpu0_aux", "acpu1_aux", "qsb"; 33 - #clock-cells = <1>; 34 - };
+43
Documentation/devicetree/bindings/clock/qcom,krait-cc.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/qcom,krait-cc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Krait Clock Controller 8 + 9 + maintainers: 10 + - Stephen Boyd <sboyd@kernel.org> 11 + 12 + properties: 13 + compatible: 14 + enum: 15 + - qcom,krait-cc-v1 16 + - qcom,krait-cc-v2 17 + 18 + '#clock-cells': 19 + const: 1 20 + 21 + clocks: 22 + items: 23 + - description: Parent clock phandle for hfpll0 24 + - description: Parent clock phandle for hfpll1 25 + - description: Parent clock phandle for acpu0_aux 26 + - description: Parent clock phandle for acpu1_aux 27 + - description: Parent clock phandle for qsb 28 + 29 + clock-names: 30 + items: 31 + - const: hfpll0 32 + - const: hfpll1 33 + - const: acpu0_aux 34 + - const: acpu1_aux 35 + - const: qsb 36 + 37 + required: 38 + - compatible 39 + - '#clock-cells' 40 + - clocks 41 + - clock-names 42 + 43 + additionalProperties: false
+1 -1
Documentation/devicetree/bindings/clock/qcom,msm8998-gpucc.yaml
··· 13 13 Qualcomm graphics clock control module provides the clocks, resets and power 14 14 domains on MSM8998. 15 15 16 - See also:: include/dt-bindings/clock/qcom,gpucc-msm8998.h 16 + See also: include/dt-bindings/clock/qcom,gpucc-msm8998.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,qcm2290-dispcc.yaml
··· 13 13 Qualcomm display clock control module provides the clocks, resets and power 14 14 domains on qcm2290. 15 15 16 - See also:: include/dt-bindings/clock/qcom,dispcc-qcm2290.h 16 + See also: include/dt-bindings/clock/qcom,dispcc-qcm2290.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,qdu1000-ecpricc.yaml
··· 14 14 Qualcomm ECPRI Specification V2.0 Common Public Radio Interface clock control 15 15 module which supports the clocks, resets on QDU1000 and QRU1000 16 16 17 - See also:: include/dt-bindings/clock/qcom,qdu1000-ecpricc.h 17 + See also: include/dt-bindings/clock/qcom,qdu1000-ecpricc.h 18 18 19 19 properties: 20 20 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,qdu1000-gcc.yaml
··· 14 14 Qualcomm global clock control module which supports the clocks, resets and 15 15 power domains on QDU1000 and QRU1000 16 16 17 - See also:: include/dt-bindings/clock/qcom,qdu1000-gcc.h 17 + See also: include/dt-bindings/clock/qcom,qdu1000-gcc.h 18 18 19 19 properties: 20 20 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sa8775p-gcc.yaml
··· 13 13 Qualcomm global clock control module provides the clocks, resets and 14 14 power domains on sa8775p. 15 15 16 - See also:: include/dt-bindings/clock/qcom,sa8775p-gcc.h 16 + See also: include/dt-bindings/clock/qcom,sa8775p-gcc.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sc7180-camcc.yaml
··· 13 13 Qualcomm camera clock control module provides the clocks, resets and power 14 14 domains on SC7180. 15 15 16 - See also:: include/dt-bindings/clock/qcom,camcc-sc7180.h 16 + See also: include/dt-bindings/clock/qcom,camcc-sc7180.h 17 17 18 18 allOf: 19 19 - $ref: qcom,gcc.yaml#
+1 -1
Documentation/devicetree/bindings/clock/qcom,sc7180-dispcc.yaml
··· 13 13 Qualcomm display clock control module provides the clocks, resets and power 14 14 domains on SC7180. 15 15 16 - See also:: include/dt-bindings/clock/qcom,dispcc-sc7180.h 16 + See also: include/dt-bindings/clock/qcom,dispcc-sc7180.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sc7180-lpasscorecc.yaml
··· 13 13 Qualcomm LPASS core clock control module provides the clocks and power 14 14 domains on SC7180. 15 15 16 - See also:: include/dt-bindings/clock/qcom,lpasscorecc-sc7180.h 16 + See also: include/dt-bindings/clock/qcom,lpasscorecc-sc7180.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sc7280-camcc.yaml
··· 13 13 Qualcomm camera clock control module provides the clocks, resets and 14 14 power domains on SC7280. 15 15 16 - See also:: include/dt-bindings/clock/qcom,camcc-sc7280.h 16 + See also: include/dt-bindings/clock/qcom,camcc-sc7280.h 17 17 18 18 allOf: 19 19 - $ref: qcom,gcc.yaml#
+1 -1
Documentation/devicetree/bindings/clock/qcom,sc7280-dispcc.yaml
··· 13 13 Qualcomm display clock control module provides the clocks, resets and power 14 14 domains on SC7280. 15 15 16 - See also:: include/dt-bindings/clock/qcom,dispcc-sc7280.h 16 + See also: include/dt-bindings/clock/qcom,dispcc-sc7280.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sc7280-lpasscc.yaml
··· 13 13 Qualcomm LPASS core clock control module provides the clocks and power 14 14 domains on SC7280. 15 15 16 - See also:: include/dt-bindings/clock/qcom,lpass-sc7280.h 16 + See also: include/dt-bindings/clock/qcom,lpass-sc7280.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sdm845-camcc.yaml
··· 13 13 Qualcomm camera clock control module provides the clocks, resets and power 14 14 domains on SDM845. 15 15 16 - See also:: include/dt-bindings/clock/qcom,camcc-sm845.h 16 + See also: include/dt-bindings/clock/qcom,camcc-sm845.h 17 17 18 18 allOf: 19 19 - $ref: qcom,gcc.yaml#
+1 -1
Documentation/devicetree/bindings/clock/qcom,sdm845-dispcc.yaml
··· 13 13 Qualcomm display clock control module provides the clocks, resets and power 14 14 domains on SDM845. 15 15 16 - See also:: include/dt-bindings/clock/qcom,dispcc-sdm845.h 16 + See also: include/dt-bindings/clock/qcom,dispcc-sdm845.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sdm845-lpasscc.yaml
··· 12 12 description: | 13 13 Qualcomm SDM845 LPASS (Low Power Audio SubSystem) Clock Controller. 14 14 15 - See also:: include/dt-bindings/clock/qcom,lpass-sdm845.h 15 + See also: include/dt-bindings/clock/qcom,lpass-sdm845.h 16 16 17 17 properties: 18 18 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sdx75-gcc.yaml
··· 14 14 Qualcomm global clock control module provides the clocks, resets and power 15 15 domains on SDX75 16 16 17 - See also:: include/dt-bindings/clock/qcom,sdx75-gcc.h 17 + See also: include/dt-bindings/clock/qcom,sdx75-gcc.h 18 18 19 19 properties: 20 20 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sm4450-camcc.yaml
··· 14 14 Qualcomm camera clock control module provides the clocks, resets and power 15 15 domains on SM4450 16 16 17 - See also:: include/dt-bindings/clock/qcom,sm4450-camcc.h 17 + See also: include/dt-bindings/clock/qcom,sm4450-camcc.h 18 18 19 19 properties: 20 20 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sm4450-dispcc.yaml
··· 14 14 Qualcomm display clock control module provides the clocks, resets and power 15 15 domains on SM4450 16 16 17 - See also:: include/dt-bindings/clock/qcom,sm4450-dispcc.h 17 + See also: include/dt-bindings/clock/qcom,sm4450-dispcc.h 18 18 19 19 properties: 20 20 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sm4450-gcc.yaml
··· 14 14 Qualcomm global clock control module provides the clocks, resets and power 15 15 domains on SM4450 16 16 17 - See also:: include/dt-bindings/clock/qcom,sm4450-gcc.h 17 + See also: include/dt-bindings/clock/qcom,sm4450-gcc.h 18 18 19 19 properties: 20 20 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sm6115-dispcc.yaml
··· 13 13 Qualcomm display clock control module provides the clocks and power domains 14 14 on SM6115. 15 15 16 - See also:: include/dt-bindings/clock/qcom,sm6115-dispcc.h 16 + See also: include/dt-bindings/clock/qcom,sm6115-dispcc.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sm6115-gpucc.yaml
··· 13 13 Qualcomm graphics clock control module provides clocks, resets and power 14 14 domains on Qualcomm SoCs. 15 15 16 - See also:: include/dt-bindings/clock/qcom,sm6115-gpucc.h 16 + See also: include/dt-bindings/clock/qcom,sm6115-gpucc.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sm6125-gpucc.yaml
··· 13 13 Qualcomm graphics clock control module provides clocks and power domains on 14 14 Qualcomm SoCs. 15 15 16 - See also:: include/dt-bindings/clock/qcom,sm6125-gpucc.h 16 + See also: include/dt-bindings/clock/qcom,sm6125-gpucc.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sm6350-camcc.yaml
··· 13 13 Qualcomm camera clock control module provides the clocks, resets and power 14 14 domains on SM6350. 15 15 16 - See also:: include/dt-bindings/clock/qcom,sm6350-camcc.h 16 + See also: include/dt-bindings/clock/qcom,sm6350-camcc.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sm6375-dispcc.yaml
··· 13 13 Qualcomm display clock control module provides the clocks, resets and power 14 14 domains on SM6375. 15 15 16 - See also:: include/dt-bindings/clock/qcom,dispcc-sm6375.h 16 + See also: include/dt-bindings/clock/qcom,dispcc-sm6375.h 17 17 18 18 allOf: 19 19 - $ref: qcom,gcc.yaml#
+1 -1
Documentation/devicetree/bindings/clock/qcom,sm6375-gcc.yaml
··· 13 13 Qualcomm global clock control module provides the clocks, resets and power 14 14 domains on SM6375 15 15 16 - See also:: include/dt-bindings/clock/qcom,sm6375-gcc.h 16 + See also: include/dt-bindings/clock/qcom,sm6375-gcc.h 17 17 18 18 allOf: 19 19 - $ref: qcom,gcc.yaml#
+1 -1
Documentation/devicetree/bindings/clock/qcom,sm6375-gpucc.yaml
··· 13 13 Qualcomm graphics clock control module provides clocks, resets and power 14 14 domains on Qualcomm SoCs. 15 15 16 - See also:: include/dt-bindings/clock/qcom,sm6375-gpucc.h 16 + See also: include/dt-bindings/clock/qcom,sm6375-gpucc.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sm7150-camcc.yaml
··· 15 15 Qualcomm camera clock control module provides the clocks, resets and power 16 16 domains on SM7150. 17 17 18 - See also:: include/dt-bindings/clock/qcom,sm7150-camcc.h 18 + See also: include/dt-bindings/clock/qcom,sm7150-camcc.h 19 19 20 20 properties: 21 21 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sm7150-dispcc.yaml
··· 15 15 Qualcomm display clock control module provides the clocks, resets and power 16 16 domains on SM7150. 17 17 18 - See also:: include/dt-bindings/clock/qcom,sm7150-dispcc.h 18 + See also: include/dt-bindings/clock/qcom,sm7150-dispcc.h 19 19 20 20 properties: 21 21 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sm7150-gcc.yaml
··· 15 15 Qualcomm global clock control module provides the clocks, resets and power 16 16 domains on SM7150 17 17 18 - See also:: include/dt-bindings/clock/qcom,sm7150-gcc.h 18 + See also: include/dt-bindings/clock/qcom,sm7150-gcc.h 19 19 20 20 properties: 21 21 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sm7150-videocc.yaml
··· 15 15 Qualcomm video clock control module provides the clocks, resets and power 16 16 domains on SM7150. 17 17 18 - See also:: include/dt-bindings/clock/qcom,videocc-sm7150.h 18 + See also: include/dt-bindings/clock/qcom,videocc-sm7150.h 19 19 20 20 properties: 21 21 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sm8150-camcc.yaml
··· 13 13 Qualcomm camera clock control module provides the clocks, resets and 14 14 power domains on SM8150. 15 15 16 - See also:: include/dt-bindings/clock/qcom,sm8150-camcc.h 16 + See also: include/dt-bindings/clock/qcom,sm8150-camcc.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sm8450-dispcc.yaml
··· 13 13 Qualcomm display clock control module provides the clocks, resets and power 14 14 domains on SM8450. 15 15 16 - See also:: include/dt-bindings/clock/qcom,sm8450-dispcc.h 16 + See also: include/dt-bindings/clock/qcom,sm8450-dispcc.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sm8550-gcc.yaml
··· 13 13 Qualcomm global clock control module provides the clocks, resets and power 14 14 domains on SM8550 15 15 16 - See also:: include/dt-bindings/clock/qcom,sm8550-gcc.h 16 + See also: include/dt-bindings/clock/qcom,sm8550-gcc.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,sm8650-gcc.yaml
··· 13 13 Qualcomm global clock control module provides the clocks, resets and power 14 14 domains on SM8650 15 15 16 - See also:: include/dt-bindings/clock/qcom,sm8650-gcc.h 16 + See also: include/dt-bindings/clock/qcom,sm8650-gcc.h 17 17 18 18 properties: 19 19 compatible:
+1 -1
Documentation/devicetree/bindings/clock/qcom,x1e80100-gcc.yaml
··· 13 13 Qualcomm global clock control module provides the clocks, resets and power 14 14 domains on X1E80100 15 15 16 - See also:: include/dt-bindings/clock/qcom,x1e80100-gcc.h 16 + See also: include/dt-bindings/clock/qcom,x1e80100-gcc.h 17 17 18 18 properties: 19 19 compatible:
-37
Documentation/devicetree/bindings/clock/ti/autoidle.txt
··· 1 - Binding for Texas Instruments autoidle clock. 2 - 3 - This binding uses the common clock binding[1]. It assumes a register mapped 4 - clock which can be put to idle automatically by hardware based on the usage 5 - and a configuration bit setting. Autoidle clock is never an individual 6 - clock, it is always a derivative of some basic clock like a gate, divider, 7 - or fixed-factor. 8 - 9 - [1] Documentation/devicetree/bindings/clock/clock-bindings.txt 10 - 11 - Required properties: 12 - - reg : offset for the register controlling the autoidle 13 - - ti,autoidle-shift : bit shift of the autoidle enable bit 14 - - ti,invert-autoidle-bit : autoidle is enabled by setting the bit to 0 15 - 16 - Examples: 17 - dpll_core_m4_ck: dpll_core_m4_ck { 18 - #clock-cells = <0>; 19 - compatible = "ti,divider-clock"; 20 - clocks = <&dpll_core_x2_ck>; 21 - ti,max-div = <31>; 22 - ti,autoidle-shift = <8>; 23 - reg = <0x2d38>; 24 - ti,index-starts-at-one; 25 - ti,invert-autoidle-bit; 26 - }; 27 - 28 - dpll_usb_clkdcoldo_ck: dpll_usb_clkdcoldo_ck { 29 - #clock-cells = <0>; 30 - compatible = "ti,fixed-factor-clock"; 31 - clocks = <&dpll_usb_ck>; 32 - ti,clock-div = <1>; 33 - ti,autoidle-shift = <8>; 34 - reg = <0x01b4>; 35 - ti,clock-mult = <1>; 36 - ti,invert-autoidle-bit; 37 - };
-42
Documentation/devicetree/bindings/clock/ti/fixed-factor-clock.txt
··· 1 - Binding for TI fixed factor rate clock sources. 2 - 3 - This binding uses the common clock binding[1], and also uses the autoidle 4 - support from TI autoidle clock [2]. 5 - 6 - [1] Documentation/devicetree/bindings/clock/clock-bindings.txt 7 - [2] Documentation/devicetree/bindings/clock/ti/autoidle.txt 8 - 9 - Required properties: 10 - - compatible : shall be "ti,fixed-factor-clock". 11 - - #clock-cells : from common clock binding; shall be set to 0. 12 - - ti,clock-div: fixed divider. 13 - - ti,clock-mult: fixed multiplier. 14 - - clocks: parent clock. 15 - 16 - Optional properties: 17 - - clock-output-names : from common clock binding. 18 - - ti,autoidle-shift: bit shift of the autoidle enable bit for the clock, 19 - see [2] 20 - - reg: offset for the autoidle register of this clock, see [2] 21 - - ti,invert-autoidle-bit: autoidle is enabled by setting the bit to 0, see [2] 22 - - ti,set-rate-parent: clk_set_rate is propagated to parent 23 - 24 - Example: 25 - clock { 26 - compatible = "ti,fixed-factor-clock"; 27 - clocks = <&parentclk>; 28 - #clock-cells = <0>; 29 - ti,clock-div = <2>; 30 - ti,clock-mult = <1>; 31 - }; 32 - 33 - dpll_usb_clkdcoldo_ck: dpll_usb_clkdcoldo_ck { 34 - #clock-cells = <0>; 35 - compatible = "ti,fixed-factor-clock"; 36 - clocks = <&dpll_usb_ck>; 37 - ti,clock-div = <1>; 38 - ti,autoidle-shift = <8>; 39 - reg = <0x01b4>; 40 - ti,clock-mult = <1>; 41 - ti,invert-autoidle-bit; 42 - };
+34
Documentation/devicetree/bindings/clock/ti/ti,autoidle.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/ti/ti,autoidle.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: TI autoidle clock 8 + 9 + maintainers: 10 + - Tero Kristo <kristo@kernel.org> 11 + - Sukrut Bellary <sbellary@baylibre.com> 12 + 13 + description: 14 + Some clocks in TI SoC support the autoidle feature. These properties are 15 + applicable only if the clock supports autoidle feature. It assumes a register 16 + mapped clock which can be put to idle automatically by hardware based on 17 + usage and configuration bit setting. Autoidle clock is never an individual 18 + clock, it is always a derivative of some basic clock like a gate, divider, or 19 + fixed-factor. 20 + 21 + properties: 22 + ti,autoidle-shift: 23 + $ref: /schemas/types.yaml#/definitions/uint32 24 + description: 25 + bit shift of the autoidle enable bit for the clock 26 + maximum: 31 27 + default: 0 28 + 29 + ti,invert-autoidle-bit: 30 + type: boolean 31 + description: 32 + autoidle is enabled by setting the bit to 0 33 + 34 + additionalProperties: true
+4 -18
Documentation/devicetree/bindings/clock/ti/ti,divider-clock.yaml
··· 55 55 is missing it is the same as supplying a zero shift. 56 56 57 57 This binding can also optionally provide support to the hardware autoidle 58 - feature, see [1]. 58 + feature. 59 59 60 - [1] Documentation/devicetree/bindings/clock/ti/autoidle.txt 60 + allOf: 61 + - $ref: ti,autoidle.yaml# 61 62 62 63 properties: 63 64 compatible: ··· 98 97 minimum: 1 99 98 default: 1 100 99 101 - 102 100 ti,max-div: 103 101 $ref: /schemas/types.yaml#/definitions/uint32 104 102 description: ··· 115 115 description: 116 116 valid divisor programming must be a power of two, 117 117 only valid if ti,dividers is not defined. 118 - 119 - ti,autoidle-shift: 120 - $ref: /schemas/types.yaml#/definitions/uint32 121 - description: 122 - bit shift of the autoidle enable bit for the clock, 123 - see [1]. 124 - maximum: 31 125 - default: 0 126 - 127 - ti,invert-autoidle-bit: 128 - type: boolean 129 - description: 130 - autoidle is enabled by setting the bit to 0, 131 - see [1] 132 118 133 119 ti,set-rate-parent: 134 120 type: boolean ··· 142 156 - clocks 143 157 - reg 144 158 145 - additionalProperties: false 159 + unevaluatedProperties: false 146 160 147 161 examples: 148 162 - |
+76
Documentation/devicetree/bindings/clock/ti/ti,fixed-factor-clock.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/ti/ti,fixed-factor-clock.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: TI fixed factor rate clock sources 8 + 9 + maintainers: 10 + - Tero Kristo <kristo@kernel.org> 11 + - Sukrut Bellary <sbellary@baylibre.com> 12 + 13 + description: 14 + This consists of a divider and a multiplier used to generate a fixed rate 15 + clock. This also uses the autoidle support from TI autoidle clock. 16 + 17 + allOf: 18 + - $ref: ti,autoidle.yaml# 19 + 20 + properties: 21 + compatible: 22 + const: ti,fixed-factor-clock 23 + 24 + "#clock-cells": 25 + const: 0 26 + 27 + reg: 28 + maxItems: 1 29 + 30 + ti,clock-div: 31 + $ref: /schemas/types.yaml#/definitions/uint32 32 + description: Fixed divider 33 + minimum: 1 34 + 35 + ti,clock-mult: 36 + $ref: /schemas/types.yaml#/definitions/uint32 37 + description: Fixed multiplier 38 + minimum: 1 39 + 40 + clocks: 41 + maxItems: 1 42 + 43 + clock-output-names: 44 + maxItems: 1 45 + 46 + ti,set-rate-parent: 47 + description: 48 + Propagate to parent clock 49 + type: boolean 50 + 51 + required: 52 + - compatible 53 + - clocks 54 + - "#clock-cells" 55 + - ti,clock-mult 56 + - ti,clock-div 57 + 58 + unevaluatedProperties: false 59 + 60 + examples: 61 + - | 62 + bus{ 63 + #address-cells = <1>; 64 + #size-cells = <0>; 65 + 66 + clock@1b4 { 67 + compatible = "ti,fixed-factor-clock"; 68 + reg = <0x1b4>; 69 + clocks = <&dpll_usb_ck>; 70 + #clock-cells = <0>; 71 + ti,clock-mult = <1>; 72 + ti,clock-div = <1>; 73 + ti,autoidle-shift = <8>; 74 + ti,invert-autoidle-bit; 75 + }; 76 + };
-131
Documentation/devicetree/bindings/clock/xgene.txt
··· 1 - Device Tree Clock bindings for APM X-Gene 2 - 3 - This binding uses the common clock binding[1]. 4 - 5 - [1] Documentation/devicetree/bindings/clock/clock-bindings.txt 6 - 7 - Required properties: 8 - - compatible : shall be one of the following: 9 - "apm,xgene-socpll-clock" - for a X-Gene SoC PLL clock 10 - "apm,xgene-pcppll-clock" - for a X-Gene PCP PLL clock 11 - "apm,xgene-pmd-clock" - for a X-Gene PMD clock 12 - "apm,xgene-device-clock" - for a X-Gene device clock 13 - "apm,xgene-socpll-v2-clock" - for a X-Gene SoC PLL v2 clock 14 - "apm,xgene-pcppll-v2-clock" - for a X-Gene PCP PLL v2 clock 15 - 16 - Required properties for SoC or PCP PLL clocks: 17 - - reg : shall be the physical PLL register address for the pll clock. 18 - - clocks : shall be the input parent clock phandle for the clock. This should 19 - be the reference clock. 20 - - #clock-cells : shall be set to 1. 21 - - clock-output-names : shall be the name of the PLL referenced by derive 22 - clock. 23 - Optional properties for PLL clocks: 24 - - clock-names : shall be the name of the PLL. If missing, use the device name. 25 - 26 - Required properties for PMD clocks: 27 - - reg : shall be the physical register address for the pmd clock. 28 - - clocks : shall be the input parent clock phandle for the clock. 29 - - #clock-cells : shall be set to 1. 30 - - clock-output-names : shall be the name of the clock referenced by derive 31 - clock. 32 - Optional properties for PLL clocks: 33 - - clock-names : shall be the name of the clock. If missing, use the device name. 34 - 35 - Required properties for device clocks: 36 - - reg : shall be a list of address and length pairs describing the CSR 37 - reset and/or the divider. Either may be omitted, but at least 38 - one must be present. 39 - - reg-names : shall be a string list describing the reg resource. This 40 - may include "csr-reg" and/or "div-reg". If this property 41 - is not present, the reg property is assumed to describe 42 - only "csr-reg". 43 - - clocks : shall be the input parent clock phandle for the clock. 44 - - #clock-cells : shall be set to 1. 45 - - clock-output-names : shall be the name of the device referenced. 46 - Optional properties for device clocks: 47 - - clock-names : shall be the name of the device clock. If missing, use the 48 - device name. 49 - - csr-offset : Offset to the CSR reset register from the reset address base. 50 - Default is 0. 51 - - csr-mask : CSR reset mask bit. Default is 0xF. 52 - - enable-offset : Offset to the enable register from the reset address base. 53 - Default is 0x8. 54 - - enable-mask : CSR enable mask bit. Default is 0xF. 55 - - divider-offset : Offset to the divider CSR register from the divider base. 56 - Default is 0x0. 57 - - divider-width : Width of the divider register. Default is 0. 58 - - divider-shift : Bit shift of the divider register. Default is 0. 59 - 60 - For example: 61 - 62 - pcppll: pcppll@17000100 { 63 - compatible = "apm,xgene-pcppll-clock"; 64 - #clock-cells = <1>; 65 - clocks = <&refclk 0>; 66 - clock-names = "pcppll"; 67 - reg = <0x0 0x17000100 0x0 0x1000>; 68 - clock-output-names = "pcppll"; 69 - type = <0>; 70 - }; 71 - 72 - pmd0clk: pmd0clk@7e200200 { 73 - compatible = "apm,xgene-pmd-clock"; 74 - #clock-cells = <1>; 75 - clocks = <&pmdpll 0>; 76 - reg = <0x0 0x7e200200 0x0 0x10>; 77 - clock-output-names = "pmd0clk"; 78 - }; 79 - 80 - socpll: socpll@17000120 { 81 - compatible = "apm,xgene-socpll-clock"; 82 - #clock-cells = <1>; 83 - clocks = <&refclk 0>; 84 - clock-names = "socpll"; 85 - reg = <0x0 0x17000120 0x0 0x1000>; 86 - clock-output-names = "socpll"; 87 - type = <1>; 88 - }; 89 - 90 - qmlclk: qmlclk { 91 - compatible = "apm,xgene-device-clock"; 92 - #clock-cells = <1>; 93 - clocks = <&socplldiv2 0>; 94 - clock-names = "qmlclk"; 95 - reg = <0x0 0x1703C000 0x0 0x1000>; 96 - reg-name = "csr-reg"; 97 - clock-output-names = "qmlclk"; 98 - }; 99 - 100 - ethclk: ethclk { 101 - compatible = "apm,xgene-device-clock"; 102 - #clock-cells = <1>; 103 - clocks = <&socplldiv2 0>; 104 - clock-names = "ethclk"; 105 - reg = <0x0 0x17000000 0x0 0x1000>; 106 - reg-names = "div-reg"; 107 - divider-offset = <0x238>; 108 - divider-width = <0x9>; 109 - divider-shift = <0x0>; 110 - clock-output-names = "ethclk"; 111 - }; 112 - 113 - apbclk: apbclk { 114 - compatible = "apm,xgene-device-clock"; 115 - #clock-cells = <1>; 116 - clocks = <&ahbclk 0>; 117 - clock-names = "apbclk"; 118 - reg = <0x0 0x1F2AC000 0x0 0x1000 119 - 0x0 0x1F2AC000 0x0 0x1000>; 120 - reg-names = "csr-reg", "div-reg"; 121 - csr-offset = <0x0>; 122 - csr-mask = <0x200>; 123 - enable-offset = <0x8>; 124 - enable-mask = <0x200>; 125 - divider-offset = <0x10>; 126 - divider-width = <0x2>; 127 - divider-shift = <0x0>; 128 - flags = <0x8>; 129 - clock-output-names = "apbclk"; 130 - }; 131 -
+2 -1
MAINTAINERS
··· 2884 2884 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 2885 2885 S: Odd Fixes 2886 2886 F: Documentation/devicetree/bindings/arm/moxart.yaml 2887 - F: Documentation/devicetree/bindings/clock/moxa,moxart-clock.txt 2887 + F: Documentation/devicetree/bindings/clock/moxa,moxart-clock.yaml 2888 2888 F: arch/arm/boot/dts/moxa/ 2889 2889 F: drivers/clk/clk-moxart.c 2890 2890 ··· 5980 5980 F: include/linux/clk-pr* 5981 5981 F: include/linux/clk/ 5982 5982 F: include/linux/of_clk.h 5983 + F: scripts/gdb/linux/clk.py 5983 5984 F: rust/helpers/clk.c 5984 5985 F: rust/kernel/clk.rs 5985 5986 X: drivers/clk/clkdev.c
-1
drivers/clk/Kconfig
··· 61 61 config COMMON_CLK_APPLE_NCO 62 62 tristate "Clock driver for Apple SoC NCOs" 63 63 depends on ARCH_APPLE || COMPILE_TEST 64 - default ARCH_APPLE 65 64 help 66 65 This driver supports NCO (Numerically Controlled Oscillator) blocks 67 66 found on Apple SoCs such as t8103 (M1). The blocks are typically
+1
drivers/clk/Makefile
··· 18 18 kunit_clk_assigned_rates_without_consumer.dtbo.o \ 19 19 kunit_clk_assigned_rates_zero.dtbo.o \ 20 20 kunit_clk_assigned_rates_zero_consumer.dtbo.o \ 21 + kunit_clk_hw_get_dev_of_node.dtbo.o \ 21 22 kunit_clk_parent_data_test.dtbo.o 22 23 obj-$(CONFIG_COMMON_CLK) += clk-divider.o 23 24 obj-$(CONFIG_COMMON_CLK) += clk-fixed-factor.o
+1 -1
drivers/clk/baikal-t1/clk-ccu-div.c
··· 405 405 { 406 406 int idx; 407 407 408 - /* Uninstall only the clocks registered on the specfied stage */ 408 + /* Uninstall only the clocks registered on the specified stage */ 409 409 for (idx = 0; idx < data->divs_num; ++idx) { 410 410 if (!!(data->divs_info[idx].features & CCU_DIV_BASIC) ^ defer) 411 411 continue;
+1 -1
drivers/clk/baikal-t1/clk-ccu-pll.c
··· 196 196 { 197 197 int idx; 198 198 199 - /* Uninstall only the clocks registered on the specfied stage */ 199 + /* Uninstall only the clocks registered on the specified stage */ 200 200 for (idx = 0; idx < CCU_PLL_NUM; ++idx) { 201 201 if (!!(pll_info[idx].features & CCU_PLL_BASIC) ^ defer) 202 202 continue;
+12 -7
drivers/clk/bcm/clk-bcm2835.c
··· 570 570 return rate >> A2W_PLL_FRAC_BITS; 571 571 } 572 572 573 - static long bcm2835_pll_round_rate(struct clk_hw *hw, unsigned long rate, 574 - unsigned long *parent_rate) 573 + static int bcm2835_pll_determine_rate(struct clk_hw *hw, 574 + struct clk_rate_request *req) 575 575 { 576 576 struct bcm2835_pll *pll = container_of(hw, struct bcm2835_pll, hw); 577 577 const struct bcm2835_pll_data *data = pll->data; 578 578 u32 ndiv, fdiv; 579 579 580 - rate = clamp(rate, data->min_rate, data->max_rate); 580 + req->rate = clamp(req->rate, data->min_rate, data->max_rate); 581 581 582 - bcm2835_pll_choose_ndiv_and_fdiv(rate, *parent_rate, &ndiv, &fdiv); 582 + bcm2835_pll_choose_ndiv_and_fdiv(req->rate, req->best_parent_rate, 583 + &ndiv, &fdiv); 583 584 584 - return bcm2835_pll_rate_from_divisors(*parent_rate, ndiv, fdiv, 1); 585 + req->rate = bcm2835_pll_rate_from_divisors(req->best_parent_rate, 586 + ndiv, fdiv, 587 + 1); 588 + 589 + return 0; 585 590 } 586 591 587 592 static unsigned long bcm2835_pll_get_rate(struct clk_hw *hw, ··· 788 783 .unprepare = bcm2835_pll_off, 789 784 .recalc_rate = bcm2835_pll_get_rate, 790 785 .set_rate = bcm2835_pll_set_rate, 791 - .round_rate = bcm2835_pll_round_rate, 786 + .determine_rate = bcm2835_pll_determine_rate, 792 787 .debug_init = bcm2835_pll_debug_init, 793 788 }; 794 789 ··· 1555 1550 .parents = bcm2835_clock_osc_parents, \ 1556 1551 __VA_ARGS__) 1557 1552 1558 - /* main peripherial parent mux */ 1553 + /* main peripheral parent mux */ 1559 1554 static const char *const bcm2835_clock_per_parents[] = { 1560 1555 "gnd", 1561 1556 "xosc",
+1 -1
drivers/clk/bcm/clk-bcm53573-ilp.c
··· 59 59 /* 60 60 * At minimum we should loop for a bit to let hardware do the 61 61 * measurement. This isn't very accurate however, so for a better 62 - * precision lets try getting 20 different values for and use average. 62 + * precision let's try getting 20 different values and use average. 63 63 */ 64 64 while (num < 20) { 65 65 regmap_read(regmap, PMU_XTAL_FREQ_RATIO, &cur_val);
+1 -1
drivers/clk/berlin/berlin2-avpll.c
··· 319 319 320 320 /* 321 321 * AV3 divider start at VCO_CTRL14, bit 7; each 4 bits wide. 322 - * AV2/AV3 form a fractional divider, where only specfic values for AV3 322 + * AV2/AV3 form a fractional divider, where only specific values for AV3 323 323 * are allowed. AV3 != 0 divides by AV2/2, AV3=0 is bypass. 324 324 */ 325 325 if (ch->index < 6) {
+2 -2
drivers/clk/clk-asm9260.c
··· 92 92 { CLKID_SYS_CPU, "cpu_div", "main_gate", HW_CPUCLKDIV }, 93 93 { CLKID_SYS_AHB, "ahb_div", "cpu_div", HW_SYSAHBCLKDIV }, 94 94 95 - /* i2s has two deviders: one for only external mclk and internal 96 - * devider for all clks. */ 95 + /* i2s has two dividers: one for only external mclk and internal 96 + * divider for all clks. */ 97 97 { CLKID_SYS_I2S0M, "i2s0m_div", "i2s0_mclk", HW_I2S0MCLKDIV }, 98 98 { CLKID_SYS_I2S1M, "i2s1m_div", "i2s1_mclk", HW_I2S1MCLKDIV }, 99 99 { CLKID_SYS_I2S0S, "i2s0s_div", "i2s0_gate", HW_I2S0SCLKDIV },
+1 -1
drivers/clk/clk-ast2600.c
··· 92 92 * 93 93 * There are some gates that do not have an associated reset; these are 94 94 * handled by using -1 as the index for the reset, and the consumer must 95 - * explictly assert/deassert reset lines as required. 95 + * explicitly assert/deassert reset lines as required. 96 96 * 97 97 * Clocks marked with CLK_IS_CRITICAL: 98 98 *
+113 -48
drivers/clk/clk-axi-clkgen.c
··· 6 6 * Author: Lars-Peter Clausen <lars@metafoo.de> 7 7 */ 8 8 9 - #include <linux/platform_device.h> 9 + #include <linux/adi-axi-common.h> 10 + #include <linux/bits.h> 10 11 #include <linux/clk.h> 11 12 #include <linux/clk-provider.h> 12 - #include <linux/slab.h> 13 - #include <linux/io.h> 14 - #include <linux/of.h> 15 - #include <linux/module.h> 16 13 #include <linux/err.h> 14 + #include <linux/io.h> 15 + #include <linux/module.h> 16 + #include <linux/mod_devicetable.h> 17 + #include <linux/of.h> 18 + #include <linux/platform_device.h> 19 + #include <linux/slab.h> 17 20 18 21 #define AXI_CLKGEN_V2_REG_RESET 0x40 19 22 #define AXI_CLKGEN_V2_REG_CLKSEL 0x44 ··· 30 27 #define AXI_CLKGEN_V2_DRP_CNTRL_READ BIT(28) 31 28 32 29 #define AXI_CLKGEN_V2_DRP_STATUS_BUSY BIT(16) 30 + 31 + #define ADI_CLKGEN_REG_FPGA_VOLTAGE 0x0140 32 + #define ADI_CLKGEN_INFO_FPGA_VOLTAGE(val) ((val) & GENMASK(15, 0)) 33 33 34 34 #define MMCM_REG_CLKOUT5_2 0x07 35 35 #define MMCM_REG_CLKOUT0_1 0x08 ··· 96 90 } 97 91 } 98 92 99 - static const uint32_t axi_clkgen_lock_table[] = { 93 + static const u32 axi_clkgen_lock_table[] = { 100 94 0x060603e8, 0x060603e8, 0x080803e8, 0x0b0b03e8, 101 95 0x0e0e03e8, 0x111103e8, 0x131303e8, 0x161603e8, 102 96 0x191903e8, 0x1c1c03e8, 0x1f1f0384, 0x1f1f0339, ··· 108 102 0x1f1f012c, 0x1f1f0113, 0x1f1f0113, 0x1f1f0113, 109 103 }; 110 104 111 - static uint32_t axi_clkgen_lookup_lock(unsigned int m) 105 + static u32 axi_clkgen_lookup_lock(unsigned int m) 112 106 { 113 107 if (m < ARRAY_SIZE(axi_clkgen_lock_table)) 114 108 return axi_clkgen_lock_table[m]; ··· 124 118 125 119 static const struct axi_clkgen_limits axi_clkgen_zynq_default_limits = { 126 120 .fpfd_min = 10000, 127 - .fpfd_max = 300000, 121 + .fpfd_max = 450000, 128 122 .fvco_min = 600000, 129 123 .fvco_max = 1200000, 130 124 }; 131 125 132 126 static void axi_clkgen_calc_params(const struct axi_clkgen_limits *limits, 133 - unsigned long fin, unsigned long fout, 134 - unsigned int *best_d, unsigned int *best_m, unsigned int *best_dout) 127 + unsigned long fin, unsigned long fout, 128 + unsigned int *best_d, unsigned int *best_m, 129 + unsigned int *best_dout) 135 130 { 136 131 unsigned long d, d_min, d_max, _d_min, _d_max; 137 132 unsigned long m, m_min, m_max; ··· 148 141 *best_m = 0; 149 142 *best_dout = 0; 150 143 151 - d_min = max_t(unsigned long, DIV_ROUND_UP(fin, limits->fpfd_max), 1); 152 - d_max = min_t(unsigned long, fin / limits->fpfd_min, 80); 144 + d_min = max(DIV_ROUND_UP(fin, limits->fpfd_max), 1); 145 + d_max = min(fin / limits->fpfd_min, 80); 153 146 154 147 again: 155 148 fvco_min_fract = limits->fvco_min << fract_shift; 156 149 fvco_max_fract = limits->fvco_max << fract_shift; 157 150 158 - m_min = max_t(unsigned long, DIV_ROUND_UP(fvco_min_fract, fin) * d_min, 1); 159 - m_max = min_t(unsigned long, fvco_max_fract * d_max / fin, 64 << fract_shift); 151 + m_min = max(DIV_ROUND_UP(fvco_min_fract, fin) * d_min, 1); 152 + m_max = min(fvco_max_fract * d_max / fin, 64 << fract_shift); 160 153 161 154 for (m = m_min; m <= m_max; m++) { 162 155 _d_min = max(d_min, DIV_ROUND_UP(fin * m, fvco_max_fract)); ··· 179 172 } 180 173 } 181 174 182 - /* Lets see if we find a better setting in fractional mode */ 175 + /* Let's see if we find a better setting in fractional mode */ 183 176 if (fract_shift == 0) { 184 177 fract_shift = 3; 185 178 goto again; ··· 199 192 }; 200 193 201 194 static void axi_clkgen_calc_clk_params(unsigned int divider, 202 - unsigned int frac_divider, struct axi_clkgen_div_params *params) 195 + unsigned int frac_divider, 196 + struct axi_clkgen_div_params *params) 203 197 { 204 - 205 198 memset(params, 0x0, sizeof(*params)); 206 199 207 200 if (divider == 1) { ··· 229 222 if (params->edge == 0 || frac_divider == 1) 230 223 params->low--; 231 224 if (((params->edge == 0) ^ (frac_divider == 1)) || 232 - (divider == 2 && frac_divider == 1)) 225 + (divider == 2 && frac_divider == 1)) 233 226 params->frac_wf_f = 1; 234 227 235 228 params->frac_phase = params->edge * 4 + frac_divider / 2; ··· 237 230 } 238 231 239 232 static void axi_clkgen_write(struct axi_clkgen *axi_clkgen, 240 - unsigned int reg, unsigned int val) 233 + unsigned int reg, unsigned int val) 241 234 { 242 235 writel(val, axi_clkgen->base + reg); 243 236 } 244 237 245 238 static void axi_clkgen_read(struct axi_clkgen *axi_clkgen, 246 - unsigned int reg, unsigned int *val) 239 + unsigned int reg, unsigned int *val) 247 240 { 248 241 *val = readl(axi_clkgen->base + reg); 249 242 } ··· 264 257 } 265 258 266 259 static int axi_clkgen_mmcm_read(struct axi_clkgen *axi_clkgen, 267 - unsigned int reg, unsigned int *val) 260 + unsigned int reg, unsigned int *val) 268 261 { 269 262 unsigned int reg_val; 270 263 int ret; ··· 288 281 } 289 282 290 283 static int axi_clkgen_mmcm_write(struct axi_clkgen *axi_clkgen, 291 - unsigned int reg, unsigned int val, unsigned int mask) 284 + unsigned int reg, unsigned int val, 285 + unsigned int mask) 292 286 { 293 287 unsigned int reg_val = 0; 294 288 int ret; ··· 310 302 return 0; 311 303 } 312 304 313 - static void axi_clkgen_mmcm_enable(struct axi_clkgen *axi_clkgen, 314 - bool enable) 305 + static void axi_clkgen_mmcm_enable(struct axi_clkgen *axi_clkgen, bool enable) 315 306 { 316 307 unsigned int val = AXI_CLKGEN_V2_RESET_ENABLE; 317 308 ··· 326 319 } 327 320 328 321 static void axi_clkgen_set_div(struct axi_clkgen *axi_clkgen, 329 - unsigned int reg1, unsigned int reg2, unsigned int reg3, 330 - struct axi_clkgen_div_params *params) 322 + unsigned int reg1, unsigned int reg2, 323 + unsigned int reg3, 324 + struct axi_clkgen_div_params *params) 331 325 { 332 326 axi_clkgen_mmcm_write(axi_clkgen, reg1, 333 - (params->high << 6) | params->low, 0xefff); 327 + (params->high << 6) | params->low, 0xefff); 334 328 axi_clkgen_mmcm_write(axi_clkgen, reg2, 335 - (params->frac << 12) | (params->frac_en << 11) | 336 - (params->frac_wf_r << 10) | (params->edge << 7) | 337 - (params->nocount << 6), 0x7fff); 329 + (params->frac << 12) | (params->frac_en << 11) | 330 + (params->frac_wf_r << 10) | (params->edge << 7) | 331 + (params->nocount << 6), 0x7fff); 338 332 if (reg3 != 0) { 339 333 axi_clkgen_mmcm_write(axi_clkgen, reg3, 340 - (params->frac_phase << 11) | (params->frac_wf_f << 10), 0x3c00); 334 + (params->frac_phase << 11) | (params->frac_wf_f << 10), 335 + 0x3c00); 341 336 } 342 337 } 343 338 344 - static int axi_clkgen_set_rate(struct clk_hw *clk_hw, 345 - unsigned long rate, unsigned long parent_rate) 339 + static int axi_clkgen_set_rate(struct clk_hw *clk_hw, unsigned long rate, 340 + unsigned long parent_rate) 346 341 { 347 342 struct axi_clkgen *axi_clkgen = clk_hw_to_axi_clkgen(clk_hw); 348 343 const struct axi_clkgen_limits *limits = &axi_clkgen->limits; 349 344 unsigned int d, m, dout; 350 345 struct axi_clkgen_div_params params; 351 - uint32_t power = 0; 352 - uint32_t filter; 353 - uint32_t lock; 346 + u32 power = 0, filter, lock; 354 347 355 348 if (parent_rate == 0 || rate == 0) 356 349 return -EINVAL; ··· 370 363 371 364 axi_clkgen_calc_clk_params(dout >> 3, dout & 0x7, &params); 372 365 axi_clkgen_set_div(axi_clkgen, MMCM_REG_CLKOUT0_1, MMCM_REG_CLKOUT0_2, 373 - MMCM_REG_CLKOUT5_2, &params); 366 + MMCM_REG_CLKOUT5_2, &params); 374 367 375 368 axi_clkgen_calc_clk_params(d, 0, &params); 376 369 axi_clkgen_mmcm_write(axi_clkgen, MMCM_REG_CLK_DIV, 377 - (params.edge << 13) | (params.nocount << 12) | 378 - (params.high << 6) | params.low, 0x3fff); 370 + (params.edge << 13) | (params.nocount << 12) | 371 + (params.high << 6) | params.low, 0x3fff); 379 372 380 373 axi_clkgen_calc_clk_params(m >> 3, m & 0x7, &params); 381 374 axi_clkgen_set_div(axi_clkgen, MMCM_REG_CLK_FB1, MMCM_REG_CLK_FB2, 382 - MMCM_REG_CLKOUT6_2, &params); 375 + MMCM_REG_CLKOUT6_2, &params); 383 376 384 377 axi_clkgen_mmcm_write(axi_clkgen, MMCM_REG_LOCK1, lock & 0x3ff, 0x3ff); 385 378 axi_clkgen_mmcm_write(axi_clkgen, MMCM_REG_LOCK2, 386 - (((lock >> 16) & 0x1f) << 10) | 0x1, 0x7fff); 379 + (((lock >> 16) & 0x1f) << 10) | 0x1, 0x7fff); 387 380 axi_clkgen_mmcm_write(axi_clkgen, MMCM_REG_LOCK3, 388 - (((lock >> 24) & 0x1f) << 10) | 0x3e9, 0x7fff); 381 + (((lock >> 24) & 0x1f) << 10) | 0x3e9, 0x7fff); 389 382 axi_clkgen_mmcm_write(axi_clkgen, MMCM_REG_FILTER1, filter >> 16, 0x9900); 390 383 axi_clkgen_mmcm_write(axi_clkgen, MMCM_REG_FILTER2, filter, 0x9900); 391 384 ··· 414 407 } 415 408 416 409 static unsigned int axi_clkgen_get_div(struct axi_clkgen *axi_clkgen, 417 - unsigned int reg1, unsigned int reg2) 410 + unsigned int reg1, unsigned int reg2) 418 411 { 419 412 unsigned int val1, val2; 420 413 unsigned int div; ··· 441 434 } 442 435 443 436 static unsigned long axi_clkgen_recalc_rate(struct clk_hw *clk_hw, 444 - unsigned long parent_rate) 437 + unsigned long parent_rate) 445 438 { 446 439 struct axi_clkgen *axi_clkgen = clk_hw_to_axi_clkgen(clk_hw); 447 440 unsigned int d, m, dout; ··· 449 442 unsigned int val; 450 443 451 444 dout = axi_clkgen_get_div(axi_clkgen, MMCM_REG_CLKOUT0_1, 452 - MMCM_REG_CLKOUT0_2); 445 + MMCM_REG_CLKOUT0_2); 453 446 m = axi_clkgen_get_div(axi_clkgen, MMCM_REG_CLK_FB1, 454 - MMCM_REG_CLK_FB2); 447 + MMCM_REG_CLK_FB2); 455 448 456 449 axi_clkgen_mmcm_read(axi_clkgen, MMCM_REG_CLK_DIV, &val); 457 450 if (val & MMCM_CLK_DIV_NOCOUNT) ··· 503 496 return parent; 504 497 } 505 498 499 + static int axi_clkgen_setup_limits(struct axi_clkgen *axi_clkgen, 500 + struct device *dev) 501 + { 502 + unsigned int tech, family, speed_grade, reg_value; 503 + 504 + axi_clkgen_read(axi_clkgen, ADI_AXI_REG_FPGA_INFO, &reg_value); 505 + tech = ADI_AXI_INFO_FPGA_TECH(reg_value); 506 + family = ADI_AXI_INFO_FPGA_FAMILY(reg_value); 507 + speed_grade = ADI_AXI_INFO_FPGA_SPEED_GRADE(reg_value); 508 + 509 + axi_clkgen->limits.fpfd_min = 10000; 510 + axi_clkgen->limits.fvco_min = 600000; 511 + 512 + switch (speed_grade) { 513 + case ADI_AXI_FPGA_SPEED_1 ... ADI_AXI_FPGA_SPEED_1LV: 514 + axi_clkgen->limits.fvco_max = 1200000; 515 + axi_clkgen->limits.fpfd_max = 450000; 516 + break; 517 + case ADI_AXI_FPGA_SPEED_2 ... ADI_AXI_FPGA_SPEED_2LV: 518 + axi_clkgen->limits.fvco_max = 1440000; 519 + axi_clkgen->limits.fpfd_max = 500000; 520 + if (family == ADI_AXI_FPGA_FAMILY_KINTEX || family == ADI_AXI_FPGA_FAMILY_ARTIX) { 521 + axi_clkgen_read(axi_clkgen, ADI_CLKGEN_REG_FPGA_VOLTAGE, 522 + &reg_value); 523 + if (ADI_CLKGEN_INFO_FPGA_VOLTAGE(reg_value) < 950) { 524 + axi_clkgen->limits.fvco_max = 1200000; 525 + axi_clkgen->limits.fpfd_max = 450000; 526 + } 527 + } 528 + break; 529 + case ADI_AXI_FPGA_SPEED_3: 530 + axi_clkgen->limits.fvco_max = 1600000; 531 + axi_clkgen->limits.fpfd_max = 550000; 532 + break; 533 + default: 534 + return dev_err_probe(dev, -ENODEV, "Unknown speed grade %d\n", 535 + speed_grade); 536 + }; 537 + 538 + /* Overwrite vco limits for ultrascale+ */ 539 + if (tech == ADI_AXI_FPGA_TECH_ULTRASCALE_PLUS) { 540 + axi_clkgen->limits.fvco_max = 1600000; 541 + axi_clkgen->limits.fvco_min = 800000; 542 + } 543 + 544 + return 0; 545 + } 546 + 506 547 static const struct clk_ops axi_clkgen_ops = { 507 548 .recalc_rate = axi_clkgen_recalc_rate, 508 549 .determine_rate = axi_clkgen_determine_rate, ··· 565 510 { 566 511 const struct axi_clkgen_limits *dflt_limits; 567 512 struct axi_clkgen *axi_clkgen; 513 + unsigned int pcore_version; 568 514 struct clk_init_data init; 569 515 const char *parent_names[2]; 570 516 const char *clk_name; ··· 611 555 return -EINVAL; 612 556 } 613 557 614 - memcpy(&axi_clkgen->limits, dflt_limits, sizeof(axi_clkgen->limits)); 558 + axi_clkgen_read(axi_clkgen, ADI_AXI_REG_VERSION, &pcore_version); 559 + 560 + if (ADI_AXI_PCORE_VER_MAJOR(pcore_version) > 0x04) { 561 + ret = axi_clkgen_setup_limits(axi_clkgen, &pdev->dev); 562 + if (ret) 563 + return ret; 564 + } else { 565 + memcpy(&axi_clkgen->limits, dflt_limits, 566 + sizeof(axi_clkgen->limits)); 567 + } 615 568 616 569 clk_name = pdev->dev.of_node->name; 617 570 of_property_read_string(pdev->dev.of_node, "clock-output-names", 618 - &clk_name); 571 + &clk_name); 619 572 620 573 init.name = clk_name; 621 574 init.ops = &axi_clkgen_ops;
+1 -1
drivers/clk/clk-clps711x.c
··· 99 99 */ 100 100 tmp &= ~(SYSCON1_TC1M | SYSCON1_TC1S); 101 101 /* Timer2 in prescale mode. 102 - * Value writen is automatically re-loaded when 102 + * Value written is automatically re-loaded when 103 103 * the counter underflows. 104 104 */ 105 105 tmp |= SYSCON1_TC2M | SYSCON1_TC2S;
+1 -1
drivers/clk/clk-eyeq.c
··· 131 131 * Both factors (mult and div) must fit in 32 bits. When an operation overflows, 132 132 * this function throws away low bits so that factors still fit in 32 bits. 133 133 * 134 - * Precision loss depends on amplitude of mult and div. Worst theorical 134 + * Precision loss depends on amplitude of mult and div. Worst theoretical 135 135 * loss is: (UINT_MAX+1) / UINT_MAX - 1 = 2.3e-10. 136 136 * This is 1Hz every 4.3GHz. 137 137 */
+1 -1
drivers/clk/clk-gate.c
··· 15 15 #include <linux/string.h> 16 16 17 17 /** 18 - * DOC: basic gatable clock which can gate and ungate its output 18 + * DOC: basic gateable clock which can gate and ungate its output 19 19 * 20 20 * Traits of this clock: 21 21 * prepare - clk_(un)prepare only ensures parent is (un)prepared
+1 -1
drivers/clk/clk-hsdk-pll.c
··· 265 265 return -EINVAL; 266 266 267 267 /* 268 - * Program divider to div-by-1 if we succesfuly set core clock below 268 + * Program divider to div-by-1 if we successfully set core clock below 269 269 * 500MHz threshold. 270 270 */ 271 271 if (rate <= CORE_IF_CLK_THRESHOLD_HZ)
+38 -11
drivers/clk/clk-pwm.c
··· 14 14 struct clk_pwm { 15 15 struct clk_hw hw; 16 16 struct pwm_device *pwm; 17 + struct pwm_state state; 17 18 u32 fixed_rate; 18 19 }; 19 20 ··· 23 22 return container_of(hw, struct clk_pwm, hw); 24 23 } 25 24 25 + static int clk_pwm_enable(struct clk_hw *hw) 26 + { 27 + struct clk_pwm *clk_pwm = to_clk_pwm(hw); 28 + 29 + return pwm_apply_atomic(clk_pwm->pwm, &clk_pwm->state); 30 + } 31 + 32 + static void clk_pwm_disable(struct clk_hw *hw) 33 + { 34 + struct clk_pwm *clk_pwm = to_clk_pwm(hw); 35 + struct pwm_state state = clk_pwm->state; 36 + 37 + state.enabled = false; 38 + 39 + pwm_apply_atomic(clk_pwm->pwm, &state); 40 + } 41 + 26 42 static int clk_pwm_prepare(struct clk_hw *hw) 27 43 { 28 44 struct clk_pwm *clk_pwm = to_clk_pwm(hw); 29 45 30 - return pwm_enable(clk_pwm->pwm); 46 + return pwm_apply_might_sleep(clk_pwm->pwm, &clk_pwm->state); 31 47 } 32 48 33 49 static void clk_pwm_unprepare(struct clk_hw *hw) ··· 66 48 { 67 49 struct clk_pwm *clk_pwm = to_clk_pwm(hw); 68 50 struct pwm_state state; 51 + int ret; 69 52 70 - pwm_get_state(clk_pwm->pwm, &state); 53 + ret = pwm_get_state_hw(clk_pwm->pwm, &state); 54 + if (ret) 55 + return ret; 71 56 72 57 duty->num = state.duty_cycle; 73 58 duty->den = state.period; 74 59 75 60 return 0; 76 61 } 62 + 63 + static const struct clk_ops clk_pwm_ops_atomic = { 64 + .enable = clk_pwm_enable, 65 + .disable = clk_pwm_disable, 66 + .recalc_rate = clk_pwm_recalc_rate, 67 + .get_duty_cycle = clk_pwm_get_duty_cycle, 68 + }; 77 69 78 70 static const struct clk_ops clk_pwm_ops = { 79 71 .prepare = clk_pwm_prepare, ··· 131 103 return -EINVAL; 132 104 } 133 105 134 - /* 135 - * FIXME: pwm_apply_args() should be removed when switching to the 136 - * atomic PWM API. 137 - */ 138 - pwm_apply_args(pwm); 139 - ret = pwm_config(pwm, (pargs.period + 1) >> 1, pargs.period); 140 - if (ret < 0) 141 - return ret; 106 + pwm_init_state(pwm, &clk_pwm->state); 107 + pwm_set_relative_duty_cycle(&clk_pwm->state, 1, 2); 108 + clk_pwm->state.enabled = true; 142 109 143 110 clk_name = node->name; 144 111 of_property_read_string(node, "clock-output-names", &clk_name); 145 112 146 113 init.name = clk_name; 147 - init.ops = &clk_pwm_ops; 114 + if (pwm_might_sleep(pwm)) 115 + init.ops = &clk_pwm_ops; 116 + else 117 + init.ops = &clk_pwm_ops_atomic; 118 + 148 119 init.flags = 0; 149 120 init.num_parents = 0; 150 121
+1 -1
drivers/clk/clk-s2mps11.c
··· 235 235 * through platform_device_id. 236 236 * 237 237 * However if device's DT node contains proper clock compatible and driver is 238 - * built as a module, then the *module* matching will be done trough DT aliases. 238 + * built as a module, then the *module* matching will be done through DT aliases. 239 239 * This requires of_device_id table. In the same time this will not change the 240 240 * actual *device* matching so do not add .of_match_table. 241 241 */
+1 -1
drivers/clk/clk-scmi.c
··· 451 451 452 452 /* 453 453 * Note that the scmi_clk_ops_db is on the stack, not global, 454 - * because it cannot be shared between mulitple probe-sequences 454 + * because it cannot be shared between multiple probe-sequences 455 455 * to avoid sharing the devm_ allocated clk_ops between multiple 456 456 * SCMI clk driver instances. 457 457 */
+3 -3
drivers/clk/clk-si5351.c
··· 655 655 unsigned long a, b, c; 656 656 int divby4; 657 657 658 - /* multisync6-7 can only handle freqencies < 150MHz */ 658 + /* multisync6-7 can only handle frequencies < 150MHz */ 659 659 if (hwdata->num >= 6 && rate > SI5351_MULTISYNTH67_MAX_FREQ) 660 660 rate = SI5351_MULTISYNTH67_MAX_FREQ; 661 661 ··· 1048 1048 unsigned long rate = req->rate; 1049 1049 unsigned char rdiv; 1050 1050 1051 - /* clkout6/7 can only handle output freqencies < 150MHz */ 1051 + /* clkout6/7 can only handle output frequencies < 150MHz */ 1052 1052 if (hwdata->num >= 6 && rate > SI5351_CLKOUT67_MAX_FREQ) 1053 1053 rate = SI5351_CLKOUT67_MAX_FREQ; 1054 1054 1055 - /* clkout freqency is 8kHz - 160MHz */ 1055 + /* clkout frequency is 8kHz - 160MHz */ 1056 1056 if (rate > SI5351_CLKOUT_MAX_FREQ) 1057 1057 rate = SI5351_CLKOUT_MAX_FREQ; 1058 1058 if (rate < SI5351_CLKOUT_MIN_FREQ)
+1 -1
drivers/clk/clk-si544.c
··· 39 39 /* Max freq depends on speed grade */ 40 40 #define SI544_MIN_FREQ 200000U 41 41 42 - /* Si544 Internal oscilator runs at 55.05 MHz */ 42 + /* Si544 Internal oscillator runs at 55.05 MHz */ 43 43 #define FXO 55050000U 44 44 45 45 /* VCO range is 10.8 .. 12.1 GHz, max depends on speed grade */
+2 -2
drivers/clk/clk-si570.c
··· 63 63 * struct clk_si570: 64 64 * @hw: Clock hw struct 65 65 * @regmap: Device's regmap 66 - * @div_offset: Rgister offset for dividers 66 + * @div_offset: Register offset for dividers 67 67 * @info: Device info 68 68 * @fxtal: Factory xtal frequency 69 69 * @n1: Clock divider N1 ··· 181 181 } 182 182 183 183 /** 184 - * si570_calc_divs() - Caluclate clock dividers 184 + * si570_calc_divs() - Calculate clock dividers 185 185 * @frequency: Target frequency 186 186 * @data: Driver data structure 187 187 * @out_rfreq: RFREG fractional multiplier (output)
+1 -1
drivers/clk/clk-sp7021.c
··· 14 14 15 15 #include <dt-bindings/clock/sunplus,sp7021-clkc.h> 16 16 17 - /* speical div_width values for PLLTV/PLLA */ 17 + /* special div_width values for PLLTV/PLLA */ 18 18 #define DIV_TV 33 19 19 #define DIV_A 34 20 20
+1 -1
drivers/clk/clk-stm32f4.c
··· 19 19 #include <linux/mfd/syscon.h> 20 20 21 21 /* 22 - * Include list of clocks wich are not derived from system clock (SYSCLOCK) 22 + * Include list of clocks which are not derived from system clock (SYSCLOCK) 23 23 * The index of these clocks is the secondary index of DT bindings 24 24 * 25 25 */
+1 -1
drivers/clk/clk-versaclock5.c
··· 136 136 #define VC5_MAX_FOD_NUM 4 137 137 138 138 /* flags to describe chip features */ 139 - /* chip has built-in oscilator */ 139 + /* chip has built-in oscillator */ 140 140 #define VC5_HAS_INTERNAL_XTAL BIT(0) 141 141 /* chip has PFD requency doubler */ 142 142 #define VC5_HAS_PFD_FREQ_DBL BIT(1)
+1 -1
drivers/clk/clk-versaclock7.c
··· 1257 1257 .num_outputs = 8, 1258 1258 }; 1259 1259 1260 - static struct regmap_range_cfg vc7_range_cfg[] = { 1260 + static const struct regmap_range_cfg vc7_range_cfg[] = { 1261 1261 { 1262 1262 .range_min = 0, 1263 1263 .range_max = VC7_MAX_REG,
+12
drivers/clk/clk.c
··· 365 365 } 366 366 EXPORT_SYMBOL_GPL(clk_hw_get_name); 367 367 368 + struct device *clk_hw_get_dev(const struct clk_hw *hw) 369 + { 370 + return hw->core->dev; 371 + } 372 + EXPORT_SYMBOL_GPL(clk_hw_get_dev); 373 + 374 + struct device_node *clk_hw_get_of_node(const struct clk_hw *hw) 375 + { 376 + return hw->core->of_node; 377 + } 378 + EXPORT_SYMBOL_GPL(clk_hw_get_of_node); 379 + 368 380 struct clk_hw *__clk_get_hw(struct clk *clk) 369 381 { 370 382 return !clk ? NULL : clk->core->hw;
+187 -39
drivers/clk/clk_test.c
··· 292 292 } 293 293 294 294 /* 295 - * Test that clk_round_rate and clk_set_rate are consitent and will 295 + * Test that clk_round_rate and clk_set_rate are consistent and will 296 296 * return the same frequency. 297 297 */ 298 298 static void clk_test_round_set_get_rate(struct kunit *test) ··· 2794 2794 }; 2795 2795 2796 2796 /** 2797 - * struct clk_register_clk_parent_data_device_ctx - Context for clk_parent_data device tests 2798 - * @dev: device of clk under test 2799 - * @hw: clk_hw for clk under test 2797 + * struct platform_driver_dev_ctx - Context to stash platform device 2798 + * @dev: device under test 2800 2799 * @pdrv: driver to attach to find @dev 2801 2800 */ 2802 - struct clk_register_clk_parent_data_device_ctx { 2801 + struct platform_driver_dev_ctx { 2803 2802 struct device *dev; 2804 - struct clk_hw hw; 2805 2803 struct platform_driver pdrv; 2806 2804 }; 2807 2805 2808 - static inline struct clk_register_clk_parent_data_device_ctx * 2809 - clk_register_clk_parent_data_driver_to_test_context(struct platform_device *pdev) 2806 + static inline struct platform_driver_dev_ctx * 2807 + pdev_to_platform_driver_dev_ctx(struct platform_device *pdev) 2810 2808 { 2811 2809 return container_of(to_platform_driver(pdev->dev.driver), 2812 - struct clk_register_clk_parent_data_device_ctx, pdrv); 2810 + struct platform_driver_dev_ctx, pdrv); 2813 2811 } 2814 2812 2815 - static int clk_register_clk_parent_data_device_probe(struct platform_device *pdev) 2813 + static int kunit_platform_driver_dev_probe(struct platform_device *pdev) 2816 2814 { 2817 - struct clk_register_clk_parent_data_device_ctx *ctx; 2815 + struct platform_driver_dev_ctx *ctx; 2818 2816 2819 - ctx = clk_register_clk_parent_data_driver_to_test_context(pdev); 2817 + ctx = pdev_to_platform_driver_dev_ctx(pdev); 2820 2818 ctx->dev = &pdev->dev; 2821 2819 2822 2820 return 0; 2823 2821 } 2824 2822 2825 - static void clk_register_clk_parent_data_device_driver(struct kunit *test) 2823 + static struct device * 2824 + kunit_of_platform_driver_dev(struct kunit *test, const struct of_device_id *match_table) 2826 2825 { 2827 - struct clk_register_clk_parent_data_device_ctx *ctx = test->priv; 2828 - static const struct of_device_id match_table[] = { 2829 - { .compatible = "test,clk-parent-data" }, 2830 - { } 2831 - }; 2826 + struct platform_driver_dev_ctx *ctx; 2832 2827 2833 - ctx->pdrv.probe = clk_register_clk_parent_data_device_probe; 2828 + ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); 2829 + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); 2830 + 2831 + ctx->pdrv.probe = kunit_platform_driver_dev_probe; 2834 2832 ctx->pdrv.driver.of_match_table = match_table; 2835 2833 ctx->pdrv.driver.name = __func__; 2836 2834 ctx->pdrv.driver.owner = THIS_MODULE; 2837 2835 2838 2836 KUNIT_ASSERT_EQ(test, 0, kunit_platform_driver_register(test, &ctx->pdrv)); 2839 2837 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx->dev); 2838 + 2839 + return ctx->dev; 2840 2840 } 2841 2841 2842 2842 static const struct clk_register_clk_parent_data_test_case ··· 2909 2909 */ 2910 2910 static void clk_register_clk_parent_data_device_test(struct kunit *test) 2911 2911 { 2912 - struct clk_register_clk_parent_data_device_ctx *ctx; 2912 + struct device *dev; 2913 + struct clk_hw *hw; 2913 2914 const struct clk_register_clk_parent_data_test_case *test_param; 2914 2915 struct clk_hw *parent_hw; 2915 2916 struct clk_init_data init = { }; 2916 2917 struct clk *expected_parent, *actual_parent; 2918 + static const struct of_device_id match_table[] = { 2919 + { .compatible = "test,clk-parent-data" }, 2920 + { } 2921 + }; 2917 2922 2918 - ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); 2919 - KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); 2920 - test->priv = ctx; 2923 + dev = kunit_of_platform_driver_dev(test, match_table); 2921 2924 2922 - clk_register_clk_parent_data_device_driver(test); 2923 - 2924 - expected_parent = clk_get_kunit(test, ctx->dev, "50"); 2925 + expected_parent = clk_get_kunit(test, dev, "50"); 2925 2926 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, expected_parent); 2927 + 2928 + hw = kunit_kzalloc(test, sizeof(*hw), GFP_KERNEL); 2929 + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, hw); 2926 2930 2927 2931 test_param = test->param_value; 2928 2932 init.parent_data = &test_param->pdata; 2929 2933 init.num_parents = 1; 2930 2934 init.name = "parent_data_device_test_clk"; 2931 2935 init.ops = &clk_dummy_single_parent_ops; 2932 - ctx->hw.init = &init; 2933 - KUNIT_ASSERT_EQ(test, 0, clk_hw_register_kunit(test, ctx->dev, &ctx->hw)); 2936 + hw->init = &init; 2937 + KUNIT_ASSERT_EQ(test, 0, clk_hw_register_kunit(test, dev, hw)); 2934 2938 2935 - parent_hw = clk_hw_get_parent(&ctx->hw); 2939 + parent_hw = clk_hw_get_parent(hw); 2936 2940 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent_hw); 2937 2941 2938 2942 actual_parent = clk_hw_get_clk_kunit(test, parent_hw, __func__); ··· 3020 3016 */ 3021 3017 static void clk_register_clk_parent_data_device_hw_test(struct kunit *test) 3022 3018 { 3023 - struct clk_register_clk_parent_data_device_ctx *ctx; 3019 + struct device *dev; 3020 + struct clk_hw *hw; 3024 3021 const struct clk_register_clk_parent_data_test_case *test_param; 3025 3022 struct clk_dummy_context *parent; 3026 3023 struct clk_hw *parent_hw; 3027 3024 struct clk_parent_data pdata = { }; 3028 3025 struct clk_init_data init = { }; 3026 + static const struct of_device_id match_table[] = { 3027 + { .compatible = "test,clk-parent-data" }, 3028 + { } 3029 + }; 3029 3030 3030 - ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); 3031 - KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); 3032 - test->priv = ctx; 3033 - 3034 - clk_register_clk_parent_data_device_driver(test); 3031 + dev = kunit_of_platform_driver_dev(test, match_table); 3035 3032 3036 3033 parent = kunit_kzalloc(test, sizeof(*parent), GFP_KERNEL); 3037 3034 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, parent); ··· 3041 3036 parent_hw->init = CLK_HW_INIT_NO_PARENT("parent-clk", 3042 3037 &clk_dummy_rate_ops, 0); 3043 3038 3044 - KUNIT_ASSERT_EQ(test, 0, clk_hw_register_kunit(test, ctx->dev, parent_hw)); 3039 + KUNIT_ASSERT_EQ(test, 0, clk_hw_register_kunit(test, dev, parent_hw)); 3040 + 3041 + hw = kunit_kzalloc(test, sizeof(*hw), GFP_KERNEL); 3042 + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, hw); 3045 3043 3046 3044 test_param = test->param_value; 3047 3045 memcpy(&pdata, &test_param->pdata, sizeof(pdata)); ··· 3053 3045 init.num_parents = 1; 3054 3046 init.ops = &clk_dummy_single_parent_ops; 3055 3047 init.name = "parent_data_device_hw_test_clk"; 3056 - ctx->hw.init = &init; 3057 - KUNIT_ASSERT_EQ(test, 0, clk_hw_register_kunit(test, ctx->dev, &ctx->hw)); 3048 + hw->init = &init; 3049 + KUNIT_ASSERT_EQ(test, 0, clk_hw_register_kunit(test, dev, hw)); 3058 3050 3059 - KUNIT_EXPECT_PTR_EQ(test, parent_hw, clk_hw_get_parent(&ctx->hw)); 3051 + KUNIT_EXPECT_PTR_EQ(test, parent_hw, clk_hw_get_parent(hw)); 3060 3052 } 3061 3053 3062 3054 static struct kunit_case clk_register_clk_parent_data_device_test_cases[] = { ··· 3403 3395 .init = clk_assigned_rates_test_init, 3404 3396 }; 3405 3397 3398 + static const struct clk_init_data clk_hw_get_dev_of_node_init_data = { 3399 + .name = "clk_hw_get_dev_of_node", 3400 + .ops = &empty_clk_ops, 3401 + }; 3402 + 3403 + /* 3404 + * Test that a clk registered with a struct device returns the device from 3405 + * clk_hw_get_dev() and the node from clk_hw_get_of_node() 3406 + */ 3407 + static void clk_hw_register_dev_get_dev_returns_dev(struct kunit *test) 3408 + { 3409 + struct device *dev; 3410 + struct clk_hw *hw; 3411 + static const struct of_device_id match_table[] = { 3412 + { .compatible = "test,clk-hw-get-dev-of-node" }, 3413 + { } 3414 + }; 3415 + 3416 + KUNIT_ASSERT_EQ(test, 0, of_overlay_apply_kunit(test, kunit_clk_hw_get_dev_of_node)); 3417 + 3418 + dev = kunit_of_platform_driver_dev(test, match_table); 3419 + 3420 + hw = kunit_kzalloc(test, sizeof(*hw), GFP_KERNEL); 3421 + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, hw); 3422 + 3423 + hw->init = &clk_hw_get_dev_of_node_init_data; 3424 + KUNIT_ASSERT_EQ(test, 0, clk_hw_register_kunit(test, dev, hw)); 3425 + 3426 + KUNIT_EXPECT_PTR_EQ(test, dev, clk_hw_get_dev(hw)); 3427 + KUNIT_EXPECT_PTR_EQ(test, dev_of_node(dev), clk_hw_get_of_node(hw)); 3428 + } 3429 + 3430 + /* 3431 + * Test that a clk registered with a struct device that's not associated with 3432 + * an OF node returns the device from clk_hw_get_dev() and NULL from 3433 + * clk_hw_get_of_node() 3434 + */ 3435 + static void clk_hw_register_dev_no_node_get_dev_returns_dev(struct kunit *test) 3436 + { 3437 + struct platform_device *pdev; 3438 + struct device *dev; 3439 + struct clk_hw *hw; 3440 + 3441 + pdev = kunit_platform_device_alloc(test, "clk_hw_register_dev_no_node", -1); 3442 + KUNIT_ASSERT_NOT_NULL(test, pdev); 3443 + KUNIT_ASSERT_EQ(test, 0, kunit_platform_device_add(test, pdev)); 3444 + dev = &pdev->dev; 3445 + 3446 + hw = kunit_kzalloc(test, sizeof(*hw), GFP_KERNEL); 3447 + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, hw); 3448 + 3449 + hw->init = &clk_hw_get_dev_of_node_init_data; 3450 + KUNIT_ASSERT_EQ(test, 0, clk_hw_register_kunit(test, dev, hw)); 3451 + 3452 + KUNIT_EXPECT_PTR_EQ(test, dev, clk_hw_get_dev(hw)); 3453 + KUNIT_EXPECT_PTR_EQ(test, NULL, clk_hw_get_of_node(hw)); 3454 + } 3455 + 3456 + /* 3457 + * Test that a clk registered without a struct device returns NULL from 3458 + * clk_hw_get_dev() 3459 + */ 3460 + static void clk_hw_register_NULL_get_dev_of_node_returns_NULL(struct kunit *test) 3461 + { 3462 + struct clk_hw *hw; 3463 + 3464 + hw = kunit_kzalloc(test, sizeof(*hw), GFP_KERNEL); 3465 + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, hw); 3466 + 3467 + hw->init = &clk_hw_get_dev_of_node_init_data; 3468 + 3469 + KUNIT_ASSERT_EQ(test, 0, clk_hw_register_kunit(test, NULL, hw)); 3470 + 3471 + KUNIT_EXPECT_PTR_EQ(test, NULL, clk_hw_get_dev(hw)); 3472 + KUNIT_EXPECT_PTR_EQ(test, NULL, clk_hw_get_of_node(hw)); 3473 + } 3474 + 3475 + /* 3476 + * Test that a clk registered with an of_node returns the node from 3477 + * clk_hw_get_of_node() and NULL from clk_hw_get_dev() 3478 + */ 3479 + static void of_clk_hw_register_node_get_of_node_returns_node(struct kunit *test) 3480 + { 3481 + struct device_node *np; 3482 + struct clk_hw *hw; 3483 + 3484 + hw = kunit_kzalloc(test, sizeof(*hw), GFP_KERNEL); 3485 + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, hw); 3486 + 3487 + KUNIT_ASSERT_EQ(test, 0, of_overlay_apply_kunit(test, kunit_clk_hw_get_dev_of_node)); 3488 + 3489 + np = of_find_compatible_node(NULL, NULL, "test,clk-hw-get-dev-of-node"); 3490 + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, np); 3491 + of_node_put_kunit(test, np); 3492 + 3493 + hw->init = &clk_hw_get_dev_of_node_init_data; 3494 + KUNIT_ASSERT_EQ(test, 0, of_clk_hw_register_kunit(test, np, hw)); 3495 + 3496 + KUNIT_EXPECT_PTR_EQ(test, NULL, clk_hw_get_dev(hw)); 3497 + KUNIT_EXPECT_PTR_EQ(test, np, clk_hw_get_of_node(hw)); 3498 + } 3499 + 3500 + /* 3501 + * Test that a clk registered without an of_node returns the node from 3502 + * clk_hw_get_of_node() and clk_hw_get_dev() 3503 + */ 3504 + static void of_clk_hw_register_NULL_get_of_node_returns_NULL(struct kunit *test) 3505 + { 3506 + struct clk_hw *hw; 3507 + 3508 + hw = kunit_kzalloc(test, sizeof(*hw), GFP_KERNEL); 3509 + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, hw); 3510 + 3511 + hw->init = &clk_hw_get_dev_of_node_init_data; 3512 + KUNIT_ASSERT_EQ(test, 0, of_clk_hw_register_kunit(test, NULL, hw)); 3513 + 3514 + KUNIT_EXPECT_PTR_EQ(test, NULL, clk_hw_get_dev(hw)); 3515 + KUNIT_EXPECT_PTR_EQ(test, NULL, clk_hw_get_of_node(hw)); 3516 + } 3517 + 3518 + static struct kunit_case clk_hw_get_dev_of_node_test_cases[] = { 3519 + KUNIT_CASE(clk_hw_register_dev_get_dev_returns_dev), 3520 + KUNIT_CASE(clk_hw_register_dev_no_node_get_dev_returns_dev), 3521 + KUNIT_CASE(clk_hw_register_NULL_get_dev_of_node_returns_NULL), 3522 + KUNIT_CASE(of_clk_hw_register_node_get_of_node_returns_node), 3523 + KUNIT_CASE(of_clk_hw_register_NULL_get_of_node_returns_NULL), 3524 + {} 3525 + }; 3526 + 3527 + /* 3528 + * Test suite to verify clk_hw_get_dev() and clk_hw_get_of_node() when clk 3529 + * registered with clk_hw_register() and of_clk_hw_register() 3530 + */ 3531 + static struct kunit_suite clk_hw_get_dev_of_node_test_suite = { 3532 + .name = "clk_hw_get_dev_of_node_test_suite", 3533 + .test_cases = clk_hw_get_dev_of_node_test_cases, 3534 + }; 3535 + 3536 + 3406 3537 kunit_test_suites( 3407 3538 &clk_assigned_rates_suite, 3539 + &clk_hw_get_dev_of_node_test_suite, 3408 3540 &clk_leaf_mux_set_rate_parent_test_suite, 3409 3541 &clk_test_suite, 3410 3542 &clk_multiple_parents_mux_test_suite,
+1 -1
drivers/clk/davinci/pll.h
··· 80 80 * @name: The name of the clock 81 81 * @parent_names: Array of names of the parent clocks 82 82 * @num_parents: Length of @parent_names 83 - * @table: Array of values to write to OCSEL[OCSRC] cooresponding to 83 + * @table: Array of values to write to OCSEL[OCSRC] corresponding to 84 84 * @parent_names 85 85 * @ocsrc_mask: Bitmask for OCSEL[OCSRC] 86 86 */
+5
drivers/clk/davinci/psc.c
··· 277 277 278 278 lpsc->pm_domain.name = devm_kasprintf(dev, GFP_KERNEL, "%s: %s", 279 279 best_dev_name(dev), name); 280 + if (!lpsc->pm_domain.name) { 281 + clk_hw_unregister(&lpsc->hw); 282 + kfree(lpsc); 283 + return ERR_PTR(-ENOMEM); 284 + } 280 285 lpsc->pm_domain.attach_dev = davinci_psc_genpd_attach_dev; 281 286 lpsc->pm_domain.detach_dev = davinci_psc_genpd_detach_dev; 282 287 lpsc->pm_domain.flags = GENPD_FLAG_PM_CLK;
+8 -8
drivers/clk/hisilicon/clkgate-separated.c
··· 17 17 #include "clk.h" 18 18 19 19 /* clock separated gate register offset */ 20 - #define CLKGATE_SEPERATED_ENABLE 0x0 21 - #define CLKGATE_SEPERATED_DISABLE 0x4 22 - #define CLKGATE_SEPERATED_STATUS 0x8 20 + #define CLKGATE_SEPARATED_ENABLE 0x0 21 + #define CLKGATE_SEPARATED_DISABLE 0x4 22 + #define CLKGATE_SEPARATED_STATUS 0x8 23 23 24 24 struct clkgate_separated { 25 25 struct clk_hw hw; ··· 40 40 spin_lock_irqsave(sclk->lock, flags); 41 41 reg = BIT(sclk->bit_idx); 42 42 writel_relaxed(reg, sclk->enable); 43 - readl_relaxed(sclk->enable + CLKGATE_SEPERATED_STATUS); 43 + readl_relaxed(sclk->enable + CLKGATE_SEPARATED_STATUS); 44 44 if (sclk->lock) 45 45 spin_unlock_irqrestore(sclk->lock, flags); 46 46 return 0; ··· 56 56 if (sclk->lock) 57 57 spin_lock_irqsave(sclk->lock, flags); 58 58 reg = BIT(sclk->bit_idx); 59 - writel_relaxed(reg, sclk->enable + CLKGATE_SEPERATED_DISABLE); 60 - readl_relaxed(sclk->enable + CLKGATE_SEPERATED_STATUS); 59 + writel_relaxed(reg, sclk->enable + CLKGATE_SEPARATED_DISABLE); 60 + readl_relaxed(sclk->enable + CLKGATE_SEPARATED_STATUS); 61 61 if (sclk->lock) 62 62 spin_unlock_irqrestore(sclk->lock, flags); 63 63 } ··· 68 68 u32 reg; 69 69 70 70 sclk = container_of(hw, struct clkgate_separated, hw); 71 - reg = readl_relaxed(sclk->enable + CLKGATE_SEPERATED_STATUS); 71 + reg = readl_relaxed(sclk->enable + CLKGATE_SEPARATED_STATUS); 72 72 reg &= BIT(sclk->bit_idx); 73 73 74 74 return reg ? 1 : 0; ··· 100 100 init.parent_names = (parent_name ? &parent_name : NULL); 101 101 init.num_parents = (parent_name ? 1 : 0); 102 102 103 - sclk->enable = reg + CLKGATE_SEPERATED_ENABLE; 103 + sclk->enable = reg + CLKGATE_SEPARATED_ENABLE; 104 104 sclk->bit_idx = bit_idx; 105 105 sclk->flags = clk_gate_flags; 106 106 sclk->hw.init = &init;
+4 -4
drivers/clk/imx/clk-busy.c
··· 46 46 return busy->div_ops->recalc_rate(&busy->div.hw, parent_rate); 47 47 } 48 48 49 - static long clk_busy_divider_round_rate(struct clk_hw *hw, unsigned long rate, 50 - unsigned long *prate) 49 + static int clk_busy_divider_determine_rate(struct clk_hw *hw, 50 + struct clk_rate_request *req) 51 51 { 52 52 struct clk_busy_divider *busy = to_clk_busy_divider(hw); 53 53 54 - return busy->div_ops->round_rate(&busy->div.hw, rate, prate); 54 + return busy->div_ops->determine_rate(&busy->div.hw, req); 55 55 } 56 56 57 57 static int clk_busy_divider_set_rate(struct clk_hw *hw, unsigned long rate, ··· 69 69 70 70 static const struct clk_ops clk_busy_divider_ops = { 71 71 .recalc_rate = clk_busy_divider_recalc_rate, 72 - .round_rate = clk_busy_divider_round_rate, 72 + .determine_rate = clk_busy_divider_determine_rate, 73 73 .set_rate = clk_busy_divider_set_rate, 74 74 }; 75 75
-16
drivers/clk/imx/clk-composite-8m.c
··· 73 73 return ret; 74 74 } 75 75 76 - static long imx8m_clk_composite_divider_round_rate(struct clk_hw *hw, 77 - unsigned long rate, 78 - unsigned long *prate) 79 - { 80 - int prediv_value; 81 - int div_value; 82 - 83 - imx8m_clk_composite_compute_dividers(rate, *prate, 84 - &prediv_value, &div_value); 85 - rate = DIV_ROUND_UP(*prate, prediv_value); 86 - 87 - return DIV_ROUND_UP(rate, div_value); 88 - 89 - } 90 - 91 76 static int imx8m_clk_composite_divider_set_rate(struct clk_hw *hw, 92 77 unsigned long rate, 93 78 unsigned long parent_rate) ··· 138 153 139 154 static const struct clk_ops imx8m_clk_composite_divider_ops = { 140 155 .recalc_rate = imx8m_clk_composite_divider_recalc_rate, 141 - .round_rate = imx8m_clk_composite_divider_round_rate, 142 156 .set_rate = imx8m_clk_composite_divider_set_rate, 143 157 .determine_rate = imx8m_divider_determine_rate, 144 158 };
-7
drivers/clk/imx/clk-composite-93.c
··· 98 98 return clk_divider_ops.recalc_rate(hw, parent_rate); 99 99 } 100 100 101 - static long 102 - imx93_clk_composite_divider_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *prate) 103 - { 104 - return clk_divider_ops.round_rate(hw, rate, prate); 105 - } 106 - 107 101 static int 108 102 imx93_clk_composite_divider_determine_rate(struct clk_hw *hw, struct clk_rate_request *req) 109 103 { ··· 135 141 136 142 static const struct clk_ops imx93_clk_composite_divider_ops = { 137 143 .recalc_rate = imx93_clk_composite_divider_recalc_rate, 138 - .round_rate = imx93_clk_composite_divider_round_rate, 139 144 .determine_rate = imx93_clk_composite_divider_determine_rate, 140 145 .set_rate = imx93_clk_composite_divider_set_rate, 141 146 };
+6 -4
drivers/clk/imx/clk-cpu.c
··· 30 30 return clk_get_rate(cpu->div); 31 31 } 32 32 33 - static long clk_cpu_round_rate(struct clk_hw *hw, unsigned long rate, 34 - unsigned long *prate) 33 + static int clk_cpu_determine_rate(struct clk_hw *hw, 34 + struct clk_rate_request *req) 35 35 { 36 36 struct clk_cpu *cpu = to_clk_cpu(hw); 37 37 38 - return clk_round_rate(cpu->pll, rate); 38 + req->rate = clk_round_rate(cpu->pll, req->rate); 39 + 40 + return 0; 39 41 } 40 42 41 43 static int clk_cpu_set_rate(struct clk_hw *hw, unsigned long rate, ··· 68 66 69 67 static const struct clk_ops clk_cpu_ops = { 70 68 .recalc_rate = clk_cpu_recalc_rate, 71 - .round_rate = clk_cpu_round_rate, 69 + .determine_rate = clk_cpu_determine_rate, 72 70 .set_rate = clk_cpu_set_rate, 73 71 }; 74 72
+5 -5
drivers/clk/imx/clk-fixup-div.c
··· 18 18 * @fixup: a hook to fixup the write value 19 19 * 20 20 * The imx fixup divider clock is a subclass of basic clk_divider 21 - * with an addtional fixup hook. 21 + * with an additional fixup hook. 22 22 */ 23 23 struct clk_fixup_div { 24 24 struct clk_divider divider; ··· 41 41 return fixup_div->ops->recalc_rate(&fixup_div->divider.hw, parent_rate); 42 42 } 43 43 44 - static long clk_fixup_div_round_rate(struct clk_hw *hw, unsigned long rate, 45 - unsigned long *prate) 44 + static int clk_fixup_div_determine_rate(struct clk_hw *hw, 45 + struct clk_rate_request *req) 46 46 { 47 47 struct clk_fixup_div *fixup_div = to_clk_fixup_div(hw); 48 48 49 - return fixup_div->ops->round_rate(&fixup_div->divider.hw, rate, prate); 49 + return fixup_div->ops->determine_rate(&fixup_div->divider.hw, req); 50 50 } 51 51 52 52 static int clk_fixup_div_set_rate(struct clk_hw *hw, unsigned long rate, ··· 81 81 82 82 static const struct clk_ops clk_fixup_div_ops = { 83 83 .recalc_rate = clk_fixup_div_recalc_rate, 84 - .round_rate = clk_fixup_div_round_rate, 84 + .determine_rate = clk_fixup_div_determine_rate, 85 85 .set_rate = clk_fixup_div_set_rate, 86 86 }; 87 87
+1 -1
drivers/clk/imx/clk-fixup-mux.c
··· 17 17 * @fixup: a hook to fixup the write value 18 18 * 19 19 * The imx fixup multiplexer clock is a subclass of basic clk_mux 20 - * with an addtional fixup hook. 20 + * with an additional fixup hook. 21 21 */ 22 22 struct clk_fixup_mux { 23 23 struct clk_mux mux;
+11 -9
drivers/clk/imx/clk-frac-pll.c
··· 119 119 return rate; 120 120 } 121 121 122 - static long clk_pll_round_rate(struct clk_hw *hw, unsigned long rate, 123 - unsigned long *prate) 122 + static int clk_pll_determine_rate(struct clk_hw *hw, 123 + struct clk_rate_request *req) 124 124 { 125 - u64 parent_rate = *prate; 125 + u64 parent_rate = req->best_parent_rate; 126 126 u32 divff, divfi; 127 127 u64 temp64; 128 128 129 129 parent_rate *= 8; 130 - rate *= 2; 131 - temp64 = rate; 130 + req->rate *= 2; 131 + temp64 = req->rate; 132 132 do_div(temp64, parent_rate); 133 133 divfi = temp64; 134 - temp64 = rate - divfi * parent_rate; 134 + temp64 = req->rate - divfi * parent_rate; 135 135 temp64 *= PLL_FRAC_DENOM; 136 136 do_div(temp64, parent_rate); 137 137 divff = temp64; ··· 140 140 temp64 *= divff; 141 141 do_div(temp64, PLL_FRAC_DENOM); 142 142 143 - rate = parent_rate * divfi + temp64; 143 + req->rate = parent_rate * divfi + temp64; 144 144 145 - return rate / 2; 145 + req->rate = req->rate / 2; 146 + 147 + return 0; 146 148 } 147 149 148 150 /* ··· 200 198 .unprepare = clk_pll_unprepare, 201 199 .is_prepared = clk_pll_is_prepared, 202 200 .recalc_rate = clk_pll_recalc_rate, 203 - .round_rate = clk_pll_round_rate, 201 + .determine_rate = clk_pll_determine_rate, 204 202 .set_rate = clk_pll_set_rate, 205 203 }; 206 204
+11 -6
drivers/clk/imx/clk-fracn-gppll.c
··· 134 134 return NULL; 135 135 } 136 136 137 - static long clk_fracn_gppll_round_rate(struct clk_hw *hw, unsigned long rate, 138 - unsigned long *prate) 137 + static int clk_fracn_gppll_determine_rate(struct clk_hw *hw, 138 + struct clk_rate_request *req) 139 139 { 140 140 struct clk_fracn_gppll *pll = to_clk_fracn_gppll(hw); 141 141 const struct imx_fracn_gppll_rate_table *rate_table = pll->rate_table; ··· 143 143 144 144 /* Assuming rate_table is in descending order */ 145 145 for (i = 0; i < pll->rate_count; i++) 146 - if (rate >= rate_table[i].rate) 147 - return rate_table[i].rate; 146 + if (req->rate >= rate_table[i].rate) { 147 + req->rate = rate_table[i].rate; 148 + 149 + return 0; 150 + } 148 151 149 152 /* return minimum supported value */ 150 - return rate_table[pll->rate_count - 1].rate; 153 + req->rate = rate_table[pll->rate_count - 1].rate; 154 + 155 + return 0; 151 156 } 152 157 153 158 static unsigned long clk_fracn_gppll_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) ··· 350 345 .unprepare = clk_fracn_gppll_unprepare, 351 346 .is_prepared = clk_fracn_gppll_is_prepared, 352 347 .recalc_rate = clk_fracn_gppll_recalc_rate, 353 - .round_rate = clk_fracn_gppll_round_rate, 348 + .determine_rate = clk_fracn_gppll_determine_rate, 354 349 .set_rate = clk_fracn_gppll_set_rate, 355 350 }; 356 351
+1 -1
drivers/clk/imx/clk-gate-exclusive.c
··· 18 18 * gate clock 19 19 * 20 20 * The imx exclusive gate clock is a subclass of basic clk_gate 21 - * with an addtional mask to indicate which other gate bits in the same 21 + * with an additional mask to indicate which other gate bits in the same 22 22 * register is mutually exclusive to this gate clock. 23 23 */ 24 24 struct clk_gate_exclusive {
+1 -1
drivers/clk/imx/clk-imx5.c
··· 454 454 * longer supported. Set to one for better power saving. 455 455 * 456 456 * The effect of not setting these bits is that MIPI clocks can't be 457 - * enabled without the IPU clock being enabled aswell. 457 + * enabled without the IPU clock being enabled as well. 458 458 */ 459 459 val = readl(MXC_CCM_CCDR); 460 460 val |= 1 << 18;
+1 -1
drivers/clk/imx/clk-imx8-acm.c
··· 22 22 * struct clk_imx_acm_pm_domains - structure for multi power domain 23 23 * @pd_dev: power domain device 24 24 * @pd_dev_link: power domain device link 25 - * @num_domains: power domain nummber 25 + * @num_domains: power domain number 26 26 */ 27 27 struct clk_imx_acm_pm_domains { 28 28 struct device **pd_dev;
+10 -8
drivers/clk/imx/clk-pfd.c
··· 62 62 return tmp; 63 63 } 64 64 65 - static long clk_pfd_round_rate(struct clk_hw *hw, unsigned long rate, 66 - unsigned long *prate) 65 + static int clk_pfd_determine_rate(struct clk_hw *hw, 66 + struct clk_rate_request *req) 67 67 { 68 - u64 tmp = *prate; 68 + u64 tmp = req->best_parent_rate; 69 69 u8 frac; 70 70 71 - tmp = tmp * 18 + rate / 2; 72 - do_div(tmp, rate); 71 + tmp = tmp * 18 + req->rate / 2; 72 + do_div(tmp, req->rate); 73 73 frac = tmp; 74 74 if (frac < 12) 75 75 frac = 12; 76 76 else if (frac > 35) 77 77 frac = 35; 78 - tmp = *prate; 78 + tmp = req->best_parent_rate; 79 79 tmp *= 18; 80 80 do_div(tmp, frac); 81 81 82 - return tmp; 82 + req->rate = tmp; 83 + 84 + return 0; 83 85 } 84 86 85 87 static int clk_pfd_set_rate(struct clk_hw *hw, unsigned long rate, ··· 119 117 .enable = clk_pfd_enable, 120 118 .disable = clk_pfd_disable, 121 119 .recalc_rate = clk_pfd_recalc_rate, 122 - .round_rate = clk_pfd_round_rate, 120 + .determine_rate = clk_pfd_determine_rate, 123 121 .set_rate = clk_pfd_set_rate, 124 122 .is_enabled = clk_pfd_is_enabled, 125 123 };
+18 -11
drivers/clk/imx/clk-pll14xx.c
··· 216 216 t->mdiv, t->kdiv); 217 217 } 218 218 219 - static long clk_pll1416x_round_rate(struct clk_hw *hw, unsigned long rate, 220 - unsigned long *prate) 219 + static int clk_pll1416x_determine_rate(struct clk_hw *hw, 220 + struct clk_rate_request *req) 221 221 { 222 222 struct clk_pll14xx *pll = to_clk_pll14xx(hw); 223 223 const struct imx_pll14xx_rate_table *rate_table = pll->rate_table; ··· 225 225 226 226 /* Assuming rate_table is in descending order */ 227 227 for (i = 0; i < pll->rate_count; i++) 228 - if (rate >= rate_table[i].rate) 229 - return rate_table[i].rate; 228 + if (req->rate >= rate_table[i].rate) { 229 + req->rate = rate_table[i].rate; 230 + 231 + return 0; 232 + } 230 233 231 234 /* return minimum supported value */ 232 - return rate_table[pll->rate_count - 1].rate; 235 + req->rate = rate_table[pll->rate_count - 1].rate; 236 + 237 + return 0; 233 238 } 234 239 235 - static long clk_pll1443x_round_rate(struct clk_hw *hw, unsigned long rate, 236 - unsigned long *prate) 240 + static int clk_pll1443x_determine_rate(struct clk_hw *hw, 241 + struct clk_rate_request *req) 237 242 { 238 243 struct clk_pll14xx *pll = to_clk_pll14xx(hw); 239 244 struct imx_pll14xx_rate_table t; 240 245 241 - imx_pll14xx_calc_settings(pll, rate, *prate, &t); 246 + imx_pll14xx_calc_settings(pll, req->rate, req->best_parent_rate, &t); 242 247 243 - return t.rate; 248 + req->rate = t.rate; 249 + 250 + return 0; 244 251 } 245 252 246 253 static unsigned long clk_pll14xx_recalc_rate(struct clk_hw *hw, ··· 477 470 .unprepare = clk_pll14xx_unprepare, 478 471 .is_prepared = clk_pll14xx_is_prepared, 479 472 .recalc_rate = clk_pll14xx_recalc_rate, 480 - .round_rate = clk_pll1416x_round_rate, 473 + .determine_rate = clk_pll1416x_determine_rate, 481 474 .set_rate = clk_pll1416x_set_rate, 482 475 }; 483 476 ··· 490 483 .unprepare = clk_pll14xx_unprepare, 491 484 .is_prepared = clk_pll14xx_is_prepared, 492 485 .recalc_rate = clk_pll14xx_recalc_rate, 493 - .round_rate = clk_pll1443x_round_rate, 486 + .determine_rate = clk_pll1443x_determine_rate, 494 487 .set_rate = clk_pll1443x_set_rate, 495 488 }; 496 489
+15 -8
drivers/clk/imx/clk-pllv2.c
··· 178 178 return 0; 179 179 } 180 180 181 - static long clk_pllv2_round_rate(struct clk_hw *hw, unsigned long rate, 182 - unsigned long *prate) 181 + static int clk_pllv2_determine_rate(struct clk_hw *hw, 182 + struct clk_rate_request *req) 183 183 { 184 184 u32 dp_op, dp_mfd, dp_mfn; 185 185 int ret; 186 186 187 - ret = __clk_pllv2_set_rate(rate, *prate, &dp_op, &dp_mfd, &dp_mfn); 188 - if (ret) 189 - return ret; 187 + ret = __clk_pllv2_set_rate(req->rate, req->best_parent_rate, &dp_op, 188 + &dp_mfd, &dp_mfn); 189 + if (ret) { 190 + req->rate = ret; 190 191 191 - return __clk_pllv2_recalc_rate(*prate, MXC_PLL_DP_CTL_DPDCK0_2_EN, 192 - dp_op, dp_mfd, dp_mfn); 192 + return 0; 193 + } 194 + 195 + req->rate = __clk_pllv2_recalc_rate(req->best_parent_rate, 196 + MXC_PLL_DP_CTL_DPDCK0_2_EN, dp_op, 197 + dp_mfd, dp_mfn); 198 + 199 + return 0; 193 200 } 194 201 195 202 static int clk_pllv2_prepare(struct clk_hw *hw) ··· 242 235 .prepare = clk_pllv2_prepare, 243 236 .unprepare = clk_pllv2_unprepare, 244 237 .recalc_rate = clk_pllv2_recalc_rate, 245 - .round_rate = clk_pllv2_round_rate, 238 + .determine_rate = clk_pllv2_determine_rate, 246 239 .set_rate = clk_pllv2_set_rate, 247 240 }; 248 241
+40 -32
drivers/clk/imx/clk-pllv3.c
··· 117 117 return (div == 1) ? parent_rate * 22 : parent_rate * 20; 118 118 } 119 119 120 - static long clk_pllv3_round_rate(struct clk_hw *hw, unsigned long rate, 121 - unsigned long *prate) 120 + static int clk_pllv3_determine_rate(struct clk_hw *hw, 121 + struct clk_rate_request *req) 122 122 { 123 - unsigned long parent_rate = *prate; 123 + unsigned long parent_rate = req->best_parent_rate; 124 124 125 - return (rate >= parent_rate * 22) ? parent_rate * 22 : 126 - parent_rate * 20; 125 + req->rate = (req->rate >= parent_rate * 22) ? parent_rate * 22 : parent_rate * 20; 126 + 127 + return 0; 127 128 } 128 129 129 130 static int clk_pllv3_set_rate(struct clk_hw *hw, unsigned long rate, ··· 153 152 .unprepare = clk_pllv3_unprepare, 154 153 .is_prepared = clk_pllv3_is_prepared, 155 154 .recalc_rate = clk_pllv3_recalc_rate, 156 - .round_rate = clk_pllv3_round_rate, 155 + .determine_rate = clk_pllv3_determine_rate, 157 156 .set_rate = clk_pllv3_set_rate, 158 157 }; 159 158 ··· 166 165 return parent_rate * div / 2; 167 166 } 168 167 169 - static long clk_pllv3_sys_round_rate(struct clk_hw *hw, unsigned long rate, 170 - unsigned long *prate) 168 + static int clk_pllv3_sys_determine_rate(struct clk_hw *hw, 169 + struct clk_rate_request *req) 171 170 { 172 - unsigned long parent_rate = *prate; 171 + unsigned long parent_rate = req->best_parent_rate; 173 172 unsigned long min_rate = parent_rate * 54 / 2; 174 173 unsigned long max_rate = parent_rate * 108 / 2; 175 174 u32 div; 176 175 177 - if (rate > max_rate) 178 - rate = max_rate; 179 - else if (rate < min_rate) 180 - rate = min_rate; 181 - div = rate * 2 / parent_rate; 176 + if (req->rate > max_rate) 177 + req->rate = max_rate; 178 + else if (req->rate < min_rate) 179 + req->rate = min_rate; 180 + div = req->rate * 2 / parent_rate; 182 181 183 - return parent_rate * div / 2; 182 + req->rate = parent_rate * div / 2; 183 + 184 + return 0; 184 185 } 185 186 186 187 static int clk_pllv3_sys_set_rate(struct clk_hw *hw, unsigned long rate, ··· 210 207 .unprepare = clk_pllv3_unprepare, 211 208 .is_prepared = clk_pllv3_is_prepared, 212 209 .recalc_rate = clk_pllv3_sys_recalc_rate, 213 - .round_rate = clk_pllv3_sys_round_rate, 210 + .determine_rate = clk_pllv3_sys_determine_rate, 214 211 .set_rate = clk_pllv3_sys_set_rate, 215 212 }; 216 213 ··· 229 226 return parent_rate * div + (unsigned long)temp64; 230 227 } 231 228 232 - static long clk_pllv3_av_round_rate(struct clk_hw *hw, unsigned long rate, 233 - unsigned long *prate) 229 + static int clk_pllv3_av_determine_rate(struct clk_hw *hw, 230 + struct clk_rate_request *req) 234 231 { 235 - unsigned long parent_rate = *prate; 232 + unsigned long parent_rate = req->best_parent_rate; 236 233 unsigned long min_rate = parent_rate * 27; 237 234 unsigned long max_rate = parent_rate * 54; 238 235 u32 div; ··· 240 237 u32 max_mfd = 0x3FFFFFFF; 241 238 u64 temp64; 242 239 243 - if (rate > max_rate) 244 - rate = max_rate; 245 - else if (rate < min_rate) 246 - rate = min_rate; 240 + if (req->rate > max_rate) 241 + req->rate = max_rate; 242 + else if (req->rate < min_rate) 243 + req->rate = min_rate; 247 244 248 245 if (parent_rate <= max_mfd) 249 246 mfd = parent_rate; 250 247 251 - div = rate / parent_rate; 252 - temp64 = (u64) (rate - div * parent_rate); 248 + div = req->rate / parent_rate; 249 + temp64 = (u64) (req->rate - div * parent_rate); 253 250 temp64 *= mfd; 254 251 temp64 = div64_ul(temp64, parent_rate); 255 252 mfn = temp64; ··· 258 255 temp64 *= mfn; 259 256 do_div(temp64, mfd); 260 257 261 - return parent_rate * div + (unsigned long)temp64; 258 + req->rate = parent_rate * div + (unsigned long)temp64; 259 + 260 + return 0; 262 261 } 263 262 264 263 static int clk_pllv3_av_set_rate(struct clk_hw *hw, unsigned long rate, ··· 301 296 .unprepare = clk_pllv3_unprepare, 302 297 .is_prepared = clk_pllv3_is_prepared, 303 298 .recalc_rate = clk_pllv3_av_recalc_rate, 304 - .round_rate = clk_pllv3_av_round_rate, 299 + .determine_rate = clk_pllv3_av_determine_rate, 305 300 .set_rate = clk_pllv3_av_set_rate, 306 301 }; 307 302 ··· 360 355 return clk_pllv3_vf610_mf_to_rate(parent_rate, mf); 361 356 } 362 357 363 - static long clk_pllv3_vf610_round_rate(struct clk_hw *hw, unsigned long rate, 364 - unsigned long *prate) 358 + static int clk_pllv3_vf610_determine_rate(struct clk_hw *hw, 359 + struct clk_rate_request *req) 365 360 { 366 - struct clk_pllv3_vf610_mf mf = clk_pllv3_vf610_rate_to_mf(*prate, rate); 361 + struct clk_pllv3_vf610_mf mf = clk_pllv3_vf610_rate_to_mf(req->best_parent_rate, 362 + req->rate); 367 363 368 - return clk_pllv3_vf610_mf_to_rate(*prate, mf); 364 + req->rate = clk_pllv3_vf610_mf_to_rate(req->best_parent_rate, mf); 365 + 366 + return 0; 369 367 } 370 368 371 369 static int clk_pllv3_vf610_set_rate(struct clk_hw *hw, unsigned long rate, ··· 397 389 .unprepare = clk_pllv3_unprepare, 398 390 .is_prepared = clk_pllv3_is_prepared, 399 391 .recalc_rate = clk_pllv3_vf610_recalc_rate, 400 - .round_rate = clk_pllv3_vf610_round_rate, 392 + .determine_rate = clk_pllv3_vf610_determine_rate, 401 393 .set_rate = clk_pllv3_vf610_set_rate, 402 394 }; 403 395
+18 -11
drivers/clk/imx/clk-pllv4.c
··· 95 95 return (parent_rate * mult) + (u32)temp64; 96 96 } 97 97 98 - static long clk_pllv4_round_rate(struct clk_hw *hw, unsigned long rate, 99 - unsigned long *prate) 98 + static int clk_pllv4_determine_rate(struct clk_hw *hw, 99 + struct clk_rate_request *req) 100 100 { 101 101 struct clk_pllv4 *pll = to_clk_pllv4(hw); 102 - unsigned long parent_rate = *prate; 102 + unsigned long parent_rate = req->best_parent_rate; 103 103 unsigned long round_rate, i; 104 104 u32 mfn, mfd = DEFAULT_MFD; 105 105 bool found = false; ··· 107 107 u32 mult; 108 108 109 109 if (pll->use_mult_range) { 110 - temp64 = (u64)rate; 110 + temp64 = (u64) req->rate; 111 111 do_div(temp64, parent_rate); 112 112 mult = temp64; 113 113 if (mult >= pllv4_mult_range[1] && ··· 118 118 } else { 119 119 for (i = 0; i < ARRAY_SIZE(pllv4_mult_table); i++) { 120 120 round_rate = parent_rate * pllv4_mult_table[i]; 121 - if (rate >= round_rate) { 121 + if (req->rate >= round_rate) { 122 122 found = true; 123 123 break; 124 124 } ··· 127 127 128 128 if (!found) { 129 129 pr_warn("%s: unable to round rate %lu, parent rate %lu\n", 130 - clk_hw_get_name(hw), rate, parent_rate); 130 + clk_hw_get_name(hw), req->rate, parent_rate); 131 + req->rate = 0; 132 + 131 133 return 0; 132 134 } 133 135 134 136 if (parent_rate <= MAX_MFD) 135 137 mfd = parent_rate; 136 138 137 - temp64 = (u64)(rate - round_rate); 139 + temp64 = (u64)(req->rate - round_rate); 138 140 temp64 *= mfd; 139 141 do_div(temp64, parent_rate); 140 142 mfn = temp64; ··· 147 145 * pair of mfn/mfd, we simply return the round_rate without using 148 146 * the frac part. 149 147 */ 150 - if (mfn >= mfd) 151 - return round_rate; 148 + if (mfn >= mfd) { 149 + req->rate = round_rate; 150 + 151 + return 0; 152 + } 152 153 153 154 temp64 = (u64)parent_rate; 154 155 temp64 *= mfn; 155 156 do_div(temp64, mfd); 156 157 157 - return round_rate + (u32)temp64; 158 + req->rate = round_rate + (u32)temp64; 159 + 160 + return 0; 158 161 } 159 162 160 163 static bool clk_pllv4_is_valid_mult(struct clk_pllv4 *pll, unsigned int mult) ··· 236 229 237 230 static const struct clk_ops clk_pllv4_ops = { 238 231 .recalc_rate = clk_pllv4_recalc_rate, 239 - .round_rate = clk_pllv4_round_rate, 232 + .determine_rate = clk_pllv4_determine_rate, 240 233 .set_rate = clk_pllv4_set_rate, 241 234 .prepare = clk_pllv4_prepare, 242 235 .unprepare = clk_pllv4_unprepare,
+10 -28
drivers/clk/imx/clk-scu.c
··· 269 269 return 0; 270 270 } 271 271 272 - /* 273 - * clk_scu_round_rate - Round clock rate for a SCU clock 274 - * @hw: clock to round rate for 275 - * @rate: rate to round 276 - * @parent_rate: parent rate provided by common clock framework, not used 277 - * 278 - * Returns the current clock rate, or zero in failure. 279 - */ 280 - static long clk_scu_round_rate(struct clk_hw *hw, unsigned long rate, 281 - unsigned long *parent_rate) 282 - { 283 - /* 284 - * Assume we support all the requested rate and let the SCU firmware 285 - * to handle the left work 286 - */ 287 - return rate; 288 - } 289 - 290 272 static int clk_scu_atf_set_cpu_rate(struct clk_hw *hw, unsigned long rate, 291 273 unsigned long parent_rate) 292 274 { ··· 436 454 437 455 static const struct clk_ops clk_scu_cpu_ops = { 438 456 .recalc_rate = clk_scu_recalc_rate, 439 - .round_rate = clk_scu_round_rate, 457 + .determine_rate = clk_scu_determine_rate, 440 458 .set_rate = clk_scu_atf_set_cpu_rate, 441 459 .prepare = clk_scu_prepare, 442 460 .unprepare = clk_scu_unprepare, ··· 444 462 445 463 static const struct clk_ops clk_scu_pi_ops = { 446 464 .recalc_rate = clk_scu_recalc_rate, 447 - .round_rate = clk_scu_round_rate, 465 + .determine_rate = clk_scu_determine_rate, 448 466 .set_rate = clk_scu_set_rate, 449 467 }; 450 468 ··· 711 729 if (ret) 712 730 goto put_device; 713 731 714 - /* For API backwards compatiblilty, simply return NULL for success */ 732 + /* For API backwards compatibility, simply return NULL for success */ 715 733 return NULL; 716 734 717 735 put_device: ··· 748 766 return err ? 0 : rate; 749 767 } 750 768 751 - static long clk_gpr_div_scu_round_rate(struct clk_hw *hw, unsigned long rate, 752 - unsigned long *prate) 769 + static int clk_gpr_div_scu_determine_rate(struct clk_hw *hw, 770 + struct clk_rate_request *req) 753 771 { 754 - if (rate < *prate) 755 - rate = *prate / 2; 772 + if (req->rate < req->best_parent_rate) 773 + req->rate = req->best_parent_rate / 2; 756 774 else 757 - rate = *prate; 775 + req->rate = req->best_parent_rate; 758 776 759 - return rate; 777 + return 0; 760 778 } 761 779 762 780 static int clk_gpr_div_scu_set_rate(struct clk_hw *hw, unsigned long rate, ··· 775 793 776 794 static const struct clk_ops clk_gpr_div_scu_ops = { 777 795 .recalc_rate = clk_gpr_div_scu_recalc_rate, 778 - .round_rate = clk_gpr_div_scu_round_rate, 796 + .determine_rate = clk_gpr_div_scu_determine_rate, 779 797 .set_rate = clk_gpr_div_scu_set_rate, 780 798 }; 781 799
+1 -1
drivers/clk/ingenic/cgu.h
··· 239 239 * 240 240 * Register the clocks described by the CGU with the common clock framework. 241 241 * 242 - * Return: 0 on success or -errno if unsuccesful. 242 + * Return: 0 on success or -errno if unsuccessful. 243 243 */ 244 244 int ingenic_cgu_register_clocks(struct ingenic_cgu *cgu); 245 245
+10
drivers/clk/kunit_clk_hw_get_dev_of_node.dtso
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /dts-v1/; 3 + /plugin/; 4 + 5 + &{/} { 6 + kunit-clock-controller { 7 + compatible = "test,clk-hw-get-dev-of-node"; 8 + #clock-cells = <0>; 9 + }; 10 + };
+1 -1
drivers/clk/meson/axg.c
··· 918 918 /* 919 919 * Following these parent clocks, we should also have had mpll2, mpll3 920 920 * and gp0_pll but these clocks are too precious to be used here. All 921 - * the necessary rates for MMC and NAND operation can be acheived using 921 + * the necessary rates for MMC and NAND operation can be achieved using 922 922 * xtal or fclk_div clocks 923 923 */ 924 924 };
+3 -3
drivers/clk/meson/g12a.c
··· 2489 2489 /* 2490 2490 * Following these parent clocks, we should also have had mpll2, mpll3 2491 2491 * and gp0_pll but these clocks are too precious to be used here. All 2492 - * the necessary rates for MMC and NAND operation can be acheived using 2492 + * the necessary rates for MMC and NAND operation can be achieved using 2493 2493 * g12a_ee_core or fclk_div clocks 2494 2494 */ 2495 2495 }; ··· 3753 3753 }; 3754 3754 3755 3755 /* 3756 - * FIXME: Force as bypass by forcing a single /1 table entry, and doensn't on boot value 3757 - * when setting a clock whith this node in the clock path, but doesn't garantee the divider 3756 + * FIXME: Force as bypass by forcing a single /1 table entry, and doesn't on boot value 3757 + * when setting a clock with this node in the clock path, but doesn't guarantee the divider 3758 3758 * is at /1 at boot until a rate is set. 3759 3759 */ 3760 3760 static const struct clk_div_table g12a_mipi_dsi_pxclk_div_table[] = {
+1 -1
drivers/clk/meson/gxbb.c
··· 1335 1335 /* 1336 1336 * Following these parent clocks, we should also have had mpll2, mpll3 1337 1337 * and gp0_pll but these clocks are too precious to be used here. All 1338 - * the necessary rates for MMC and NAND operation can be acheived using 1338 + * the necessary rates for MMC and NAND operation can be achieved using 1339 1339 * xtal or fclk_div clocks 1340 1340 */ 1341 1341 };
+1 -1
drivers/clk/microchip/clk-core.c
··· 326 326 * i.e. fout = fin / 2 * DIV 327 327 * whereas DIV = rodiv + (rotrim / 512) 328 328 * 329 - * Since kernel does not perform floating-point arithmatic so 329 + * Since kernel does not perform floating-point arithmetic so 330 330 * (rotrim/512) will be zero. And DIV & rodiv will result same. 331 331 * 332 332 * ie. fout = (fin * 256) / [(512 * rodiv) + rotrim] ... from (1)
+1 -1
drivers/clk/mmp/clk-gate.c
··· 15 15 #include "clk.h" 16 16 17 17 /* 18 - * Some clocks will have mutiple bits to enable the clocks, and 18 + * Some clocks will have multiple bits to enable the clocks, and 19 19 * the bits to disable the clock is not same as enabling bits. 20 20 */ 21 21
+2 -3
drivers/clk/mvebu/armada-xp.c
··· 7 7 * Gregory CLEMENT <gregory.clement@free-electrons.com> 8 8 * Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> 9 9 * Andrew Lunn <andrew@lunn.ch> 10 - * 11 10 */ 12 11 13 12 #include <linux/kernel.h> ··· 18 19 /* 19 20 * Core Clocks 20 21 * 21 - * Armada XP Sample At Reset is a 64 bit bitfiled split in two 22 - * register of 32 bits 22 + * Armada XP Sample At Reset is a 64 bit bitfield split in two 23 + * registers of 32 bits 23 24 */ 24 25 25 26 #define SARL 0 /* Low part [0:31] */
+1 -1
drivers/clk/mxs/clk-div.c
··· 16 16 * @busy: busy bit shift 17 17 * 18 18 * The mxs divider clock is a subclass of basic clk_divider with an 19 - * addtional busy bit. 19 + * additional busy bit. 20 20 */ 21 21 struct clk_div { 22 22 struct clk_divider divider;
+2 -2
drivers/clk/nuvoton/Kconfig
··· 4 4 config COMMON_CLK_NUVOTON 5 5 bool "Nuvoton clock controller common support" 6 6 depends on ARCH_MA35 || COMPILE_TEST 7 - default y 7 + default ARCH_MA35 8 8 help 9 9 Say y here to enable common clock controller for Nuvoton platforms. 10 10 ··· 12 12 13 13 config CLK_MA35D1 14 14 bool "Nuvoton MA35D1 clock controller support" 15 - default y 15 + default ARCH_MA35 16 16 help 17 17 Build the clock controller driver for MA35D1 SoC. 18 18
+1 -1
drivers/clk/nxp/clk-lpc18xx-ccu.c
··· 148 148 val |= LPC18XX_CCU_RUN; 149 149 } else { 150 150 /* 151 - * To safely disable a branch clock a squence of two separate 151 + * To safely disable a branch clock a sequence of two separate 152 152 * writes must be used. First write should set the AUTO bit 153 153 * and the next write should clear the RUN bit. 154 154 */
+3 -3
drivers/clk/qcom/gcc-sm8150.c
··· 1245 1245 }; 1246 1246 1247 1247 /* 1248 - * Clock ON depends on external parent 'config noc', so cant poll 1248 + * Clock ON depends on external parent 'config noc', so can't poll 1249 1249 * delay and also mark as crtitical for camss boot 1250 1250 */ 1251 1251 static struct clk_branch gcc_camera_ahb_clk = { ··· 1398 1398 }; 1399 1399 1400 1400 /* 1401 - * Clock ON depends on external parent 'config noc', so cant poll 1401 + * Clock ON depends on external parent 'config noc', so can't poll 1402 1402 * delay and also mark as crtitical for disp boot 1403 1403 */ 1404 1404 static struct clk_branch gcc_disp_ahb_clk = { ··· 3339 3339 }; 3340 3340 3341 3341 /* 3342 - * Clock ON depends on external parent 'config noc', so cant poll 3342 + * Clock ON depends on external parent 'config noc', so can't poll 3343 3343 * delay and also mark as crtitical for video boot 3344 3344 */ 3345 3345 static struct clk_branch gcc_video_ahb_clk = {
+3 -3
drivers/clk/rockchip/clk-cpu.c
··· 16 16 * of the SoC or supplied after the SoC characterization. 17 17 * 18 18 * The below implementation of the CPU clock allows the rate changes of the CPU 19 - * clock and the corresponding rate changes of the auxillary clocks of the CPU 19 + * clock and the corresponding rate changes of the auxiliary clocks of the CPU 20 20 * domain. The platform clock driver provides a clock register configuration 21 21 * for each configurable rate which is then used to program the clock hardware 22 - * registers to acheive a fast co-oridinated rate change for all the CPU domain 22 + * registers to achieve a fast co-oridinated rate change for all the CPU domain 23 23 * clocks. 24 24 * 25 25 * On a rate change request for the CPU clock, the rate change is propagated 26 - * upto the PLL supplying the clock to the CPU domain clock blocks. While the 26 + * up to the PLL supplying the clock to the CPU domain clock blocks. While the 27 27 * CPU domain PLL is reconfigured, the CPU domain clocks are driven using an 28 28 * alternate clock source. If required, the alternate clock source is divided 29 29 * down in order to keep the output clock rate within the previous OPP limits.
+2 -2
drivers/clk/rockchip/clk-mmc-phase.c
··· 174 174 175 175 /* 176 176 * rockchip_mmc_clk is mostly used by mmc controllers to sample 177 - * the intput data, which expects the fixed phase after the tuning 177 + * the input data, which expects the fixed phase after the tuning 178 178 * process. However if the clock rate is changed, the phase is stale 179 179 * and may break the data sampling. So here we try to restore the phase 180 180 * for that case, except that 181 - * (1) cached_phase is invaild since we inevitably cached it when the 181 + * (1) cached_phase is invalid since we inevitably cached it when the 182 182 * clock provider be reparented from orphan to its real parent in the 183 183 * first place. Otherwise we may mess up the initialization of MMC cards 184 184 * since we only set the default sample phase and drive phase later on.
+1 -1
drivers/clk/rockchip/clk-pll.c
··· 68 68 const struct rockchip_pll_rate_table *rate_table = pll->rate_table; 69 69 int i; 70 70 71 - /* Assumming rate_table is in descending order */ 71 + /* Assuming rate_table is in descending order */ 72 72 for (i = 0; i < pll->rate_count; i++) { 73 73 if (drate >= rate_table[i].rate) 74 74 return rate_table[i].rate;
+1 -1
drivers/clk/rockchip/clk.h
··· 532 532 * 533 533 * Flags: 534 534 * ROCKCHIP_PLL_SYNC_RATE - check rate parameters to match against the 535 - * rate_table parameters and ajust them if necessary. 535 + * rate_table parameters and adjust them if necessary. 536 536 * ROCKCHIP_PLL_FIXED_MODE - the pll operates in normal mode only 537 537 */ 538 538 struct rockchip_pll_clock {
+1 -1
drivers/clk/samsung/clk-cpu.c
··· 243 243 if (cpuclk->flags & CLK_CPU_NEEDS_DEBUG_ALT_DIV) { 244 244 /* 245 245 * In Exynos4210, ATB clock parent is also mout_core. So 246 - * ATB clock also needs to be mantained at safe speed. 246 + * ATB clock also needs to be maintained at safe speed. 247 247 */ 248 248 alt_div |= E4210_DIV0_ATB_MASK; 249 249 alt_div_mask |= E4210_DIV0_ATB_MASK;
+1 -1
drivers/clk/samsung/clk-pll.c
··· 56 56 const struct samsung_pll_rate_table *rate_table = pll->rate_table; 57 57 int i; 58 58 59 - /* Assumming rate_table is in descending order */ 59 + /* Assuming rate_table is in descending order */ 60 60 for (i = 0; i < pll->rate_count; i++) { 61 61 if (drate >= rate_table[i].rate) 62 62 return rate_table[i].rate;
+1 -1
drivers/clk/sophgo/clk-sg2042-clkgen.c
··· 968 968 /* 969 969 * "1" is the array index of the second parent input source of 970 970 * mux. For SG2042, it's fpll for all mux clocks. 971 - * "0" is the array index of the frist parent input source of 971 + * "0" is the array index of the first parent input source of 972 972 * mux, For SG2042, it's mpll. 973 973 * FIXME, any good idea to avoid magic number? 974 974 */
+2 -2
drivers/clk/sophgo/clk-sg2042-pll.c
··· 155 155 156 156 numerator = (u64)parent_rate * ctrl_table.fbdiv; 157 157 denominator = ctrl_table.refdiv * ctrl_table.postdiv1 * ctrl_table.postdiv2; 158 - do_div(numerator, denominator); 158 + numerator = div64_u64(numerator, denominator); 159 159 return numerator; 160 160 } 161 161 ··· 212 212 tmp0 *= fbdiv; 213 213 214 214 /* ((prate/REFDIV) x FBDIV)/rate and result save to tmp0 */ 215 - do_div(tmp0, rate); 215 + tmp0 = div64_ul(tmp0, rate); 216 216 217 217 /* tmp0 is POSTDIV1*POSTDIV2, now we calculate div1 and div2 value */ 218 218 if (tmp0 <= 7) {
+1 -1
drivers/clk/spear/spear1340_clock.c
··· 199 199 * We can program this synthesizer to make cpu run on different clock 200 200 * frequencies. 201 201 * Following table provides configuration values to let cpu run on 200, 202 - * 250, 332, 400 or 500 MHz considering different possibilites of input 202 + * 250, 332, 400 or 500 MHz considering different possibilities of input 203 203 * (vco1div2) clock. 204 204 * 205 205 * --------------------------------------------------------------------
+1 -1
drivers/clk/sprd/gate.h
··· 26 26 * CLK_GATE_BIG_ENDIAN BIT(2) 27 27 * so we define new flags from BIT(3) 28 28 */ 29 - #define SPRD_GATE_NON_AON BIT(3) /* not alway powered on, check before read */ 29 + #define SPRD_GATE_NON_AON BIT(3) /* not always powered on, check before read */ 30 30 31 31 #define SPRD_SC_GATE_CLK_HW_INIT_FN(_struct, _name, _parent, _reg, \ 32 32 _sc_offset, _enable_mask, _flags, \
+2 -2
drivers/clk/sprd/ums512-clk.c
··· 1550 1550 1551 1551 /* audcp apb gates */ 1552 1552 /* Audcp apb clocks configure CLK_IGNORE_UNUSED because these clocks may be 1553 - * controlled by audcp sys at the same time. It may be cause an execption if 1553 + * controlled by audcp sys at the same time. It may cause an exception if 1554 1554 * kernel gates these clock. 1555 1555 */ 1556 1556 static SPRD_SC_GATE_CLK_HW(audcp_wdg_eb, "audcp-wdg-eb", ··· 1592 1592 1593 1593 /* audcp ahb gates */ 1594 1594 /* Audcp aphb clocks configure CLK_IGNORE_UNUSED because these clocks may be 1595 - * controlled by audcp sys at the same time. It may be cause an execption if 1595 + * controlled by audcp sys at the same time. It may cause an exception if 1596 1596 * kernel gates these clock. 1597 1597 */ 1598 1598 static SPRD_SC_GATE_CLK_HW(audcp_iis0_eb, "audcp-iis0-eb",
+1 -1
drivers/clk/starfive/clk-starfive-jh7110-sys.c
··· 376 376 377 377 /* 378 378 * This clock notifier is called when the rate of PLL0 clock is to be changed. 379 - * The cpu_root clock should save the curent parent clock and switch its parent 379 + * The cpu_root clock should save the current parent clock and switch its parent 380 380 * clock to osc before PLL0 rate will be changed. Then switch its parent clock 381 381 * back after the PLL0 rate is completed. 382 382 */
+4 -4
drivers/clk/stm32/Kconfig
··· 4 4 menuconfig COMMON_CLK_STM32MP 5 5 bool "Clock support for common STM32MP clocks" 6 6 depends on ARCH_STM32 || COMPILE_TEST 7 - default y 7 + default ARCH_STM32 8 8 select RESET_CONTROLLER 9 9 help 10 10 Support for STM32MP SoC family clocks. ··· 14 14 config COMMON_CLK_STM32MP135 15 15 bool "Clock driver for stm32mp13x clocks" 16 16 depends on ARM || COMPILE_TEST 17 - default y 17 + default ARCH_STM32 18 18 help 19 19 Support for stm32mp13x SoC family clocks. 20 20 21 21 config COMMON_CLK_STM32MP157 22 22 bool "Clock driver for stm32mp15x clocks" 23 23 depends on ARM || COMPILE_TEST 24 - default y 24 + default ARCH_STM32 25 25 help 26 26 Support for stm32mp15x SoC family clocks. 27 27 28 28 config COMMON_CLK_STM32MP257 29 29 bool "Clock driver for stm32mp25x clocks" 30 30 depends on ARM64 || COMPILE_TEST 31 - default y 31 + default ARCH_STM32 32 32 help 33 33 Support for stm32mp25x SoC family clocks. 34 34
+1 -1
drivers/clk/stm32/clk-stm32mp1.c
··· 2041 2041 KCLK(ADFSDM_K, "adfsdm_k", sai_src, 0, G_ADFSDM, M_SAI1), 2042 2042 KCLK(USBO_K, "usbo_k", usbo_src, 0, G_USBO, M_USBO), 2043 2043 2044 - /* Particulary Kernel Clocks (no mux or no gate) */ 2044 + /* Particularly Kernel Clocks (no mux or no gate) */ 2045 2045 MGATE_MP1(DFSDM_K, "dfsdm_k", "ck_mcu", 0, G_DFSDM), 2046 2046 MGATE_MP1(DSI_PX, "dsi_px", "pll4_q", CLK_SET_RATE_PARENT, G_DSI), 2047 2047 MGATE_MP1(LTDC_PX, "ltdc_px", "pll4_q", CLK_SET_RATE_PARENT, G_LTDC),
+1 -1
drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c
··· 80 80 * in the BSP source code, although most of them are unused. The existence 81 81 * of the hardware block is verified with "3.1 Memory Mapping" chapter in 82 82 * "Allwinner H6 V200 User Manual V1.1"; and the parent APB buses are verified 83 - * with "3.3.2.1 System Bus Tree" chapter inthe same document. 83 + * with "3.3.2.1 System Bus Tree" chapter in the same document. 84 84 */ 85 85 static SUNXI_CCU_GATE(r_apb1_timer_clk, "r-apb1-timer", "r-apb1", 86 86 0x11c, BIT(0), 0);
+1 -1
drivers/clk/sunxi-ng/ccu-sun8i-r40.c
··· 439 439 static SUNXI_CCU_GATE(bus_i2c3_clk, "bus-i2c3", "apb2", 440 440 0x06c, BIT(3), 0); 441 441 /* 442 - * In datasheet here's "Reserved", however the gate exists in BSP soucre 442 + * In datasheet here's "Reserved", however the gate exists in BSP source 443 443 * code. 444 444 */ 445 445 static SUNXI_CCU_GATE(bus_can_clk, "bus-can", "apb2",
+1 -1
drivers/clk/sunxi-ng/ccu_common.c
··· 66 66 * changed. In common PLL designs, changes to the dividers take effect 67 67 * almost immediately, while changes to the multipliers (implemented 68 68 * as dividers in the feedback loop) take a few cycles to work into 69 - * the feedback loop for the PLL to stablize. 69 + * the feedback loop for the PLL to stabilize. 70 70 * 71 71 * Sometimes when the PLL clock rate is changed, the decrease in the 72 72 * divider is too much for the decrease in the multiplier to catch up.
+3 -3
drivers/clk/tegra/clk-periph.c
··· 51 51 struct tegra_clk_periph *periph = to_clk_periph(hw); 52 52 const struct clk_ops *div_ops = periph->div_ops; 53 53 struct clk_hw *div_hw = &periph->divider.hw; 54 - unsigned long rate; 54 + long rate; 55 55 56 56 __clk_hw_set_clk(div_hw, hw); 57 57 ··· 59 59 if (rate < 0) 60 60 return rate; 61 61 62 - req->rate = rate; 62 + req->rate = (unsigned long)rate; 63 63 return 0; 64 64 } 65 65 ··· 132 132 clk_periph_set_parent(hw, parent_id); 133 133 } 134 134 135 - const struct clk_ops tegra_clk_periph_ops = { 135 + static const struct clk_ops tegra_clk_periph_ops = { 136 136 .get_parent = clk_periph_get_parent, 137 137 .set_parent = clk_periph_set_parent, 138 138 .recalc_rate = clk_periph_recalc_rate,
+1 -1
drivers/clk/tegra/clk-tegra210.c
··· 255 255 /* VIC register to handle during MBIST WAR */ 256 256 #define NV_PVIC_THI_SLCG_OVERRIDE_LOW 0x8c 257 257 258 - /* APE, DISPA and VIC base addesses needed for MBIST WAR */ 258 + /* APE, DISPA and VIC base addresses needed for MBIST WAR */ 259 259 #define TEGRA210_AHUB_BASE 0x702d0000 260 260 #define TEGRA210_DISPA_BASE 0x54200000 261 261 #define TEGRA210_VIC_BASE 0x54340000
-1
drivers/clk/tegra/clk.h
··· 629 629 630 630 #define TEGRA_CLK_PERIPH_MAGIC 0x18221223 631 631 632 - extern const struct clk_ops tegra_clk_periph_ops; 633 632 struct clk *tegra_clk_register_periph(const char *name, 634 633 const char * const *parent_names, int num_parents, 635 634 struct tegra_clk_periph *periph, void __iomem *clk_base,
+1 -1
drivers/clk/ti/autoidle.c
··· 30 30 31 31 /* 32 32 * we have some non-atomic read/write 33 - * operations behind it, so lets 33 + * operations behind it, so let's 34 34 * take one lock for handling autoidle 35 35 * of all clocks 36 36 */
+1 -1
drivers/clk/ti/clk-43xx.c
··· 286 286 /* 287 287 * cpsw_cpts_rft_clk has got the choice of 3 clocksources 288 288 * dpll_core_m4_ck, dpll_core_m5_ck and dpll_disp_m2_ck. 289 - * By default dpll_core_m4_ck is selected, witn this as clock 289 + * By default dpll_core_m4_ck is selected, with this as clock 290 290 * source the CPTS doesnot work properly. It gives clockcheck errors 291 291 * while running PTP. 292 292 * clockcheck: clock jumped backward or running slower than expected!
+6 -21
drivers/clk/ti/clk.c
··· 118 118 * Eventually we could standardize to using '_' for clk-*.c files to follow the 119 119 * TRM naming. 120 120 */ 121 - static struct device_node *ti_find_clock_provider(struct device_node *from, 122 - const char *name) 121 + static struct device_node *ti_find_clock_provider(const char *name) 123 122 { 124 123 char *tmp __free(kfree) = NULL; 125 124 struct device_node *np; 126 - bool found = false; 127 - const char *n; 128 125 char *p; 129 126 130 127 tmp = kstrdup_and_replace(name, '-', '_', GFP_KERNEL); ··· 134 137 *p = '\0'; 135 138 136 139 /* Node named "clock" with "clock-output-names" */ 137 - for_each_of_allnodes_from(from, np) { 138 - if (of_property_read_string_index(np, "clock-output-names", 139 - 0, &n)) 140 - continue; 141 - 142 - if (!strncmp(n, tmp, strlen(tmp))) { 143 - of_node_get(np); 144 - found = true; 145 - break; 146 - } 147 - } 148 - 149 - if (found) { 150 - of_node_put(from); 151 - return np; 140 + for_each_node_with_property(np, "clock-output-names") { 141 + if (of_property_match_string(np, "clock-output-names", tmp) == 0) 142 + return np; 152 143 } 153 144 154 145 /* Fall back to using old node name base provider name */ 155 - return of_find_node_by_name(from, tmp); 146 + return of_find_node_by_name(NULL, tmp); 156 147 } 157 148 158 149 /** ··· 193 208 if (num_args && clkctrl_nodes_missing) 194 209 continue; 195 210 196 - node = ti_find_clock_provider(NULL, buf); 211 + node = ti_find_clock_provider(buf); 197 212 if (num_args && compat_mode) { 198 213 parent = node; 199 214 child = of_get_child_by_name(parent, "clock");
+1 -1
drivers/clk/ti/mux.c
··· 84 84 } 85 85 86 86 /** 87 - * clk_mux_save_context - Save the parent selcted in the mux 87 + * clk_mux_save_context - Save the parent selected in the mux 88 88 * @hw: pointer struct clk_hw 89 89 * 90 90 * Save the parent mux value.
+1 -1
drivers/clk/versatile/clk-icst.c
··· 194 194 pr_err("ICST error: tried to use RDW != 22\n"); 195 195 break; 196 196 default: 197 - /* Regular auxilary oscillator */ 197 + /* Regular auxiliary oscillator */ 198 198 mask = VERSATILE_AUX_OSC_BITS; 199 199 val = vco.v | (vco.r << 9) | (vco.s << 16); 200 200 break;
+1 -1
drivers/clk/visconti/pll.c
··· 107 107 const struct visconti_pll_rate_table *rate_table = pll->rate_table; 108 108 int i; 109 109 110 - /* Assumming rate_table is in descending order */ 110 + /* Assuming rate_table is in descending order */ 111 111 for (i = 0; i < pll->rate_count; i++) 112 112 if (rate >= rate_table[i].rate) 113 113 return rate_table[i].rate;
+1 -1
drivers/clk/xilinx/clk-xlnx-clock-wizard.c
··· 669 669 u32 m, d, o, div, f; 670 670 int err; 671 671 672 - err = clk_wzrd_get_divisors(hw, rate, *prate); 672 + err = clk_wzrd_get_divisors_ver(hw, rate, *prate); 673 673 if (err) 674 674 return err; 675 675
+31 -2
drivers/clk/xilinx/xlnx_vcu.c
··· 11 11 #include <linux/clk-provider.h> 12 12 #include <linux/device.h> 13 13 #include <linux/errno.h> 14 + #include <linux/gpio/consumer.h> 14 15 #include <linux/io.h> 15 16 #include <linux/mfd/syscon.h> 16 17 #include <linux/mfd/syscon/xlnx-vcu.h> ··· 52 51 * @dev: Platform device 53 52 * @pll_ref: pll ref clock source 54 53 * @aclk: axi clock source 54 + * @reset_gpio: vcu reset gpio 55 55 * @logicore_reg_ba: logicore reg base address 56 56 * @vcu_slcr_ba: vcu_slcr Register base address 57 57 * @pll: handle for the VCU PLL ··· 63 61 struct device *dev; 64 62 struct clk *pll_ref; 65 63 struct clk *aclk; 64 + struct gpio_desc *reset_gpio; 66 65 struct regmap *logicore_reg_ba; 67 66 void __iomem *vcu_slcr_ba; 68 67 struct clk_hw *pll; ··· 590 587 xvcu_clk_hw_unregister_leaf(hws[CLK_XVCU_ENC_MCU]); 591 588 if (!IS_ERR_OR_NULL(hws[CLK_XVCU_ENC_CORE])) 592 589 xvcu_clk_hw_unregister_leaf(hws[CLK_XVCU_ENC_CORE]); 593 - 594 - clk_hw_unregister_fixed_factor(xvcu->pll_post); 590 + if (!IS_ERR_OR_NULL(xvcu->pll_post)) 591 + clk_hw_unregister_fixed_factor(xvcu->pll_post); 595 592 } 596 593 597 594 /** ··· 679 676 * Bit 0 : Gasket isolation 680 677 * Bit 1 : put VCU out of reset 681 678 */ 679 + xvcu->reset_gpio = devm_gpiod_get_optional(&pdev->dev, "reset", 680 + GPIOD_OUT_LOW); 681 + if (IS_ERR(xvcu->reset_gpio)) { 682 + ret = PTR_ERR(xvcu->reset_gpio); 683 + dev_err_probe(&pdev->dev, ret, "failed to get reset gpio for vcu.\n"); 684 + goto error_get_gpio; 685 + } 686 + 687 + if (xvcu->reset_gpio) { 688 + gpiod_set_value(xvcu->reset_gpio, 0); 689 + /* min 2 clock cycle of vcu pll_ref, slowest freq is 33.33KHz */ 690 + usleep_range(60, 120); 691 + gpiod_set_value(xvcu->reset_gpio, 1); 692 + usleep_range(60, 120); 693 + } else { 694 + dev_dbg(&pdev->dev, "No reset gpio info found in dts for VCU. This may result in incorrect functionality if VCU isolation is removed after initialization in designs where the VCU reset is driven by gpio.\n"); 695 + } 696 + 682 697 regmap_write(xvcu->logicore_reg_ba, VCU_GASKET_INIT, VCU_GASKET_VALUE); 683 698 684 699 ret = xvcu_register_clock_provider(xvcu); ··· 711 690 712 691 error_clk_provider: 713 692 xvcu_unregister_clock_provider(xvcu); 693 + error_get_gpio: 714 694 clk_disable_unprepare(xvcu->aclk); 715 695 return ret; 716 696 } ··· 733 711 xvcu_unregister_clock_provider(xvcu); 734 712 735 713 /* Add the Gasket isolation and put the VCU in reset. */ 714 + if (xvcu->reset_gpio) { 715 + gpiod_set_value(xvcu->reset_gpio, 0); 716 + /* min 2 clock cycle of vcu pll_ref, slowest freq is 33.33KHz */ 717 + usleep_range(60, 120); 718 + gpiod_set_value(xvcu->reset_gpio, 1); 719 + usleep_range(60, 120); 720 + } 736 721 regmap_write(xvcu->logicore_reg_ba, VCU_GASKET_INIT, 0); 737 722 738 723 clk_disable_unprepare(xvcu->aclk);
+1 -1
drivers/dma/dma-axi-dmac.c
··· 6 6 * Author: Lars-Peter Clausen <lars@metafoo.de> 7 7 */ 8 8 9 + #include <linux/adi-axi-common.h> 9 10 #include <linux/bitfield.h> 10 11 #include <linux/clk.h> 11 12 #include <linux/device.h> ··· 23 22 #include <linux/platform_device.h> 24 23 #include <linux/regmap.h> 25 24 #include <linux/slab.h> 26 - #include <linux/fpga/adi-axi-common.h> 27 25 28 26 #include <dt-bindings/dma/axi-dmac.h> 29 27
+1 -1
drivers/hwmon/axi-fan-control.c
··· 4 4 * 5 5 * Copyright 2019 Analog Devices Inc. 6 6 */ 7 + #include <linux/adi-axi-common.h> 7 8 #include <linux/bits.h> 8 9 #include <linux/clk.h> 9 - #include <linux/fpga/adi-axi-common.h> 10 10 #include <linux/hwmon.h> 11 11 #include <linux/hwmon-sysfs.h> 12 12 #include <linux/interrupt.h>
+1 -2
drivers/iio/adc/adi-axi-adc.c
··· 6 6 * Copyright 2012-2020 Analog Devices Inc. 7 7 */ 8 8 9 + #include <linux/adi-axi-common.h> 9 10 #include <linux/bitfield.h> 10 11 #include <linux/cleanup.h> 11 12 #include <linux/clk.h> ··· 20 19 #include <linux/property.h> 21 20 #include <linux/regmap.h> 22 21 #include <linux/slab.h> 23 - 24 - #include <linux/fpga/adi-axi-common.h> 25 22 26 23 #include <linux/iio/backend.h> 27 24 #include <linux/iio/buffer-dmaengine.h>
+1 -1
drivers/iio/dac/adi-axi-dac.c
··· 5 5 * 6 6 * Copyright 2016-2024 Analog Devices Inc. 7 7 */ 8 + #include <linux/adi-axi-common.h> 8 9 #include <linux/bitfield.h> 9 10 #include <linux/bits.h> 10 11 #include <linux/cleanup.h> ··· 24 23 #include <linux/regmap.h> 25 24 #include <linux/units.h> 26 25 27 - #include <linux/fpga/adi-axi-common.h> 28 26 #include <linux/iio/backend.h> 29 27 #include <linux/iio/buffer-dmaengine.h> 30 28 #include <linux/iio/buffer.h>
+1 -1
drivers/pwm/pwm-axi-pwmgen.c
··· 18 18 * - Supports normal polarity. Does not support changing polarity. 19 19 * - On disable, the PWM output becomes low (inactive). 20 20 */ 21 + #include <linux/adi-axi-common.h> 21 22 #include <linux/bits.h> 22 23 #include <linux/clk.h> 23 24 #include <linux/err.h> 24 - #include <linux/fpga/adi-axi-common.h> 25 25 #include <linux/io.h> 26 26 #include <linux/minmax.h> 27 27 #include <linux/module.h>
+1 -1
drivers/spi/spi-axi-spi-engine.c
··· 6 6 * Author: Lars-Peter Clausen <lars@metafoo.de> 7 7 */ 8 8 9 + #include <linux/adi-axi-common.h> 9 10 #include <linux/bitfield.h> 10 11 #include <linux/bitops.h> 11 12 #include <linux/clk.h> 12 13 #include <linux/completion.h> 13 14 #include <linux/dmaengine.h> 14 - #include <linux/fpga/adi-axi-common.h> 15 15 #include <linux/interrupt.h> 16 16 #include <linux/io.h> 17 17 #include <linux/iopoll.h>
+56
include/linux/adi-axi-common.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * Analog Devices AXI common registers & definitions 4 + * 5 + * Copyright 2019 Analog Devices Inc. 6 + * 7 + * https://wiki.analog.com/resources/fpga/docs/axi_ip 8 + * https://wiki.analog.com/resources/fpga/docs/hdl/regmap 9 + */ 10 + 11 + #ifndef ADI_AXI_COMMON_H_ 12 + #define ADI_AXI_COMMON_H_ 13 + 14 + #define ADI_AXI_REG_VERSION 0x0000 15 + #define ADI_AXI_REG_FPGA_INFO 0x001C 16 + 17 + #define ADI_AXI_PCORE_VER(major, minor, patch) \ 18 + (((major) << 16) | ((minor) << 8) | (patch)) 19 + 20 + #define ADI_AXI_PCORE_VER_MAJOR(version) (((version) >> 16) & 0xff) 21 + #define ADI_AXI_PCORE_VER_MINOR(version) (((version) >> 8) & 0xff) 22 + #define ADI_AXI_PCORE_VER_PATCH(version) ((version) & 0xff) 23 + 24 + #define ADI_AXI_INFO_FPGA_TECH(info) (((info) >> 24) & 0xff) 25 + #define ADI_AXI_INFO_FPGA_FAMILY(info) (((info) >> 16) & 0xff) 26 + #define ADI_AXI_INFO_FPGA_SPEED_GRADE(info) (((info) >> 8) & 0xff) 27 + 28 + enum adi_axi_fpga_technology { 29 + ADI_AXI_FPGA_TECH_UNKNOWN = 0, 30 + ADI_AXI_FPGA_TECH_SERIES7, 31 + ADI_AXI_FPGA_TECH_ULTRASCALE, 32 + ADI_AXI_FPGA_TECH_ULTRASCALE_PLUS, 33 + }; 34 + 35 + enum adi_axi_fpga_family { 36 + ADI_AXI_FPGA_FAMILY_UNKNOWN = 0, 37 + ADI_AXI_FPGA_FAMILY_ARTIX, 38 + ADI_AXI_FPGA_FAMILY_KINTEX, 39 + ADI_AXI_FPGA_FAMILY_VIRTEX, 40 + ADI_AXI_FPGA_FAMILY_ZYNQ, 41 + }; 42 + 43 + enum adi_axi_fpga_speed_grade { 44 + ADI_AXI_FPGA_SPEED_UNKNOWN = 0, 45 + ADI_AXI_FPGA_SPEED_1 = 10, 46 + ADI_AXI_FPGA_SPEED_1L = 11, 47 + ADI_AXI_FPGA_SPEED_1H = 12, 48 + ADI_AXI_FPGA_SPEED_1HV = 13, 49 + ADI_AXI_FPGA_SPEED_1LV = 14, 50 + ADI_AXI_FPGA_SPEED_2 = 20, 51 + ADI_AXI_FPGA_SPEED_2L = 21, 52 + ADI_AXI_FPGA_SPEED_2LV = 22, 53 + ADI_AXI_FPGA_SPEED_3 = 30, 54 + }; 55 + 56 + #endif /* ADI_AXI_COMMON_H_ */
+26
include/linux/clk-provider.h
··· 1360 1360 /* helper functions */ 1361 1361 const char *__clk_get_name(const struct clk *clk); 1362 1362 const char *clk_hw_get_name(const struct clk_hw *hw); 1363 + 1364 + /** 1365 + * clk_hw_get_dev() - get device from an hardware clock. 1366 + * @hw: the clk_hw pointer to get the struct device from 1367 + * 1368 + * This is a helper to get the struct device associated with a hardware 1369 + * clock. Some clock controllers, such as the one registered with 1370 + * CLK_OF_DECLARE(), may have not provided a device pointer while 1371 + * registering the clock. 1372 + * 1373 + * Return: the struct device associated with the clock, or NULL if there 1374 + * is none. 1375 + */ 1376 + struct device *clk_hw_get_dev(const struct clk_hw *hw); 1377 + 1378 + /** 1379 + * clk_hw_get_of_node() - get device_node from a hardware clock. 1380 + * @hw: the clk_hw pointer to get the struct device_node from 1381 + * 1382 + * This is a helper to get the struct device_node associated with a 1383 + * hardware clock. 1384 + * 1385 + * Return: the struct device_node associated with the clock, or NULL 1386 + * if there is none. 1387 + */ 1388 + struct device_node *clk_hw_get_of_node(const struct clk_hw *hw); 1363 1389 #ifdef CONFIG_COMMON_CLK 1364 1390 struct clk_hw *__clk_get_hw(struct clk *clk); 1365 1391 #else
-23
include/linux/fpga/adi-axi-common.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - /* 3 - * Analog Devices AXI common registers & definitions 4 - * 5 - * Copyright 2019 Analog Devices Inc. 6 - * 7 - * https://wiki.analog.com/resources/fpga/docs/axi_ip 8 - * https://wiki.analog.com/resources/fpga/docs/hdl/regmap 9 - */ 10 - 11 - #ifndef ADI_AXI_COMMON_H_ 12 - #define ADI_AXI_COMMON_H_ 13 - 14 - #define ADI_AXI_REG_VERSION 0x0000 15 - 16 - #define ADI_AXI_PCORE_VER(major, minor, patch) \ 17 - (((major) << 16) | ((minor) << 8) | (patch)) 18 - 19 - #define ADI_AXI_PCORE_VER_MAJOR(version) (((version) >> 16) & 0xff) 20 - #define ADI_AXI_PCORE_VER_MINOR(version) (((version) >> 8) & 0xff) 21 - #define ADI_AXI_PCORE_VER_PATCH(version) ((version) & 0xff) 22 - 23 - #endif /* ADI_AXI_COMMON_H_ */
+19 -23
rust/kernel/clk.rs
··· 30 30 pub struct Hertz(pub c_ulong); 31 31 32 32 impl Hertz { 33 + const KHZ_TO_HZ: c_ulong = 1_000; 34 + const MHZ_TO_HZ: c_ulong = 1_000_000; 35 + const GHZ_TO_HZ: c_ulong = 1_000_000_000; 36 + 33 37 /// Create a new instance from kilohertz (kHz) 34 - pub fn from_khz(khz: c_ulong) -> Self { 35 - Self(khz * 1_000) 38 + pub const fn from_khz(khz: c_ulong) -> Self { 39 + Self(khz * Self::KHZ_TO_HZ) 36 40 } 37 41 38 42 /// Create a new instance from megahertz (MHz) 39 - pub fn from_mhz(mhz: c_ulong) -> Self { 40 - Self(mhz * 1_000_000) 43 + pub const fn from_mhz(mhz: c_ulong) -> Self { 44 + Self(mhz * Self::MHZ_TO_HZ) 41 45 } 42 46 43 47 /// Create a new instance from gigahertz (GHz) 44 - pub fn from_ghz(ghz: c_ulong) -> Self { 45 - Self(ghz * 1_000_000_000) 48 + pub const fn from_ghz(ghz: c_ulong) -> Self { 49 + Self(ghz * Self::GHZ_TO_HZ) 46 50 } 47 51 48 52 /// Get the frequency in hertz 49 - pub fn as_hz(&self) -> c_ulong { 53 + pub const fn as_hz(&self) -> c_ulong { 50 54 self.0 51 55 } 52 56 53 57 /// Get the frequency in kilohertz 54 - pub fn as_khz(&self) -> c_ulong { 55 - self.0 / 1_000 58 + pub const fn as_khz(&self) -> c_ulong { 59 + self.0 / Self::KHZ_TO_HZ 56 60 } 57 61 58 62 /// Get the frequency in megahertz 59 - pub fn as_mhz(&self) -> c_ulong { 60 - self.0 / 1_000_000 63 + pub const fn as_mhz(&self) -> c_ulong { 64 + self.0 / Self::MHZ_TO_HZ 61 65 } 62 66 63 67 /// Get the frequency in gigahertz 64 - pub fn as_ghz(&self) -> c_ulong { 65 - self.0 / 1_000_000_000 68 + pub const fn as_ghz(&self) -> c_ulong { 69 + self.0 / Self::GHZ_TO_HZ 66 70 } 67 71 } 68 72 ··· 136 132 /// 137 133 /// [`clk_get`]: https://docs.kernel.org/core-api/kernel-api.html#c.clk_get 138 134 pub fn get(dev: &Device, name: Option<&CStr>) -> Result<Self> { 139 - let con_id = if let Some(name) = name { 140 - name.as_ptr() 141 - } else { 142 - ptr::null() 143 - }; 135 + let con_id = name.map_or(ptr::null(), |n| n.as_ptr()); 144 136 145 137 // SAFETY: It is safe to call [`clk_get`] for a valid device pointer. 146 138 // ··· 304 304 /// [`clk_get_optional`]: 305 305 /// https://docs.kernel.org/core-api/kernel-api.html#c.clk_get_optional 306 306 pub fn get(dev: &Device, name: Option<&CStr>) -> Result<Self> { 307 - let con_id = if let Some(name) = name { 308 - name.as_ptr() 309 - } else { 310 - ptr::null() 311 - }; 307 + let con_id = name.map_or(ptr::null(), |n| n.as_ptr()); 312 308 313 309 // SAFETY: It is safe to call [`clk_get_optional`] for a valid device pointer. 314 310 //