xref: /linux/Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt (revision 93caec0042659bf17ec217b09857bd5eaeca6804)
10c59d267STuomas TynkkynenNVIDIA Tegra124 DFLL FCPU clocksource
20c59d267STuomas Tynkkynen
30c59d267STuomas TynkkynenThis binding uses the common clock binding:
40c59d267STuomas TynkkynenDocumentation/devicetree/bindings/clock/clock-bindings.txt
50c59d267STuomas Tynkkynen
60c59d267STuomas TynkkynenThe DFLL IP block on Tegra is a root clocksource designed for clocking
70c59d267STuomas Tynkkynenthe fast CPU cluster. It consists of a free-running voltage controlled
80c59d267STuomas Tynkkynenoscillator connected to the CPU voltage rail (VDD_CPU), and a closed loop
90c59d267STuomas Tynkkynencontrol module that will automatically adjust the VDD_CPU voltage by
100c59d267STuomas Tynkkynencommunicating with an off-chip PMIC either via an I2C bus or via PWM signals.
110c59d267STuomas Tynkkynen
120c59d267STuomas TynkkynenRequired properties:
130c59d267STuomas Tynkkynen- compatible : should be "nvidia,tegra124-dfll"
140c59d267STuomas Tynkkynen- reg : Defines the following set of registers, in the order listed:
150c59d267STuomas Tynkkynen        - registers for the DFLL control logic.
160c59d267STuomas Tynkkynen        - registers for the I2C output logic.
170c59d267STuomas Tynkkynen        - registers for the integrated I2C master controller.
180c59d267STuomas Tynkkynen        - look-up table RAM for voltage register values.
190c59d267STuomas Tynkkynen- interrupts: Should contain the DFLL block interrupt.
200c59d267STuomas Tynkkynen- clocks: Must contain an entry for each entry in clock-names.
210c59d267STuomas Tynkkynen  See clock-bindings.txt for details.
220c59d267STuomas Tynkkynen- clock-names: Must include the following entries:
230c59d267STuomas Tynkkynen  - soc: Clock source for the DFLL control logic.
240c59d267STuomas Tynkkynen  - ref: The closed loop reference clock
250c59d267STuomas Tynkkynen  - i2c: Clock source for the integrated I2C master.
260c59d267STuomas Tynkkynen- resets: Must contain an entry for each entry in reset-names.
270c59d267STuomas Tynkkynen  See ../reset/reset.txt for details.
280c59d267STuomas Tynkkynen- reset-names: Must include the following entries:
290c59d267STuomas Tynkkynen  - dvco: Reset control for the DFLL DVCO.
300c59d267STuomas Tynkkynen- #clock-cells: Must be 0.
310c59d267STuomas Tynkkynen- clock-output-names: Name of the clock output.
320c59d267STuomas Tynkkynen- vdd-cpu-supply: Regulator for the CPU voltage rail that the DFLL
330c59d267STuomas Tynkkynen  hardware will start controlling. The regulator will be queried for
340c59d267STuomas Tynkkynen  the I2C register, control values and supported voltages.
350c59d267STuomas Tynkkynen
360c59d267STuomas TynkkynenRequired properties for the control loop parameters:
370c59d267STuomas Tynkkynen- nvidia,sample-rate: Sample rate of the DFLL control loop.
380c59d267STuomas Tynkkynen- nvidia,droop-ctrl: See the register CL_DVFS_DROOP_CTRL in the TRM.
390c59d267STuomas Tynkkynen- nvidia,force-mode: See the field DFLL_PARAMS_FORCE_MODE in the TRM.
400c59d267STuomas Tynkkynen- nvidia,cf: Numeric value, see the field DFLL_PARAMS_CF_PARAM in the TRM.
410c59d267STuomas Tynkkynen- nvidia,ci: Numeric value, see the field DFLL_PARAMS_CI_PARAM in the TRM.
420c59d267STuomas Tynkkynen- nvidia,cg: Numeric value, see the field DFLL_PARAMS_CG_PARAM in the TRM.
430c59d267STuomas Tynkkynen
440c59d267STuomas TynkkynenOptional properties for the control loop parameters:
450c59d267STuomas Tynkkynen- nvidia,cg-scale: Boolean value, see the field DFLL_PARAMS_CG_SCALE in the TRM.
460c59d267STuomas Tynkkynen
47*93caec00SPeter De SchrijverOptional properties for mode selection:
48*93caec00SPeter De Schrijver- nvidia,pwm-to-pmic: Use PWM to control regulator rather then I2C.
49*93caec00SPeter De Schrijver
500c59d267STuomas TynkkynenRequired properties for I2C mode:
510c59d267STuomas Tynkkynen- nvidia,i2c-fs-rate: I2C transfer rate, if using full speed mode.
520c59d267STuomas Tynkkynen
53*93caec00SPeter De SchrijverRequired properties for PWM mode:
54*93caec00SPeter De Schrijver- nvidia,pwm-period-nanoseconds: period of PWM square wave in nanoseconds.
55*93caec00SPeter De Schrijver- nvidia,pwm-tristate-microvolts: Regulator voltage in micro volts when PWM
56*93caec00SPeter De Schrijver  control is disabled and the PWM output is tristated. Note that this voltage is
57*93caec00SPeter De Schrijver  configured in hardware, typically via a resistor divider.
58*93caec00SPeter De Schrijver- nvidia,pwm-min-microvolts: Regulator voltage in micro volts when PWM control
59*93caec00SPeter De Schrijver  is enabled and PWM output is low. Hence, this is the minimum output voltage
60*93caec00SPeter De Schrijver  that the regulator supports when PWM control is enabled.
61*93caec00SPeter De Schrijver- nvidia,pwm-voltage-step-microvolts: Voltage increase in micro volts
62*93caec00SPeter De Schrijver  corresponding to a 1/33th increase in duty cycle. Eg the voltage for 2/33th
63*93caec00SPeter De Schrijver  duty cycle would be: nvidia,pwm-min-microvolts +
64*93caec00SPeter De Schrijver  nvidia,pwm-voltage-step-microvolts * 2.
65*93caec00SPeter De Schrijver- pinctrl-0: I/O pad configuration when PWM control is enabled.
66*93caec00SPeter De Schrijver- pinctrl-1: I/O pad configuration when PWM control is disabled.
67*93caec00SPeter De Schrijver- pinctrl-names: must include the following entries:
68*93caec00SPeter De Schrijver  - dvfs_pwm_enable: I/O pad configuration when PWM control is enabled.
69*93caec00SPeter De Schrijver  - dvfs_pwm_disable: I/O pad configuration when PWM control is disabled.
70*93caec00SPeter De Schrijver
71*93caec00SPeter De SchrijverExample for I2C:
720c59d267STuomas Tynkkynen
73f43521e9SThierry Redingclock@70110000 {
740c59d267STuomas Tynkkynen        compatible = "nvidia,tegra124-dfll";
750c59d267STuomas Tynkkynen        reg = <0 0x70110000 0 0x100>, /* DFLL control */
760c59d267STuomas Tynkkynen              <0 0x70110000 0 0x100>, /* I2C output control */
770c59d267STuomas Tynkkynen              <0 0x70110100 0 0x100>, /* Integrated I2C controller */
780c59d267STuomas Tynkkynen              <0 0x70110200 0 0x100>; /* Look-up table RAM */
790c59d267STuomas Tynkkynen        interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
800c59d267STuomas Tynkkynen        clocks = <&tegra_car TEGRA124_CLK_DFLL_SOC>,
810c59d267STuomas Tynkkynen                 <&tegra_car TEGRA124_CLK_DFLL_REF>,
820c59d267STuomas Tynkkynen                 <&tegra_car TEGRA124_CLK_I2C5>;
830c59d267STuomas Tynkkynen        clock-names = "soc", "ref", "i2c";
840c59d267STuomas Tynkkynen        resets = <&tegra_car TEGRA124_RST_DFLL_DVCO>;
850c59d267STuomas Tynkkynen        reset-names = "dvco";
860c59d267STuomas Tynkkynen        #clock-cells = <0>;
870c59d267STuomas Tynkkynen        clock-output-names = "dfllCPU_out";
880c59d267STuomas Tynkkynen        vdd-cpu-supply = <&vdd_cpu>;
890c59d267STuomas Tynkkynen
900c59d267STuomas Tynkkynen        nvidia,sample-rate = <12500>;
910c59d267STuomas Tynkkynen        nvidia,droop-ctrl = <0x00000f00>;
920c59d267STuomas Tynkkynen        nvidia,force-mode = <1>;
930c59d267STuomas Tynkkynen        nvidia,cf = <10>;
940c59d267STuomas Tynkkynen        nvidia,ci = <0>;
950c59d267STuomas Tynkkynen        nvidia,cg = <2>;
960c59d267STuomas Tynkkynen
970c59d267STuomas Tynkkynen        nvidia,i2c-fs-rate = <400000>;
980c59d267STuomas Tynkkynen};
99*93caec00SPeter De Schrijver
100*93caec00SPeter De SchrijverExample for PWM:
101*93caec00SPeter De Schrijver
102*93caec00SPeter De Schrijverclock@70110000 {
103*93caec00SPeter De Schrijver	compatible = "nvidia,tegra124-dfll";
104*93caec00SPeter De Schrijver	reg = <0 0x70110000 0 0x100>, /* DFLL control */
105*93caec00SPeter De Schrijver	      <0 0x70110000 0 0x100>, /* I2C output control */
106*93caec00SPeter De Schrijver	      <0 0x70110100 0 0x100>, /* Integrated I2C controller */
107*93caec00SPeter De Schrijver	      <0 0x70110200 0 0x100>; /* Look-up table RAM */
108*93caec00SPeter De Schrijver	interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
109*93caec00SPeter De Schrijver	clocks = <&tegra_car TEGRA210_CLK_DFLL_SOC>,
110*93caec00SPeter De Schrijver	         <&tegra_car TEGRA210_CLK_DFLL_REF>,
111*93caec00SPeter De Schrijver		 <&tegra_car TEGRA124_CLK_I2C5>;;
112*93caec00SPeter De Schrijver	clock-names = "soc", "ref", "i2c";
113*93caec00SPeter De Schrijver	resets = <&tegra_car TEGRA124_RST_DFLL_DVCO>;
114*93caec00SPeter De Schrijver	reset-names = "dvco";
115*93caec00SPeter De Schrijver	#clock-cells = <0>;
116*93caec00SPeter De Schrijver	clock-output-names = "dfllCPU_out";
117*93caec00SPeter De Schrijver
118*93caec00SPeter De Schrijver	nvidia,sample-rate = <25000>;
119*93caec00SPeter De Schrijver	nvidia,droop-ctrl = <0x00000f00>;
120*93caec00SPeter De Schrijver	nvidia,force-mode = <1>;
121*93caec00SPeter De Schrijver	nvidia,cf = <6>;
122*93caec00SPeter De Schrijver	nvidia,ci = <0>;
123*93caec00SPeter De Schrijver	nvidia,cg = <2>;
124*93caec00SPeter De Schrijver
125*93caec00SPeter De Schrijver	nvidia,pwm-min-microvolts = <708000>; /* 708mV */
126*93caec00SPeter De Schrijver	nvidia,pwm-period-nanoseconds = <2500>; /* 2.5us */
127*93caec00SPeter De Schrijver	nvidia,pwm-to-pmic;
128*93caec00SPeter De Schrijver	nvidia,pwm-tristate-microvolts = <1000000>;
129*93caec00SPeter De Schrijver	nvidia,pwm-voltage-step-microvolts = <19200>; /* 19.2mV */
130*93caec00SPeter De Schrijver
131*93caec00SPeter De Schrijver	pinctrl-names = "dvfs_pwm_enable", "dvfs_pwm_disable";
132*93caec00SPeter De Schrijver	pinctrl-0 = <&dvfs_pwm_active_state>;
133*93caec00SPeter De Schrijver	pinctrl-1 = <&dvfs_pwm_inactive_state>;
134*93caec00SPeter De Schrijver};
135*93caec00SPeter De Schrijver
136*93caec00SPeter De Schrijver/* pinmux nodes added for completeness. Binding doc can be found in:
137*93caec00SPeter De Schrijver * Documentation/devicetree/bindings/pinctrl/nvidia,tegra210-pinmux.txt
138*93caec00SPeter De Schrijver */
139*93caec00SPeter De Schrijver
140*93caec00SPeter De Schrijverpinmux: pinmux@700008d4 {
141*93caec00SPeter De Schrijver	dvfs_pwm_active_state: dvfs_pwm_active {
142*93caec00SPeter De Schrijver		dvfs_pwm_pbb1 {
143*93caec00SPeter De Schrijver			nvidia,pins = "dvfs_pwm_pbb1";
144*93caec00SPeter De Schrijver			nvidia,tristate = <TEGRA_PIN_DISABLE>;
145*93caec00SPeter De Schrijver		};
146*93caec00SPeter De Schrijver	};
147*93caec00SPeter De Schrijver	dvfs_pwm_inactive_state: dvfs_pwm_inactive {
148*93caec00SPeter De Schrijver		dvfs_pwm_pbb1 {
149*93caec00SPeter De Schrijver			nvidia,pins = "dvfs_pwm_pbb1";
150*93caec00SPeter De Schrijver			nvidia,tristate = <TEGRA_PIN_ENABLE>;
151*93caec00SPeter De Schrijver		};
152*93caec00SPeter De Schrijver	};
153*93caec00SPeter De Schrijver};
154