ARM: tango4: Initial platform support
authorMarc Gonzalez <marc_gonzalez@sigmadesigns.com>
Tue, 15 Dec 2015 09:41:13 +0000 (10:41 +0100)
committerOlof Johansson <olof@lixom.net>
Tue, 22 Dec 2015 23:10:31 +0000 (15:10 -0800)
Support Sigma Designs ARM-based (specifically, Cortex-A9 MPCore r3p0)
Tango4 "Secure Media Processor" platforms: smp8756, smp8758, smp8759
(8756 is single-core, the latter are dual-core).

Note: 8758 vs 8759: same chip, different package.

Support for older MIPS-based platforms can be found elsewhere:
https://github.com/mansr/linux-tangox

Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
MAINTAINERS
arch/arm/Kconfig
arch/arm/Makefile
arch/arm/mach-tango/Kconfig [new file with mode: 0644]
arch/arm/mach-tango/Makefile [new file with mode: 0644]
arch/arm/mach-tango/setup.c [new file with mode: 0644]
arch/arm/mach-tango/smc.S [new file with mode: 0644]
arch/arm/mach-tango/smc.h [new file with mode: 0644]

index cba790b42f23d5980088588d01d97084cd8423d2..d5506b0e385b65b411b662d1f7e7ee3826fa6f65 100644 (file)
@@ -1588,6 +1588,13 @@ T:       git git://git.kernel.org/pub/scm/linux/kernel/git/mcoquelin/stm32.git
 N:     stm32
 F:     drivers/clocksource/armv7m_systick.c
 
+ARM/TANGO ARCHITECTURE
+M:     Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
+L:     linux-arm-kernel@lists.infradead.org
+S:     Maintained
+F:     arch/arm/mach-tango/
+F:     arch/arm/boot/dts/tango*
+
 ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
 M:     Lennert Buytenhek <kernel@wantstofly.org>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
index e803304f4afa8d9aa1bd1fafec2c49b2e47938d3..0bdf7a62925973426fa433ab93d40c570adab928 100644 (file)
@@ -919,6 +919,8 @@ source "arch/arm/mach-sunxi/Kconfig"
 
 source "arch/arm/mach-prima2/Kconfig"
 
+source "arch/arm/mach-tango/Kconfig"
+
 source "arch/arm/mach-tegra/Kconfig"
 
 source "arch/arm/mach-u300/Kconfig"
index 2c2b28ee48119771dfa92f353124795d456d770a..d1da24885af08fc9ac116edc785cbccbe5646b72 100644 (file)
@@ -211,6 +211,7 @@ machine-$(CONFIG_ARCH_SOCFPGA)              += socfpga
 machine-$(CONFIG_ARCH_STI)             += sti
 machine-$(CONFIG_ARCH_STM32)           += stm32
 machine-$(CONFIG_ARCH_SUNXI)           += sunxi
+machine-$(CONFIG_ARCH_TANGO)           += tango
 machine-$(CONFIG_ARCH_TEGRA)           += tegra
 machine-$(CONFIG_ARCH_U300)            += u300
 machine-$(CONFIG_ARCH_U8500)           += ux500
diff --git a/arch/arm/mach-tango/Kconfig b/arch/arm/mach-tango/Kconfig
new file mode 100644 (file)
index 0000000..d6a3714
--- /dev/null
@@ -0,0 +1,12 @@
+config ARCH_TANGO
+       bool "Sigma Designs Tango4 (SMP87xx)" if ARCH_MULTI_V7
+       # Cortex-A9 MPCore r3p0, PL310 r3p2
+       select ARCH_HAS_HOLES_MEMORYMODEL
+       select ARM_ERRATA_754322
+       select ARM_ERRATA_764369 if SMP
+       select ARM_ERRATA_775420
+       select ARM_GIC
+       select CLKSRC_TANGO_XTAL
+       select HAVE_ARM_SCU
+       select HAVE_ARM_TWD
+       select TANGO_IRQ
diff --git a/arch/arm/mach-tango/Makefile b/arch/arm/mach-tango/Makefile
new file mode 100644 (file)
index 0000000..0d7e2b5
--- /dev/null
@@ -0,0 +1,2 @@
+asflags-y += -mcpu=cortex-a9
+obj-y += setup.o smc.o
diff --git a/arch/arm/mach-tango/setup.c b/arch/arm/mach-tango/setup.c
new file mode 100644 (file)
index 0000000..d869005
--- /dev/null
@@ -0,0 +1,31 @@
+#include <linux/smp.h>
+#include <asm/mach/arch.h>
+#include <asm/hardware/cache-l2x0.h>
+#include "smc.h"
+
+static int tango4_boot_secondary(unsigned int cpu, struct task_struct *idle)
+{
+       tango_set_aux_boot_addr(virt_to_phys(secondary_startup));
+       tango_start_aux_core(cpu);
+       return 0;
+}
+
+static struct smp_operations tango4_smp_ops __initdata = {
+       .smp_boot_secondary     = tango4_boot_secondary,
+};
+
+CPU_METHOD_OF_DECLARE(tango4_smp, "sigma,tango4-smp", &tango4_smp_ops);
+
+static void tango_l2c_write(unsigned long val, unsigned int reg)
+{
+       if (reg == L2X0_CTRL)
+               tango_set_l2_control(val);
+}
+
+static const char *const tango_dt_compat[] = { "sigma,tango4", NULL };
+
+DT_MACHINE_START(TANGO_DT, "Sigma Tango DT")
+       .dt_compat      = tango_dt_compat,
+       .l2c_aux_mask   = ~0,
+       .l2c_write_sec  = tango_l2c_write,
+MACHINE_END
diff --git a/arch/arm/mach-tango/smc.S b/arch/arm/mach-tango/smc.S
new file mode 100644 (file)
index 0000000..5d932ce
--- /dev/null
@@ -0,0 +1,9 @@
+#include <linux/linkage.h>
+
+ENTRY(tango_smc)
+       push    {lr}
+       mov     ip, r1
+       dsb     /* This barrier is probably unnecessary */
+       smc     #0
+       pop     {pc}
+ENDPROC(tango_smc)
diff --git a/arch/arm/mach-tango/smc.h b/arch/arm/mach-tango/smc.h
new file mode 100644 (file)
index 0000000..7a4af35
--- /dev/null
@@ -0,0 +1,5 @@
+extern int tango_smc(unsigned int val, unsigned int service);
+
+#define tango_set_l2_control(val)      tango_smc(val, 0x102)
+#define tango_start_aux_core(val)      tango_smc(val, 0x104)
+#define tango_set_aux_boot_addr(val)   tango_smc((unsigned int)val, 0x105)
This page took 0.040843 seconds and 5 git commands to generate.