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

Configure Feed

Select the types of activity you want to include in your feed.

dt-bindings: clock: tegra124-dfll: Convert to json-schema

Convert the Tegra124 (and later) DFLL bindings from the free-form text
format to json-schema.

Co-developed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>

+290 -155
-155
Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt
··· 1 - NVIDIA Tegra124 DFLL FCPU clocksource 2 - 3 - This binding uses the common clock binding: 4 - Documentation/devicetree/bindings/clock/clock-bindings.txt 5 - 6 - The DFLL IP block on Tegra is a root clocksource designed for clocking 7 - the fast CPU cluster. It consists of a free-running voltage controlled 8 - oscillator connected to the CPU voltage rail (VDD_CPU), and a closed loop 9 - control module that will automatically adjust the VDD_CPU voltage by 10 - communicating with an off-chip PMIC either via an I2C bus or via PWM signals. 11 - 12 - Required properties: 13 - - compatible : should be one of: 14 - - "nvidia,tegra124-dfll": for Tegra124 15 - - "nvidia,tegra210-dfll": for Tegra210 16 - - reg : Defines the following set of registers, in the order listed: 17 - - registers for the DFLL control logic. 18 - - registers for the I2C output logic. 19 - - registers for the integrated I2C master controller. 20 - - look-up table RAM for voltage register values. 21 - - interrupts: Should contain the DFLL block interrupt. 22 - - clocks: Must contain an entry for each entry in clock-names. 23 - See clock-bindings.txt for details. 24 - - clock-names: Must include the following entries: 25 - - soc: Clock source for the DFLL control logic. 26 - - ref: The closed loop reference clock 27 - - i2c: Clock source for the integrated I2C master. 28 - - resets: Must contain an entry for each entry in reset-names. 29 - See ../reset/reset.txt for details. 30 - - reset-names: Must include the following entries: 31 - - dvco: Reset control for the DFLL DVCO. 32 - - #clock-cells: Must be 0. 33 - - clock-output-names: Name of the clock output. 34 - - vdd-cpu-supply: Regulator for the CPU voltage rail that the DFLL 35 - hardware will start controlling. The regulator will be queried for 36 - the I2C register, control values and supported voltages. 37 - 38 - Required properties for the control loop parameters: 39 - - nvidia,sample-rate: Sample rate of the DFLL control loop. 40 - - nvidia,droop-ctrl: See the register CL_DVFS_DROOP_CTRL in the TRM. 41 - - nvidia,force-mode: See the field DFLL_PARAMS_FORCE_MODE in the TRM. 42 - - nvidia,cf: Numeric value, see the field DFLL_PARAMS_CF_PARAM in the TRM. 43 - - nvidia,ci: Numeric value, see the field DFLL_PARAMS_CI_PARAM in the TRM. 44 - - nvidia,cg: Numeric value, see the field DFLL_PARAMS_CG_PARAM in the TRM. 45 - 46 - Optional properties for the control loop parameters: 47 - - nvidia,cg-scale: Boolean value, see the field DFLL_PARAMS_CG_SCALE in the TRM. 48 - 49 - Optional properties for mode selection: 50 - - nvidia,pwm-to-pmic: Use PWM to control regulator rather then I2C. 51 - 52 - Required properties for I2C mode: 53 - - nvidia,i2c-fs-rate: I2C transfer rate, if using full speed mode. 54 - 55 - Required properties for PWM mode: 56 - - nvidia,pwm-period-nanoseconds: period of PWM square wave in nanoseconds. 57 - - nvidia,pwm-tristate-microvolts: Regulator voltage in micro volts when PWM 58 - control is disabled and the PWM output is tristated. Note that this voltage is 59 - configured in hardware, typically via a resistor divider. 60 - - nvidia,pwm-min-microvolts: Regulator voltage in micro volts when PWM control 61 - is enabled and PWM output is low. Hence, this is the minimum output voltage 62 - that the regulator supports when PWM control is enabled. 63 - - nvidia,pwm-voltage-step-microvolts: Voltage increase in micro volts 64 - corresponding to a 1/33th increase in duty cycle. Eg the voltage for 2/33th 65 - duty cycle would be: nvidia,pwm-min-microvolts + 66 - nvidia,pwm-voltage-step-microvolts * 2. 67 - - pinctrl-0: I/O pad configuration when PWM control is enabled. 68 - - pinctrl-1: I/O pad configuration when PWM control is disabled. 69 - - pinctrl-names: must include the following entries: 70 - - dvfs_pwm_enable: I/O pad configuration when PWM control is enabled. 71 - - dvfs_pwm_disable: I/O pad configuration when PWM control is disabled. 72 - 73 - Example for I2C: 74 - 75 - clock@70110000 { 76 - compatible = "nvidia,tegra124-dfll"; 77 - reg = <0 0x70110000 0 0x100>, /* DFLL control */ 78 - <0 0x70110000 0 0x100>, /* I2C output control */ 79 - <0 0x70110100 0 0x100>, /* Integrated I2C controller */ 80 - <0 0x70110200 0 0x100>; /* Look-up table RAM */ 81 - interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>; 82 - clocks = <&tegra_car TEGRA124_CLK_DFLL_SOC>, 83 - <&tegra_car TEGRA124_CLK_DFLL_REF>, 84 - <&tegra_car TEGRA124_CLK_I2C5>; 85 - clock-names = "soc", "ref", "i2c"; 86 - resets = <&tegra_car TEGRA124_RST_DFLL_DVCO>; 87 - reset-names = "dvco"; 88 - #clock-cells = <0>; 89 - clock-output-names = "dfllCPU_out"; 90 - vdd-cpu-supply = <&vdd_cpu>; 91 - 92 - nvidia,sample-rate = <12500>; 93 - nvidia,droop-ctrl = <0x00000f00>; 94 - nvidia,force-mode = <1>; 95 - nvidia,cf = <10>; 96 - nvidia,ci = <0>; 97 - nvidia,cg = <2>; 98 - 99 - nvidia,i2c-fs-rate = <400000>; 100 - }; 101 - 102 - Example for PWM: 103 - 104 - clock@70110000 { 105 - compatible = "nvidia,tegra124-dfll"; 106 - reg = <0 0x70110000 0 0x100>, /* DFLL control */ 107 - <0 0x70110000 0 0x100>, /* I2C output control */ 108 - <0 0x70110100 0 0x100>, /* Integrated I2C controller */ 109 - <0 0x70110200 0 0x100>; /* Look-up table RAM */ 110 - interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>; 111 - clocks = <&tegra_car TEGRA210_CLK_DFLL_SOC>, 112 - <&tegra_car TEGRA210_CLK_DFLL_REF>, 113 - <&tegra_car TEGRA124_CLK_I2C5>;; 114 - clock-names = "soc", "ref", "i2c"; 115 - resets = <&tegra_car TEGRA124_RST_DFLL_DVCO>; 116 - reset-names = "dvco"; 117 - #clock-cells = <0>; 118 - clock-output-names = "dfllCPU_out"; 119 - 120 - nvidia,sample-rate = <25000>; 121 - nvidia,droop-ctrl = <0x00000f00>; 122 - nvidia,force-mode = <1>; 123 - nvidia,cf = <6>; 124 - nvidia,ci = <0>; 125 - nvidia,cg = <2>; 126 - 127 - nvidia,pwm-min-microvolts = <708000>; /* 708mV */ 128 - nvidia,pwm-period-nanoseconds = <2500>; /* 2.5us */ 129 - nvidia,pwm-to-pmic; 130 - nvidia,pwm-tristate-microvolts = <1000000>; 131 - nvidia,pwm-voltage-step-microvolts = <19200>; /* 19.2mV */ 132 - 133 - pinctrl-names = "dvfs_pwm_enable", "dvfs_pwm_disable"; 134 - pinctrl-0 = <&dvfs_pwm_active_state>; 135 - pinctrl-1 = <&dvfs_pwm_inactive_state>; 136 - }; 137 - 138 - /* pinmux nodes added for completeness. Binding doc can be found in: 139 - * Documentation/devicetree/bindings/pinctrl/nvidia,tegra210-pinmux.yaml 140 - */ 141 - 142 - pinmux: pinmux@700008d4 { 143 - dvfs_pwm_active_state: dvfs_pwm_active { 144 - dvfs_pwm_pbb1 { 145 - nvidia,pins = "dvfs_pwm_pbb1"; 146 - nvidia,tristate = <TEGRA_PIN_DISABLE>; 147 - }; 148 - }; 149 - dvfs_pwm_inactive_state: dvfs_pwm_inactive { 150 - dvfs_pwm_pbb1 { 151 - nvidia,pins = "dvfs_pwm_pbb1"; 152 - nvidia,tristate = <TEGRA_PIN_ENABLE>; 153 - }; 154 - }; 155 - };
+290
Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.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/nvidia,tegra124-dfll.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: NVIDIA Tegra124 (and later) DFLL FCPU clocksource 8 + 9 + maintainers: 10 + - Thierry Reding <thierry.reding@gmail.com> 11 + - Jon Hunter <jonathanh@nvidia.com> 12 + 13 + description: 14 + The DFLL IP block on Tegra is a root clocksource designed for clocking 15 + the fast CPU cluster. It consists of a free-running voltage controlled 16 + oscillator connected to the CPU voltage rail (VDD_CPU), and a closed 17 + loop control module that will automatically adjust the VDD_CPU voltage 18 + by communicating with an off-chip PMIC either via an I2C bus or via 19 + PWM signals. 20 + 21 + properties: 22 + compatible: 23 + enum: 24 + - nvidia,tegra124-dfll 25 + - nvidia,tegra210-dfll 26 + 27 + reg: 28 + items: 29 + - description: DFLL control logic 30 + - description: I2C output logic 31 + - description: Integrated I2C controller 32 + - description: Look-up table RAM for voltage register values 33 + 34 + interrupts: 35 + maxItems: 1 36 + 37 + "#clock-cells": 38 + const: 0 39 + 40 + clocks: 41 + items: 42 + - description: Clock source for the DFLL control logic 43 + - description: Closed loop reference clock 44 + - description: Clock source for the integrated I2C controller 45 + 46 + clock-names: 47 + items: 48 + - const: soc 49 + - const: ref 50 + - const: i2c 51 + 52 + clock-output-names: 53 + description: Name of the clock output 54 + items: 55 + - const: dfllCPU_out 56 + 57 + resets: 58 + minItems: 1 59 + maxItems: 2 60 + 61 + reset-names: 62 + minItems: 1 63 + items: 64 + - const: dvco 65 + - const: dfll 66 + 67 + vdd-cpu-supply: 68 + description: Regulator for the CPU voltage rail that the DFLL 69 + hardware will start controlling. The regulator will be queried for 70 + the I2C register, control values and supported voltages. 71 + 72 + nvidia,sample-rate: 73 + description: Sample rate of the DFLL control loop 74 + $ref: /schemas/types.yaml#/definitions/uint32 75 + minimum: 12500 76 + maximum: 25000 77 + 78 + nvidia,droop-ctrl: 79 + description: Droop control parameter (CL_DVFS_DROOP_CTRL) in the TRM 80 + $ref: /schemas/types.yaml#/definitions/uint32 81 + 82 + nvidia,force-mode: 83 + description: See the field DFLL_PARAMS_FORCE_MODE in the TRM 84 + $ref: /schemas/types.yaml#/definitions/uint32 85 + oneOf: 86 + - description: disabled 87 + const: 0 88 + - description: fixed delay mode 89 + const: 1 90 + - description: auto mode 91 + const: 2 92 + 93 + nvidia,cf: 94 + description: Numeric value, see the field DFLL_PARAMS_CF_PARAM in the TRM 95 + $ref: /schemas/types.yaml#/definitions/uint32 96 + minimum: 0 97 + maximum: 63 98 + 99 + nvidia,ci: 100 + description: Numeric value, see the field DFLL_PARAMS_CI_PARAM in the TRM 101 + $ref: /schemas/types.yaml#/definitions/uint32 102 + minimum: 0 103 + maximum: 7 104 + 105 + nvidia,cg: 106 + description: Numeric value, see the field DFLL_PARAMS_CG_PARAM in the TRM 107 + $ref: /schemas/types.yaml#/definitions/uint32 108 + minimum: 0 109 + maximum: 255 110 + 111 + # optional properties 112 + nvidia,cg-scale: 113 + description: Boolean value, see the field DFLL_PARAMS_CG_SCALE in the TRM 114 + $ref: /schemas/types.yaml#/definitions/flag 115 + 116 + nvidia,pwm-to-pmic: 117 + description: Use PWM to control regulator rather than I2C 118 + $ref: /schemas/types.yaml#/definitions/flag 119 + 120 + nvidia,i2c-fs-rate: 121 + description: I2C transfer rate, if using full speed mode 122 + $ref: /schemas/types.yaml#/definitions/uint32 123 + enum: [100000, 400000] 124 + 125 + # required properties for PWM mode 126 + nvidia,pwm-period-nanoseconds: 127 + description: Period of PWM square wave in nanoseconds 128 + $ref: /schemas/types.yaml#/definitions/uint32 129 + minimum: 1000 130 + maximum: 1000000000 131 + 132 + nvidia,pwm-tristate-microvolts: 133 + description: Regulator voltage in microvolts when PWM control is disabled 134 + and the PWM output is tristated. Note that this voltage is configured in 135 + hardware, typically via a resistor divider. 136 + $ref: /schemas/types.yaml#/definitions/uint32 137 + minimum: 0 138 + maximum: 3300000 139 + 140 + nvidia,pwm-min-microvolts: 141 + description: Regulator voltage in microvolts when PWM control is enabled 142 + and PWM output is low. Hence, this is the minimum output voltage that 143 + the regulator supports when PWM control is enabled. 144 + $ref: /schemas/types.yaml#/definitions/uint32 145 + minimum: 0 146 + maximum: 3300000 147 + 148 + nvidia,pwm-voltage-step-microvolts: 149 + description: | 150 + Voltage increase in micro volts corresponding to a 1/33th increase 151 + in duty cycle. For example, the voltage for 2/33th duty cycle would be: 152 + 153 + nvidia,pwm-min-microvolts + nvidia,pwm-voltage-step-microvolts * 2 154 + $ref: /schemas/types.yaml#/definitions/uint32 155 + minimum: 0 156 + maximum: 100000 157 + 158 + pinctrl-0: 159 + description: I/O pad configuration when PWM control is enabled 160 + 161 + pinctrl-1: 162 + description: I/O pad configuration when PWM control is disabled 163 + 164 + pinctrl-names: 165 + items: 166 + - const: dvfs_pwm_enable 167 + - const: dvfs_pwm_disable 168 + 169 + required: 170 + - compatible 171 + - reg 172 + - interrupts 173 + - "#clock-cells" 174 + - clocks 175 + - clock-names 176 + - clock-output-names 177 + - resets 178 + - reset-names 179 + - nvidia,sample-rate 180 + - nvidia,droop-ctrl 181 + - nvidia,force-mode 182 + - nvidia,cf 183 + - nvidia,ci 184 + - nvidia,cg 185 + 186 + additionalProperties: false 187 + 188 + allOf: 189 + - if: 190 + properties: 191 + compatible: 192 + contains: 193 + const: nvidia,tegra124-dfll 194 + then: 195 + properties: 196 + resets: 197 + maxItems: 1 198 + 199 + reset-names: 200 + maxItems: 1 201 + else: 202 + properties: 203 + resets: 204 + minItems: 2 205 + 206 + reset-names: 207 + minItems: 2 208 + 209 + - if: 210 + required: 211 + - nvidia,pwm-to-pmic 212 + then: 213 + required: 214 + - nvidia,pwm-min-microvolts 215 + - nvidia,pwm-period-nanoseconds 216 + - nvidia,pwm-tristate-microvolts 217 + - nvidia,pwm-voltage-step-microvolts 218 + else: 219 + required: 220 + - vdd-cpu-supply 221 + 222 + examples: 223 + - | 224 + #include <dt-bindings/clock/tegra124-car.h> 225 + #include <dt-bindings/interrupt-controller/arm-gic.h> 226 + #include <dt-bindings/reset/tegra124-car.h> 227 + 228 + clock@70110000 { 229 + compatible = "nvidia,tegra124-dfll"; 230 + reg = <0x70110000 0x100>, /* DFLL control */ 231 + <0x70110000 0x100>, /* I2C output control */ 232 + <0x70110100 0x100>, /* Integrated I2C controller */ 233 + <0x70110200 0x100>; /* Look-up table RAM */ 234 + interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>; 235 + clocks = <&tegra_car TEGRA124_CLK_DFLL_SOC>, 236 + <&tegra_car TEGRA124_CLK_DFLL_REF>, 237 + <&tegra_car TEGRA124_CLK_I2C5>; 238 + clock-names = "soc", "ref", "i2c"; 239 + resets = <&tegra_car TEGRA124_RST_DFLL_DVCO>; 240 + reset-names = "dvco"; 241 + #clock-cells = <0>; 242 + clock-output-names = "dfllCPU_out"; 243 + vdd-cpu-supply = <&vdd_cpu>; 244 + 245 + nvidia,sample-rate = <12500>; 246 + nvidia,droop-ctrl = <0x00000f00>; 247 + nvidia,force-mode = <1>; 248 + nvidia,cf = <10>; 249 + nvidia,ci = <0>; 250 + nvidia,cg = <2>; 251 + 252 + nvidia,i2c-fs-rate = <400000>; 253 + }; 254 + 255 + - | 256 + #include <dt-bindings/clock/tegra210-car.h> 257 + #include <dt-bindings/interrupt-controller/arm-gic.h> 258 + #include <dt-bindings/reset/tegra210-car.h> 259 + 260 + clock@70110000 { 261 + compatible = "nvidia,tegra210-dfll"; 262 + reg = <0x70110000 0x100>, /* DFLL control */ 263 + <0x70110000 0x100>, /* I2C output control */ 264 + <0x70110100 0x100>, /* Integrated I2C controller */ 265 + <0x70110200 0x100>; /* Look-up table RAM */ 266 + interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>; 267 + clocks = <&tegra_car TEGRA210_CLK_DFLL_SOC>, 268 + <&tegra_car TEGRA210_CLK_DFLL_REF>, 269 + <&tegra_car TEGRA210_CLK_I2C5>; 270 + clock-names = "soc", "ref", "i2c"; 271 + resets = <&tegra_car TEGRA210_RST_DFLL_DVCO>, 272 + <&tegra_car 155>; 273 + reset-names = "dvco", "dfll"; 274 + #clock-cells = <0>; 275 + clock-output-names = "dfllCPU_out"; 276 + vdd-cpu-supply = <&vdd_cpu>; 277 + 278 + nvidia,sample-rate = <25000>; 279 + nvidia,droop-ctrl = <0x00000f00>; 280 + nvidia,force-mode = <1>; 281 + nvidia,cf = <6>; 282 + nvidia,ci = <0>; 283 + nvidia,cg = <2>; 284 + 285 + nvidia,pwm-min-microvolts = <708000>; /* 708mV */ 286 + nvidia,pwm-period-nanoseconds = <2500>; /* 2.5us */ 287 + nvidia,pwm-to-pmic; 288 + nvidia,pwm-tristate-microvolts = <1000000>; 289 + nvidia,pwm-voltage-step-microvolts = <19200>; /* 19.2mV */ 290 + };