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