ARM: Initial support for Tegra 114 SoC
Subsystems (5)
v3 cover ARM: Initial support for Tegra 114 SoC
Hi,
This patchset adds initial support for NVIDIA's new Tegra 114 SoC (T114) based on the ARM Cortex-A15 MP. It has the minimal support to allow the kernel to boot up into shell console. This can be used as a basis for adding other device drivers for this SoC. Currently there are 2 evaluation boards available, "Dalmore" and "Pluto".
For those who want to try:
$ make ARCH=arm tegra_defconfig
$ scripts/config -e ARCH_TEGRA_114_SOC -d DRM -d SUSPEND \
-d PM_RUNTIME -d CPU_FREQ -d CPU_IDLE -d HOTPLUG_CPU
$ make ARCH=arm menuconfig # if needed to configure more
$ make ARCH=arm all -j9You may also want to enable CONFIG_ARM_APPENDED_DTB and CONFIG_ARM_ATAG_DTB_COMPAT if the bootloader doesn't support DT yet.
Verified that this single image booted up with "Dalmore(T114)", "Pluto(T114)" and "Cardhu(T30)". For "Cardhu(T30)" with this single image, SPI driver doesn't seem to afford the above configuration , it hangs at boot-up. With SPI disabled, it's ok.
v3:
Rebased against next-20130115.
Dropped TSC/arch timer patch.
Use /cpus entry in DT to detect cpu core #.
v2:
Rebased against the latest Stephen Warren's linux-next_common Add /cpus entry in DT
Add comment to initialize TSC only in secure mode.
Hiroshi Doyu (9):
ARM: tegra: fuse: Add chipid TEGRA114 0x35
HACK: ARM: tegra: Use CLK_IGNORE_UNUSED for Tegra 114 SoC
ARM: tegra: Use DT /cpu node to detect number of CPU core
ARM: Add API to detect SCU base address from CP15
ARM: tegra: Skip scu_enable(scu_base) if not Cortex A9
ARM: dt: tegra114: Add new SoC base, Tegra 114 SoC
ARM: dt: tegra114: Add new board, Dalmore
ARM: dt: tegra114: Add new board, Pluto
ARM: tegra: Add initial support for Tegra 114 SoC.
arch/arm/boot/dts/Makefile | 4 +- arch/arm/boot/dts/tegra114-dalmore.dts | 21 ++++++ arch/arm/boot/dts/tegra114-pluto.dts | 21 ++++++ arch/arm/boot/dts/tegra114.dtsi | 116 +++++++++++++++++++++++++++++ arch/arm/include/asm/smp_scu.h | 17 +++++ arch/arm/mach-tegra/Kconfig | 10 +++ arch/arm/mach-tegra/Makefile | 1 + arch/arm/mach-tegra/board-dt-tegra114.c | 48 ++++++++++++ arch/arm/mach-tegra/common.c | 1 + arch/arm/mach-tegra/fuse.h | 1 + arch/arm/mach-tegra/platsmp.c | 22 ++---- arch/arm/mach-tegra/tegra30_clocks_data.c | 2 + 12 files changed, 246 insertions(+), 18 deletions(-) create mode 100644 arch/arm/boot/dts/tegra114-dalmore.dts create mode 100644 arch/arm/boot/dts/tegra114-pluto.dts create mode 100644 arch/arm/boot/dts/tegra114.dtsi create mode 100644 arch/arm/mach-tegra/board-dt-tegra114.c
Signature · 1 line
1.7.9.5
PATCH v3 1/9 ARM: tegra: fuse: Add chipid TEGRA114 0x35
Add tegra_chip_id TEGRA114 0x35
--- arch/arm/mach-tegra/fuse.h | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-tegra/fuse.h +1 -0
@@ -37,6 +37,7 @@ enum tegra_revision {#define TEGRA20 0x20#define TEGRA30 0x30 +#define TEGRA114 0x35extern int tegra_sku_id;extern int tegra_cpu_process_id;
Signature · 1 line
1.7.9.5
PATCH v3 1/9 ARM: tegra: fuse: Add chipid TEGRA114 0x35
Hiroshi Doyu <[email protected]> wrote @ Tue, 15 Jan 2013 09:13:10 +0100:
Quoted 6 lines
Add
tegra_chip_idTEGRA1140x35Signed-off-by Hiroshi Doyu <[email protected]>--- arch/arm/mach-tegra/fuse.h | 1 + 1 file changed, 1 insertion(+)
Please ignore this series. The later version has been already queued for v3.9.
PATCH v3 2/9 HACK: ARM: tegra: Use CLK_IGNORE_UNUSED for Tegra 114 SoC
In reply to Hiroshi DoyuUse CLK_IGNORE_UNUSED for the Tegra 114 SoC to ensure clk_disable_unused() is not called. Otherwise the system will die, because the usecount of the clocks is incorrect. This patch will be reverted once the Tegra 114 clocks are implemented.
---
NOTE: Will be updated once the latest ccf is merged.
--- arch/arm/mach-tegra/tegra30_clocks_data.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/mach-tegra/tegra30_clocks_data.c +2 -0
@@ -1384,6 +1384,8 @@ static void tegra30_init_one_clock(struct clk *c)if (!clk->lookup.dev_id && !clk->lookup.con_id) clk->lookup.con_id = c->name; clk->lookup.clk = c; +if (tegra_chip_id ==TEGRA114 )/* FIXME: Implement T114 clocks */ + c->flags |=CLK_IGNORE_UNUSED ;clkdev_add (&clk->lookup);tegra_clk_add (c); }
Signature · 1 line
1.7.9.5
PATCH v3 3/9 ARM: tegra: Use DT /cpu node to detect number of CPU core
In reply to Hiroshi DoyuSCU based detection only works with Cortex-A9 MP and it doesn't support ones with multiple clusters. The only way to detect number of CPU core correctly is with DT /cpu node.
Tegra SoCs decided to use DT detection as the only way and to not use SCU based detection at all. Even if DT /cpu node based detection fails, it continues with a single core
---
Based on the discussion:
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-January/140608.html
--- arch/arm/mach-tegra/platsmp.c | 15 --------------- 1 file changed, 15 deletions(-)
arch/arm/mach-tegra/platsmp.c +0 -15
@@ -177,23 +177,8 @@ done:return status; } -/* -* Initialise the CPU possible map early - this describes the CPUs -* which may be present or become present in the system. -*/ static void __init tegra_smp_init_cpus (void ) { -unsigned int i, ncores =scu_get_core_count (scu_base); - -if (ncores > nr_cpu_ids) { -pr_warn ("SMP: %u cores greater than maximum (%u), clipping\n" , - ncores, nr_cpu_ids); - ncores = nr_cpu_ids; - } - -for (i =0 ; i < ncores; i++) -set_cpu_possible (i, true); -set_smp_cross_call (gic_raise_softirq); }
Signature · 1 line
1.7.9.5
PATCH v3 3/9 ARM: tegra: Use DT /cpu node to detect number of CPU core
Quoted 7 lines · Hiroshi Doyu
SCU based detection only works with Cortex-A9 MP and it doesn't support ones with multiple clusters. The only way to detect number of CPU core correctly is with DT /cpu node.
Tegra SoCs decided to use DT detection as the only way and to not use SCU based detection at all. Even if DT /cpu node based detection fails, it continues with a single core
Please add missing punctuation, reword the commit log to make it clearer.
Quoted 29 lines
Signed-off-by Hiroshi Doyu <[email protected]>---
Based on the discussion:
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-January/140608.htmlSigned-off-by Hiroshi Doyu <[email protected]>--- arch/arm/mach-tegra/platsmp.c | 15 --------------- 1 file changed, 15 deletions(-)arch/arm/mach-tegra/platsmp.c +0
-8@@ -177,23 +177,8 @@ done:return status; } -/* -* Initialise the CPU possible map early - this describes the CPUs -* which may be present or become present in the system. -*/ static void __init tegra_smp_init_cpus (void ) { -unsigned int i, ncores =scu_get_core_count (scu_base); - -if (ncores > nr_cpu_ids) { - pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",
arch/arm/mach-tegra/platsmp.c done: · line 184
Quoted 10 lines
arch/arm/mach-tegra/platsmp.c +0
-7- ncores, nr_cpu_ids); - ncores = nr_cpu_ids; - } - -for (i =0 ; i < ncores; i++) -set_cpu_possible (i, true); -set_smp_cross_call (gic_raise_softirq); }
As discussed,
PATCH v3 4/9 ARM: Add API to detect SCU base address from CP15
In reply to Hiroshi DoyuAdd API to detect SCU base address from CP15.
--- arch/arm/include/asm/smp_scu.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
arch/arm/include/asm/smp_scu.h +17 -0
@@ -6,6 +6,23 @@#define SCU_PM_POWEROFF 3#ifndef __ASSEMBLER__ + +#include <asm/cputype.h> + +static inline phys_addr_t scu_get_base (void ) +{ +phys_addr_t pa; +unsigned long part_number =read_cpuid_part_number (); + +switch (part_number) { +case ARM_CPU_PART_CORTEX_A9 : +/* Get SCU physical base */ + asm("mrc p15, 4, %0, c15, c0, 0" :"=r" (pa)); +return pa; +default : +return 0 ; + } +}unsigned int scu_get_core_count (void __iomem *);void scu_enable (void __iomem *);int scu_power_mode (void __iomem *,unsigned int );
Signature · 1 line
1.7.9.5
PATCH RESEND v3 4/9 ARM: Add API to detect SCU base address from CP15
In reply to Hiroshi DoyuAdd API to detect SCU base address from CP15.
---
NOTE:
This wasn't delivered to linux-arm-kernel at lists.infradead.org, resending....
For usage: http://patchwork.ozlabs.org/patch/212013/
--- arch/arm/include/asm/smp_scu.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
arch/arm/include/asm/smp_scu.h +17 -0
@@ -6,6 +6,23 @@#define SCU_PM_POWEROFF 3#ifndef __ASSEMBLER__ + +#include <asm/cputype.h> + +static inline phys_addr_t scu_get_base (void ) +{ +phys_addr_t pa; +unsigned long part_number =read_cpuid_part_number (); + +switch (part_number) { +case ARM_CPU_PART_CORTEX_A9 : +/* Get SCU physical base */ + asm("mrc p15, 4, %0, c15, c0, 0" :"=r" (pa)); +return pa; +default : +return 0 ; + } +}unsigned int scu_get_core_count (void __iomem *);void scu_enable (void __iomem *);int scu_power_mode (void __iomem *,unsigned int );
Signature · 1 line
1.7.9.5
PATCH v3 5/9 ARM: tegra: Skip scu_enable(scu_base) if not Cortex A9
In reply to Hiroshi DoyuSkip scu_enable(scu_base) if CPU is not Cortex A9.
--- arch/arm/mach-tegra/platsmp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
arch/arm/mach-tegra/platsmp.c +5 -2
@@ -38,7 +38,6 @@extern void tegra_secondary_startup (void );static cpumask_t tegra_cpu_init_mask; -static void __iomem *scu_base =IO_ADDRESS (TEGRA_ARM_PERIF_BASE );#define EVP_CPU_RESET_VECTOR \ (IO_ADDRESS(TEGRA_EXCEPTION_VECTORS_BASE) + 0x100)
@@ -184,10 +183,14 @@ static void __init tegra_smp_init_cpus(void)static void __init tegra_smp_prepare_cpus (unsigned int max_cpus) { +phys_addr_t base; +/* Always mark the boot CPU (CPU0) as initialized. */ cpumask_set_cpu (0 , &tegra_cpu_init_mask); -scu_enable (scu_base); + base =scu_get_base (); +if (base) +scu_enable (IO_ADDRESS (base)); }struct smp_operations tegra_smp_ops__initdata = {
Signature · 1 line
1.7.9.5
PATCH v3 6/9 ARM: dt: tegra114: Add new SoC base, Tegra 114 SoC
In reply to Hiroshi DoyuInitial support for Tegra 114 SoC. This is expected to be included in the board DTS files, Tegra 114 SoC based evaluation board family.
--- arch/arm/boot/dts/tegra114.dtsi | 116 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 arch/arm/boot/dts/tegra114.dtsi
arch/arm/boot/dts/tegra114.dtsi new file +116 -0
@@ -0,0 +1,116 @@ +/include/ "skeleton.dtsi" + +/ { + compatible = "nvidia,tegra114"; + interrupt-parent = <&gic>; + + gic: interrupt-controller { + compatible = "arm,cortex-a15-gic"; + #interrupt-cells = <3>; + interrupt-controller; + reg = <0x50041000 0x1000>, + <0x50042000 0x1000>, + <0x50044000 0x2000>, + <0x50046000 0x2000>; + interrupts = <1 9 0xf04>; + }; + + timer@60005000 { + compatible = "nvidia,tegra114-timer", "nvidia,tegra20-timer"; + reg = <0x60005000 0x400>; + interrupts = <0 0 0x04 + 0 1 0x04 + 0 41 0x04 + 0 42 0x04 + 0 121 0x04 + 0 122 0x04>; + }; + + serial@70006000 { + compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart"; + reg = <0x70006000 0x40>; + reg-shift = <2>; + interrupts = <0 36 0x04>; + status = "disabled"; + }; + + serial@70006040 { + compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart"; + reg = <0x70006040 0x40>; + reg-shift = <2>; + interrupts = <0 37 0x04>; + status = "disabled"; + }; + + serial@70006200 { + compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart"; + reg = <0x70006200 0x100>; + reg-shift = <2>; + interrupts = <0 46 0x04>; + status = "disabled"; + }; + + serial@70006300 { + compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart"; + reg = <0x70006300 0x100>; + reg-shift = <2>; + interrupts = <0 90 0x04>; + status = "disabled"; + }; + + serial@70006400 { + compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart"; + reg = <0x70006400 0x100>; + reg-shift = <2>; + interrupts = <0 91 0x04>; + status = "disabled"; + }; + + rtc { + compatible = "nvidia,tegra114-rtc", "nvidia,tegra20-rtc"; + reg = <0x7000e000 0x100>; + interrupts = <0 2 0x04>; + }; + + pmc { + compatible = "nvidia,tegra114-pmc", "nvidia,tegra20-pmc"; + reg = <0x7000e400 0x400>; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a15"; + reg = <0>; + }; + + cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a15"; + reg = <1>; + }; + + cpu@2 { + device_type = "cpu"; + compatible = "arm,cortex-a15"; + reg = <2>; + }; + + cpu@3 { + device_type = "cpu"; + compatible = "arm,cortex-a15"; + reg = <3>; + }; + }; + + timer { + compatible = "arm,armv7-timer"; + interrupts = <1 13 0xf08>, + <1 14 0xf08>, + <1 11 0xf08>, + <1 10 0xf08>; + }; +};
Signature · 1 line
1.7.9.5
PATCH v3 6/9 ARM: dt: tegra114: Add new SoC base, Tegra 114 SoC
Quoted 2 lines · Hiroshi Doyu
Initial support for Tegra 114 SoC. This is expected to be included in the board DTS files, Tegra 114 SoC based evaluation board family.
This series looks fine to me. Assuming no other comments, I'll apply once CCF is applied and you've done the rebase you mentioned for patch 2.
Note that I'll apply most patches to Tegra's for-3.9/soc branch (the code) but the 3 device tree patches to Tegra's for-3.9/dt branch, since it's fine for the DT files to appear later than the code supporting the SoC, since this is all new features.
One question: The .dts files don't include any clocks properties. I assume Peter will add these when he posts the Tegra114 CCF code?
PATCH v3 6/9 ARM: dt: tegra114: Add new SoC base, Tegra 114 SoC
Quoted 7 lines · Stephen Warren
Quoted 2 lines · Hiroshi Doyu
Initial support for Tegra 114 SoC. This is expected to be included in the board DTS files, Tegra 114 SoC based evaluation board family.
This series looks fine to me. Assuming no other comments, I'll apply once CCF is applied and you've done the rebase you mentioned for patch 2.
Quoted 7 lines
Note that I'll apply most patches to Tegra's for-3.9/soc branch (the code) but the 3 device tree patches to Tegra's for-3.9/dt branch, since it's fine for the DT files to appear later than the code supporting the SoC, since this is all new features.
One question: The .dts files don't include any clocks properties. I assume Peter will add these when he posts the Tegra114 CCF code?
Yes. I will add those as part of the Tegra114 CCF series.
Cheers,
Peter.
PATCH v3 6/9 ARM: dt: tegra114: Add new SoC base, Tegra 114 SoC
Peter De Schrijver <[email protected]> wrote @ Tue, 15 Jan 2013 18:27:33 +0100:
Quoted 13 lines · Stephen Warren
Quoted 12 lines · Hiroshi Doyu
Quoted 2 lines
Initial support for Tegra 114 SoC. This is expected to be included in the board DTS files, Tegra 114 SoC based evaluation board family.
This series looks fine to me. Assuming no other comments, I'll apply once CCF is applied and you've done the rebase you mentioned for patch 2.
Note that I'll apply most patches to Tegra's for-3.9/soc branch (the code) but the 3 device tree patches to Tegra's for-3.9/dt branch, since it's fine for the DT files to appear later than the code supporting the SoC, since this is all new features.
Quoted 4 lines
Quoted 2 lines
One question: The .dts files don't include any clocks properties. I assume Peter will add these when he posts the Tegra114 CCF code?
Yes. I will add those as part of the Tegra114 CCF series.
Once Tegra114 CCF comes, the 2nd one can be dropped.
PATCH v3 7/9 ARM: dt: tegra114: Add new board, Dalmore
In reply to Hiroshi DoyuAdd a new evaluation board, Dalmore for Tegra 114 family.
--- arch/arm/boot/dts/Makefile | 3 ++- arch/arm/boot/dts/tegra114-dalmore.dts | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boot/dts/tegra114-dalmore.dts
arch/arm/boot/dts/Makefile +2 -1
@@ -147,7 +147,8 @@ dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \ tegra20-whistler.dtb \ tegra30-cardhu-a02.dtb \ tegra30-cardhu-a04.dtb \ - tegra30-beaver.dtb + tegra30-beaver.dtb \ + tegra114-dalmore.dtb dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2p-ca5s.dtb \ vexpress-v2p-ca9.dtb \ vexpress-v2p-ca15-tc1.dtb \
arch/arm/boot/dts/tegra114-dalmore.dts new file +21 -0
@@ -0,0 +1,21 @@ +/dts-v1/; + +/include/ "tegra114.dtsi" + +/ { + model = "NVIDIA Tegra114 Dalmore evaluation board"; + compatible = "nvidia,dalmore", "nvidia,tegra114"; + + memory { + reg = <0x80000000 0x40000000>; + }; + + serial@70006300 { + status = "okay"; + clock-frequency = <408000000>; + }; + + pmc { + nvidia,invert-interrupt; + }; +};
Signature · 1 line
1.7.9.5
PATCH v3 8/9 ARM: dt: tegra114: Add new board, Pluto
In reply to Hiroshi DoyuAdd a new evaluation board, Pluto for Tegra 114 family.
--- arch/arm/boot/dts/Makefile | 3 ++- arch/arm/boot/dts/tegra114-pluto.dts | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boot/dts/tegra114-pluto.dts
arch/arm/boot/dts/Makefile +2 -1
@@ -148,7 +148,8 @@ dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \ tegra30-cardhu-a02.dtb \ tegra30-cardhu-a04.dtb \ tegra30-beaver.dtb \ - tegra114-dalmore.dtb + tegra114-dalmore.dtb \ + tegra114-pluto.dtb dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2p-ca5s.dtb \ vexpress-v2p-ca9.dtb \ vexpress-v2p-ca15-tc1.dtb \
arch/arm/boot/dts/tegra114-pluto.dts new file +21 -0
@@ -0,0 +1,21 @@ +/dts-v1/; + +/include/ "tegra114.dtsi" + +/ { + model = "NVIDIA Tegra114 Pluto evaluation board"; + compatible = "nvidia,pluto", "nvidia,tegra114"; + + memory { + reg = <0x80000000 0x40000000>; + }; + + serial@70006300 { + status = "okay"; + clock-frequency = <408000000>; + }; + + pmc { + nvidia,invert-interrupt; + }; +};
Signature · 1 line
1.7.9.5
PATCH v3 9/9 ARM: tegra: Add initial support for Tegra 114 SoC.
In reply to Hiroshi DoyuAdd new Tegra 114 SoC support.
--- arch/arm/mach-tegra/Kconfig | 10 +++++++ arch/arm/mach-tegra/Makefile | 1 + arch/arm/mach-tegra/board-dt-tegra114.c | 48 +++++++++++++++++++++++++++++++ arch/arm/mach-tegra/common.c | 1 + 4 files changed, 60 insertions(+) create mode 100644 arch/arm/mach-tegra/board-dt-tegra114.c
arch/arm/mach-tegra/Kconfig +10 -0
@@ -44,6 +44,16 @@ config ARCH_TEGRA_3x_SOC Support for NVIDIA Tegra T30 processor family, based on the ARM CortexA9MP CPU and the ARM PL310 L2 cache controller +config ARCH_TEGRA_114_SOC + bool "Enable support for Tegra114 family" + select ARM_GIC + select CPU_V7 + select ARM_L1_CACHE_SHIFT_6 + select ARM_ARCH_TIMER + help + Support for NVIDIA Tegra T114 processor family, based on the + ARM CortexA15MP CPU + config TEGRA_PCI bool "PCI Express support" depends on ARCH_TEGRA_2x_SOC
arch/arm/mach-tegra/Makefile +1 -0
@@ -33,6 +33,7 @@ obj-$(CONFIG_TEGRA_PCI) += pcie.o obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-dt-tegra20.o obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o +obj-$(CONFIG_ARCH_TEGRA_114_SOC) += board-dt-tegra114.o obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-harmony-pcie.o
arch/arm/mach-tegra/board-dt-tegra114.c new file +48 -0
48 lines not on this page · raw message
arch/arm/mach-tegra/common.c +1 -0
@@ -59,6 +59,7 @@ u32 tegra_uart_config[4] = {#ifdef CONFIG_OF static const struct of_device_id tegra_dt_irq_match[]__initconst = { + { .compatible ="arm,cortex-a15-gic" , .data = gic_of_init }, { .compatible ="arm,cortex-a9-gic" , .data = gic_of_init }, { } };
Signature · 1 line
1.7.9.5