Skip to contentSkip to conversation

Sigma Designs Tango4 port

PATCH Superseded Marc Gonzalez 2 participants 7 messages Nov 24, 2015 – Dec 14, 2015

Subsystems (4)

v10 of 11 Superseded Latest is v11 →

lore
Share & tools
lore
#0 lore raw

v10 cover Sigma Designs Tango4 port

One more time. (We're gonna celebrate)

Changes planned for a future patch series:
Have clkgen driver export CD2/2 (for USB) and CD6/2 (for SDIO)

Changes since v9:
Rename mach-tangox to mach-tango and ARCH_TANGOX to ARCH_TANGO (??) => Should I instead define ARCH_TANGO4 and later define ARCH_TANGO5? Add entry in MAINTAINERS
Delete pr_debug() call
=> mach code is not supposed to use this function?

Marc Gonzalez (2):
arm-soc: Import initial tango4 device tree
arm-soc: Add support for tango4 platforms

 MAINTAINERS                               |   7 ++
 arch/arm/Kconfig                          |   2 +
 arch/arm/Makefile                         |   1 +
 arch/arm/boot/dts/Makefile                |   2 +
 arch/arm/boot/dts/tango4-common.dtsi      | 121 ++++++++++++++++++++++++++++++
 arch/arm/boot/dts/tango4-smp8758.dtsi     |  31 ++++++++
 arch/arm/boot/dts/tango4-vantage-1172.dts |  29 +++++++
 arch/arm/mach-tango/Kconfig               |  12 +++
 arch/arm/mach-tango/Makefile              |   2 +
 arch/arm/mach-tango/setup.c               |  31 ++++++++
 arch/arm/mach-tango/smc.S                 |   9 +++
 arch/arm/mach-tango/smc.h                 |   5 ++
 12 files changed, 252 insertions(+)
 create mode 100644 arch/arm/boot/dts/tango4-common.dtsi
 create mode 100644 arch/arm/boot/dts/tango4-smp8758.dtsi
 create mode 100644 arch/arm/boot/dts/tango4-vantage-1172.dts
 create mode 100644 arch/arm/mach-tango/Kconfig
 create mode 100644 arch/arm/mach-tango/Makefile
 create mode 100644 arch/arm/mach-tango/setup.c
 create mode 100644 arch/arm/mach-tango/smc.S
 create mode 100644 arch/arm/mach-tango/smc.h
Signature · 1 line
2.4.5
#1 lore raw

PATCH v10 1/2 arm-soc: Import initial tango4 device tree

This device tree was tested on a Sigma Designs SMP8758 Vantage-1172 development board.

---
 arch/arm/boot/dts/Makefile                |   2 +
 arch/arm/boot/dts/tango4-common.dtsi      | 121 ++++++++++++++++++++++++++++++
 arch/arm/boot/dts/tango4-smp8758.dtsi     |  31 ++++++++
 arch/arm/boot/dts/tango4-vantage-1172.dts |  29 +++++++
 4 files changed, 183 insertions(+)
 create mode 100644 arch/arm/boot/dts/tango4-common.dtsi
 create mode 100644 arch/arm/boot/dts/tango4-smp8758.dtsi
 create mode 100644 arch/arm/boot/dts/tango4-vantage-1172.dts
arch/arm/boot/dts/Makefile +2 -0
index 246473a244f6..2499295051d5 100644
@@ -605,6 +605,8 @@ dtb-$(CONFIG_MACH_SUN8I) += \
 dtb-$(CONFIG_MACH_SUN9I) += \
 	sun9i-a80-optimus.dtb \
 	sun9i-a80-cubieboard4.dtb
+dtb-$(CONFIG_ARCH_TANGOX) += \
+	tango4-vantage-1172.dtb
 dtb-$(CONFIG_ARCH_TEGRA_2x_SOC) += \
 	tegra20-harmony.dtb \
 	tegra20-iris-512.dtb \
arch/arm/boot/dts/tango4-common.dtsi new file +121 -0

121 lines not on this page · raw message

arch/arm/boot/dts/tango4-smp8758.dtsi new file +31 -0
new file mode 100644
index 000000000000..7ed88ee629fb
@@ -0,0 +1,31 @@
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		enable-method = "sigma,tango4-smp";
+
+		cpu0: cpu at 0 {
+			compatible = "arm,cortex-a9";
+			next-level-cache = <&l2cc>;
+			device_type = "cpu";
+			reg = <0>;
+		};
+
+		cpu1: cpu at 1 {
+			compatible = "arm,cortex-a9";
+			next-level-cache = <&l2cc>;
+			device_type = "cpu";
+			reg = <1>;
+		};
+	};
+
+	pmu {
+		compatible = "arm,cortex-a9-pmu";
+		interrupt-affinity = <&cpu0>, <&cpu1>;
+		interrupts =
+			<GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
+			<GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
+	};
+};
arch/arm/boot/dts/tango4-vantage-1172.dts new file +29 -0
new file mode 100644
index 000000000000..fcfac8231e7a
@@ -0,0 +1,29 @@
+/dts-v1/;
+
+#include "tango4-smp8758.dtsi"
+#include "tango4-common.dtsi"
+
+/ {
+	model = "Sigma Designs SMP8758 Vantage-1172 Rev E1";
+	compatible = "sigma,vantage-1172", "sigma,smp8758", "sigma,tango4";
+
+	memory at 80000000 {
+		device_type = "memory";
+		reg = <0x80000000 0x80000000>; /* 2 GB */
+	};
+};
+
+&eth0 {
+	phy-connection-type = "rgmii";
+	phy-handle = <&eth0_phy>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	/* Atheros AR8035 */
+	eth0_phy: ethernet-phy at 4 {
+		compatible = "ethernet-phy-id004d.d072",
+			     "ethernet-phy-ieee802.3-c22";
+		interrupts = <37 IRQ_TYPE_EDGE_RISING>;
+		reg = <4>;
+	};
+};
Signature · 1 line
2.4.5
#2 lore raw

PATCH v10 1/2 arm-soc: Import initial tango4 device tree

arch/arm/boot/dts/Makefile dtb-$(CONFIG_MACH_SUN8I) += \ · line 608

Quoted 9 lines · Marc Gonzalez
arch/arm/boot/dts/Makefile +1 -0
index 246473a244f6..2499295051d5 100644
@@ -605,6 +605,8 @@ dtb-$(CONFIG_MACH_SUN8I) += \
 dtb-$(CONFIG_MACH_SUN9I) += \
 	sun9i-a80-optimus.dtb \
 	sun9i-a80-cubieboard4.dtb
+dtb-$(CONFIG_ARCH_TANGOX) += \

<sigh> Missed an ARCH_TANGOX here.

#3 lore raw

PATCH v10 2/2 arm-soc: Add support for tango4 platforms

In reply to Marc Gonzalez

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

---
 MAINTAINERS                  |  7 +++++++
 arch/arm/Kconfig             |  2 ++
 arch/arm/Makefile            |  1 +
 arch/arm/mach-tango/Kconfig  | 12 ++++++++++++
 arch/arm/mach-tango/Makefile |  2 ++
 arch/arm/mach-tango/setup.c  | 31 +++++++++++++++++++++++++++++++
 arch/arm/mach-tango/smc.S    |  9 +++++++++
 arch/arm/mach-tango/smc.h    |  5 +++++
 8 files changed, 69 insertions(+)
 create mode 100644 arch/arm/mach-tango/Kconfig
 create mode 100644 arch/arm/mach-tango/Makefile
 create mode 100644 arch/arm/mach-tango/setup.c
 create mode 100644 arch/arm/mach-tango/smc.S
 create mode 100644 arch/arm/mach-tango/smc.h
MAINTAINERS +7 -0
index b60e2b2369d2..67575fffc188 100644
@@ -1529,6 +1529,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 <[email protected]>
+L:	linux-arm-kernel at 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 <[email protected]>
 L:	linux-arm-kernel at lists.infradead.org (moderated for non-subscribers)
arch/arm/Kconfig +2 -0
index 774dc59650c5..3fbe165d3c37 100644
@@ -934,6 +934,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"
arch/arm/Makefile +1 -0
index 7451b447cc2d..e49840682d3d 100644
@@ -203,6 +203,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
arch/arm/mach-tango/Kconfig new file +12 -0
new file mode 100644
index 000000000000..cfcc87995426
@@ -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 GENERIC_IRQ_CHIP
+	select HAVE_ARM_SCU
+	select HAVE_ARM_TWD
arch/arm/mach-tango/Makefile new file +2 -0
new file mode 100644
index 000000000000..0d7e2b5976e3
@@ -0,0 +1,2 @@
+asflags-y += -mcpu=cortex-a9
+obj-y += setup.o smc.o
arch/arm/mach-tango/setup.c new file +31 -0
new file mode 100644
index 000000000000..d86900550e63
@@ -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
arch/arm/mach-tango/smc.S new file +9 -0
new file mode 100644
index 000000000000..5d932ce3c1bd
@@ -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)
arch/arm/mach-tango/smc.h new file +5 -0
new file mode 100644
index 000000000000..7a4af35cc390
@@ -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)
Signature · 1 line
2.4.5
#4 lore raw

PATCH v10 2/2 arm-soc: Add support for tango4 platforms

arch/arm/mach-tango/Kconfig line 10

Quoted 10 lines · Marc Gonzalez
arch/arm/mach-tango/Kconfig new file +10 -0
+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 GENERIC_IRQ_CHIP

Instead of GENERIC_IRQ_CHIP, I should select TANGO_IRQCHIP (to be defined in drivers/irqchip/Kconfig)

TANGO_IRQCHIP itself will select IRQ_DOMAIN and GENERIC_IRQ_CHIP.

maintainer
#5 lore raw

PATCH v10 2/2 arm-soc: Add support for tango4 platforms

Quoted 13 lines · On Wednesday 25 November 2015 11:32:33 Marc Gonzalez wrote:

arch/arm/mach-tango/Kconfig line 10

Quoted 10 lines · Marc Gonzalez
arch/arm/mach-tango/Kconfig new file +10 -0
+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 GENERIC_IRQ_CHIP
Quoted 5 lines

Instead of GENERIC_IRQ_CHIP, I should select TANGO_IRQCHIP (to be defined in drivers/irqchip/Kconfig)

TANGO_IRQCHIP itself will select IRQ_DOMAIN and GENERIC_IRQ_CHIP.

Are you sending a V11 with this?

Arnd

#6 lore raw

PATCH v10 2/2 arm-soc: Add support for tango4 platforms

Quoted 14 lines · Arnd Bergmann
Quoted 13 lines · On Wednesday 25 November 2015 11:32:33 Marc Gonzalez wrote:
Quoted 10 lines · Marc Gonzalez
arch/arm/mach-tango/Kconfig new file +10 -0
+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 GENERIC_IRQ_CHIP
Quoted 7 lines
Quoted 5 lines

Instead of GENERIC_IRQ_CHIP, I should select TANGO_IRQCHIP (to be defined in drivers/irqchip/Kconfig)

TANGO_IRQCHIP itself will select IRQ_DOMAIN and GENERIC_IRQ_CHIP.

Are you sending a V11 with this?

Yep, v11 coming up later today.

Thanks for reminding me.

Regards.