Tang Yuantian | 93a17c0 | 2015-01-15 14:03:41 +0800 | [diff] [blame] | 1 | * Clock Block on Freescale QorIQ Platforms |
Tang Yuantian | 4b3cbc8 | 2014-01-13 16:16:35 +0800 | [diff] [blame] | 2 | |
Scott Wood | 0dfc86b | 2015-09-19 23:29:54 -0500 | [diff] [blame] | 3 | Freescale QorIQ chips take primary clocking input from the external |
Tang Yuantian | 4b3cbc8 | 2014-01-13 16:16:35 +0800 | [diff] [blame] | 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 | |
Tang Yuantian | eaf76b2 | 2014-05-08 11:12:10 +0800 | [diff] [blame] | 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 |
Scott Wood | 0dfc86b | 2015-09-19 23:29:54 -0500 | [diff] [blame] | 16 | 2.0 t4240, b4860 |
Tang Yuantian | eaf76b2 | 2014-05-08 11:12:10 +0800 | [diff] [blame] | 17 | |
Tang Yuantian | 4b3cbc8 | 2014-01-13 16:16:35 +0800 | [diff] [blame] | 18 | 1. Clock Block Binding |
| 19 | |
| 20 | Required properties: |
Scott Wood | 0dfc86b | 2015-09-19 23:29:54 -0500 | [diff] [blame] | 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: |
Tang Yuantian | 4b3cbc8 | 2014-01-13 16:16:35 +0800 | [diff] [blame] | 26 | * "fsl,p2041-clockgen" |
| 27 | * "fsl,p3041-clockgen" |
| 28 | * "fsl,p4080-clockgen" |
| 29 | * "fsl,p5020-clockgen" |
| 30 | * "fsl,p5040-clockgen" |
| 31 | * "fsl,t4240-clockgen" |
| 32 | * "fsl,b4420-clockgen" |
| 33 | * "fsl,b4860-clockgen" |
Harninder Rai | 73447f6 | 2016-11-09 23:40:53 +0530 | [diff] [blame] | 34 | * "fsl,ls1012a-clockgen" |
Tang Yuantian | 93a17c0 | 2015-01-15 14:03:41 +0800 | [diff] [blame] | 35 | * "fsl,ls1021a-clockgen" |
Shaohui Xie | 2b688d5 | 2016-09-13 16:09:57 +0800 | [diff] [blame] | 36 | * "fsl,ls1043a-clockgen" |
| 37 | * "fsl,ls1046a-clockgen" |
Harninder Rai | 124248e | 2017-02-09 16:33:49 +0530 | [diff] [blame] | 38 | * "fsl,ls1088a-clockgen" |
Shaohui Xie | 2b688d5 | 2016-09-13 16:09:57 +0800 | [diff] [blame] | 39 | * "fsl,ls2080a-clockgen" |
Scott Wood | 0dfc86b | 2015-09-19 23:29:54 -0500 | [diff] [blame] | 40 | Chassis-version clock strings include: |
Tang Yuantian | 4b3cbc8 | 2014-01-13 16:16:35 +0800 | [diff] [blame] | 41 | * "fsl,qoriq-clockgen-1.0": for chassis 1.0 clocks |
| 42 | * "fsl,qoriq-clockgen-2.0": for chassis 2.0 clocks |
| 43 | - reg: Describes the address of the device's resources within the |
| 44 | address space defined by its parent bus, and resource zero |
| 45 | represents the clock register set |
Tang Yuantian | 4b3cbc8 | 2014-01-13 16:16:35 +0800 | [diff] [blame] | 46 | |
Scott Wood | 0dfc86b | 2015-09-19 23:29:54 -0500 | [diff] [blame] | 47 | Optional properties: |
Tang Yuantian | 4b3cbc8 | 2014-01-13 16:16:35 +0800 | [diff] [blame] | 48 | - ranges: Allows valid translation between child's address space and |
| 49 | parent's. Must be present if the device has sub-nodes. |
| 50 | - #address-cells: Specifies the number of cells used to represent |
| 51 | physical base addresses. Must be present if the device has |
| 52 | sub-nodes and set to 1 if present |
| 53 | - #size-cells: Specifies the number of cells used to represent |
| 54 | the size of an address. Must be present if the device has |
| 55 | sub-nodes and set to 1 if present |
Scott Wood | 0dfc86b | 2015-09-19 23:29:54 -0500 | [diff] [blame] | 56 | - clock-frequency: Input system clock frequency (SYSCLK) |
| 57 | - clocks: If clock-frequency is not specified, sysclk may be provided |
| 58 | as an input clock. Either clock-frequency or clocks must be |
| 59 | provided. |
Tang Yuantian | 4b3cbc8 | 2014-01-13 16:16:35 +0800 | [diff] [blame] | 60 | |
Scott Wood | 0dfc86b | 2015-09-19 23:29:54 -0500 | [diff] [blame] | 61 | 2. Clock Provider |
| 62 | |
| 63 | The clockgen node should act as a clock provider, though in older device |
| 64 | trees the children of the clockgen node are the clock providers. |
| 65 | |
| 66 | When the clockgen node is a clock provider, #clock-cells = <2>. |
| 67 | The first cell of the clock specifier is the clock type, and the |
| 68 | second cell is the clock index for the specified type. |
| 69 | |
| 70 | Type# Name Index Cell |
| 71 | 0 sysclk must be 0 |
| 72 | 1 cmux index (n in CLKCnCSR) |
| 73 | 2 hwaccel index (n in CLKCGnHWACSR) |
| 74 | 3 fman 0 for fm1, 1 for fm2 |
| 75 | 4 platform pll 0=pll, 1=pll/2, 2=pll/3, 3=pll/4 |
| 76 | |
| 77 | 3. Example |
| 78 | |
| 79 | clockgen: global-utilities@e1000 { |
| 80 | compatible = "fsl,p5020-clockgen", "fsl,qoriq-clockgen-1.0"; |
| 81 | clock-frequency = <133333333>; |
| 82 | reg = <0xe1000 0x1000>; |
| 83 | #clock-cells = <2>; |
| 84 | }; |
| 85 | |
| 86 | fman@400000 { |
| 87 | ... |
| 88 | clocks = <&clockgen 3 0>; |
| 89 | ... |
| 90 | }; |
| 91 | } |
| 92 | 4. Legacy Child Nodes |
| 93 | |
| 94 | NOTE: These nodes are deprecated. Kernels should continue to support |
| 95 | device trees with these nodes, but new device trees should not use them. |
Tang Yuantian | 4b3cbc8 | 2014-01-13 16:16:35 +0800 | [diff] [blame] | 96 | |
| 97 | Most of the bindings are from the common clock binding[1]. |
| 98 | [1] Documentation/devicetree/bindings/clock/clock-bindings.txt |
| 99 | |
| 100 | Required properties: |
| 101 | - compatible : Should include one of the following: |
| 102 | * "fsl,qoriq-core-pll-1.0" for core PLL clocks (v1.0) |
| 103 | * "fsl,qoriq-core-pll-2.0" for core PLL clocks (v2.0) |
| 104 | * "fsl,qoriq-core-mux-1.0" for core mux clocks (v1.0) |
| 105 | * "fsl,qoriq-core-mux-2.0" for core mux clocks (v2.0) |
| 106 | * "fsl,qoriq-sysclk-1.0": for input system clock (v1.0). |
| 107 | It takes parent's clock-frequency as its clock. |
| 108 | * "fsl,qoriq-sysclk-2.0": for input system clock (v2.0). |
| 109 | It takes parent's clock-frequency as its clock. |
Emil Medve | f1aa77c | 2014-11-06 09:48:12 -0600 | [diff] [blame] | 110 | * "fsl,qoriq-platform-pll-1.0" for the platform PLL clock (v1.0) |
| 111 | * "fsl,qoriq-platform-pll-2.0" for the platform PLL clock (v2.0) |
Tang Yuantian | 4b3cbc8 | 2014-01-13 16:16:35 +0800 | [diff] [blame] | 112 | - #clock-cells: From common clock binding. The number of cells in a |
| 113 | clock-specifier. Should be <0> for "fsl,qoriq-sysclk-[1,2].0" |
| 114 | clocks, or <1> for "fsl,qoriq-core-pll-[1,2].0" clocks. |
| 115 | For "fsl,qoriq-core-pll-[1,2].0" clocks, the single |
| 116 | clock-specifier cell may take the following values: |
| 117 | * 0 - equal to the PLL frequency |
| 118 | * 1 - equal to the PLL frequency divided by 2 |
| 119 | * 2 - equal to the PLL frequency divided by 4 |
| 120 | |
| 121 | Recommended properties: |
| 122 | - clocks: Should be the phandle of input parent clock |
| 123 | - clock-names: From common clock binding, indicates the clock name |
| 124 | - clock-output-names: From common clock binding, indicates the names of |
| 125 | output clocks |
| 126 | - reg: Should be the offset and length of clock block base address. |
| 127 | The length should be 4. |
| 128 | |
Scott Wood | 0dfc86b | 2015-09-19 23:29:54 -0500 | [diff] [blame] | 129 | Legacy Example: |
Tang Yuantian | 4b3cbc8 | 2014-01-13 16:16:35 +0800 | [diff] [blame] | 130 | / { |
| 131 | clockgen: global-utilities@e1000 { |
| 132 | compatible = "fsl,p5020-clockgen", "fsl,qoriq-clockgen-1.0"; |
| 133 | ranges = <0x0 0xe1000 0x1000>; |
| 134 | clock-frequency = <133333333>; |
| 135 | reg = <0xe1000 0x1000>; |
| 136 | #address-cells = <1>; |
| 137 | #size-cells = <1>; |
| 138 | |
| 139 | sysclk: sysclk { |
| 140 | #clock-cells = <0>; |
| 141 | compatible = "fsl,qoriq-sysclk-1.0"; |
| 142 | clock-output-names = "sysclk"; |
Tang Yuantian | eaf76b2 | 2014-05-08 11:12:10 +0800 | [diff] [blame] | 143 | }; |
Tang Yuantian | 4b3cbc8 | 2014-01-13 16:16:35 +0800 | [diff] [blame] | 144 | |
| 145 | pll0: pll0@800 { |
| 146 | #clock-cells = <1>; |
| 147 | reg = <0x800 0x4>; |
| 148 | compatible = "fsl,qoriq-core-pll-1.0"; |
| 149 | clocks = <&sysclk>; |
| 150 | clock-output-names = "pll0", "pll0-div2"; |
| 151 | }; |
| 152 | |
| 153 | pll1: pll1@820 { |
| 154 | #clock-cells = <1>; |
| 155 | reg = <0x820 0x4>; |
| 156 | compatible = "fsl,qoriq-core-pll-1.0"; |
| 157 | clocks = <&sysclk>; |
| 158 | clock-output-names = "pll1", "pll1-div2"; |
| 159 | }; |
| 160 | |
| 161 | mux0: mux0@0 { |
| 162 | #clock-cells = <0>; |
| 163 | reg = <0x0 0x4>; |
| 164 | compatible = "fsl,qoriq-core-mux-1.0"; |
| 165 | clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>; |
| 166 | clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2"; |
| 167 | clock-output-names = "cmux0"; |
| 168 | }; |
| 169 | |
| 170 | mux1: mux1@20 { |
| 171 | #clock-cells = <0>; |
| 172 | reg = <0x20 0x4>; |
| 173 | compatible = "fsl,qoriq-core-mux-1.0"; |
| 174 | clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>; |
| 175 | clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2"; |
| 176 | clock-output-names = "cmux1"; |
| 177 | }; |
Emil Medve | f1aa77c | 2014-11-06 09:48:12 -0600 | [diff] [blame] | 178 | |
| 179 | platform-pll: platform-pll@c00 { |
| 180 | #clock-cells = <1>; |
| 181 | reg = <0xc00 0x4>; |
| 182 | compatible = "fsl,qoriq-platform-pll-1.0"; |
| 183 | clocks = <&sysclk>; |
| 184 | clock-output-names = "platform-pll", "platform-pll-div2"; |
| 185 | }; |
Tang Yuantian | 4b3cbc8 | 2014-01-13 16:16:35 +0800 | [diff] [blame] | 186 | }; |
Emil Medve | f1aa77c | 2014-11-06 09:48:12 -0600 | [diff] [blame] | 187 | }; |
Tang Yuantian | 4b3cbc8 | 2014-01-13 16:16:35 +0800 | [diff] [blame] | 188 | |
Scott Wood | 0dfc86b | 2015-09-19 23:29:54 -0500 | [diff] [blame] | 189 | Example for legacy clock consumer: |
Tang Yuantian | 4b3cbc8 | 2014-01-13 16:16:35 +0800 | [diff] [blame] | 190 | |
| 191 | / { |
| 192 | cpu0: PowerPC,e5500@0 { |
| 193 | ... |
| 194 | clocks = <&mux0>; |
| 195 | ... |
| 196 | }; |
Emil Medve | f1aa77c | 2014-11-06 09:48:12 -0600 | [diff] [blame] | 197 | }; |