Skip to content

Commit f4be3c6

Browse files
committed
Merge tag 'tegra-for-4.3-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/dt
ARM: tegra: Devicetree changes for v4.3-rc1 Enables CPU frequency scaling on Jetson TK1 and enables the GK20A GPU on Venice2 and Jetson TK1. This also enables support for the PMU hardware found on Tegra124, which among other things, can be used for performance measurements. * tag 'tegra-for-4.3-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: ARM: tegra: Add gpio-ranges property ARM: tegra: Fix AHB base address on Tegra20, Tegra30 and Tegra114 ARM: tegra: Add Tegra124 PMU support ARM: tegra: jetson-tk1: Add GK20A GPU DT node ARM: tegra: venice2: Add GK20A GPU DT node ARM: tegra: Add IOMMU node to GK20A ARM: tegra: Add CPU regulator to the Jetson TK1 device tree ARM: tegra: Add entries for cpufreq on Tegra124 ARM: tegra: Enable the DFLL on the Jetson TK1 ARM: tegra: Add the DFLL to Tegra124 device tree pinctrl: tegra: Only set the gpio range if needed clk: tegra: Add the DFLL as a possible parent of the cclk_g clock clk: tegra: Save/restore CCLKG_BURST_POLICY on suspend clk: tegra: Add Tegra124 DFLL clocksource platform driver clk: tegra: Add DFLL DVCO reset control for Tegra124 clk: tegra: Introduce ability for SoC-specific reset control callbacks clk: tegra: Add functions for parsing CVB tables clk: tegra: Add closed loop support for the DFLL clk: tegra: Add library for the DFLL clock source (open-loop mode) clk: tegra: Add binding for the Tegra124 DFLL clocksource Signed-off-by: Olof Johansson <[email protected]>
2 parents 99650c2 + 17cdddf commit f4be3c6

File tree

20 files changed

+2505
-19
lines changed

20 files changed

+2505
-19
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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+
Currently only the I2C mode is supported by these bindings.
12+
13+
Required properties:
14+
- compatible : should be "nvidia,tegra124-dfll"
15+
- reg : Defines the following set of registers, in the order listed:
16+
- registers for the DFLL control logic.
17+
- registers for the I2C output logic.
18+
- registers for the integrated I2C master controller.
19+
- look-up table RAM for voltage register values.
20+
- interrupts: Should contain the DFLL block interrupt.
21+
- clocks: Must contain an entry for each entry in clock-names.
22+
See clock-bindings.txt for details.
23+
- clock-names: Must include the following entries:
24+
- soc: Clock source for the DFLL control logic.
25+
- ref: The closed loop reference clock
26+
- i2c: Clock source for the integrated I2C master.
27+
- resets: Must contain an entry for each entry in reset-names.
28+
See ../reset/reset.txt for details.
29+
- reset-names: Must include the following entries:
30+
- dvco: Reset control for the DFLL DVCO.
31+
- #clock-cells: Must be 0.
32+
- clock-output-names: Name of the clock output.
33+
- vdd-cpu-supply: Regulator for the CPU voltage rail that the DFLL
34+
hardware will start controlling. The regulator will be queried for
35+
the I2C register, control values and supported voltages.
36+
37+
Required properties for the control loop parameters:
38+
- nvidia,sample-rate: Sample rate of the DFLL control loop.
39+
- nvidia,droop-ctrl: See the register CL_DVFS_DROOP_CTRL in the TRM.
40+
- nvidia,force-mode: See the field DFLL_PARAMS_FORCE_MODE in the TRM.
41+
- nvidia,cf: Numeric value, see the field DFLL_PARAMS_CF_PARAM in the TRM.
42+
- nvidia,ci: Numeric value, see the field DFLL_PARAMS_CI_PARAM in the TRM.
43+
- nvidia,cg: Numeric value, see the field DFLL_PARAMS_CG_PARAM in the TRM.
44+
45+
Optional properties for the control loop parameters:
46+
- nvidia,cg-scale: Boolean value, see the field DFLL_PARAMS_CG_SCALE in the TRM.
47+
48+
Required properties for I2C mode:
49+
- nvidia,i2c-fs-rate: I2C transfer rate, if using full speed mode.
50+
51+
Example:
52+
53+
clock@0,70110000 {
54+
compatible = "nvidia,tegra124-dfll";
55+
reg = <0 0x70110000 0 0x100>, /* DFLL control */
56+
<0 0x70110000 0 0x100>, /* I2C output control */
57+
<0 0x70110100 0 0x100>, /* Integrated I2C controller */
58+
<0 0x70110200 0 0x100>; /* Look-up table RAM */
59+
interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
60+
clocks = <&tegra_car TEGRA124_CLK_DFLL_SOC>,
61+
<&tegra_car TEGRA124_CLK_DFLL_REF>,
62+
<&tegra_car TEGRA124_CLK_I2C5>;
63+
clock-names = "soc", "ref", "i2c";
64+
resets = <&tegra_car TEGRA124_RST_DFLL_DVCO>;
65+
reset-names = "dvco";
66+
#clock-cells = <0>;
67+
clock-output-names = "dfllCPU_out";
68+
vdd-cpu-supply = <&vdd_cpu>;
69+
status = "okay";
70+
71+
nvidia,sample-rate = <12500>;
72+
nvidia,droop-ctrl = <0x00000f00>;
73+
nvidia,force-mode = <1>;
74+
nvidia,cf = <10>;
75+
nvidia,ci = <0>;
76+
nvidia,cg = <2>;
77+
78+
nvidia,i2c-fs-rate = <400000>;
79+
};

arch/arm/boot/dts/tegra114.dtsi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,9 @@
214214
#dma-cells = <1>;
215215
};
216216

217-
ahb: ahb@6000c004 {
217+
ahb: ahb@6000c000 {
218218
compatible = "nvidia,tegra114-ahb", "nvidia,tegra30-ahb";
219-
reg = <0x6000c004 0x14c>;
219+
reg = <0x6000c000 0x150>;
220220
};
221221

222222
gpio: gpio@6000d000 {
@@ -234,6 +234,7 @@
234234
gpio-controller;
235235
#interrupt-cells = <2>;
236236
interrupt-controller;
237+
gpio-ranges = <&pinmux 0 0 246>;
237238
};
238239

239240
apbmisc@70000800 {

arch/arm/boot/dts/tegra124-jetson-tk1.dts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@
5353
};
5454
};
5555

56+
gpu@0,57000000 {
57+
/*
58+
* Node left disabled on purpose - the bootloader will enable
59+
* it after having set the VPR up
60+
*/
61+
vdd-supply = <&vdd_gpu>;
62+
};
63+
5664
pinmux: pinmux@0,70000868 {
5765
pinctrl-names = "boot";
5866
pinctrl-0 = <&state_boot>;
@@ -1462,7 +1470,7 @@
14621470
vin-ldo9-10-supply = <&vdd_5v0_sys>;
14631471
vin-ldo11-supply = <&vdd_3v3_run>;
14641472

1465-
sd0 {
1473+
vdd_cpu: sd0 {
14661474
regulator-name = "+VDD_CPU_AP";
14671475
regulator-min-microvolt = <700000>;
14681476
regulator-max-microvolt = <1400000>;
@@ -1514,7 +1522,7 @@
15141522
regulator-always-on;
15151523
};
15161524

1517-
sd6 {
1525+
vdd_gpu: sd6 {
15181526
regulator-name = "+VDD_GPU_AP";
15191527
regulator-min-microvolt = <650000>;
15201528
regulator-max-microvolt = <1200000>;
@@ -1694,6 +1702,13 @@
16941702
non-removable;
16951703
};
16961704

1705+
/* CPU DFLL clock */
1706+
clock@0,70110000 {
1707+
status = "okay";
1708+
vdd-cpu-supply = <&vdd_cpu>;
1709+
nvidia,i2c-fs-rate = <400000>;
1710+
};
1711+
16971712
ahub@0,70300000 {
16981713
i2s@0,70301100 {
16991714
status = "okay";
@@ -1732,6 +1747,12 @@
17321747
};
17331748
};
17341749

1750+
cpus {
1751+
cpu@0 {
1752+
vdd-cpu-supply = <&vdd_cpu>;
1753+
};
1754+
};
1755+
17351756
gpio-keys {
17361757
compatible = "gpio-keys";
17371758

arch/arm/boot/dts/tegra124-venice2.dts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@
4343
};
4444
};
4545

46+
gpu@0,57000000 {
47+
/*
48+
* Node left disabled on purpose - the bootloader will enable
49+
* it after having set the VPR up
50+
*/
51+
vdd-supply = <&vdd_gpu>;
52+
};
53+
4654
pinmux: pinmux@0,70000868 {
4755
pinctrl-names = "boot";
4856
pinctrl-0 = <&pinmux_boot>;
@@ -735,7 +743,7 @@
735743
regulator-always-on;
736744
};
737745

738-
sd6 {
746+
vdd_gpu: sd6 {
739747
regulator-name = "+VDD_GPU_AP";
740748
regulator-min-microvolt = <650000>;
741749
regulator-max-microvolt = <1200000>;

arch/arm/boot/dts/tegra124.dtsi

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <dt-bindings/pinctrl/pinctrl-tegra.h>
55
#include <dt-bindings/pinctrl/pinctrl-tegra-xusb.h>
66
#include <dt-bindings/interrupt-controller/arm-gic.h>
7+
#include <dt-bindings/reset/tegra124-car.h>
78
#include <dt-bindings/thermal/tegra124-soctherm.h>
89

910
#include "skeleton.dtsi"
@@ -188,6 +189,9 @@
188189
clock-names = "gpu", "pwr";
189190
resets = <&tegra_car 184>;
190191
reset-names = "gpu";
192+
193+
iommus = <&mc TEGRA_SWGROUP_GPU>;
194+
191195
status = "disabled";
192196
};
193197

@@ -254,6 +258,7 @@
254258
gpio-controller;
255259
#interrupt-cells = <2>;
256260
interrupt-controller;
261+
gpio-ranges = <&pinmux 0 0 251>;
257262
};
258263

259264
apbdma: dma@0,60020000 {
@@ -702,6 +707,30 @@
702707
#thermal-sensor-cells = <1>;
703708
};
704709

710+
dfll: clock@0,70110000 {
711+
compatible = "nvidia,tegra124-dfll";
712+
reg = <0 0x70110000 0 0x100>, /* DFLL control */
713+
<0 0x70110000 0 0x100>, /* I2C output control */
714+
<0 0x70110100 0 0x100>, /* Integrated I2C controller */
715+
<0 0x70110200 0 0x100>; /* Look-up table RAM */
716+
interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
717+
clocks = <&tegra_car TEGRA124_CLK_DFLL_SOC>,
718+
<&tegra_car TEGRA124_CLK_DFLL_REF>,
719+
<&tegra_car TEGRA124_CLK_I2C5>;
720+
clock-names = "soc", "ref", "i2c";
721+
resets = <&tegra_car TEGRA124_RST_DFLL_DVCO>;
722+
reset-names = "dvco";
723+
#clock-cells = <0>;
724+
clock-output-names = "dfllCPU_out";
725+
nvidia,sample-rate = <12500>;
726+
nvidia,droop-ctrl = <0x00000f00>;
727+
nvidia,force-mode = <1>;
728+
nvidia,cf = <10>;
729+
nvidia,ci = <0>;
730+
nvidia,cg = <2>;
731+
status = "disabled";
732+
};
733+
705734
ahub@0,70300000 {
706735
compatible = "nvidia,tegra124-ahub";
707736
reg = <0x0 0x70300000 0x0 0x200>,
@@ -922,6 +951,15 @@
922951
device_type = "cpu";
923952
compatible = "arm,cortex-a15";
924953
reg = <0>;
954+
955+
clocks = <&tegra_car TEGRA124_CLK_CCLK_G>,
956+
<&tegra_car TEGRA124_CLK_CCLK_LP>,
957+
<&tegra_car TEGRA124_CLK_PLL_X>,
958+
<&tegra_car TEGRA124_CLK_PLL_P>,
959+
<&dfll>;
960+
clock-names = "cpu_g", "cpu_lp", "pll_x", "pll_p", "dfll";
961+
/* FIXME: what's the actual transition time? */
962+
clock-latency = <300000>;
925963
};
926964

927965
cpu@1 {
@@ -943,6 +981,18 @@
943981
};
944982
};
945983

984+
pmu {
985+
compatible = "arm,cortex-a15-pmu";
986+
interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>,
987+
<GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>,
988+
<GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH>,
989+
<GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
990+
interrupt-affinity = <&{/cpus/cpu@0}>,
991+
<&{/cpus/cpu@1}>,
992+
<&{/cpus/cpu@2}>,
993+
<&{/cpus/cpu@3}>;
994+
};
995+
946996
thermal-zones {
947997
cpu {
948998
polling-delay-passive = <1000>;

arch/arm/boot/dts/tegra20.dtsi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,9 @@
225225
#dma-cells = <1>;
226226
};
227227

228-
ahb@6000c004 {
228+
ahb@6000c000 {
229229
compatible = "nvidia,tegra20-ahb";
230-
reg = <0x6000c004 0x10c>; /* AHB Arbitration + Gizmo Controller */
230+
reg = <0x6000c000 0x110>; /* AHB Arbitration + Gizmo Controller */
231231
};
232232

233233
gpio: gpio@6000d000 {
@@ -244,6 +244,7 @@
244244
gpio-controller;
245245
#interrupt-cells = <2>;
246246
interrupt-controller;
247+
gpio-ranges = <&pinmux 0 0 224>;
247248
};
248249

249250
apbmisc@70000800 {

arch/arm/boot/dts/tegra30.dtsi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,9 @@
329329
#dma-cells = <1>;
330330
};
331331

332-
ahb: ahb@6000c004 {
332+
ahb: ahb@6000c000 {
333333
compatible = "nvidia,tegra30-ahb";
334-
reg = <0x6000c004 0x14c>; /* AHB Arbitration + Gizmo Controller */
334+
reg = <0x6000c000 0x150>; /* AHB Arbitration + Gizmo Controller */
335335
};
336336

337337
gpio: gpio@6000d000 {
@@ -349,6 +349,7 @@
349349
gpio-controller;
350350
#interrupt-cells = <2>;
351351
interrupt-controller;
352+
gpio-ranges = <&pinmux 0 0 248>;
352353
};
353354

354355
apbmisc@70000800 {

arch/arm/mach-tegra/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ menuconfig ARCH_TEGRA
88
select HAVE_ARM_SCU if SMP
99
select HAVE_ARM_TWD if SMP
1010
select PINCTRL
11+
select PM_OPP
1112
select ARCH_HAS_RESET_CONTROLLER
1213
select RESET_CONTROLLER
1314
select SOC_BUS

drivers/clk/tegra/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
obj-y += clk.o
22
obj-y += clk-audio-sync.o
3+
obj-y += clk-dfll.o
34
obj-y += clk-divider.o
45
obj-y += clk-periph.o
56
obj-y += clk-periph-gate.o
@@ -16,4 +17,6 @@ obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += clk-tegra20.o
1617
obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += clk-tegra30.o
1718
obj-$(CONFIG_ARCH_TEGRA_114_SOC) += clk-tegra114.o
1819
obj-$(CONFIG_ARCH_TEGRA_124_SOC) += clk-tegra124.o
20+
obj-$(CONFIG_ARCH_TEGRA_124_SOC) += clk-tegra124-dfll-fcpu.o
1921
obj-$(CONFIG_ARCH_TEGRA_132_SOC) += clk-tegra124.o
22+
obj-y += cvb.o

0 commit comments

Comments
 (0)