1c66ec88fSEmmanuel VadotNVIDIA Tegra124 DFLL FCPU clocksource 2c66ec88fSEmmanuel Vadot 3c66ec88fSEmmanuel VadotThis binding uses the common clock binding: 4c66ec88fSEmmanuel VadotDocumentation/devicetree/bindings/clock/clock-bindings.txt 5c66ec88fSEmmanuel Vadot 6c66ec88fSEmmanuel VadotThe DFLL IP block on Tegra is a root clocksource designed for clocking 7c66ec88fSEmmanuel Vadotthe fast CPU cluster. It consists of a free-running voltage controlled 8c66ec88fSEmmanuel Vadotoscillator connected to the CPU voltage rail (VDD_CPU), and a closed loop 9c66ec88fSEmmanuel Vadotcontrol module that will automatically adjust the VDD_CPU voltage by 10c66ec88fSEmmanuel Vadotcommunicating with an off-chip PMIC either via an I2C bus or via PWM signals. 11c66ec88fSEmmanuel Vadot 12c66ec88fSEmmanuel VadotRequired properties: 13c66ec88fSEmmanuel Vadot- compatible : should be one of: 14c66ec88fSEmmanuel Vadot - "nvidia,tegra124-dfll": for Tegra124 15c66ec88fSEmmanuel Vadot - "nvidia,tegra210-dfll": for Tegra210 16c66ec88fSEmmanuel Vadot- reg : Defines the following set of registers, in the order listed: 17c66ec88fSEmmanuel Vadot - registers for the DFLL control logic. 18c66ec88fSEmmanuel Vadot - registers for the I2C output logic. 19c66ec88fSEmmanuel Vadot - registers for the integrated I2C master controller. 20c66ec88fSEmmanuel Vadot - look-up table RAM for voltage register values. 21c66ec88fSEmmanuel Vadot- interrupts: Should contain the DFLL block interrupt. 22c66ec88fSEmmanuel Vadot- clocks: Must contain an entry for each entry in clock-names. 23c66ec88fSEmmanuel Vadot See clock-bindings.txt for details. 24c66ec88fSEmmanuel Vadot- clock-names: Must include the following entries: 25c66ec88fSEmmanuel Vadot - soc: Clock source for the DFLL control logic. 26c66ec88fSEmmanuel Vadot - ref: The closed loop reference clock 27c66ec88fSEmmanuel Vadot - i2c: Clock source for the integrated I2C master. 28c66ec88fSEmmanuel Vadot- resets: Must contain an entry for each entry in reset-names. 29c66ec88fSEmmanuel Vadot See ../reset/reset.txt for details. 30c66ec88fSEmmanuel Vadot- reset-names: Must include the following entries: 31c66ec88fSEmmanuel Vadot - dvco: Reset control for the DFLL DVCO. 32c66ec88fSEmmanuel Vadot- #clock-cells: Must be 0. 33c66ec88fSEmmanuel Vadot- clock-output-names: Name of the clock output. 34c66ec88fSEmmanuel Vadot- vdd-cpu-supply: Regulator for the CPU voltage rail that the DFLL 35c66ec88fSEmmanuel Vadot hardware will start controlling. The regulator will be queried for 36c66ec88fSEmmanuel Vadot the I2C register, control values and supported voltages. 37c66ec88fSEmmanuel Vadot 38c66ec88fSEmmanuel VadotRequired properties for the control loop parameters: 39c66ec88fSEmmanuel Vadot- nvidia,sample-rate: Sample rate of the DFLL control loop. 40c66ec88fSEmmanuel Vadot- nvidia,droop-ctrl: See the register CL_DVFS_DROOP_CTRL in the TRM. 41c66ec88fSEmmanuel Vadot- nvidia,force-mode: See the field DFLL_PARAMS_FORCE_MODE in the TRM. 42c66ec88fSEmmanuel Vadot- nvidia,cf: Numeric value, see the field DFLL_PARAMS_CF_PARAM in the TRM. 43c66ec88fSEmmanuel Vadot- nvidia,ci: Numeric value, see the field DFLL_PARAMS_CI_PARAM in the TRM. 44c66ec88fSEmmanuel Vadot- nvidia,cg: Numeric value, see the field DFLL_PARAMS_CG_PARAM in the TRM. 45c66ec88fSEmmanuel Vadot 46c66ec88fSEmmanuel VadotOptional properties for the control loop parameters: 47c66ec88fSEmmanuel Vadot- nvidia,cg-scale: Boolean value, see the field DFLL_PARAMS_CG_SCALE in the TRM. 48c66ec88fSEmmanuel Vadot 49c66ec88fSEmmanuel VadotOptional properties for mode selection: 50c66ec88fSEmmanuel Vadot- nvidia,pwm-to-pmic: Use PWM to control regulator rather then I2C. 51c66ec88fSEmmanuel Vadot 52c66ec88fSEmmanuel VadotRequired properties for I2C mode: 53c66ec88fSEmmanuel Vadot- nvidia,i2c-fs-rate: I2C transfer rate, if using full speed mode. 54c66ec88fSEmmanuel Vadot 55c66ec88fSEmmanuel VadotRequired properties for PWM mode: 56c66ec88fSEmmanuel Vadot- nvidia,pwm-period-nanoseconds: period of PWM square wave in nanoseconds. 57c66ec88fSEmmanuel Vadot- nvidia,pwm-tristate-microvolts: Regulator voltage in micro volts when PWM 58c66ec88fSEmmanuel Vadot control is disabled and the PWM output is tristated. Note that this voltage is 59c66ec88fSEmmanuel Vadot configured in hardware, typically via a resistor divider. 60c66ec88fSEmmanuel Vadot- nvidia,pwm-min-microvolts: Regulator voltage in micro volts when PWM control 61c66ec88fSEmmanuel Vadot is enabled and PWM output is low. Hence, this is the minimum output voltage 62c66ec88fSEmmanuel Vadot that the regulator supports when PWM control is enabled. 63c66ec88fSEmmanuel Vadot- nvidia,pwm-voltage-step-microvolts: Voltage increase in micro volts 64c66ec88fSEmmanuel Vadot corresponding to a 1/33th increase in duty cycle. Eg the voltage for 2/33th 65c66ec88fSEmmanuel Vadot duty cycle would be: nvidia,pwm-min-microvolts + 66c66ec88fSEmmanuel Vadot nvidia,pwm-voltage-step-microvolts * 2. 67c66ec88fSEmmanuel Vadot- pinctrl-0: I/O pad configuration when PWM control is enabled. 68c66ec88fSEmmanuel Vadot- pinctrl-1: I/O pad configuration when PWM control is disabled. 69c66ec88fSEmmanuel Vadot- pinctrl-names: must include the following entries: 70c66ec88fSEmmanuel Vadot - dvfs_pwm_enable: I/O pad configuration when PWM control is enabled. 71c66ec88fSEmmanuel Vadot - dvfs_pwm_disable: I/O pad configuration when PWM control is disabled. 72c66ec88fSEmmanuel Vadot 73c66ec88fSEmmanuel VadotExample for I2C: 74c66ec88fSEmmanuel Vadot 75c66ec88fSEmmanuel Vadotclock@70110000 { 76c66ec88fSEmmanuel Vadot compatible = "nvidia,tegra124-dfll"; 77c66ec88fSEmmanuel Vadot reg = <0 0x70110000 0 0x100>, /* DFLL control */ 78c66ec88fSEmmanuel Vadot <0 0x70110000 0 0x100>, /* I2C output control */ 79c66ec88fSEmmanuel Vadot <0 0x70110100 0 0x100>, /* Integrated I2C controller */ 80c66ec88fSEmmanuel Vadot <0 0x70110200 0 0x100>; /* Look-up table RAM */ 81c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>; 82c66ec88fSEmmanuel Vadot clocks = <&tegra_car TEGRA124_CLK_DFLL_SOC>, 83c66ec88fSEmmanuel Vadot <&tegra_car TEGRA124_CLK_DFLL_REF>, 84c66ec88fSEmmanuel Vadot <&tegra_car TEGRA124_CLK_I2C5>; 85c66ec88fSEmmanuel Vadot clock-names = "soc", "ref", "i2c"; 86c66ec88fSEmmanuel Vadot resets = <&tegra_car TEGRA124_RST_DFLL_DVCO>; 87c66ec88fSEmmanuel Vadot reset-names = "dvco"; 88c66ec88fSEmmanuel Vadot #clock-cells = <0>; 89c66ec88fSEmmanuel Vadot clock-output-names = "dfllCPU_out"; 90c66ec88fSEmmanuel Vadot vdd-cpu-supply = <&vdd_cpu>; 91c66ec88fSEmmanuel Vadot 92c66ec88fSEmmanuel Vadot nvidia,sample-rate = <12500>; 93c66ec88fSEmmanuel Vadot nvidia,droop-ctrl = <0x00000f00>; 94c66ec88fSEmmanuel Vadot nvidia,force-mode = <1>; 95c66ec88fSEmmanuel Vadot nvidia,cf = <10>; 96c66ec88fSEmmanuel Vadot nvidia,ci = <0>; 97c66ec88fSEmmanuel Vadot nvidia,cg = <2>; 98c66ec88fSEmmanuel Vadot 99c66ec88fSEmmanuel Vadot nvidia,i2c-fs-rate = <400000>; 100c66ec88fSEmmanuel Vadot}; 101c66ec88fSEmmanuel Vadot 102c66ec88fSEmmanuel VadotExample for PWM: 103c66ec88fSEmmanuel Vadot 104c66ec88fSEmmanuel Vadotclock@70110000 { 105c66ec88fSEmmanuel Vadot compatible = "nvidia,tegra124-dfll"; 106c66ec88fSEmmanuel Vadot reg = <0 0x70110000 0 0x100>, /* DFLL control */ 107c66ec88fSEmmanuel Vadot <0 0x70110000 0 0x100>, /* I2C output control */ 108c66ec88fSEmmanuel Vadot <0 0x70110100 0 0x100>, /* Integrated I2C controller */ 109c66ec88fSEmmanuel Vadot <0 0x70110200 0 0x100>; /* Look-up table RAM */ 110c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>; 111c66ec88fSEmmanuel Vadot clocks = <&tegra_car TEGRA210_CLK_DFLL_SOC>, 112c66ec88fSEmmanuel Vadot <&tegra_car TEGRA210_CLK_DFLL_REF>, 113c66ec88fSEmmanuel Vadot <&tegra_car TEGRA124_CLK_I2C5>;; 114c66ec88fSEmmanuel Vadot clock-names = "soc", "ref", "i2c"; 115c66ec88fSEmmanuel Vadot resets = <&tegra_car TEGRA124_RST_DFLL_DVCO>; 116c66ec88fSEmmanuel Vadot reset-names = "dvco"; 117c66ec88fSEmmanuel Vadot #clock-cells = <0>; 118c66ec88fSEmmanuel Vadot clock-output-names = "dfllCPU_out"; 119c66ec88fSEmmanuel Vadot 120c66ec88fSEmmanuel Vadot nvidia,sample-rate = <25000>; 121c66ec88fSEmmanuel Vadot nvidia,droop-ctrl = <0x00000f00>; 122c66ec88fSEmmanuel Vadot nvidia,force-mode = <1>; 123c66ec88fSEmmanuel Vadot nvidia,cf = <6>; 124c66ec88fSEmmanuel Vadot nvidia,ci = <0>; 125c66ec88fSEmmanuel Vadot nvidia,cg = <2>; 126c66ec88fSEmmanuel Vadot 127c66ec88fSEmmanuel Vadot nvidia,pwm-min-microvolts = <708000>; /* 708mV */ 128c66ec88fSEmmanuel Vadot nvidia,pwm-period-nanoseconds = <2500>; /* 2.5us */ 129c66ec88fSEmmanuel Vadot nvidia,pwm-to-pmic; 130c66ec88fSEmmanuel Vadot nvidia,pwm-tristate-microvolts = <1000000>; 131c66ec88fSEmmanuel Vadot nvidia,pwm-voltage-step-microvolts = <19200>; /* 19.2mV */ 132c66ec88fSEmmanuel Vadot 133c66ec88fSEmmanuel Vadot pinctrl-names = "dvfs_pwm_enable", "dvfs_pwm_disable"; 134c66ec88fSEmmanuel Vadot pinctrl-0 = <&dvfs_pwm_active_state>; 135c66ec88fSEmmanuel Vadot pinctrl-1 = <&dvfs_pwm_inactive_state>; 136c66ec88fSEmmanuel Vadot}; 137c66ec88fSEmmanuel Vadot 138c66ec88fSEmmanuel Vadot/* pinmux nodes added for completeness. Binding doc can be found in: 139*8bab661aSEmmanuel Vadot * Documentation/devicetree/bindings/pinctrl/nvidia,tegra210-pinmux.yaml 140c66ec88fSEmmanuel Vadot */ 141c66ec88fSEmmanuel Vadot 142c66ec88fSEmmanuel Vadotpinmux: pinmux@700008d4 { 143c66ec88fSEmmanuel Vadot dvfs_pwm_active_state: dvfs_pwm_active { 144c66ec88fSEmmanuel Vadot dvfs_pwm_pbb1 { 145c66ec88fSEmmanuel Vadot nvidia,pins = "dvfs_pwm_pbb1"; 146c66ec88fSEmmanuel Vadot nvidia,tristate = <TEGRA_PIN_DISABLE>; 147c66ec88fSEmmanuel Vadot }; 148c66ec88fSEmmanuel Vadot }; 149c66ec88fSEmmanuel Vadot dvfs_pwm_inactive_state: dvfs_pwm_inactive { 150c66ec88fSEmmanuel Vadot dvfs_pwm_pbb1 { 151c66ec88fSEmmanuel Vadot nvidia,pins = "dvfs_pwm_pbb1"; 152c66ec88fSEmmanuel Vadot nvidia,tristate = <TEGRA_PIN_ENABLE>; 153c66ec88fSEmmanuel Vadot }; 154c66ec88fSEmmanuel Vadot }; 155c66ec88fSEmmanuel Vadot}; 156