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

dt-bindings: clock: qoriq-clock: convert to yaml format

Convert qoria-clock DT binding to yaml format. Split to two files
qoriq-clock.yaml and qoriq-clock-legancy.yaml.

Addtional change:
- Remove clock consumer part in example
- Fixed example dts error
- Deprecated legancy node
- fsl,b4420-clockgen and fsl,b4860-clockgen fallback to fsl,b4-clockgen.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20240701205809.1978389-1-Frank.Li@nxp.com
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Frank Li and committed by
Stephen Boyd
0d796569 7fd35692

+291 -212
+84
Documentation/devicetree/bindings/clock/fsl,qoriq-clock-legacy.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/fsl,qoriq-clock-legacy.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Legacy Clock Block on Freescale QorIQ Platforms 8 + 9 + maintainers: 10 + - Frank Li <Frank.Li@nxp.com> 11 + 12 + description: | 13 + These nodes are deprecated. Kernels should continue to support 14 + device trees with these nodes, but new device trees should not use them. 15 + 16 + Most of the bindings are from the common clock binding[1]. 17 + [1] Documentation/devicetree/bindings/clock/clock-bindings.txt 18 + 19 + properties: 20 + compatible: 21 + enum: 22 + - fsl,qoriq-core-pll-1.0 23 + - fsl,qoriq-core-pll-2.0 24 + - fsl,qoriq-core-mux-1.0 25 + - fsl,qoriq-core-mux-2.0 26 + - fsl,qoriq-sysclk-1.0 27 + - fsl,qoriq-sysclk-2.0 28 + - fsl,qoriq-platform-pll-1.0 29 + - fsl,qoriq-platform-pll-2.0 30 + 31 + reg: 32 + maxItems: 1 33 + 34 + clocks: 35 + minItems: 1 36 + maxItems: 4 37 + 38 + clock-names: 39 + minItems: 1 40 + maxItems: 4 41 + 42 + clock-output-names: 43 + minItems: 1 44 + maxItems: 8 45 + 46 + '#clock-cells': 47 + minimum: 0 48 + maximum: 1 49 + 50 + required: 51 + - compatible 52 + - '#clock-cells' 53 + 54 + additionalProperties: false 55 + 56 + allOf: 57 + - if: 58 + properties: 59 + compatible: 60 + contains: 61 + enum: 62 + - fsl,qoriq-sysclk-1.0 63 + - fsl,qoriq-sysclk-2.0 64 + then: 65 + properties: 66 + '#clock-cells': 67 + const: 0 68 + 69 + - if: 70 + properties: 71 + compatible: 72 + contains: 73 + enum: 74 + - fsl,qoriq-core-pll-1.0 75 + - fsl,qoriq-core-pll-2.0 76 + then: 77 + properties: 78 + '#clock-cells': 79 + const: 1 80 + description: | 81 + * 0 - equal to the PLL frequency 82 + * 1 - equal to the PLL frequency divided by 2 83 + * 2 - equal to the PLL frequency divided by 4 84 +
+207
Documentation/devicetree/bindings/clock/fsl,qoriq-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/fsl,qoriq-clock.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Clock Block on Freescale QorIQ Platforms 8 + 9 + maintainers: 10 + - Frank Li <Frank.Li@nxp.com> 11 + 12 + description: | 13 + Freescale QorIQ chips take primary clocking input from the external 14 + SYSCLK signal. The SYSCLK input (frequency) is multiplied using 15 + multiple phase locked loops (PLL) to create a variety of frequencies 16 + which can then be passed to a variety of internal logic, including 17 + cores and peripheral IP blocks. 18 + Please refer to the Reference Manual for details. 19 + 20 + All references to "1.0" and "2.0" refer to the QorIQ chassis version to 21 + which the chip complies. 22 + 23 + Chassis Version Example Chips 24 + --------------- ------------- 25 + 1.0 p4080, p5020, p5040 26 + 2.0 t4240 27 + 28 + Clock Provider 29 + 30 + The clockgen node should act as a clock provider, though in older device 31 + trees the children of the clockgen node are the clock providers. 32 + 33 + properties: 34 + compatible: 35 + oneOf: 36 + - items: 37 + - enum: 38 + - fsl,p2041-clockgen 39 + - fsl,p3041-clockgen 40 + - fsl,p4080-clockgen 41 + - fsl,p5020-clockgen 42 + - fsl,p5040-clockgen 43 + - const: fsl,qoriq-clockgen-1.0 44 + - items: 45 + - enum: 46 + - fsl,t1023-clockgen 47 + - fsl,t1024-clockgen 48 + - fsl,t1040-clockgen 49 + - fsl,t1042-clockgen 50 + - fsl,t2080-clockgen 51 + - fsl,t2081-clockgen 52 + - fsl,t4240-clockgen 53 + - const: fsl,qoriq-clockgen-2.0 54 + - items: 55 + - enum: 56 + - fsl,b4420-clockgen 57 + - fsl,b4860-clockgen 58 + - const: fsl,b4-clockgen 59 + - items: 60 + - enum: 61 + - fsl,ls1012a-clockgen 62 + - fsl,ls1021a-clockgen 63 + - fsl,ls1028a-clockgen 64 + - fsl,ls1043a-clockgen 65 + - fsl,ls1046a-clockgen 66 + - fsl,ls1088a-clockgen 67 + - fsl,ls2080a-clockgen 68 + - fsl,lx2160a-clockgen 69 + 70 + reg: 71 + maxItems: 1 72 + 73 + ranges: true 74 + 75 + '#address-cells': 76 + const: 1 77 + 78 + '#size-cells': 79 + const: 1 80 + 81 + '#clock-cells': 82 + const: 2 83 + description: | 84 + The first cell of the clock specifier is the clock type, and the 85 + second cell is the clock index for the specified type. 86 + 87 + Type# Name Index Cell 88 + 0 sysclk must be 0 89 + 1 cmux index (n in CLKCnCSR) 90 + 2 hwaccel index (n in CLKCGnHWACSR) 91 + 3 fman 0 for fm1, 1 for fm2 92 + 4 platform pll n=pll/(n+1). For example, when n=1, 93 + that means output_freq=PLL_freq/2. 94 + 5 coreclk must be 0 95 + 96 + clock-frequency: 97 + description: Input system clock frequency (SYSCLK) 98 + 99 + clocks: 100 + items: 101 + - description: 102 + sysclk may be provided as an input clock. Either clock-frequency 103 + or clocks must be provided. 104 + - description: 105 + A second input clock, called "coreclk", may be provided if 106 + core PLLs are based on a different input clock from the 107 + platform PLL. 108 + minItems: 1 109 + 110 + clock-names: 111 + items: 112 + - const: sysclk 113 + - const: coreclk 114 + 115 + patternProperties: 116 + '^mux[0-9]@[a-f0-9]+$': 117 + deprecated: true 118 + $ref: fsl,qoriq-clock-legacy.yaml 119 + 120 + '^sysclk(-[a-z0-9]+)?$': 121 + deprecated: true 122 + $ref: fsl,qoriq-clock-legacy.yaml 123 + 124 + '^pll[0-9]@[a-f0-9]+$': 125 + deprecated: true 126 + $ref: fsl,qoriq-clock-legacy.yaml 127 + 128 + '^platform\-pll@[a-f0-9]+$': 129 + deprecated: true 130 + $ref: fsl,qoriq-clock-legacy.yaml 131 + 132 + required: 133 + - compatible 134 + - reg 135 + - '#clock-cells' 136 + 137 + additionalProperties: false 138 + 139 + examples: 140 + - | 141 + /* clock provider example */ 142 + global-utilities@e1000 { 143 + compatible = "fsl,p5020-clockgen", "fsl,qoriq-clockgen-1.0"; 144 + reg = <0xe1000 0x1000>; 145 + clock-frequency = <133333333>; 146 + #clock-cells = <2>; 147 + }; 148 + 149 + - | 150 + /* Legacy example */ 151 + global-utilities@e1000 { 152 + compatible = "fsl,p5020-clockgen", "fsl,qoriq-clockgen-1.0"; 153 + reg = <0xe1000 0x1000>; 154 + ranges = <0x0 0xe1000 0x1000>; 155 + clock-frequency = <133333333>; 156 + #address-cells = <1>; 157 + #size-cells = <1>; 158 + #clock-cells = <2>; 159 + 160 + sysclk: sysclk { 161 + compatible = "fsl,qoriq-sysclk-1.0"; 162 + clock-output-names = "sysclk"; 163 + #clock-cells = <0>; 164 + }; 165 + 166 + pll0: pll0@800 { 167 + compatible = "fsl,qoriq-core-pll-1.0"; 168 + reg = <0x800 0x4>; 169 + #clock-cells = <1>; 170 + clocks = <&sysclk>; 171 + clock-output-names = "pll0", "pll0-div2"; 172 + }; 173 + 174 + pll1: pll1@820 { 175 + compatible = "fsl,qoriq-core-pll-1.0"; 176 + reg = <0x820 0x4>; 177 + #clock-cells = <1>; 178 + clocks = <&sysclk>; 179 + clock-output-names = "pll1", "pll1-div2"; 180 + }; 181 + 182 + mux0: mux0@0 { 183 + compatible = "fsl,qoriq-core-mux-1.0"; 184 + reg = <0x0 0x4>; 185 + #clock-cells = <0>; 186 + clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>; 187 + clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2"; 188 + clock-output-names = "cmux0"; 189 + }; 190 + 191 + mux1: mux1@20 { 192 + compatible = "fsl,qoriq-core-mux-1.0"; 193 + reg = <0x20 0x4>; 194 + #clock-cells = <0>; 195 + clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>; 196 + clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2"; 197 + clock-output-names = "cmux1"; 198 + }; 199 + 200 + platform-pll@c00 { 201 + #clock-cells = <1>; 202 + reg = <0xc00 0x4>; 203 + compatible = "fsl,qoriq-platform-pll-1.0"; 204 + clocks = <&sysclk>; 205 + clock-output-names = "platform-pll", "platform-pll-div2"; 206 + }; 207 + };
-212
Documentation/devicetree/bindings/clock/qoriq-clock.txt
··· 1 - * Clock Block on Freescale QorIQ Platforms 2 - 3 - Freescale QorIQ chips take primary clocking input from the external 4 - SYSCLK signal. The SYSCLK input (frequency) is multiplied using 5 - multiple phase locked loops (PLL) to create a variety of frequencies 6 - which can then be passed to a variety of internal logic, including 7 - cores and peripheral IP blocks. 8 - Please refer to the Reference Manual for details. 9 - 10 - All references to "1.0" and "2.0" refer to the QorIQ chassis version to 11 - which the chip complies. 12 - 13 - Chassis Version Example Chips 14 - --------------- ------------- 15 - 1.0 p4080, p5020, p5040 16 - 2.0 t4240, b4860 17 - 18 - 1. Clock Block Binding 19 - 20 - Required properties: 21 - - compatible: Should contain a chip-specific clock block compatible 22 - string and (if applicable) may contain a chassis-version clock 23 - compatible string. 24 - 25 - Chip-specific strings are of the form "fsl,<chip>-clockgen", such as: 26 - * "fsl,p2041-clockgen" 27 - * "fsl,p3041-clockgen" 28 - * "fsl,p4080-clockgen" 29 - * "fsl,p5020-clockgen" 30 - * "fsl,p5040-clockgen" 31 - * "fsl,t1023-clockgen" 32 - * "fsl,t1024-clockgen" 33 - * "fsl,t1040-clockgen" 34 - * "fsl,t1042-clockgen" 35 - * "fsl,t2080-clockgen" 36 - * "fsl,t2081-clockgen" 37 - * "fsl,t4240-clockgen" 38 - * "fsl,b4420-clockgen" 39 - * "fsl,b4860-clockgen" 40 - * "fsl,ls1012a-clockgen" 41 - * "fsl,ls1021a-clockgen" 42 - * "fsl,ls1028a-clockgen" 43 - * "fsl,ls1043a-clockgen" 44 - * "fsl,ls1046a-clockgen" 45 - * "fsl,ls1088a-clockgen" 46 - * "fsl,ls2080a-clockgen" 47 - * "fsl,lx2160a-clockgen" 48 - Chassis-version clock strings include: 49 - * "fsl,qoriq-clockgen-1.0": for chassis 1.0 clocks 50 - * "fsl,qoriq-clockgen-2.0": for chassis 2.0 clocks 51 - - reg: Describes the address of the device's resources within the 52 - address space defined by its parent bus, and resource zero 53 - represents the clock register set 54 - 55 - Optional properties: 56 - - ranges: Allows valid translation between child's address space and 57 - parent's. Must be present if the device has sub-nodes. 58 - - #address-cells: Specifies the number of cells used to represent 59 - physical base addresses. Must be present if the device has 60 - sub-nodes and set to 1 if present 61 - - #size-cells: Specifies the number of cells used to represent 62 - the size of an address. Must be present if the device has 63 - sub-nodes and set to 1 if present 64 - - clock-frequency: Input system clock frequency (SYSCLK) 65 - - clocks: If clock-frequency is not specified, sysclk may be provided 66 - as an input clock. Either clock-frequency or clocks must be 67 - provided. 68 - A second input clock, called "coreclk", may be provided if 69 - core PLLs are based on a different input clock from the 70 - platform PLL. 71 - - clock-names: Required if a coreclk is present. Valid names are 72 - "sysclk" and "coreclk". 73 - 74 - 2. Clock Provider 75 - 76 - The clockgen node should act as a clock provider, though in older device 77 - trees the children of the clockgen node are the clock providers. 78 - 79 - When the clockgen node is a clock provider, #clock-cells = <2>. 80 - The first cell of the clock specifier is the clock type, and the 81 - second cell is the clock index for the specified type. 82 - 83 - Type# Name Index Cell 84 - 0 sysclk must be 0 85 - 1 cmux index (n in CLKCnCSR) 86 - 2 hwaccel index (n in CLKCGnHWACSR) 87 - 3 fman 0 for fm1, 1 for fm2 88 - 4 platform pll n=pll/(n+1). For example, when n=1, 89 - that means output_freq=PLL_freq/2. 90 - 5 coreclk must be 0 91 - 92 - 3. Example 93 - 94 - clockgen: global-utilities@e1000 { 95 - compatible = "fsl,p5020-clockgen", "fsl,qoriq-clockgen-1.0"; 96 - clock-frequency = <133333333>; 97 - reg = <0xe1000 0x1000>; 98 - #clock-cells = <2>; 99 - }; 100 - 101 - fman@400000 { 102 - ... 103 - clocks = <&clockgen 3 0>; 104 - ... 105 - }; 106 - } 107 - 4. Legacy Child Nodes 108 - 109 - NOTE: These nodes are deprecated. Kernels should continue to support 110 - device trees with these nodes, but new device trees should not use them. 111 - 112 - Most of the bindings are from the common clock binding[1]. 113 - [1] Documentation/devicetree/bindings/clock/clock-bindings.txt 114 - 115 - Required properties: 116 - - compatible : Should include one of the following: 117 - * "fsl,qoriq-core-pll-1.0" for core PLL clocks (v1.0) 118 - * "fsl,qoriq-core-pll-2.0" for core PLL clocks (v2.0) 119 - * "fsl,qoriq-core-mux-1.0" for core mux clocks (v1.0) 120 - * "fsl,qoriq-core-mux-2.0" for core mux clocks (v2.0) 121 - * "fsl,qoriq-sysclk-1.0": for input system clock (v1.0). 122 - It takes parent's clock-frequency as its clock. 123 - * "fsl,qoriq-sysclk-2.0": for input system clock (v2.0). 124 - It takes parent's clock-frequency as its clock. 125 - * "fsl,qoriq-platform-pll-1.0" for the platform PLL clock (v1.0) 126 - * "fsl,qoriq-platform-pll-2.0" for the platform PLL clock (v2.0) 127 - - #clock-cells: From common clock binding. The number of cells in a 128 - clock-specifier. Should be <0> for "fsl,qoriq-sysclk-[1,2].0" 129 - clocks, or <1> for "fsl,qoriq-core-pll-[1,2].0" clocks. 130 - For "fsl,qoriq-core-pll-[1,2].0" clocks, the single 131 - clock-specifier cell may take the following values: 132 - * 0 - equal to the PLL frequency 133 - * 1 - equal to the PLL frequency divided by 2 134 - * 2 - equal to the PLL frequency divided by 4 135 - 136 - Recommended properties: 137 - - clocks: Should be the phandle of input parent clock 138 - - clock-names: From common clock binding, indicates the clock name 139 - - clock-output-names: From common clock binding, indicates the names of 140 - output clocks 141 - - reg: Should be the offset and length of clock block base address. 142 - The length should be 4. 143 - 144 - Legacy Example: 145 - / { 146 - clockgen: global-utilities@e1000 { 147 - compatible = "fsl,p5020-clockgen", "fsl,qoriq-clockgen-1.0"; 148 - ranges = <0x0 0xe1000 0x1000>; 149 - clock-frequency = <133333333>; 150 - reg = <0xe1000 0x1000>; 151 - #address-cells = <1>; 152 - #size-cells = <1>; 153 - 154 - sysclk: sysclk { 155 - #clock-cells = <0>; 156 - compatible = "fsl,qoriq-sysclk-1.0"; 157 - clock-output-names = "sysclk"; 158 - }; 159 - 160 - pll0: pll0@800 { 161 - #clock-cells = <1>; 162 - reg = <0x800 0x4>; 163 - compatible = "fsl,qoriq-core-pll-1.0"; 164 - clocks = <&sysclk>; 165 - clock-output-names = "pll0", "pll0-div2"; 166 - }; 167 - 168 - pll1: pll1@820 { 169 - #clock-cells = <1>; 170 - reg = <0x820 0x4>; 171 - compatible = "fsl,qoriq-core-pll-1.0"; 172 - clocks = <&sysclk>; 173 - clock-output-names = "pll1", "pll1-div2"; 174 - }; 175 - 176 - mux0: mux0@0 { 177 - #clock-cells = <0>; 178 - reg = <0x0 0x4>; 179 - compatible = "fsl,qoriq-core-mux-1.0"; 180 - clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>; 181 - clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2"; 182 - clock-output-names = "cmux0"; 183 - }; 184 - 185 - mux1: mux1@20 { 186 - #clock-cells = <0>; 187 - reg = <0x20 0x4>; 188 - compatible = "fsl,qoriq-core-mux-1.0"; 189 - clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>; 190 - clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2"; 191 - clock-output-names = "cmux1"; 192 - }; 193 - 194 - platform-pll: platform-pll@c00 { 195 - #clock-cells = <1>; 196 - reg = <0xc00 0x4>; 197 - compatible = "fsl,qoriq-platform-pll-1.0"; 198 - clocks = <&sysclk>; 199 - clock-output-names = "platform-pll", "platform-pll-div2"; 200 - }; 201 - }; 202 - }; 203 - 204 - Example for legacy clock consumer: 205 - 206 - / { 207 - cpu0: PowerPC,e5500@0 { 208 - ... 209 - clocks = <&mux0>; 210 - ... 211 - }; 212 - };