|
| 1 | +# SPDX-License-Identifier: GPL-2.0 |
| 2 | +%YAML 1.2 |
| 3 | +--- |
| 4 | +$id: http://devicetree.org/schemas/clock/litex,clock.yaml# |
| 5 | +$schema: http://devicetree.org/meta-schemas/core.yaml# |
| 6 | + |
| 7 | +title: LiteX clock control driver |
| 8 | + |
| 9 | +description: | |
| 10 | + Common clock driver with MMCM unit for dynamic reconfiguration |
| 11 | + of up to 7 clock outputs with ability to change frequency, duty |
| 12 | + cycle and phase offset |
| 13 | +
|
| 14 | +maintainers: |
| 15 | + - Karol Gugala <[email protected]> |
| 16 | + - Mateusz Holenko <[email protected]> |
| 17 | + |
| 18 | +properties: |
| 19 | + compatible: |
| 20 | + const: litex,clock |
| 21 | + |
| 22 | + reg: |
| 23 | + description: Base address and lengths of the register space |
| 24 | + |
| 25 | + "#clock-cells": |
| 26 | + description: |
| 27 | + Number of cells in a clock specifier; |
| 28 | + Typically 0 for nodes with a single clock output |
| 29 | + and 1 for nodes with multiple clock outputs. |
| 30 | + const: 1 |
| 31 | + |
| 32 | + "#address-cells": |
| 33 | + description: |
| 34 | + Number of cells that are needed to form the base address |
| 35 | + part in the reg property. |
| 36 | + const: 1 |
| 37 | + |
| 38 | + "#size-cells": |
| 39 | + description: |
| 40 | + Used to state how many cells are in each field of a reg property |
| 41 | + const: 0 |
| 42 | + |
| 43 | + clock-output-names: |
| 44 | + description: |
| 45 | + List of strings of clock output signal names indexed |
| 46 | + by the first cell in the clock specifier. |
| 47 | + minItems: 1 |
| 48 | + maxItems: 7 |
| 49 | + items: |
| 50 | + - const: CLKOUT0 |
| 51 | + - const: CLKOUT1 |
| 52 | + - const: CLKOUT2 |
| 53 | + - const: CLKOUT3 |
| 54 | + - const: CLKOUT4 |
| 55 | + - const: CLKOUT5 |
| 56 | + - const: CLKOUT6 |
| 57 | + |
| 58 | + litex,nclkout: |
| 59 | + description: Number of desired clock outputs |
| 60 | + $ref: /schemas/types.yaml#/definitions/uint32 |
| 61 | + minimum: 1 |
| 62 | + maximum: 7 |
| 63 | + |
| 64 | + litex,lock-timeout: |
| 65 | + description: Number of ms to wait for MMCM to assert LOCK signal |
| 66 | + $ref: /schemas/types.yaml#/definitions/uint32 |
| 67 | + minimum: 1 |
| 68 | + |
| 69 | + litex,drdy-timeout: |
| 70 | + description: Number of ms to wait for MMCM to assert DRDY signal |
| 71 | + $ref: /schemas/types.yaml#/definitions/uint32 |
| 72 | + minimum: 1 |
| 73 | + |
| 74 | + litex,sys-clock-freq: |
| 75 | + description: System clock frequency |
| 76 | + $ref: /schemas/types.yaml#/definitions/uint32 |
| 77 | + |
| 78 | +patternProperties: |
| 79 | + "^CLKOUT[0-6]$": |
| 80 | + description: |
| 81 | + Child node representing configurable clock outputs of MMCM unit |
| 82 | + type: object |
| 83 | + |
| 84 | + properties: |
| 85 | + compatible: |
| 86 | + const: litex,clock |
| 87 | + |
| 88 | + reg: |
| 89 | + description: clock output ID, zero-based numbering |
| 90 | + |
| 91 | + litex,clock-frequency: |
| 92 | + description: default frequency in Hz for clock output |
| 93 | + $ref: /schemas/types.yaml#/definitions/uint32 |
| 94 | + minimum: 1587000 |
| 95 | + maximum: 100000000 |
| 96 | + |
| 97 | + litex,clock-phase: |
| 98 | + description: default phase offset given in degrees |
| 99 | + $ref: /schemas/types.yaml#/definitions/uint32 |
| 100 | + minimum: 0 |
| 101 | + maximum: 359 |
| 102 | + |
| 103 | + litex,clock-duty-num: |
| 104 | + description: default duty cycle numerator value |
| 105 | + $ref: /schemas/types.yaml#/definitions/uint32 |
| 106 | + minimum: 1 |
| 107 | + maximum: 100 |
| 108 | + |
| 109 | + litex,clock-duty-den: |
| 110 | + description: default duty cycle denominator value |
| 111 | + $ref: /schemas/types.yaml#/definitions/uint32 |
| 112 | + minimum: 1 |
| 113 | + maximum: 100 |
| 114 | + |
| 115 | + required: |
| 116 | + - compatible |
| 117 | + - "#clock-cells" |
| 118 | + - clock-output-names |
| 119 | + - reg |
| 120 | + - litex,clock-frequency |
| 121 | + - litex,clock-phase |
| 122 | + - litex,clock-duty-num |
| 123 | + - litex,clock-duty-den |
| 124 | + |
| 125 | +required: |
| 126 | + - compatible |
| 127 | + - reg |
| 128 | + - "#clock-cells" |
| 129 | + - "#address-cells" |
| 130 | + - "#size-cells" |
| 131 | + - clock-output-names |
| 132 | + - litex,nclkout |
| 133 | + - CLKOUTx |
| 134 | + |
| 135 | +additionalProperties: false |
| 136 | + |
| 137 | +examples: |
| 138 | + - | |
| 139 | + clk0: clock-controller@f0003000 { |
| 140 | + compatible = "litex,clk"; |
| 141 | + reg = <0x0 0xf0003000>, <0x0 0x100>; |
| 142 | + #clock-cells = <1>; |
| 143 | + #address-cells = <1>; |
| 144 | + #size-cells = <0>; |
| 145 | + clock-output-names = "CLKOUT0", |
| 146 | + "CLKOUT1", |
| 147 | + "CLKOUT2", |
| 148 | + "CLKOUT3", |
| 149 | + "CLKOUT4", |
| 150 | + "CLKOUT5", |
| 151 | + "CLKOUT6"; |
| 152 | + litex,nclkout = <7>; |
| 153 | +
|
| 154 | + CLKOUT0: CLKOUT0@0 { |
| 155 | + compatible = "litex,clk"; |
| 156 | + #clock-cells = <0>; |
| 157 | + clock-output-names = "CLKOUT0"; |
| 158 | + reg = <0>; |
| 159 | + litex,clock-frequency = <50000000>; |
| 160 | + litex,clock-phase = <0>; |
| 161 | + litex,clock-duty = <50>; |
| 162 | + }; |
| 163 | +
|
| 164 | + CLKOUT1: CLKOUT1@1 { |
| 165 | + compatible = "litex,clk"; |
| 166 | + #clock-cells = <0>; |
| 167 | + clock-output-names = "CLKOUT1"; |
| 168 | + reg = <1>; |
| 169 | + litex,clock-frequency = <50000000>; |
| 170 | + litex,clock-phase = <90>; |
| 171 | + litex,clock-duty = <50>; |
| 172 | + }; |
| 173 | +
|
| 174 | + CLKOUT2: CLKOUT2@2 { |
| 175 | + compatible = "litex,clk"; |
| 176 | + #clock-cells = <0>; |
| 177 | + clock-output-names = "CLKOUT2"; |
| 178 | + reg = <2>; |
| 179 | + litex,clock-frequency = <25000000>; |
| 180 | + litex,clock-phase = <0>; |
| 181 | + litex,clock-duty = <25>; |
| 182 | + }; |
| 183 | +
|
| 184 | + CLKOUT3: CLKOUT3@3 { |
| 185 | + compatible = "litex,clk"; |
| 186 | + #clock-cells = <0>; |
| 187 | + clock-output-names = "CLKOUT3"; |
| 188 | + reg = <3>; |
| 189 | + litex,clock-frequency = <12500000>; |
| 190 | + litex,clock-phase = <0>; |
| 191 | + litex,clock-duty = <75>; |
| 192 | + }; |
| 193 | +
|
| 194 | + CLKOUT4: CLKOUT4@4 { |
| 195 | + compatible = "litex,clk"; |
| 196 | + #clock-cells = <0>; |
| 197 | + clock-output-names = "CLKOUT4"; |
| 198 | + reg = <4>; |
| 199 | + litex,clock-frequency = <6250000>; |
| 200 | + litex,clock-phase = <0>; |
| 201 | + litex,clock-duty = <50>; |
| 202 | + }; |
| 203 | +
|
| 204 | + CLKOUT5: CLKOUT5@5 { |
| 205 | + compatible = "litex,clk"; |
| 206 | + #clock-cells = <0>; |
| 207 | + clock-output-names = "CLKOUT5"; |
| 208 | + reg = <5>; |
| 209 | + litex,clock-frequency = <3125000>; |
| 210 | + litex,clock-phase = <0>; |
| 211 | + litex,clock-duty = <50>; |
| 212 | + }; |
| 213 | +
|
| 214 | + CLKOUT6: CLKOUT6@6 { |
| 215 | + compatible = "litex,clk"; |
| 216 | + #clock-cells = <0>; |
| 217 | + clock-output-names = "CLKOUT6"; |
| 218 | + reg = <6>; |
| 219 | + litex,clock-frequency = <1562500>; |
| 220 | + litex,clock-phase = <0>; |
| 221 | + litex,clock-duty = <5>; |
| 222 | + }; |
| 223 | + }; |
| 224 | +... |
0 commit comments