Skip to contentSkip to conversation

ARM: tegra: basic support for Tegra124 SoC

PATCH New Joseph Lo 2 participants 8 messages Oct 8, 2013

Subsystems (7)
lore
Share & tools
lore

Joseph Lo

author
#0 lore raw

v2 cover ARM: tegra: basic support for Tegra124 SoC

Hi,

This series adds basic support for the new Tegra SoC, Tegra124. To bring up the system, it also needs an initrd as rootfs. Because most of the peripheral not be enabled yet in this series, it depends on the clock and pinctrl driver.

Here are the commands for U-Boot that I used for booting system to console prompt:
* preparing kernel & initrd image
mkimage -A arm -T kernel_noload -C none -a 0 -e 0 -d zImage kernel.img mkimage -A arm -C none -T ramdisk -a ${initrd_addr} -d rootfs.img.gz rootfs.img

* boot cmd for U-Boot
setenv bootargs console=ttyS0,115200 loglevel=8 init=/bin/sh ext2load mmc ${mmc_dev}:${boot_part} ${kernel_addr_r} kernel.img ext2load mmc ${mmc_dev}:${boot_part} ${ramdisk_addr_r} rootfs.img ext2load mmc ${mmc_dev}:${boot_part} ${fdt_addr_r} tegra124-venice2.dtb bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}

Verified on Venice2.

V2:
* squash the [v1 1/7] ~ [v2 3/7] into the 1st patch in v2
* add PMC compatible value for Tegra124
* fix the device node name with address
* fix PMC compatible value in DT

Joseph Lo (6):
ARM: tegra: add Tegra124 SoC support
ARM: tegra: add PMC compatible value for Tegar124
ARM: tegra: Add initial device tree for Tegra124
ARM: tegra: add Venice2 board support
HACK: arm: tegra: reuse the Tegra114 clock driver for Tegra124
ARM: tegra: enable Tegra124 support

 arch/arm/boot/dts/Makefile             |   3 +-
 arch/arm/boot/dts/tegra124-venice2.dts |  20 +++++
 arch/arm/boot/dts/tegra124.dtsi        | 140 +++++++++++++++++++++++++++++++++
 arch/arm/configs/tegra_defconfig       |   1 +
 arch/arm/mach-tegra/Kconfig            |   8 ++
 arch/arm/mach-tegra/fuse.h             |   1 +
 arch/arm/mach-tegra/platsmp.c          |   2 +
 arch/arm/mach-tegra/pmc.c              |   1 +
 arch/arm/mach-tegra/tegra.c            |   1 +
 drivers/clk/tegra/clk-tegra114.c       |   1 +
 10 files changed, 177 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/tegra124-venice2.dts
 create mode 100644 arch/arm/boot/dts/tegra124.dtsi
Signature · 1 line
1.8.4
author
#1 lore raw

PATCH v2 1/6 ARM: tegra: add Tegra124 SoC support

Add Tegra124 SoC support that base on CortexA15MP Core. And enable the SMP function that can re-use the same procedure with Tegra114.

---
V2:
* squash the [v1 1/7] ~ [v2 3/7] into the 1st patch in v2

---
 arch/arm/mach-tegra/Kconfig   | 8 ++++++++
 arch/arm/mach-tegra/fuse.h    | 1 +
 arch/arm/mach-tegra/platsmp.c | 2 ++
 arch/arm/mach-tegra/tegra.c   | 1 +
 4 files changed, 12 insertions(+)
arch/arm/mach-tegra/Kconfig +8 -0
index 67a76f2..92272e0 100644
@@ -61,6 +61,14 @@ config ARCH_TEGRA_114_SOC
 	  Support for NVIDIA Tegra T114 processor family, based on the
 	  ARM CortexA15MP CPU
 
+config ARCH_TEGRA_124_SOC
+	bool "Enable support for Tegra124 family"
+	select ARM_L1_CACHE_SHIFT_6
+	select HAVE_ARM_ARCH_TIMER
+	help
+	  Support for NVIDIA Tegra T124 processor family, based on the
+	  ARM CortexA15MP CPU
+
 config TEGRA_AHB
 	bool "Enable AHB driver for NVIDIA Tegra SoCs"
 	default y
arch/arm/mach-tegra/fuse.h +1 -0
index def7968..c01d047 100644
@@ -29,6 +29,7 @@
 #define TEGRA20		0x20
 #define TEGRA30		0x30
 #define TEGRA114	0x35
+#define TEGRA124	0x40
 
 #ifndef __ASSEMBLY__
 enum tegra_revision {
arch/arm/mach-tegra/platsmp.c +2 -0
index 2d02036..eb72ae7 100644
@@ -176,6 +176,8 @@ static int tegra_boot_secondary(unsigned int cpu,
 		return tegra30_boot_secondary(cpu, idle);
 	if (IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC) && tegra_chip_id == TEGRA114)
 		return tegra114_boot_secondary(cpu, idle);
+	if (IS_ENABLED(CONFIG_ARCH_TEGRA_124_SOC) && tegra_chip_id == TEGRA124)
+		return tegra114_boot_secondary(cpu, idle);
 
 	return -EINVAL;
 }
arch/arm/mach-tegra/tegra.c +1 -0
index 40b031c..80b801a 100644
@@ -181,6 +181,7 @@ static void __init tegra_dt_init_late(void)
 }
 
 static const char * const tegra_dt_board_compat[] = {
+	"nvidia,tegra124",
 	"nvidia,tegra114",
 	"nvidia,tegra30",
 	"nvidia,tegra20",
Signature · 1 line
1.8.4
#2 lore raw

PATCH v2 1/6 ARM: tegra: add Tegra124 SoC support

Quoted 2 lines · Joseph Lo

Add Tegra124 SoC support that base on CortexA15MP Core. And enable the SMP function that can re-use the same procedure with Tegra114.

I have applied patches 1, 2 to Tegra's for-3.13/soc branch, patches 3, 4 to Tegra's for-3.13/dt branch, not applied patch 5, and squashed patch 6 into Tegra's for-3.13/defconfig branch.

author
#3 lore raw

PATCH v2 2/6 ARM: tegra: add PMC compatible value for Tegar124

In reply to Joseph Lo

The PMC HW is not identical to the existing Tegra SoC. Hence add to it.

---
V2:
* new in v2

---
 arch/arm/mach-tegra/pmc.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-tegra/pmc.c +1 -0
index 93a4dbc..3744af9 100644
@@ -288,6 +288,7 @@ void tegra_pmc_suspend_init(void)
 #endif
 
 static const struct of_device_id matches[] __initconst = {
+	{ .compatible = "nvidia,tegra124-pmc" },
 	{ .compatible = "nvidia,tegra114-pmc" },
 	{ .compatible = "nvidia,tegra30-pmc" },
 	{ .compatible = "nvidia,tegra20-pmc" },
Signature · 1 line
1.8.4
author
#4 lore raw

PATCH v2 3/6 ARM: tegra: Add initial device tree for Tegra124

In reply to Joseph Lo

Initial support for Tegra 124 SoC. This is expected to be included in the board DTS files.

---
V2:
* fix device node name with register address
* fix PMC compitable value for Tegra124

---
 arch/arm/boot/dts/tegra124.dtsi | 132 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 132 insertions(+)
 create mode 100644 arch/arm/boot/dts/tegra124.dtsi
arch/arm/boot/dts/tegra124.dtsi new file +132 -0
new file mode 100644
index 0000000..905f148
@@ -0,0 +1,132 @@
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+#include "skeleton.dtsi"
+
+/ {
+	compatible = "nvidia,tegra124";
+	interrupt-parent = <&gic>;
+
+	gic: interrupt-controller at 50041000 {
+		compatible = "arm,cortex-a15-gic";
+		#interrupt-cells = <3>;
+		interrupt-controller;
+		reg = <0x50041000 0x1000>,
+		      <0x50042000 0x1000>,
+		      <0x50044000 0x2000>,
+		      <0x50046000 0x2000>;
+		interrupts = <GIC_PPI 9
+			(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
+	};
+
+	timer at 60005000 {
+		compatible = "nvidia,tegra124-timer", "nvidia,tegra20-timer";
+		reg = <0x60005000 0x400>;
+		interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
+	};
+
+	/*
+	 * There are two serial driver i.e. 8250 based simple serial
+	 * driver and APB DMA based serial driver for higher baudrate
+	 * and performace. To enable the 8250 based driver, the compatible
+	 * is "nvidia,tegra124-uart", "nvidia,tegra20-uart" and to enable
+	 * the APB DMA based serial driver, the comptible is
+	 * "nvidia,tegra124-hsuart", "nvidia,tegra30-hsuart".
+	 */
+	serial at 70006000 {
+		compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart";
+		reg = <0x70006000 0x40>;
+		reg-shift = <2>;
+		interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
+		status = "disabled";
+	};
+
+	serial at 70006040 {
+		compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart";
+		reg = <0x70006040 0x40>;
+		reg-shift = <2>;
+		interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
+		status = "disabled";
+	};
+
+	serial at 70006200 {
+		compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart";
+		reg = <0x70006200 0x40>;
+		reg-shift = <2>;
+		interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
+		status = "disabled";
+	};
+
+	serial at 70006300 {
+		compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart";
+		reg = <0x70006300 0x40>;
+		reg-shift = <2>;
+		interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>;
+		status = "disabled";
+	};
+
+	serial at 70006400 {
+		compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart";
+		reg = <0x70006400 0x40>;
+		reg-shift = <2>;
+		interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>;
+		status = "disabled";
+	};
+
+	rtc at 7000e000 {
+		compatible = "nvidia,tegra124-rtc", "nvidia,tegra20-rtc";
+		reg = <0x7000e000 0x100>;
+		interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
+		status = "disabled";
+	};
+
+	pmc at 7000e400 {
+		compatible = "nvidia,tegra124-pmc";
+		reg = <0x7000e400 0x400>;
+	};
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu at 0 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a15";
+			reg = <0>;
+		};
+
+		cpu at 1 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a15";
+			reg = <1>;
+		};
+
+		cpu at 2 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a15";
+			reg = <2>;
+		};
+
+		cpu at 3 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a15";
+			reg = <3>;
+		};
+	};
+
+	timer {
+		compatible = "arm,armv7-timer";
+		interrupts = <GIC_PPI 13
+				(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 14
+				(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 11
+				(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 10
+				(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
+	};
+};
Signature · 1 line
1.8.4
author
#5 lore raw

PATCH v2 4/6 ARM: tegra: add Venice2 board support

In reply to Joseph Lo

Add support for the Tegra124 based Venice2 reference board.

---
V2:
* fix the device node name with register address
* remove an extra blank line

---
 arch/arm/boot/dts/Makefile             |  3 ++-
 arch/arm/boot/dts/tegra124-venice2.dts | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/tegra124-venice2.dts
arch/arm/boot/dts/Makefile +2 -1
index cf75889..1c3b871 100644
@@ -252,7 +252,8 @@ dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \
 	tegra30-beaver.dtb \
 	tegra30-cardhu-a02.dtb \
 	tegra30-cardhu-a04.dtb \
-	tegra114-dalmore.dtb
+	tegra114-dalmore.dtb \
+	tegra124-venice2.dtb
 dtb-$(CONFIG_ARCH_VERSATILE) += versatile-ab.dtb \
 	versatile-pb.dtb
 dtb-$(CONFIG_ARCH_U300) += ste-u300.dtb
arch/arm/boot/dts/tegra124-venice2.dts new file +20 -0
new file mode 100644
index 0000000..2bfc7ab
@@ -0,0 +1,20 @@
+/dts-v1/;
+
+#include "tegra124.dtsi"
+
+/ {
+	model = "NVIDIA Tegra124 Venice2";
+	compatible = "nvidia,venice2", "nvidia,tegra124";
+
+	memory {
+		reg = <0x80000000 0x80000000>;
+	};
+
+	serial at 70006000 {
+		status = "okay";
+	};
+
+	pmc at 7000e400 {
+		nvidia,invert-interrupt;
+	};
+};
Signature · 1 line
1.8.4
author
#6 lore raw

PATCH v2 5/6 HACK: arm: tegra: reuse the Tegra114 clock driver for Tegra124

In reply to Joseph Lo

This patch is only a hack for Tegra124 bring up testing. Please don't merge this. The same function can be replaced by Tegra124 clock driver.

* re-use UART-A in DT
* add a temp PMC compatible value

---
V2:
* add a temp PMC compatible value fot Tegra124

---
 arch/arm/boot/dts/tegra124.dtsi  | 8 ++++++++
 drivers/clk/tegra/clk-tegra114.c | 1 +
 2 files changed, 9 insertions(+)
arch/arm/boot/dts/tegra124.dtsi +8 -0
index 905f148..7734d8d 100644
@@ -1,3 +1,4 @@
+#include <dt-bindings/clock/tegra114-car.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 
 #include "skeleton.dtsi"
@@ -29,6 +30,12 @@
 			     <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
 	};
 
+	tegra_car: clock {
+		compatible = "nvidia,tegra114-car";
+		reg = <0x60006000 0x1000>;
+		#clock-cells = <1>;
+	};
+
 	/*
 	 * There are two serial driver i.e. 8250 based simple serial
 	 * driver and APB DMA based serial driver for higher baudrate
@@ -43,6 +50,7 @@
 		reg-shift = <2>;
 		interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
 		status = "disabled";
+		clocks = <&tegra_car TEGRA114_CLK_UARTA>;
 	};
 
 	serial at 70006040 {
drivers/clk/tegra/clk-tegra114.c +1 -0
index 9467da7..9a847f3 100644
@@ -2198,6 +2198,7 @@ static struct tegra_cpu_car_ops tegra114_cpu_car_ops = {
 };
 
 static const struct of_device_id pmc_match[] __initconst = {
+	{ .compatible = "nvidia,tegra124-pmc" },
 	{ .compatible = "nvidia,tegra114-pmc" },
 	{},
 };
Signature · 1 line
1.8.4
author
#7 lore raw

PATCH v2 6/6 ARM: tegra: enable Tegra124 support

In reply to Joseph Lo

Add Tegra124 support in tegra_defconfig file.

---
V2:
* no change

---
 arch/arm/configs/tegra_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/tegra_defconfig +1 -0
index ec4f6e7..4934295 100644
@@ -27,6 +27,7 @@ CONFIG_ARCH_TEGRA=y
 CONFIG_ARCH_TEGRA_2x_SOC=y
 CONFIG_ARCH_TEGRA_3x_SOC=y
 CONFIG_ARCH_TEGRA_114_SOC=y
+CONFIG_ARCH_TEGRA_124_SOC=y
 CONFIG_TEGRA_EMC_SCALING_ENABLE=y
 CONFIG_PCI=y
 CONFIG_PCI_MSI=y
Signature · 1 line
1.8.4