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:
137e9d1098SJoseph Lo- compatible : should be one of:
147e9d1098SJoseph Lo  - "nvidia,tegra124-dfll": for Tegra124
157e9d1098SJoseph Lo  - "nvidia,tegra210-dfll": for Tegra210
160c59d267STuomas Tynkkynen- reg : Defines the following set of registers, in the order listed:
170c59d267STuomas Tynkkynen        - registers for the DFLL control logic.
180c59d267STuomas Tynkkynen        - registers for the I2C output logic.
190c59d267STuomas Tynkkynen        - registers for the integrated I2C master controller.
200c59d267STuomas Tynkkynen        - look-up table RAM for voltage register values.
210c59d267STuomas Tynkkynen- interrupts: Should contain the DFLL block interrupt.
220c59d267STuomas Tynkkynen- clocks: Must contain an entry for each entry in clock-names.
230c59d267STuomas Tynkkynen  See clock-bindings.txt for details.
240c59d267STuomas Tynkkynen- clock-names: Must include the following entries:
250c59d267STuomas Tynkkynen  - soc: Clock source for the DFLL control logic.
260c59d267STuomas Tynkkynen  - ref: The closed loop reference clock
270c59d267STuomas Tynkkynen  - i2c: Clock source for the integrated I2C master.
280c59d267STuomas Tynkkynen- resets: Must contain an entry for each entry in reset-names.
290c59d267STuomas Tynkkynen  See ../reset/reset.txt for details.
300c59d267STuomas Tynkkynen- reset-names: Must include the following entries:
310c59d267STuomas Tynkkynen  - dvco: Reset control for the DFLL DVCO.
320c59d267STuomas Tynkkynen- #clock-cells: Must be 0.
330c59d267STuomas Tynkkynen- clock-output-names: Name of the clock output.
340c59d267STuomas Tynkkynen- vdd-cpu-supply: Regulator for the CPU voltage rail that the DFLL
350c59d267STuomas Tynkkynen  hardware will start controlling. The regulator will be queried for
360c59d267STuomas Tynkkynen  the I2C register, control values and supported voltages.
370c59d267STuomas Tynkkynen
380c59d267STuomas TynkkynenRequired properties for the control loop parameters:
390c59d267STuomas Tynkkynen- nvidia,sample-rate: Sample rate of the DFLL control loop.
400c59d267STuomas Tynkkynen- nvidia,droop-ctrl: See the register CL_DVFS_DROOP_CTRL in the TRM.
410c59d267STuomas Tynkkynen- nvidia,force-mode: See the field DFLL_PARAMS_FORCE_MODE in the TRM.
420c59d267STuomas Tynkkynen- nvidia,cf: Numeric value, see the field DFLL_PARAMS_CF_PARAM in the TRM.
430c59d267STuomas Tynkkynen- nvidia,ci: Numeric value, see the field DFLL_PARAMS_CI_PARAM in the TRM.
440c59d267STuomas Tynkkynen- nvidia,cg: Numeric value, see the field DFLL_PARAMS_CG_PARAM in the TRM.
450c59d267STuomas Tynkkynen
460c59d267STuomas TynkkynenOptional properties for the control loop parameters:
470c59d267STuomas Tynkkynen- nvidia,cg-scale: Boolean value, see the field DFLL_PARAMS_CG_SCALE in the TRM.
480c59d267STuomas Tynkkynen
4993caec00SPeter De SchrijverOptional properties for mode selection:
5093caec00SPeter De Schrijver- nvidia,pwm-to-pmic: Use PWM to control regulator rather then I2C.
5193caec00SPeter De Schrijver
520c59d267STuomas TynkkynenRequired properties for I2C mode:
530c59d267STuomas Tynkkynen- nvidia,i2c-fs-rate: I2C transfer rate, if using full speed mode.
540c59d267STuomas Tynkkynen
5593caec00SPeter De SchrijverRequired properties for PWM mode:
5693caec00SPeter De Schrijver- nvidia,pwm-period-nanoseconds: period of PWM square wave in nanoseconds.
5793caec00SPeter De Schrijver- nvidia,pwm-tristate-microvolts: Regulator voltage in micro volts when PWM
5893caec00SPeter De Schrijver  control is disabled and the PWM output is tristated. Note that this voltage is
5993caec00SPeter De Schrijver  configured in hardware, typically via a resistor divider.
6093caec00SPeter De Schrijver- nvidia,pwm-min-microvolts: Regulator voltage in micro volts when PWM control
6193caec00SPeter De Schrijver  is enabled and PWM output is low. Hence, this is the minimum output voltage
6293caec00SPeter De Schrijver  that the regulator supports when PWM control is enabled.
6393caec00SPeter De Schrijver- nvidia,pwm-voltage-step-microvolts: Voltage increase in micro volts
6493caec00SPeter De Schrijver  corresponding to a 1/33th increase in duty cycle. Eg the voltage for 2/33th
6593caec00SPeter De Schrijver  duty cycle would be: nvidia,pwm-min-microvolts +
6693caec00SPeter De Schrijver  nvidia,pwm-voltage-step-microvolts * 2.
6793caec00SPeter De Schrijver- pinctrl-0: I/O pad configuration when PWM control is enabled.
6893caec00SPeter De Schrijver- pinctrl-1: I/O pad configuration when PWM control is disabled.
6993caec00SPeter De Schrijver- pinctrl-names: must include the following entries:
7093caec00SPeter De Schrijver  - dvfs_pwm_enable: I/O pad configuration when PWM control is enabled.
7193caec00SPeter De Schrijver  - dvfs_pwm_disable: I/O pad configuration when PWM control is disabled.
7293caec00SPeter De Schrijver
7393caec00SPeter De SchrijverExample for I2C:
740c59d267STuomas Tynkkynen
75f43521e9SThierry Redingclock@70110000 {
760c59d267STuomas Tynkkynen        compatible = "nvidia,tegra124-dfll";
770c59d267STuomas Tynkkynen        reg = <0 0x70110000 0 0x100>, /* DFLL control */
780c59d267STuomas Tynkkynen              <0 0x70110000 0 0x100>, /* I2C output control */
790c59d267STuomas Tynkkynen              <0 0x70110100 0 0x100>, /* Integrated I2C controller */
800c59d267STuomas Tynkkynen              <0 0x70110200 0 0x100>; /* Look-up table RAM */
810c59d267STuomas Tynkkynen        interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
820c59d267STuomas Tynkkynen        clocks = <&tegra_car TEGRA124_CLK_DFLL_SOC>,
830c59d267STuomas Tynkkynen                 <&tegra_car TEGRA124_CLK_DFLL_REF>,
840c59d267STuomas Tynkkynen                 <&tegra_car TEGRA124_CLK_I2C5>;
850c59d267STuomas Tynkkynen        clock-names = "soc", "ref", "i2c";
860c59d267STuomas Tynkkynen        resets = <&tegra_car TEGRA124_RST_DFLL_DVCO>;
870c59d267STuomas Tynkkynen        reset-names = "dvco";
880c59d267STuomas Tynkkynen        #clock-cells = <0>;
890c59d267STuomas Tynkkynen        clock-output-names = "dfllCPU_out";
900c59d267STuomas Tynkkynen        vdd-cpu-supply = <&vdd_cpu>;
910c59d267STuomas Tynkkynen
920c59d267STuomas Tynkkynen        nvidia,sample-rate = <12500>;
930c59d267STuomas Tynkkynen        nvidia,droop-ctrl = <0x00000f00>;
940c59d267STuomas Tynkkynen        nvidia,force-mode = <1>;
950c59d267STuomas Tynkkynen        nvidia,cf = <10>;
960c59d267STuomas Tynkkynen        nvidia,ci = <0>;
970c59d267STuomas Tynkkynen        nvidia,cg = <2>;
980c59d267STuomas Tynkkynen
990c59d267STuomas Tynkkynen        nvidia,i2c-fs-rate = <400000>;
1000c59d267STuomas Tynkkynen};
10193caec00SPeter De Schrijver
10293caec00SPeter De SchrijverExample for PWM:
10393caec00SPeter De Schrijver
10493caec00SPeter De Schrijverclock@70110000 {
10593caec00SPeter De Schrijver	compatible = "nvidia,tegra124-dfll";
10693caec00SPeter De Schrijver	reg = <0 0x70110000 0 0x100>, /* DFLL control */
10793caec00SPeter De Schrijver	      <0 0x70110000 0 0x100>, /* I2C output control */
10893caec00SPeter De Schrijver	      <0 0x70110100 0 0x100>, /* Integrated I2C controller */
10993caec00SPeter De Schrijver	      <0 0x70110200 0 0x100>; /* Look-up table RAM */
11093caec00SPeter De Schrijver	interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
11193caec00SPeter De Schrijver	clocks = <&tegra_car TEGRA210_CLK_DFLL_SOC>,
11293caec00SPeter De Schrijver	         <&tegra_car TEGRA210_CLK_DFLL_REF>,
11393caec00SPeter De Schrijver		 <&tegra_car TEGRA124_CLK_I2C5>;;
11493caec00SPeter De Schrijver	clock-names = "soc", "ref", "i2c";
11593caec00SPeter De Schrijver	resets = <&tegra_car TEGRA124_RST_DFLL_DVCO>;
11693caec00SPeter De Schrijver	reset-names = "dvco";
11793caec00SPeter De Schrijver	#clock-cells = <0>;
11893caec00SPeter De Schrijver	clock-output-names = "dfllCPU_out";
11993caec00SPeter De Schrijver
12093caec00SPeter De Schrijver	nvidia,sample-rate = <25000>;
12193caec00SPeter De Schrijver	nvidia,droop-ctrl = <0x00000f00>;
12293caec00SPeter De Schrijver	nvidia,force-mode = <1>;
12393caec00SPeter De Schrijver	nvidia,cf = <6>;
12493caec00SPeter De Schrijver	nvidia,ci = <0>;
12593caec00SPeter De Schrijver	nvidia,cg = <2>;
12693caec00SPeter De Schrijver
12793caec00SPeter De Schrijver	nvidia,pwm-min-microvolts = <708000>; /* 708mV */
12893caec00SPeter De Schrijver	nvidia,pwm-period-nanoseconds = <2500>; /* 2.5us */
12993caec00SPeter De Schrijver	nvidia,pwm-to-pmic;
13093caec00SPeter De Schrijver	nvidia,pwm-tristate-microvolts = <1000000>;
13193caec00SPeter De Schrijver	nvidia,pwm-voltage-step-microvolts = <19200>; /* 19.2mV */
13293caec00SPeter De Schrijver
13393caec00SPeter De Schrijver	pinctrl-names = "dvfs_pwm_enable", "dvfs_pwm_disable";
13493caec00SPeter De Schrijver	pinctrl-0 = <&dvfs_pwm_active_state>;
13593caec00SPeter De Schrijver	pinctrl-1 = <&dvfs_pwm_inactive_state>;
13693caec00SPeter De Schrijver};
13793caec00SPeter De Schrijver
13893caec00SPeter De Schrijver/* pinmux nodes added for completeness. Binding doc can be found in:
139*de1835e3SThierry Reding * Documentation/devicetree/bindings/pinctrl/nvidia,tegra210-pinmux.yaml
14093caec00SPeter De Schrijver */
14193caec00SPeter De Schrijver
14293caec00SPeter De Schrijverpinmux: pinmux@700008d4 {
14393caec00SPeter De Schrijver	dvfs_pwm_active_state: dvfs_pwm_active {
14493caec00SPeter De Schrijver		dvfs_pwm_pbb1 {
14593caec00SPeter De Schrijver			nvidia,pins = "dvfs_pwm_pbb1";
14693caec00SPeter De Schrijver			nvidia,tristate = <TEGRA_PIN_DISABLE>;
14793caec00SPeter De Schrijver		};
14893caec00SPeter De Schrijver	};
14993caec00SPeter De Schrijver	dvfs_pwm_inactive_state: dvfs_pwm_inactive {
15093caec00SPeter De Schrijver		dvfs_pwm_pbb1 {
15193caec00SPeter De Schrijver			nvidia,pins = "dvfs_pwm_pbb1";
15293caec00SPeter De Schrijver			nvidia,tristate = <TEGRA_PIN_ENABLE>;
15393caec00SPeter De Schrijver		};
15493caec00SPeter De Schrijver	};
15593caec00SPeter De Schrijver};
156