Skip to contentSkip to conversation

Sigma Designs Tango4 port

PATCH New Marc Gonzalez 4 participants 13 messages Dec 15, 2015 – Jan 7, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v11 cover Sigma Designs Tango4 port

"One more time. We're gonna celebrate."

Changes since v10:
Add aliases and chosen DT nodes
Use CPU_CLK and SYS_CLK symbolic names MPCore private memory region DT node select TANGO_IRQ instead of GENERIC_IRQ_CHIP

Changes planned for a future patch series:
Have clkgen driver export CD2 for USB, and CD6 for SDIO

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      | 130 ++++++++++++++++++++++++++++++
 arch/arm/boot/dts/tango4-smp8758.dtsi     |  31 +++++++
 arch/arm/boot/dts/tango4-vantage-1172.dts |  37 +++++++++
 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, 269 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.6.3
#1 lore raw

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

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

---
 arch/arm/boot/dts/Makefile                |   2 +
 arch/arm/boot/dts/tango4-common.dtsi      | 130 ++++++++++++++++++++++++++++++
 arch/arm/boot/dts/tango4-smp8758.dtsi     |  31 +++++++
 arch/arm/boot/dts/tango4-vantage-1172.dts |  37 +++++++++
 4 files changed, 200 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 992736b5229b..f91db919d5fe 100644
@@ -564,6 +564,8 @@ dtb-$(CONFIG_MACH_SUN8I) += \
 	sun8i-a23-ippo-q8h-v1.2.dtb
 dtb-$(CONFIG_MACH_SUN9I) += \
 	sun9i-a80-optimus.dtb
+dtb-$(CONFIG_ARCH_TANGO) += \
+	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 +130 -0

130 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 +37 -0
new file mode 100644
index 000000000000..3e5b9c81a51c
@@ -0,0 +1,37 @@
+/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";
+
+	aliases {
+		serial = &uart;
+	};
+
+	memory at 80000000 {
+		device_type = "memory";
+		reg = <0x80000000 0x80000000>; /* 2 GB */
+	};
+
+	chosen {
+		stdout-path = "serial:115200n8";
+	};
+};
+
+&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.6.3
#2 lore raw

PATCH v11 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 d8afd2953678..3869a8053b82 100644
@@ -1494,6 +1494,13 @@ F:	drivers/usb/host/ehci-st.c
 F:	drivers/usb/host/ohci-st.c
 F:	drivers/ata/ahci_st.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 5c236f60e235..98cf131d9e08 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 47f10e7ad1f6..e85717823d38 100644
@@ -205,6 +205,7 @@ machine-$(CONFIG_ARCH_SIRF)		+= prima2
 machine-$(CONFIG_ARCH_SOCFPGA)		+= socfpga
 machine-$(CONFIG_ARCH_STI)		+= sti
 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..d6a3714b096e
@@ -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
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.6.3
#3 lore raw

v11 cover Sigma Designs Tango4 port

In reply to Marc Gonzalez
Quoted 10 lines · Marc Gonzalez

"One more time. We're gonna celebrate."

Changes since v10:
Add aliases and chosen DT nodes
Use CPU_CLK and SYS_CLK symbolic names MPCore private memory region DT node select TANGO_IRQ instead of GENERIC_IRQ_CHIP

Changes planned for a future patch series:
Have clkgen driver export CD2 for USB, and CD6 for SDIO

Was it intentional to leave out a multi_v7_defconfig change so that this actually builds? Or was that planned for a future series?

IMO, it should be part of this series so it gets build tested as soon as it's merged.

Otherwise, looking good to me.

Kevin

#4 lore raw

v11 cover Sigma Designs Tango4 port

Quoted 8 lines · Kevin Hilman
Quoted 6 lines · Marc Gonzalez

Changes since v10:
Add aliases and chosen DT nodes
Use CPU_CLK and SYS_CLK symbolic names MPCore private memory region DT node select TANGO_IRQ instead of GENERIC_IRQ_CHIP

Quoted 5 lines
Quoted 2 lines

Changes planned for a future patch series:
Have clkgen driver export CD2 for USB, and CD6 for SDIO

Was it intentional to leave out a multi_v7_defconfig change so that this actually builds? Or was that planned for a future series?

How is a multi_v7_defconfig different from any old defconfig?

Quoted 2 lines

IMO, it should be part of this series so it gets build tested as soon as it's merged.

The problem is that a mandatory driver is missing upstream (interrupt controller).

http://thread.gmane.org/gmane.linux.kernel/2089470

Quoted 3 lines

Otherwise, looking good to me.

Woot! I already have the next patch series mostly ready, but I suppose I should wait for this one to be accepted before submitting a new one.

Regards.

#5 lore raw

v11 cover Sigma Designs Tango4 port

Quoted 10 lines · Mason
Quoted 8 lines · Kevin Hilman
Quoted 6 lines · Marc Gonzalez

Changes since v10:
Add aliases and chosen DT nodes
Use CPU_CLK and SYS_CLK symbolic names MPCore private memory region DT node select TANGO_IRQ instead of GENERIC_IRQ_CHIP

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Changes planned for a future patch series:
Have clkgen driver export CD2 for USB, and CD6 for SDIO

Was it intentional to leave out a multi_v7_defconfig change so that this actually builds? Or was that planned for a future series?

How is a multi_v7_defconfig different from any old defconfig?

Not sure what you're asking.

The point is that this series doesn't enable any defconfig to build it.

Quoted 7 lines
Quoted 2 lines

IMO, it should be part of this series so it gets build tested as soon as it's merged.

The problem is that a mandatory driver is missing upstream (interrupt controller).

http://thread.gmane.org/gmane.linux.kernel/2089470

Which means it presumably wont boot without that, but it should still build without it, correct? (I tried it locally, and it does.)

Kevin

#6 lore raw

v11 cover Sigma Designs Tango4 port

Quoted 4 lines · Kevin Hilman
Quoted 2 lines · Mason

On 22/12/2015 20:25, Kevin Hilman wrote:

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Was it intentional to leave out a multi_v7_defconfig change so that this actually builds? Or was that planned for a future series?

How is a multi_v7_defconfig different from any old defconfig?

Not sure what you're asking.

The point is that this series doesn't enable any defconfig to build it.

What is not clear to me is: are you asking me to submit a new defconfig (specific to my platform), or are you saying I need to add the new platform to arch/arm/configs/multi_v7_defconfig (I'm not sure how exactly to go about doing that; also I'm concerned about merge conflicts, since my patch set is based on v4.1)

Quoted 10 lines
Quoted 7 lines
Quoted 2 lines

IMO, it should be part of this series so it gets build tested as soon as it's merged.

The problem is that a mandatory driver is missing upstream (interrupt controller).

http://thread.gmane.org/gmane.linux.kernel/2089470

Which means it presumably wont boot without that, but it should still build without it, correct? (I tried it locally, and it does.)

Can I submit the defconfig update as a follow-up patch?

Regards.

#7 lore raw

v11 cover Sigma Designs Tango4 port

Quoted 11 lines · Mason
Quoted 9 lines · Kevin Hilman
Quoted 6 lines · Mason
Quoted 2 lines · Kevin Hilman

Was it intentional to leave out a multi_v7_defconfig change so that this actually builds? Or was that planned for a future series?

How is a multi_v7_defconfig different from any old defconfig?

Quoted 7 lines
Quoted 3 lines

Not sure what you're asking.

The point is that this series doesn't enable any defconfig to build it.

What is not clear to me is: are you asking me to submit a new defconfig (specific to my platform), or are you saying I need to add the new platform to arch/arm/configs/multi_v7_defconfig

multi_v7_defconfig, which is what I've been assuming you've been testing it with. Is that correct?

Quoted 3 lines

(I'm not sure how exactly
to go about doing that; also I'm concerned about merge conflicts, since my patch set is based on v4.1)

The latter. Something like below[1]. Just keep the multi_v7_defconfig patch as a separate patch, and we'll take care of the merge conflicts when applying to the relevant arm-soc branches.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

IMO, it should be part of this series so it gets build tested as soon as it's merged.

The problem is that a mandatory driver is missing upstream (interrupt controller).

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

http://thread.gmane.org/gmane.linux.kernel/2089470

Which means it presumably wont boot without that, but it should still build without it, correct? (I tried it locally, and it does.)

Can I submit the defconfig update as a follow-up patch?

IMO, it should be part of this series that adds the platform. That way, as soon as it gets merged, it will be automatically build tested by various automated builders. (also note that it would be automatically boot tested if I had the hardware as well... hint, hint) ;)

Kevin

[1]

arch/arm/configs/multi_v7_defconfig +1 -0
index 69a22fdb52a5..d5aa59b148da 100644
@@ -89,6 +89,7 @@ CONFIG_ARCH_R8A7794=y
 CONFIG_ARCH_SH73A0=y
 CONFIG_ARCH_SUNXI=y
 CONFIG_ARCH_SIRF=y
+CONFIG_ARCH_TANGO=y
 CONFIG_ARCH_TEGRA=y
 CONFIG_ARCH_TEGRA_2x_SOC=y
 CONFIG_ARCH_TEGRA_3x_SOC=y
#8 lore raw

v11 cover Sigma Designs Tango4 port

Quoted 1 line · Kevin Hilman

Mason <[email protected]> writes:

[...]

Quoted 7 lines
Quoted 2 lines

Can I submit the defconfig update as a follow-up patch?

IMO, it should be part of this series that adds the platform. That way, as soon as it gets merged, it will be automatically build tested by various automated builders. (also note that it would be automatically boot tested if I had the hardware as well... hint, hint) ;)

Olof's and my emails crossed paths, so the main part of the series is already merged.

Please send a defconfig patch which we can apply to next/defconfig and so it gets some build test coverage.

Thanks,

Kevin

#9 lore raw

v11 cover Sigma Designs Tango4 port

In reply to Kevin Hilman
Quoted 8 lines · Kevin Hilman
Quoted 3 lines · Mason

What is not clear to me is: are you asking me to submit a new defconfig (specific to my platform), or are you saying I need to add the new platform to arch/arm/configs/multi_v7_defconfig

multi_v7_defconfig, which is what I've been assuming you've been testing it with. Is that correct?

No, I'm not using the Christmas Tree kernel :-)

I needed a small kernel, so I created a config from scratch, just for my platform (as things were before ARCH_MULTI_V7)

Quoted 3 lines

The latter. Something like below[1]. Just keep the multi_v7_defconfig patch as a separate patch, and we'll take care of the merge conflicts when applying to the relevant arm-soc branches.

I'll send the patch ASAP (probably next week).

Quoted 6 lines
Quoted 1 line

Can I submit the defconfig update as a follow-up patch?

IMO, it should be part of this series that adds the platform. That way, as soon as it gets merged, it will be automatically build tested by various automated builders. (also note that it would be automatically boot tested if I had the hardware as well... hint, hint) ;)

I will contact HQ and ask if they have boards to spare.

Regards.

#10 lore raw

v11 cover Sigma Designs Tango4 port

In reply to Marc Gonzalez
Quoted 8 lines · Marc Gonzalez

"One more time. We're gonna celebrate."

Changes since v10:
Add aliases and chosen DT nodes
Use CPU_CLK and SYS_CLK symbolic names MPCore private memory region DT node select TANGO_IRQ instead of GENERIC_IRQ_CHIP

Quoted 6 lines

Changes planned for a future patch series:
Have clkgen driver export CD2 for USB, and CD6 for SDIO

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

Thanks, I've applied these now (but with slightly modified patch subjects), and with Kevin's reviewed-by tag:

ARM: dts: tango4: Initial device trees
ARM: tango4: Initial platform support

-Olof

#11 lore raw

v11 cover Sigma Designs Tango4 port

Quoted 4 lines · Olof Johansson

Thanks, I've applied these now (but with slightly modified patch subjects), and with Kevin's reviewed-by tag:

ARM: dts: tango4: Initial device trees

Why the plural? Isn't there just one tree per board?

Quoted 1 line

ARM: tango4: Initial platform support

Cool, cool, cool.

Regards.

#12 lore raw

v11 cover Sigma Designs Tango4 port

Quoted 8 lines · Mason
Quoted 4 lines · Olof Johansson

Thanks, I've applied these now (but with slightly modified patch subjects), and with Kevin's reviewed-by tag:

ARM: dts: tango4: Initial device trees

Why the plural? Isn't there just one tree per board?

Only one dts, but multiple files which I suppose is why I wrote in plural.

Quoted 3 lines
Quoted 1 line

ARM: tango4: Initial platform support

Cool, cool, cool.

-Olof