Skip to contentSkip to conversation

Versatile Express DT support

PATCH Superseded Pawel Moll 4 participants 24 messages Nov 23, 2011 – Nov 28, 2011

Subsystems (4)

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Pawel Moll

author
#0 lore raw

v2 cover Versatile Express DT support

Hello again,

This version of the series (hopefully) addresses all the suggestions made by Dave, Rob and Russell.

The compatible values are specific for the tiles now and the memory map variant is defined as a custom property in the motherboard node.

Tested on V2P-CA9 coretile both with ATAGs and DT and V2P-CA5s with DT.

All comments, as always, welcomed!

Pawel

Pawel Moll (4):
ARM: vexpress: Get rid of MMIO_P2V
ARM: vexpress: Add DT support in v2m
ARM: vexpress: Initial RS1 memory map support
ARM: vexpress: DT-based support for CoreTiles Express A5x2 and A9x4

 Documentation/devicetree/bindings/arm/vexpress    |  101 ++++++++
 arch/arm/boot/dts/vexpress-v2m-rs1.dtsi           |  192 +++++++++++++++
 arch/arm/boot/dts/vexpress-v2m.dtsi               |  191 +++++++++++++++
 arch/arm/boot/dts/vexpress-v2p-ca5s.dts           |  132 ++++++++++
 arch/arm/boot/dts/vexpress-v2p-ca9.dts            |  146 +++++++++++
 arch/arm/include/asm/hardware/arm_timer.h         |    5 +
 arch/arm/mach-vexpress/Kconfig                    |   35 +++
 arch/arm/mach-vexpress/Makefile                   |    1 +
 arch/arm/mach-vexpress/Makefile.boot              |    6 +
 arch/arm/mach-vexpress/core.h                     |   21 ++-
 arch/arm/mach-vexpress/ct-ca9x4.c                 |   52 +---
 arch/arm/mach-vexpress/include/mach/ct-ca9x4.h    |   13 +-
 arch/arm/mach-vexpress/include/mach/debug-macro.S |   37 +++-
 arch/arm/mach-vexpress/include/mach/motherboard.h |   58 +++--
 arch/arm/mach-vexpress/include/mach/uncompress.h  |   13 +-
 arch/arm/mach-vexpress/platsmp.c                  |    4 +-
 arch/arm/mach-vexpress/v2m.c                      |  265 ++++++++++++++++++---
 arch/arm/mach-vexpress/v2p-ca5s_ca9.c             |  115 +++++++++
 18 files changed, 1272 insertions(+), 115 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/vexpress
 create mode 100644 arch/arm/boot/dts/vexpress-v2m-rs1.dtsi
 create mode 100644 arch/arm/boot/dts/vexpress-v2m.dtsi
 create mode 100644 arch/arm/boot/dts/vexpress-v2p-ca5s.dts
 create mode 100644 arch/arm/boot/dts/vexpress-v2p-ca9.dts
 create mode 100644 arch/arm/mach-vexpress/v2p-ca5s_ca9.c
author
#1 lore raw

PATCH v2 1/4 ARM: vexpress: Get rid of MMIO_P2V

This patch gets rid of the MMIO_P2V and __MMPIO_P2V macros, defining constant virtual base for motherboard and tile peripherals instead.

Additionally, in preparation for the new motherboard memory map, the motherboard peripherals are using base pointers calculated in runtime, instead of compile-time calculated values.

---
 arch/arm/include/asm/hardware/arm_timer.h         |    5 ++
 arch/arm/mach-vexpress/core.h                     |   11 ++-
 arch/arm/mach-vexpress/ct-ca9x4.c                 |   52 +++-----------
 arch/arm/mach-vexpress/include/mach/ct-ca9x4.h    |   13 ++--
 arch/arm/mach-vexpress/include/mach/motherboard.h |   52 +++++++-------
 arch/arm/mach-vexpress/platsmp.c                  |    4 +-
 arch/arm/mach-vexpress/v2m.c                      |   76 +++++++++++++--------
 7 files changed, 104 insertions(+), 109 deletions(-)
arch/arm/include/asm/hardware/arm_timer.h +5 -0
index c0f4e7b..d6030ff 100644
@@ -9,7 +9,12 @@
  *
  * Integrator AP has 16-bit timers, Integrator CP, Versatile and Realview
  * can have 16-bit or 32-bit selectable via a bit in the control register.
+ *
+ * Every SP804 contains two identical timers.
  */
+#define TIMER_1_BASE	0x00
+#define TIMER_2_BASE	0x20
+
 #define TIMER_LOAD	0x00			/* ACVR rw */
 #define TIMER_VALUE	0x04			/* ACVR ro */
 #define TIMER_CTRL	0x08			/* ACVR rw */
arch/arm/mach-vexpress/core.h +8 -3
index f439715..d3dd491 100644
@@ -1,6 +1,3 @@
-#define __MMIO_P2V(x)	(((x) & 0xfffff) | (((x) & 0x0f000000) >> 4) | 0xf8000000)
-#define MMIO_P2V(x)	((void __iomem *)__MMIO_P2V(x))
-
 #define AMBA_DEVICE(name,busid,base,plat)	\
 struct amba_device name##_device = {		\
 	.dev		= {			\
@@ -17,3 +14,11 @@ struct amba_device name##_device = {		\
 	.irq		= IRQ_##base,		\
 	/* .dma		= DMA_##base,*/		\
 }
+
+/* 2MB large area for motherboard's peripherals static mapping */
+#define V2M_PERIPH 0xf8000000
+#define V2M_PERIPH_P2V(offset) ((void __iomem *)(V2M_PERIPH | (offset)))
+
+/* Tile's peripherals static mappings should start here */
+#define V2T_PERIPH 0xf8200000
+#define V2T_PERIPH_P2V(offset) ((void __iomem *)(V2T_PERIPH | (offset)))
arch/arm/mach-vexpress/ct-ca9x4.c +12 -40

96 lines not on this page · raw message

arch/arm/mach-vexpress/include/mach/ct-ca9x4.h +5 -8
index a34d3d4..8f962fb 100644
@@ -22,14 +22,11 @@
 #define CT_CA9X4_SYSWDT		(0x1e007000)
 #define CT_CA9X4_L2CC		(0x1e00a000)
 
-#define CT_CA9X4_TIMER0		(CT_CA9X4_SP804_TIMER + 0x000)
-#define CT_CA9X4_TIMER1		(CT_CA9X4_SP804_TIMER + 0x020)
-
-#define A9_MPCORE_SCU		(CT_CA9X4_MPIC + 0x0000)
-#define A9_MPCORE_GIC_CPU	(CT_CA9X4_MPIC + 0x0100)
-#define A9_MPCORE_GIT		(CT_CA9X4_MPIC + 0x0200)
-#define A9_MPCORE_TWD		(CT_CA9X4_MPIC + 0x0600)
-#define A9_MPCORE_GIC_DIST	(CT_CA9X4_MPIC + 0x1000)
+#define A9_MPCORE_SCU		0x0000
+#define A9_MPCORE_GIC_CPU	0x0100
+#define A9_MPCORE_GIT		0x0200
+#define A9_MPCORE_TWD		0x0600
+#define A9_MPCORE_GIC_DIST	0x1000
 
 /*
  * Interrupts.  Those in {} are for AMBA devices
arch/arm/mach-vexpress/include/mach/motherboard.h +25 -27

64 lines not on this page · raw message

arch/arm/mach-vexpress/platsmp.c +1 -3
index 2b5f7ac..e8be99d 100644
@@ -45,7 +45,5 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
 	 * until it receives a soft interrupt, and then the
 	 * secondary CPU branches to this address.
 	 */
-	writel(~0, MMIO_P2V(V2M_SYS_FLAGSCLR));
-	writel(BSYM(virt_to_phys(versatile_secondary_startup)),
-		MMIO_P2V(V2M_SYS_FLAGSSET));
+	v2m_flags_set(BSYM(virt_to_phys(versatile_secondary_startup)));
 }
arch/arm/mach-vexpress/v2m.c +48 -28

147 lines not on this page · raw message

Signature · 1 line
1.6.3.3
#2 lore raw

PATCH v2 1/4 ARM: vexpress: Get rid of MMIO_P2V

Quoted 264 lines · Pawel Moll

This patch gets rid of the MMIO_P2V and __MMPIO_P2V macros, defining constant virtual base for motherboard and tile peripherals instead.

Additionally, in preparation for the new motherboard memory map, the motherboard peripherals are using base pointers calculated in runtime, instead of compile-time calculated values.

---
 arch/arm/include/asm/hardware/arm_timer.h         |    5 ++
 arch/arm/mach-vexpress/core.h                     |   11 ++-
 arch/arm/mach-vexpress/ct-ca9x4.c                 |   52 +++-----------
 arch/arm/mach-vexpress/include/mach/ct-ca9x4.h    |   13 ++--
 arch/arm/mach-vexpress/include/mach/motherboard.h |   52 +++++++-------
 arch/arm/mach-vexpress/platsmp.c                  |    4 +-
 arch/arm/mach-vexpress/v2m.c                      |   76 +++++++++++++--------
 7 files changed, 104 insertions(+), 109 deletions(-)
arch/arm/include/asm/hardware/arm_timer.h +5 -0
index c0f4e7b..d6030ff 100644
@@ -9,7 +9,12 @@
  *
  * Integrator AP has 16-bit timers, Integrator CP, Versatile and Realview
  * can have 16-bit or 32-bit selectable via a bit in the control register.
+ *
+ * Every SP804 contains two identical timers.
  */
+#define TIMER_1_BASE	0x00
+#define TIMER_2_BASE	0x20
+
 #define TIMER_LOAD	0x00			/* ACVR rw */
 #define TIMER_VALUE	0x04			/* ACVR ro */
 #define TIMER_CTRL	0x08			/* ACVR rw */
arch/arm/mach-vexpress/core.h +8 -3
index f439715..d3dd491 100644
@@ -1,6 +1,3 @@
-#define __MMIO_P2V(x)	(((x) & 0xfffff) | (((x) & 0x0f000000) >> 4) | 0xf8000000)
-#define MMIO_P2V(x)	((void __iomem *)__MMIO_P2V(x))
-
 #define AMBA_DEVICE(name,busid,base,plat)	\
 struct amba_device name##_device = {		\
 	.dev		= {			\
@@ -17,3 +14,11 @@ struct amba_device name##_device = {		\
 	.irq		= IRQ_##base,		\
 	/* .dma		= DMA_##base,*/		\
 }
+
+/* 2MB large area for motherboard's peripherals static mapping */
+#define V2M_PERIPH 0xf8000000
+#define V2M_PERIPH_P2V(offset) ((void __iomem *)(V2M_PERIPH | (offset)))
+
+/* Tile's peripherals static mappings should start here */
+#define V2T_PERIPH 0xf8200000
+#define V2T_PERIPH_P2V(offset) ((void __iomem *)(V2T_PERIPH | (offset)))
arch/arm/mach-vexpress/ct-ca9x4.c +12 -40
index 2b1e836..bfd3919 100644
@@ -30,57 +30,26 @@
 
 #include <plat/clcd.h>
 
-#define V2M_PA_CS7	0x10000000
-
 static struct map_desc ct_ca9x4_io_desc[] __initdata = {
 	{
-		.virtual	= __MMIO_P2V(CT_CA9X4_MPIC),
-		.pfn		= __phys_to_pfn(CT_CA9X4_MPIC),
-		.length		= SZ_16K,
-		.type		= MT_DEVICE,
-	}, {
-		.virtual	= __MMIO_P2V(CT_CA9X4_SP804_TIMER),
-		.pfn		= __phys_to_pfn(CT_CA9X4_SP804_TIMER),
-		.length		= SZ_4K,
-		.type		= MT_DEVICE,
-	}, {
-		.virtual	= __MMIO_P2V(CT_CA9X4_L2CC),
-		.pfn		= __phys_to_pfn(CT_CA9X4_L2CC),
-		.length		= SZ_4K,
-		.type		= MT_DEVICE,
+		.virtual        = V2T_PERIPH,
+		.pfn            = __phys_to_pfn(CT_CA9X4_MPIC),
+		.length         = SZ_8K,
+		.type           = MT_DEVICE,
 	},
 };
 
 static void __init ct_ca9x4_map_io(void)
 {
-#ifdef CONFIG_LOCAL_TIMERS
-	twd_base = MMIO_P2V(A9_MPCORE_TWD);
-#endif
 	iotable_init(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc));
 }
 
 static void __init ct_ca9x4_init_irq(void)
 {
-	gic_init(0, 29, MMIO_P2V(A9_MPCORE_GIC_DIST),
-		 MMIO_P2V(A9_MPCORE_GIC_CPU));
-}
-
-#if 0
-static void __init ct_ca9x4_timer_init(void)
-{
-	writel(0, MMIO_P2V(CT_CA9X4_TIMER0) + TIMER_CTRL);
-	writel(0, MMIO_P2V(CT_CA9X4_TIMER1) + TIMER_CTRL);
-
-	sp804_clocksource_init(MMIO_P2V(CT_CA9X4_TIMER1), "ct-timer1");
-	sp804_clockevents_init(MMIO_P2V(CT_CA9X4_TIMER0), IRQ_CT_CA9X4_TIMER0,
-		"ct-timer0");
+	gic_init(0, 29, V2T_PERIPH_P2V(A9_MPCORE_GIC_DIST),
+		 V2T_PERIPH_P2V(A9_MPCORE_GIC_CPU));
 }
 
-static struct sys_timer ct_ca9x4_timer = {
-	.init	= ct_ca9x4_timer_init,
-};
-#endif
-
 static void ct_ca9x4_clcd_enable(struct clcd_fb *fb)
 {
 	v2m_cfg_write(SYS_CFG_MUXFPGA | SYS_CFG_SITE_DB1, 0);
@@ -193,6 +162,9 @@ static struct platform_device pmu_device = {
 
 static void __init ct_ca9x4_init_early(void)
 {
+#ifdef CONFIG_LOCAL_TIMERS
+	twd_base = V2T_PERIPH_P2V(A9_MPCORE_TWD);
+#endif
 	clkdev_add_table(lookups, ARRAY_SIZE(lookups));
 }
 
@@ -201,7 +173,7 @@ static void __init ct_ca9x4_init(void)
 	int i;
 
 #ifdef CONFIG_CACHE_L2X0
-	void __iomem *l2x0_base = MMIO_P2V(CT_CA9X4_L2CC);
+	void __iomem *l2x0_base = ioremap(CT_CA9X4_L2CC, SZ_4K);
 
 	/* set RAM latencies to 1 cycle for this core tile. */
 	writel(0, l2x0_base + L2X0_TAG_LATENCY_CTRL);
@@ -219,7 +191,7 @@ static void __init ct_ca9x4_init(void)
 #ifdef CONFIG_SMP
 static void ct_ca9x4_init_cpu_map(void)
 {
-	int i, ncores = scu_get_core_count(MMIO_P2V(A9_MPCORE_SCU));
+	int i, ncores = scu_get_core_count(V2T_PERIPH_P2V(A9_MPCORE_SCU));
 
 	if (ncores > nr_cpu_ids) {
 		pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",
@@ -235,7 +207,7 @@ static void ct_ca9x4_init_cpu_map(void)
 
 static void ct_ca9x4_smp_enable(unsigned int max_cpus)
 {
-	scu_enable(MMIO_P2V(A9_MPCORE_SCU));
+	scu_enable(V2T_PERIPH_P2V(A9_MPCORE_SCU));
 }
 #endif
 
arch/arm/mach-vexpress/include/mach/ct-ca9x4.h +5 -8
index a34d3d4..8f962fb 100644
@@ -22,14 +22,11 @@
 #define CT_CA9X4_SYSWDT		(0x1e007000)
 #define CT_CA9X4_L2CC		(0x1e00a000)
 
-#define CT_CA9X4_TIMER0		(CT_CA9X4_SP804_TIMER + 0x000)
-#define CT_CA9X4_TIMER1		(CT_CA9X4_SP804_TIMER + 0x020)
-
-#define A9_MPCORE_SCU		(CT_CA9X4_MPIC + 0x0000)
-#define A9_MPCORE_GIC_CPU	(CT_CA9X4_MPIC + 0x0100)
-#define A9_MPCORE_GIT		(CT_CA9X4_MPIC + 0x0200)
-#define A9_MPCORE_TWD		(CT_CA9X4_MPIC + 0x0600)
-#define A9_MPCORE_GIC_DIST	(CT_CA9X4_MPIC + 0x1000)
+#define A9_MPCORE_SCU		0x0000
+#define A9_MPCORE_GIC_CPU	0x0100
+#define A9_MPCORE_GIT		0x0200
+#define A9_MPCORE_TWD		0x0600
+#define A9_MPCORE_GIC_DIST	0x1000
 
 /*
  * Interrupts.  Those in {} are for AMBA devices
arch/arm/mach-vexpress/include/mach/motherboard.h +25 -27
index 0a3a375..b4c498c 100644
@@ -39,33 +39,30 @@
 #define V2M_CF			(V2M_PA_CS7 + 0x0001a000)
 #define V2M_CLCD		(V2M_PA_CS7 + 0x0001f000)
 
-#define V2M_SYS_ID		(V2M_SYSREGS + 0x000)
-#define V2M_SYS_SW		(V2M_SYSREGS + 0x004)
-#define V2M_SYS_LED		(V2M_SYSREGS + 0x008)
-#define V2M_SYS_100HZ		(V2M_SYSREGS + 0x024)
-#define V2M_SYS_FLAGS		(V2M_SYSREGS + 0x030)
-#define V2M_SYS_FLAGSSET	(V2M_SYSREGS + 0x030)
-#define V2M_SYS_FLAGSCLR	(V2M_SYSREGS + 0x034)
-#define V2M_SYS_NVFLAGS		(V2M_SYSREGS + 0x038)
-#define V2M_SYS_NVFLAGSSET	(V2M_SYSREGS + 0x038)
-#define V2M_SYS_NVFLAGSCLR	(V2M_SYSREGS + 0x03c)
-#define V2M_SYS_MCI		(V2M_SYSREGS + 0x048)
-#define V2M_SYS_FLASH		(V2M_SYSREGS + 0x03c)
-#define V2M_SYS_CFGSW		(V2M_SYSREGS + 0x058)
-#define V2M_SYS_24MHZ		(V2M_SYSREGS + 0x05c)
-#define V2M_SYS_MISC		(V2M_SYSREGS + 0x060)
-#define V2M_SYS_DMA		(V2M_SYSREGS + 0x064)
-#define V2M_SYS_PROCID0		(V2M_SYSREGS + 0x084)
-#define V2M_SYS_PROCID1		(V2M_SYSREGS + 0x088)
-#define V2M_SYS_CFGDATA		(V2M_SYSREGS + 0x0a0)
-#define V2M_SYS_CFGCTRL		(V2M_SYSREGS + 0x0a4)
-#define V2M_SYS_CFGSTAT		(V2M_SYSREGS + 0x0a8)
-
-#define V2M_TIMER0		(V2M_TIMER01 + 0x000)
-#define V2M_TIMER1		(V2M_TIMER01 + 0x020)
-
-#define V2M_TIMER2		(V2M_TIMER23 + 0x000)
-#define V2M_TIMER3		(V2M_TIMER23 + 0x020)
+/*
+ * Offsets from SYSREGS base
+ */
+#define V2M_SYS_ID		0x000
+#define V2M_SYS_SW		0x004
+#define V2M_SYS_LED		0x008
+#define V2M_SYS_100HZ		0x024
+#define V2M_SYS_FLAGS		0x030
+#define V2M_SYS_FLAGSSET	0x030
+#define V2M_SYS_FLAGSCLR	0x034
+#define V2M_SYS_NVFLAGS		0x038
+#define V2M_SYS_NVFLAGSSET	0x038
+#define V2M_SYS_NVFLAGSCLR	0x03c
+#define V2M_SYS_MCI		0x048
+#define V2M_SYS_FLASH		0x03c
+#define V2M_SYS_CFGSW		0x058
+#define V2M_SYS_24MHZ		0x05c
+#define V2M_SYS_MISC		0x060
+#define V2M_SYS_DMA		0x064
+#define V2M_SYS_PROCID0		0x084
+#define V2M_SYS_PROCID1		0x088
+#define V2M_SYS_CFGDATA		0x0a0
+#define V2M_SYS_CFGCTRL		0x0a4
+#define V2M_SYS_CFGSTAT		0x0a8
 
 
 /*
@@ -117,6 +114,7 @@
 
 int v2m_cfg_write(u32 devfn, u32 data);
 int v2m_cfg_read(u32 devfn, u32 *data);
+void v2m_flags_set(u32 data);
 
 /*
  * Core tile IDs
arch/arm/mach-vexpress/platsmp.c +0 -0
index 2b5f7ac..e8be99d 100644

arch/arm/mach-vexpress/platsmp.c void __init platform_smp_prepare_cpus(unsigned int max_cpus) · line 48

Quoted 7 lines
arch/arm/mach-vexpress/platsmp.c +1 -3
@@ -45,7 +45,5 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
 	 * until it receives a soft interrupt, and then the
 	 * secondary CPU branches to this address.
 	 */
-	writel(~0, MMIO_P2V(V2M_SYS_FLAGSCLR));
-	writel(BSYM(virt_to_phys(versatile_secondary_startup)),
-		MMIO_P2V(V2M_SYS_FLAGSSET));
+	v2m_flags_set(BSYM(virt_to_phys(versatile_secondary_startup)));

This isn't a new issue, but BSYM() should only be used in assembler (mostly because gas is too stupid to know whether local symbols are ARM or Thumb in a systematic way). Here, it's needed because headsmp.S is missing an ENDPROC directive, so the assembler does not properly mark the type of that symbol.

Try this (untested):

arch/arm/plat-versatile/headsmp.S +1 -0
index d397a1f..0be2efc 100644
@@ -28,6 +28,7 @@ ENTRY(versatile_secondary_startup)
 pen:	ldr	r7, [r6]
 	cmp	r7, r0
 	bne	pen
+ENDPROC(versatile_secondary_startup)
 
 	/*
 	 * we've been released from the holding pen: secondary_stack
arch/arm/mach-vexpress/platsmp.c +1 -3
index 2b5f7ac..124ffb1 100644
@@ -13,8 +13,6 @@
 #include <linux/smp.h>
 #include <linux/io.h>
 
-#include <asm/unified.h>
-
 #include <mach/motherboard.h>
 #define V2M_PA_CS7 0x10000000
 
@@ -46,6 +44,6 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
 	 * secondary CPU branches to this address.
 	 */
 	writel(~0, MMIO_P2V(V2M_SYS_FLAGSCLR));
-	writel(BSYM(virt_to_phys(versatile_secondary_startup)),
+	writel(virt_to_phys(versatile_secondary_startup),
 		MMIO_P2V(V2M_SYS_FLAGSSET));
 }

Obviously, this doesn't make a difference unless you build with CONFIG_THUMB2_KERNEL=y.

Quoted 169 lines
arch/arm/mach-vexpress/platsmp.c +0 -0
 }
arch/arm/mach-vexpress/v2m.c +48 -28
index 1fafc32..ee52b35 100644
@@ -39,29 +39,41 @@
 
 static struct map_desc v2m_io_desc[] __initdata = {
 	{
-		.virtual	= __MMIO_P2V(V2M_PA_CS7),
+		.virtual	= V2M_PERIPH,
 		.pfn		= __phys_to_pfn(V2M_PA_CS7),
 		.length		= SZ_128K,
 		.type		= MT_DEVICE,
 	},
 };
 
+static void __iomem *v2m_sysreg_base;
+
 static void __init v2m_timer_init(void)
 {
-	u32 scctrl;
-
-	/* Select 1MHz TIMCLK as the reference clock for SP804 timers */
-	scctrl = readl(MMIO_P2V(V2M_SYSCTL + SCCTRL));
-	scctrl |= SCCTRL_TIMEREN0SEL_TIMCLK;
-	scctrl |= SCCTRL_TIMEREN1SEL_TIMCLK;
-	writel(scctrl, MMIO_P2V(V2M_SYSCTL + SCCTRL));
-
-	writel(0, MMIO_P2V(V2M_TIMER0) + TIMER_CTRL);
-	writel(0, MMIO_P2V(V2M_TIMER1) + TIMER_CTRL);
-
-	sp804_clocksource_init(MMIO_P2V(V2M_TIMER1), "v2m-timer1");
-	sp804_clockevents_init(MMIO_P2V(V2M_TIMER0), IRQ_V2M_TIMER0,
-		"v2m-timer0");
+	void __iomem *sysctl_base;
+	void __iomem *timer01_base;
+
+	sysctl_base = ioremap(V2M_SYSCTL, SZ_4K);
+	WARN_ON(!sysctl_base);
+	if (sysctl_base) {
+		/* Select 1MHz TIMCLK as the reference clock for SP804 timers */
+		u32 scctrl = readl(sysctl_base + SCCTRL);
+		scctrl |= SCCTRL_TIMEREN0SEL_TIMCLK;
+		scctrl |= SCCTRL_TIMEREN1SEL_TIMCLK;
+		writel(scctrl, sysctl_base + SCCTRL);
+	}
+
+	timer01_base = ioremap(V2M_TIMER01, SZ_4K);
+	WARN_ON(!timer01_base);
+	if (timer01_base) {
+		writel(0, timer01_base + TIMER_1_BASE + TIMER_CTRL);
+		writel(0, timer01_base + TIMER_2_BASE + TIMER_CTRL);
+
+		sp804_clocksource_init(timer01_base + TIMER_2_BASE,
+				"v2m-timer1");
+		sp804_clockevents_init(timer01_base + TIMER_1_BASE,
+				IRQ_V2M_TIMER0, "v2m-timer0");
+	}
 }
 
 static struct sys_timer v2m_timer = {
@@ -81,14 +93,14 @@ int v2m_cfg_write(u32 devfn, u32 data)
 	devfn |= SYS_CFG_START | SYS_CFG_WRITE;
 
 	spin_lock(&v2m_cfg_lock);
-	val = readl(MMIO_P2V(V2M_SYS_CFGSTAT));
-	writel(val & ~SYS_CFG_COMPLETE, MMIO_P2V(V2M_SYS_CFGSTAT));
+	val = readl(v2m_sysreg_base + V2M_SYS_CFGSTAT);
+	writel(val & ~SYS_CFG_COMPLETE, v2m_sysreg_base + V2M_SYS_CFGSTAT);
 
-	writel(data, MMIO_P2V(V2M_SYS_CFGDATA));
-	writel(devfn, MMIO_P2V(V2M_SYS_CFGCTRL));
+	writel(data, v2m_sysreg_base +  V2M_SYS_CFGDATA);
+	writel(devfn, v2m_sysreg_base + V2M_SYS_CFGCTRL);
 
 	do {
-		val = readl(MMIO_P2V(V2M_SYS_CFGSTAT));
+		val = readl(v2m_sysreg_base + V2M_SYS_CFGSTAT);
 	} while (val == 0);
 	spin_unlock(&v2m_cfg_lock);
 
@@ -102,22 +114,28 @@ int v2m_cfg_read(u32 devfn, u32 *data)
 	devfn |= SYS_CFG_START;
 
 	spin_lock(&v2m_cfg_lock);
-	writel(0, MMIO_P2V(V2M_SYS_CFGSTAT));
-	writel(devfn, MMIO_P2V(V2M_SYS_CFGCTRL));
+	writel(0, v2m_sysreg_base + V2M_SYS_CFGSTAT);
+	writel(devfn, v2m_sysreg_base + V2M_SYS_CFGCTRL);
 
 	mb();
 
 	do {
 		cpu_relax();
-		val = readl(MMIO_P2V(V2M_SYS_CFGSTAT));
+		val = readl(v2m_sysreg_base + V2M_SYS_CFGSTAT);
 	} while (val == 0);
 
-	*data = readl(MMIO_P2V(V2M_SYS_CFGDATA));
+	*data = readl(v2m_sysreg_base + V2M_SYS_CFGDATA);
 	spin_unlock(&v2m_cfg_lock);
 
 	return !!(val & SYS_CFG_ERR);
 }
 
+void __init v2m_flags_set(u32 data)
+{
+	writel(~0, v2m_sysreg_base + V2M_SYS_FLAGSCLR);
+	writel(data, v2m_sysreg_base + V2M_SYS_FLAGSSET);
+}
+
 
 static struct resource v2m_pcie_i2c_resource = {
 	.start	= V2M_SERIAL_BUS_PCI,
@@ -203,7 +221,7 @@ static struct platform_device v2m_usb_device = {
 
 static void v2m_flash_set_vpp(struct platform_device *pdev, int on)
 {
-	writel(on != 0, MMIO_P2V(V2M_SYS_FLASH));
+	writel(on != 0, v2m_sysreg_base + V2M_SYS_FLASH);
 }
 
 static struct physmap_flash_data v2m_flash_data = {
@@ -257,7 +275,7 @@ static struct platform_device v2m_cf_device = {
 
 static unsigned int v2m_mmci_status(struct device *dev)
 {
-	return readl(MMIO_P2V(V2M_SYS_MCI)) & (1 << 0);
+	return readl(v2m_sysreg_base + V2M_SYS_MCI) & (1 << 0);
 }
 
 static struct mmci_platform_data v2m_mmci_data = {
@@ -370,7 +388,7 @@ static void __init v2m_init_early(void)
 {
 	ct_desc->init_early();
 	clkdev_add_table(v2m_lookups, ARRAY_SIZE(v2m_lookups));
-	versatile_sched_clock_init(MMIO_P2V(V2M_SYS_24MHZ), 24000000);
+	versatile_sched_clock_init(v2m_sysreg_base + V2M_SYS_24MHZ, 24000000);
 }
 
 static void v2m_power_off(void)
@@ -399,7 +417,8 @@ static void __init v2m_populate_ct_desc(void)
 	u32 current_tile_id;
 
 	ct_desc = NULL;
-	current_tile_id = readl(MMIO_P2V(V2M_SYS_PROCID0)) & V2M_CT_ID_MASK;
+	current_tile_id = readl(v2m_sysreg_base + V2M_SYS_PROCID0)
+				& V2M_CT_ID_MASK;
 
 	for (i = 0; i < ARRAY_SIZE(ct_descs) && !ct_desc; ++i)
 		if (ct_descs[i]->id == current_tile_id)
@@ -413,6 +432,7 @@ static void __init v2m_populate_ct_desc(void)
 static void __init v2m_map_io(void)
 {
 	iotable_init(v2m_io_desc, ARRAY_SIZE(v2m_io_desc));
+	v2m_sysreg_base = V2M_PERIPH_P2V(V2M_SYSREGS);
 	v2m_populate_ct_desc();
 	ct_desc->map_io();
 }
Signature · 8 lines
1.6.3.3



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
author
#3 lore raw

PATCH v2 1/4 ARM: vexpress: Get rid of MMIO_P2V

Quoted 28 lines · Dave Martin

Try this (untested):

arch/arm/plat-versatile/headsmp.S +1 -0
index d397a1f..0be2efc 100644
@@ -28,6 +28,7 @@ ENTRY(versatile_secondary_startup)
 pen:   ldr     r7, [r6]
        cmp     r7, r0
        bne     pen
+ENDPROC(versatile_secondary_startup)
 
        /*
         * we've been released from the holding pen: secondary_stack
arch/arm/mach-vexpress/platsmp.c +0 -2
index 2b5f7ac..124ffb1 100644
@@ -13,8 +13,6 @@
 #include <linux/smp.h>
 #include <linux/io.h>
 
-#include <asm/unified.h>
-
 #include <mach/motherboard.h>
 #define V2M_PA_CS7 0x10000000
 

arch/arm/mach-vexpress/platsmp.c void __init platform_smp_prepare_cpus(unsigned int max_cpus) · line 49

Quoted 7 lines
arch/arm/mach-vexpress/platsmp.c +1 -1
@@ -46,6 +44,6 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
         * secondary CPU branches to this address.
         */
        writel(~0, MMIO_P2V(V2M_SYS_FLAGSCLR));
-       writel(BSYM(virt_to_phys(versatile_secondary_startup)),
+       writel(virt_to_phys(versatile_secondary_startup),
                MMIO_P2V(V2M_SYS_FLAGSSET));
 }

Sure thing, will try that.

Cheers!

Pawe?

#4 lore raw

PATCH v2 1/4 ARM: vexpress: Get rid of MMIO_P2V

In reply to Dave Martin

arch/arm/plat-versatile/headsmp.S ENTRY(versatile_secondary_startup) · line 31

Quoted 9 lines · Dave Martin
arch/arm/plat-versatile/headsmp.S +1 -0
index d397a1f..0be2efc 100644
@@ -28,6 +28,7 @@ ENTRY(versatile_secondary_startup)
 pen:	ldr	r7, [r6]
 	cmp	r7, r0
 	bne	pen
+ENDPROC(versatile_secondary_startup)

This is wrong. You're telling the assembler that this function ends here. It doesn't, it continues on. Put the ENDPROC at the end of the function.

#5 lore raw

PATCH v2 1/4 ARM: vexpress: Get rid of MMIO_P2V

Quoted 13 lines · Russell King - ARM Linux

arch/arm/plat-versatile/headsmp.S ENTRY(versatile_secondary_startup) · line 31

Quoted 9 lines · Dave Martin
arch/arm/plat-versatile/headsmp.S +1 -0
index d397a1f..0be2efc 100644
@@ -28,6 +28,7 @@ ENTRY(versatile_secondary_startup)
 pen:	ldr	r7, [r6]
 	cmp	r7, r0
 	bne	pen
+ENDPROC(versatile_secondary_startup)

This is wrong. You're telling the assembler that this function ends here. It doesn't, it continues on. Put the ENDPROC at the end of the function.

Dunno what I was thinking of there -- agreed, the ENDPROC() should move to the end of the file.

(I'm assuming that literals should be included in the size of the relevant function symbol here -- that's the convention the compiler follows.)

Cheers
---Dave

author
#6 lore raw

PATCH v2 2/4 ARM: vexpress: Add DT support in v2m

In reply to Pawel Moll

This patch provides hooks for DT-based tile machine implementations and adds Device Tree description for the motherboard.

---
 Documentation/devicetree/bindings/arm/vexpress    |  101 +++++++++++
 arch/arm/boot/dts/vexpress-v2m.dtsi               |  191 +++++++++++++++++++++
 arch/arm/mach-vexpress/Kconfig                    |    6 +
 arch/arm/mach-vexpress/core.h                     |   10 +
 arch/arm/mach-vexpress/include/mach/motherboard.h |    6 +
 arch/arm/mach-vexpress/v2m.c                      |  141 ++++++++++++++-
 6 files changed, 447 insertions(+), 8 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/vexpress
 create mode 100644 arch/arm/boot/dts/vexpress-v2m.dtsi
Documentation/devicetree/bindings/arm/vexpress new file +101 -0
new file mode 100644
index 0000000..4b2c3bf
@@ -0,0 +1,101 @@
+ARM Versatile Express boards family
+-----------------------------------
+
+ARM's Versatile Express platform consists of a motherboard
+and one or more daughterboards (tiles). The motherboard provides
+set of peripherals. Processor and RAM "live" on the tiles.
+Both parts of the system should be described in two separate
+Device Tree source files, with the tile's description including
+motherboard's file. As the motherboard can be initialized in one
+of different configurations ("memory maps"), care must be taken
+to include the correct one.
+
+Required properties in the root node:
+- compatible value:
+	compatible = "arm,vexpress-<model>";
+  where <model> is the full tile model name (as used in the tiles's
+  Technical Reference Manual), eg:
+  - for Coretile Express A5x2 (V2P-CA5s):
+	compatible = "arm,vexpress-v2p-ca5s";
+  - Coretile Express A9x4 (V2P-CA9):
+	compatible = "arm,vexpress-v2p-ca9";
+
+Current Linux implementation requires a "timer" alias pointing
+at one of the SP804 timer blocks to be used when tile is not using
+local timer source.
+
+Optional properties in the root node:
+- tile model name (use the same names as in the tile's Technical
+  Reference Manuals, eg. "V2P-CA5s")
+	model = "<model>";
+- tile's HBI number (unique ARM's board model ID, visible on the
+  PCB's silkscreen) in hexadecimal transcription:
+	arm,hbi = <0xhbi>
+  eg:
+  - for Coretile Express A5x2 (V2P-CA5s) HBI-0191:
+	arm,hbi = <0x191>;
+  - Coretile Express A9x4 (V2P-CA9) HBI-0225:
+	arm,hbi = <0x225>;
+
+The motherboard description file provides single "motherboard" node
+using 2 address cells corresponding to the Static Memory Bus used
+between the motherboard and the tile. First cell defines Chip Select
+(CS) line number, the second cell address offset within the CS.
+All interrupts lines between the motherboard and the tile are active
+high and are described using single cell.
+
+Optional properties of the "motherboard" node:
+- motherboard's memory map variant:
+	arm,v2m-memory-map = "<name>";
+  where name is one of:
+  - "rs1" - for RS1 map (i.a. peripherals on CS3); this map is also
+            referred to as "ARM Cortex-A Series memory map":
+	arm,v2m-memory-map = "rs1";
+  When this property is missing, the motherboard is using original
+  memory map (also known as "Legacy memory map") with peripherals
+  on CS7.
+
+Motherboard .dtsi files provide set of phandles to peripherals that
+can be used in the tile's aliases node:
+- UARTs:
+	mb_serial0, mb_serial1, mb_serial2 and mb_serial3
+- I2C controllers:
+	mb_i2c_dvi and mb_i2c_pcie
+- SP804 timers:
+	mb_timer01 and mb_timer23
+
+The tile description must define "ranges", "interrupt-map-mask" and
+"interrupt-map" properties to translate the motherboard's address
+and interrupt space into one used by the tile's processor.
+
+Abbreviated example:
+
+/dts-v1/;
+
+/include/ "skeleton.dtsi"
+
+/ {
+	model = "V2P-CA5s";
+	arm,hbi = <0x225>;
+	compatible = "arm,vexpress-v2p-ca5s";
+	interrupt-parent = <&gic>;
+
+	aliases {
+		serial0 = &mb_serial0;
+		timer = &mb_timer01;
+	};
+
+	gic: interrupt-controller at 2c001000 {
+		compatible = "arm,cortex-a9-gic";
+	};
+
+	motherboard {
+		/* CS0 is visible at 0x08000000 */
+		ranges = <0 0 0x08000000 0x04000000>;
+		interrupt-map-mask = <0 0 63>;
+		/* Active high IRQ 0 is connected to GIC's SPI0 */
+		interrupt-map = <0 0  0 &gic 0  0 4>;
+	};
+}
+
+/include/ "vexpress-v2m-rs1.dtsi"
arch/arm/boot/dts/vexpress-v2m.dtsi new file +191 -0

191 lines not on this page · raw message

arch/arm/mach-vexpress/Kconfig +6 -0
index 9311484..6a6fa22 100644
@@ -9,4 +9,10 @@ config ARCH_VEXPRESS_CA9X4
 	select ARM_ERRATA_751472
 	select ARM_ERRATA_753970
 
+config ARCH_VEXPRESS_DT
+	bool
+	select OF
+	help
+	  VE platform *requiring* Flattened Device Tree to boot.
+
 endmenu
arch/arm/mach-vexpress/core.h +10 -0
index d3dd491..21cc48b 100644
@@ -22,3 +22,13 @@ struct amba_device name##_device = {		\
 /* Tile's peripherals static mappings should start here */
 #define V2T_PERIPH 0xf8200000
 #define V2T_PERIPH_P2V(offset) ((void __iomem *)(V2T_PERIPH | (offset)))
+
+#if defined(CONFIG_ARCH_VEXPRESS_DT)
+
+extern struct sys_timer v2m_timer;
+
+void __init v2m_dt_map_io(void);
+void __init v2m_dt_init_early(void);
+struct of_dev_auxdata * __init v2m_dt_get_auxdata(void);
+
+#endif
arch/arm/mach-vexpress/include/mach/motherboard.h +6 -0
index b4c498c..31a9289 100644
@@ -117,6 +117,12 @@ int v2m_cfg_read(u32 devfn, u32 *data);
 void v2m_flags_set(u32 data);
 
 /*
+ * Miscellaneous
+ */
+#define SYS_MISC_MASTERSITE	(1 << 14)
+#define SYS_PROCIDx_HBI_MASK	0xfff
+
+/*
  * Core tile IDs
  */
 #define V2M_CT_ID_CA9		0x0c000191
arch/arm/mach-vexpress/v2m.c +133 -8

178 lines not on this page · raw message

Signature · 1 line
1.6.3.3
author
#7 lore raw

PATCH v2 2/4 ARM: vexpress: Add DT support in v2m

Quoted 4 lines · Pawel Moll
arch/arm/mach-vexpress/v2m.c +0 -0
index ee52b35..fd7ee1f 100644

[...]

arch/arm/mach-vexpress/v2m.c static void __iomem *v2m_sysreg_base; · line 78

Quoted 11 lines
arch/arm/mach-vexpress/v2m.c +11 -0
+		node = of_find_compatible_node(NULL, NULL, "arm,sp810");
+		if (node)
+			sysctl_base = of_iomap(node, 0);
+
+		err = of_property_read_string(of_aliases, "timer", &path);
+		if (!err)
+			node = of_find_node_by_path(path);
+		if (node) {
+			timer01_base = of_iomap(node, 0);
+			timer01_irq = irq_of_parse_and_map(node, 0);
+		}

I've just realized that this fragment should actually look like that:

                node = of_find_compatible_node(NULL, NULL, "arm,sp810");
                sysctl_base = of_iomap(node, 0);
                
                err = of_property_read_string(of_aliases, "timer", &path);
                if (!err) {
                        node = of_find_node_by_path(path);
                        timer01_base = of_iomap(node, 0);
                        timer01_irq = irq_of_parse_and_map(node, 0);
                }

I will change that.

Cheers!

Pawel

#8 lore raw

PATCH v2 2/4 ARM: vexpress: Add DT support in v2m

In reply to Pawel Moll
Quoted 21 lines · Pawel Moll

This patch provides hooks for DT-based tile machine implementations and adds Device Tree description for the motherboard.

---
 Documentation/devicetree/bindings/arm/vexpress    |  101 +++++++++++
 arch/arm/boot/dts/vexpress-v2m.dtsi               |  191 +++++++++++++++++++++
 arch/arm/mach-vexpress/Kconfig                    |    6 +
 arch/arm/mach-vexpress/core.h                     |   10 +
 arch/arm/mach-vexpress/include/mach/motherboard.h |    6 +
 arch/arm/mach-vexpress/v2m.c                      |  141 ++++++++++++++-
 6 files changed, 447 insertions(+), 8 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/vexpress
 create mode 100644 arch/arm/boot/dts/vexpress-v2m.dtsi
Documentation/devicetree/bindings/arm/vexpress new file +0 -0
new file mode 100644
index 0000000..4b2c3bf

Documentation/devicetree/bindings/arm/vexpress line 6

Quoted 6 lines
Documentation/devicetree/bindings/arm/vexpress new file +6 -0
@@ -0,0 +1,101 @@
+ARM Versatile Express boards family
+-----------------------------------
+
+ARM's Versatile Express platform consists of a motherboard
+and one or more daughterboards (tiles). The motherboard provides
+set of peripherals. Processor and RAM "live" on the tiles.

[Since this text is now stable enough to be proofread, I'll list minor pedantic nits along with the other comments -- they aren't vital to the meaning though, and the documentation still "works" if they aren't acted on.]

s/set of/a set of/

Documentation/devicetree/bindings/arm/vexpress line 8

Quoted 2 lines
Documentation/devicetree/bindings/arm/vexpress new file +2 -0
+Both parts of the system should be described in two separate
+Device Tree source files, with the tile's description including

The motherboard and each core tile should be described by a separate Device Tree source file, with [...]

Documentation/devicetree/bindings/arm/vexpress line 9

Quoted 1 line
Documentation/devicetree/bindings/arm/vexpress new file +1 -0
+motherboard's file. As the motherboard can be initialized in one

[...] including the motherboard file using a /include directive. [...]

Documentation/devicetree/bindings/arm/vexpress line 10

Quoted 1 line
Documentation/devicetree/bindings/arm/vexpress new file +1 -0
+of different configurations ("memory maps"), care must be taken

s/of different/of two different/

Documentation/devicetree/bindings/arm/vexpress line 21

Quoted 11 lines
Documentation/devicetree/bindings/arm/vexpress new file +11 -0
+to include the correct one.
+
+Required properties in the root node:
+- compatible value:
+	compatible = "arm,vexpress-<model>";
+  where <model> is the full tile model name (as used in the tiles's
+  Technical Reference Manual), eg:
+  - for Coretile Express A5x2 (V2P-CA5s):
+	compatible = "arm,vexpress-v2p-ca5s";
+  - Coretile Express A9x4 (V2P-CA9):
+	compatible = "arm,vexpress-v2p-ca9";

Should the bindings for the tiles be formally documented here? If this is the only place they are mentioned, this is the real list and not just examples, so lose the "eg".

I suspect that we won't see enough platforms getting added to lead to non-trivial merge conflicts in this file, but if that's a concern we could split those bindings out.

Documentation/devicetree/bindings/arm/vexpress line 25

Quoted 4 lines
Documentation/devicetree/bindings/arm/vexpress new file +4 -0
+
+Current Linux implementation requires a "timer" alias pointing
+at one of the SP804 timer blocks to be used when tile is not using
+local timer source.

"local timer source" might be confusing terminology.

Is this supposed to encompass sp804 or other timer blocks which may be present on the coretile, or just the architected timers? Or is this supposed to identify a fallback timer used by the motherboard code in case the coretile code doesn't set up its own timer source?

Quoted 6 lines
Documentation/devicetree/bindings/arm/vexpress new file +6 -0
+
+Optional properties in the root node:
+- tile model name (use the same names as in the tile's Technical
+  Reference Manuals, eg. "V2P-CA5s")
+	model = "<model>";
+- tile's HBI number (unique ARM's board model ID, visible on the

Documentation/devicetree/bindings/arm/vexpress line 40

Quoted 10 lines
Documentation/devicetree/bindings/arm/vexpress new file +9 -0
+  PCB's silkscreen) in hexadecimal transcription:
+	arm,hbi = <0xhbi>
 
+  eg:
+  - for Coretile Express A5x2 (V2P-CA5s) HBI-0191:
+	arm,hbi = <0x191>;
+  - Coretile Express A9x4 (V2P-CA9) HBI-0225:
+	arm,hbi = <0x225>;
+
+The motherboard description file provides single "motherboard" node

s/provides single/provides a single/

Documentation/devicetree/bindings/arm/vexpress line 42

Quoted 2 lines
Documentation/devicetree/bindings/arm/vexpress new file +2 -0
+using 2 address cells corresponding to the Static Memory Bus used
+between the motherboard and the tile. First cell defines Chip Select

s/First/The first/
s/Chip Select/the Chip Select/

Documentation/devicetree/bindings/arm/vexpress line 44

Quoted 2 lines
Documentation/devicetree/bindings/arm/vexpress new file +2 -0
+(CS) line number, the second cell address offset within the CS.
+All interrupts lines between the motherboard and the tile are active

s/interrupts/interrupt/

Documentation/devicetree/bindings/arm/vexpress line 56

Quoted 12 lines
Documentation/devicetree/bindings/arm/vexpress new file +12 -0
+high and are described using single cell.
+
+Optional properties of the "motherboard" node:
+- motherboard's memory map variant:
+	arm,v2m-memory-map = "<name>";
+  where name is one of:
+  - "rs1" - for RS1 map (i.a. peripherals on CS3); this map is also
+            referred to as "ARM Cortex-A Series memory map":
+	arm,v2m-memory-map = "rs1";
+  When this property is missing, the motherboard is using original
+  memory map (also known as "Legacy memory map") with peripherals
+  on CS7.

It could be helpful to clarify where the original memory map applies:

"This memory map is primarily used by the original CoreTile Express A9x4."

Documentation/devicetree/bindings/arm/vexpress

Quoted 2 lines
Documentation/devicetree/bindings/arm/vexpress new file +2 -0
+
+Motherboard .dtsi files provide set of phandles to peripherals that

s/provide set/provide a set/

I think strictly speaking, those .dtsi files define labels, not phandles. A phandle is a numerical identifier for a node (also derivable symbolically from a label using the &label syntax in the DT source.

Documentation/devicetree/bindings/arm/vexpress line 65

Quoted 7 lines
Documentation/devicetree/bindings/arm/vexpress new file +7 -0
+can be used in the tile's aliases node:
+- UARTs:
+	mb_serial0, mb_serial1, mb_serial2 and mb_serial3
+- I2C controllers:
+	mb_i2c_dvi and mb_i2c_pcie
+- SP804 timers:
+	mb_timer01 and mb_timer23

For the UARTs, it may be worth adding a comment that the numbers correspond to the labelled physical UARTs on the motherboard.

The I2C and timer names are probably sufficiently obvious, though.

Quoted 329 lines
Documentation/devicetree/bindings/arm/vexpress new file +36 -0
+
+The tile description must define "ranges", "interrupt-map-mask" and
+"interrupt-map" properties to translate the motherboard's address
+and interrupt space into one used by the tile's processor.
+
+Abbreviated example:
+
+/dts-v1/;
+
+/include/ "skeleton.dtsi"
+
+/ {
+	model = "V2P-CA5s";
+	arm,hbi = <0x225>;
+	compatible = "arm,vexpress-v2p-ca5s";
+	interrupt-parent = <&gic>;
+
+	aliases {
+		serial0 = &mb_serial0;
+		timer = &mb_timer01;
+	};
+
+	gic: interrupt-controller at 2c001000 {
+		compatible = "arm,cortex-a9-gic";
+	};
+
+	motherboard {
+		/* CS0 is visible at 0x08000000 */
+		ranges = <0 0 0x08000000 0x04000000>;
+		interrupt-map-mask = <0 0 63>;
+		/* Active high IRQ 0 is connected to GIC's SPI0 */
+		interrupt-map = <0 0  0 &gic 0  0 4>;
+	};
+}
+
+/include/ "vexpress-v2m-rs1.dtsi"
arch/arm/boot/dts/vexpress-v2m.dtsi new file +191 -0
new file mode 100644
index 0000000..364e44c
@@ -0,0 +1,191 @@
+/*
+ * ARM Ltd. Versatile Express
+ *
+ * Motherboard Express uATX
+ * V2M-P1
+ *
+ * HBI-0190D
+ *
+ * Original memory map ("Legacy memory map" in the board's
+ * Technical Reference Manual)
+ *
+ * WARNING! The hardware described in this file is independent from the
+ * RS1 variant (vexpress-v2m-rs1.dtsi), but there is a strong
+ * correspondence between the two configurations.
+ *
+ * TAKE CARE WHEN MAINTAINING THIS FILE TO PROPAGATE ANY RELEVANT
+ * CHANGES TO vexpress-v2m-rs1.dtsi!
+ */
+
+/ {
+	motherboard {
+		compatible = "simple-bus";
+		#address-cells = <2>; /* SMB chipselect number and offset */
+		#size-cells = <1>;
+		#interrupt-cells = <1>;
+
+		flash at 0,00000000 {
+			compatible = "arm,vexpress-flash", "cfi-flash";
+			reg = <0 0x00000000 0x04000000>,
+			      <1 0x00000000 0x04000000>;
+			bank-width = <4>;
+		};
+
+		psram at 2,00000000 {
+			compatible = "mtd-ram";
+			reg = <2 0x00000000 0x02000000>;
+			bank-width = <4>;
+		};
+
+		ethernet at 3,02000000 {
+			compatible = "smsc,lan9118", "smsc,lan9115";
+			reg = <3 0x02000000 0x10000>;
+			interrupts = <15>;
+			phy-mode = "mii";
+			reg-io-width = <4>;
+			smsc,irq-active-high;
+			smsc,irq-push-pull;
+		};
+
+		usb at 3,03000000 {
+			compatible = "nxp,usb-isp1761";
+			reg = <3 0x03000000 0x20000>;
+			interrupts = <16>;
+			port1-otg;
+		};
+
+		iofpga at 7,00000000 {
+			compatible = "arm,amba-bus", "simple-bus";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0 7 0 0x20000>;
+
+			sysreg at 00000 {
+				compatible = "arm,vexpress-sysreg";
+				reg = <0x00000 0x1000>;
+			};
+
+			sysctl at 01000 {
+				compatible = "arm,sp810", "arm,primecell";
+				reg = <0x01000 0x1000>;
+			};
+
+			/* PCI-E I2C bus */
+			mb_i2c_pcie: i2c at 02000 {
+				compatible = "arm,versatile-i2c";
+				reg = <0x02000 0x1000>;
+
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				pcie-switch at 60 {
+					compatible = "idt,89hpes32h8";
+					reg = <0x60>;
+				};
+			};
+
+			aaci at 04000 {
+				compatible = "arm,pl041", "arm,primecell";
+				reg = <0x04000 0x1000>;
+				interrupts = <11>;
+			};
+
+			mmci at 05000 {
+				compatible = "arm,pl180", "arm,primecell";
+				reg = <0x05000 0x1000>;
+				interrupts = <9 10>;
+			};
+
+			kmi at 06000 {
+				compatible = "arm,pl050", "arm,primecell";
+				reg = <0x06000 0x1000>;
+				interrupts = <12>;
+			};
+
+			kmi at 07000 {
+				compatible = "arm,pl050", "arm,primecell";
+				reg = <0x07000 0x1000>;
+				interrupts = <13>;
+			};
+
+			mb_serial0: uart at 09000 {
+				compatible = "arm,pl011", "arm,primecell";
+				reg = <0x09000 0x1000>;
+				interrupts = <5>;
+			};
+
+			mb_serial1: uart at 0a000 {
+				compatible = "arm,pl011", "arm,primecell";
+				reg = <0x0a000 0x1000>;
+				interrupts = <6>;
+			};
+
+			mb_serial2: uart at 0b000 {
+				compatible = "arm,pl011", "arm,primecell";
+				reg = <0x0b000 0x1000>;
+				interrupts = <7>;
+			};
+
+			mb_serial3: uart at 0c000 {
+				compatible = "arm,pl011", "arm,primecell";
+				reg = <0x0c000 0x1000>;
+				interrupts = <8>;
+			};
+
+			wdt at 0f000 {
+				compatible = "arm,sp805", "arm,primecell";
+				reg = <0x0f000 0x1000>;
+				interrupts = <0>;
+			};
+
+			mb_timer01: timer at 11000 {
+				compatible = "arm,sp804", "arm,primecell";
+				reg = <0x11000 0x1000>;
+				interrupts = <2>;
+			};
+
+			mb_timer23: timer at 12000 {
+				compatible = "arm,sp804", "arm,primecell";
+				reg = <0x12000 0x1000>;
+			};
+
+			/* DVI I2C bus */
+			mb_i2c_dvi: i2c at 16000 {
+				compatible = "arm,versatile-i2c";
+				reg = <0x16000 0x1000>;
+
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				dvi-transmitter at 39 {
+					compatible = "sil,sii9022-tpi", "sil,sii9022";
+					reg = <0x39>;
+				};
+
+				dvi-transmitter at 60 {
+					compatible = "sil,sii9022-cpi", "sil,sii9022";
+					reg = <0x60>;
+				};
+			};
+
+			rtc at 17000 {
+				compatible = "arm,pl031", "arm,primecell";
+				reg = <0x17000 0x1000>;
+				interrupts = <4>;
+			};
+
+			compact-flash at 1a000 {
+				compatible = "ata-generic";
+				reg = <0x1a000 0x100
+				       0x1a100 0xf00>;
+				reg-shift = <2>;
+			};
+
+			clcd at 1f000 {
+				compatible = "arm,pl111", "arm,primecell";
+				reg = <0x1f000 0x1000>;
+				interrupts = <14>;
+			};
+		};
+	};
+};
arch/arm/mach-vexpress/Kconfig +6 -0
index 9311484..6a6fa22 100644
@@ -9,4 +9,10 @@ config ARCH_VEXPRESS_CA9X4
 	select ARM_ERRATA_751472
 	select ARM_ERRATA_753970
 
+config ARCH_VEXPRESS_DT
+	bool
+	select OF
+	help
+	  VE platform *requiring* Flattened Device Tree to boot.
+
 endmenu
arch/arm/mach-vexpress/core.h +10 -0
index d3dd491..21cc48b 100644
@@ -22,3 +22,13 @@ struct amba_device name##_device = {		\
 /* Tile's peripherals static mappings should start here */
 #define V2T_PERIPH 0xf8200000
 #define V2T_PERIPH_P2V(offset) ((void __iomem *)(V2T_PERIPH | (offset)))
+
+#if defined(CONFIG_ARCH_VEXPRESS_DT)
+
+extern struct sys_timer v2m_timer;
+
+void __init v2m_dt_map_io(void);
+void __init v2m_dt_init_early(void);
+struct of_dev_auxdata * __init v2m_dt_get_auxdata(void);
+
+#endif
arch/arm/mach-vexpress/include/mach/motherboard.h +6 -0
index b4c498c..31a9289 100644
@@ -117,6 +117,12 @@ int v2m_cfg_read(u32 devfn, u32 *data);
 void v2m_flags_set(u32 data);
 
 /*
+ * Miscellaneous
+ */
+#define SYS_MISC_MASTERSITE	(1 << 14)
+#define SYS_PROCIDx_HBI_MASK	0xfff
+
+/*
  * Core tile IDs
  */
 #define V2M_CT_ID_CA9		0x0c000191
arch/arm/mach-vexpress/v2m.c +22 -2
index ee52b35..fd7ee1f 100644
@@ -6,6 +6,10 @@
 #include <linux/amba/mmci.h>
 #include <linux/io.h>
 #include <linux/init.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/ata_platform.h>
 #include <linux/smsc911x.h>
@@ -17,6 +21,7 @@
 
 #include <asm/mach-types.h>
 #include <asm/sizes.h>
+#include <asm/system.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
@@ -50,10 +55,34 @@ static void __iomem *v2m_sysreg_base;
 
 static void __init v2m_timer_init(void)
 {
-	void __iomem *sysctl_base;
-	void __iomem *timer01_base;
+	void __iomem *sysctl_base = NULL;
+	void __iomem *timer01_base = NULL;
+	unsigned int timer01_irq = NO_IRQ;
+
+	if (of_have_populated_dt()) {
+#if defined(CONFIG_ARCH_VEXPRESS_DT)
+		int err;
+		const char *path;
+		struct device_node *node;
+
+		node = of_find_compatible_node(NULL, NULL, "arm,sp810");
+		if (node)
+			sysctl_base = of_iomap(node, 0);
+
+		err = of_property_read_string(of_aliases, "timer", &path);
+		if (!err)
+			node = of_find_node_by_path(path);

arch/arm/mach-vexpress/v2m.c static void __iomem *v2m_sysreg_base; · line 84

Quoted 10 lines
arch/arm/mach-vexpress/v2m.c +10 -0
+		if (node) {
+			timer01_base = of_iomap(node, 0);
+			timer01_irq = irq_of_parse_and_map(node, 0);
+		}
+#endif
+	} else {
+		sysctl_base = ioremap(V2M_SYSCTL, SZ_4K);
+		timer01_base = ioremap(V2M_TIMER01, SZ_4K);
+		timer01_irq = IRQ_V2M_TIMER0;
+	}

Do we even have of_have_populated_dt() in a non-DT kernel?

Maybe change this to

#if defined(CONFIG_ARCH_VEXPRESS_DT)
	if (of_have_populated_dt()) {
		/* ... */
	} else
#endif
	/* follow on from previous else */
	{
		/* ... */
	}

...or if that feels a little unclear, maybe do this:

#if defined(CONFIG_ARCH_VEXPRESS_DT)
	if (of_have_populated_dt()) {
		/* ... */
	} else {
#else
	{
#endif
		/* ... */
	}

arch/arm/mach-vexpress/v2m.c static void __init v2m_timer_init(void) · line 95

Quoted 13 lines
arch/arm/mach-vexpress/v2m.c +1 -4
-	sysctl_base = ioremap(V2M_SYSCTL, SZ_4K);
 	WARN_ON(!sysctl_base);
 	if (sysctl_base) {
 		/* Select 1MHz TIMCLK as the reference clock for SP804 timers */
@@ -63,20 +92,20 @@ static void __init v2m_timer_init(void)
 		writel(scctrl, sysctl_base + SCCTRL);
 	}
 
-	timer01_base = ioremap(V2M_TIMER01, SZ_4K);
-	WARN_ON(!timer01_base);
-	if (timer01_base) {
+	WARN_ON(!timer01_base || timer01_irq != NO_IRQ);

Is that supposed to be !timer01_base || timer01_irq == NO_IRQ ?

If so, is might be better to write

WARN_ON(!(expr));

if (expr) {
	...

so that the conditions are clear inverses.

Quoted 19 lines
arch/arm/mach-vexpress/v2m.c +4 -2
+	if (timer01_base && timer01_irq != NO_IRQ) {
 		writel(0, timer01_base + TIMER_1_BASE + TIMER_CTRL);
 		writel(0, timer01_base + TIMER_2_BASE + TIMER_CTRL);
 
 		sp804_clocksource_init(timer01_base + TIMER_2_BASE,
 				"v2m-timer1");
 		sp804_clockevents_init(timer01_base + TIMER_1_BASE,
-				IRQ_V2M_TIMER0, "v2m-timer0");
+				timer01_irq, "v2m-timer0");
 	}
 }
 
-static struct sys_timer v2m_timer = {
+/* Used also by DT-powered core tiles */
+struct sys_timer v2m_timer = {
 	.init	= v2m_timer_init,
 };
 

arch/arm/mach-vexpress/v2m.c MACHINE_START(VEXPRESS, "ARM-Versatile Express") · line 501

Quoted 3 lines
arch/arm/mach-vexpress/v2m.c +0 -0
@@ -470,3 +499,99 @@ MACHINE_START(VEXPRESS, "ARM-Versatile Express")
 	.timer		= &v2m_timer,
 	.init_machine	= v2m_init,
 MACHINE_END

It would be useful to have a comment somewhere indicating that the DT_MACHINE_START() entries live in the corresponding ct-*.c files for DT-enabled coretiles.

Not essential, though ... most people do know how to use grep.

Quoted 105 lines
arch/arm/mach-vexpress/v2m.c +96 -0
+
+
+#if defined(CONFIG_ARCH_VEXPRESS_DT)
+
+void __init v2m_dt_map_io(void)
+{
+		iotable_init(v2m_rs1_io_desc, ARRAY_SIZE(v2m_rs1_io_desc));
+}
+
+static struct clk_lookup v2m_dt_lookups[] = {
+	{	/* AMBA bus clock */
+		.con_id		= "apb_pclk",
+		.clk		= &dummy_apb_pclk,
+	}, {	/* SP804 timers */
+		.dev_id		= "sp804",
+		.con_id		= "v2m-timer0",
+		.clk		= &v2m_sp804_clk,
+	}, {	/* SP804 timers */
+		.dev_id		= "sp804",
+		.con_id		= "v2m-timer1",
+		.clk		= &v2m_sp804_clk,
+	}, {	/* PL180 MMCI */
+		.dev_id		= "mb:mmci", /* 10005000.mmci */
+		.clk		= &osc2_clk,
+	}, {	/* PL050 KMI0 */
+		.dev_id		= "10006000.kmi",
+		.clk		= &osc2_clk,
+	}, {	/* PL050 KMI1 */
+		.dev_id		= "10007000.kmi",
+		.clk		= &osc2_clk,
+	}, {	/* PL011 UART0 */
+		.dev_id		= "10009000.uart",
+		.clk		= &osc2_clk,
+	}, {	/* PL011 UART1 */
+		.dev_id		= "1000a000.uart",
+		.clk		= &osc2_clk,
+	}, {	/* PL011 UART2 */
+		.dev_id		= "1000b000.uart",
+		.clk		= &osc2_clk,
+	}, {	/* PL011 UART3 */
+		.dev_id		= "1000c000.uart",
+		.clk		= &osc2_clk,
+	}, {	/* SP805 WDT */
+		.dev_id		= "1000f000.wdt",
+		.clk		= &v2m_ref_clk,
+	}, {	/* PL111 CLCD */
+		.dev_id		= "1001f000.clcd",
+		.clk		= &osc1_clk,
+	},
+};
+
+void __init v2m_dt_init_early(void)
+{
+	struct device_node *node;
+	const __be32 *reg;
+	u32 dt_hbi;
+
+	node = of_find_compatible_node(NULL, NULL, "arm,vexpress-sysreg");
+	reg = of_get_property(node, "reg", NULL);
+	if (WARN_ON(!reg))
+		return;
+
+	v2m_sysreg_base = V2M_PERIPH_P2V(be32_to_cpup(reg));
+
+	/* Confirm board type against DT property, if available */
+	if (of_property_read_u32(allnodes, "arm,hbi", &dt_hbi) == 0) {
+		u32 misc = readl(v2m_sysreg_base + V2M_SYS_MISC);
+		u32 id = readl(v2m_sysreg_base + (misc & SYS_MISC_MASTERSITE ?
+				V2M_SYS_PROCID1 : V2M_SYS_PROCID0));
+		u32 hbi = id & SYS_PROCIDx_HBI_MASK;
+
+		if (WARN_ON(dt_hbi != hbi))
+			pr_warning("vexpress: DT HBI (%x) is not matching "
+					"hardware (%x)!\n", dt_hbi, hbi);
+	}
+
+	clkdev_add_table(v2m_dt_lookups, ARRAY_SIZE(v2m_dt_lookups));
+	versatile_sched_clock_init(v2m_sysreg_base + V2M_SYS_24MHZ, 24000000);
+
+	pm_power_off = v2m_power_off;
+	arm_pm_restart = v2m_restart;
+}
+
+static struct of_dev_auxdata v2m_dt_auxdata_lookup[] __initdata = {
+	OF_DEV_AUXDATA("arm,vexpress-flash", V2M_NOR0, "physmap-flash",
+			&v2m_flash_data),
+	OF_DEV_AUXDATA("arm,primecell", V2M_MMCI, "mb:mmci", &v2m_mmci_data),
+	{}
+};
+
+struct of_dev_auxdata * __init v2m_dt_get_auxdata(void)
+{
+	return v2m_dt_auxdata_lookup;
+}
+
+#endif
Signature · 8 lines
1.6.3.3



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
author
#9 lore raw

PATCH v2 2/4 ARM: vexpress: Add DT support in v2m

Quoted 4 lines · Dave Martin

[Since this text is now stable enough to be proofread, I'll list minor pedantic nits along with the other comments -- they aren't vital to the meaning though, and the documentation still "works" if they aren't acted on.]

[snip]

Most appreciated! I'll "process" all your suggestions, thanks!

Quoted 50 lines
Quoted 23 lines
arch/arm/mach-vexpress/v2m.c +17 -2
@@ -50,10 +55,34 @@ static void __iomem *v2m_sysreg_base;
 
 static void __init v2m_timer_init(void)
 {
-     void __iomem *sysctl_base;
-     void __iomem *timer01_base;
+     void __iomem *sysctl_base = NULL;
+     void __iomem *timer01_base = NULL;
+     unsigned int timer01_irq = NO_IRQ;
+
+     if (of_have_populated_dt()) {
+#if defined(CONFIG_ARCH_VEXPRESS_DT)
+             int err;
+             const char *path;
+             struct device_node *node;
+
+             node = of_find_compatible_node(NULL, NULL, "arm,sp810");
+             if (node)
+                     sysctl_base = of_iomap(node, 0);
+
+             err = of_property_read_string(of_aliases, "timer", &path);
+             if (!err)
+                     node = of_find_node_by_path(path);

arch/arm/mach-vexpress/v2m.c static void __iomem *v2m_sysreg_base; · line 84

Quoted 10 lines
arch/arm/mach-vexpress/v2m.c +10 -0
+             if (node) {
+                     timer01_base = of_iomap(node, 0);
+                     timer01_irq = irq_of_parse_and_map(node, 0);
+             }
+#endif
+     } else {
+             sysctl_base = ioremap(V2M_SYSCTL, SZ_4K);
+             timer01_base = ioremap(V2M_TIMER01, SZ_4K);
+             timer01_irq = IRQ_V2M_TIMER0;
+     }

Do we even have of_have_populated_dt() in a non-DT kernel?

Maybe change this to

#if defined(CONFIG_ARCH_VEXPRESS_DT)
        if (of_have_populated_dt()) {
                /* ... */
        } else
#endif
        /* follow on from previous else */
        {
                /* ... */
        }

...or if that feels a little unclear, maybe do this:

Quoted 9 lines
#if defined(CONFIG_ARCH_VEXPRESS_DT)
        if (of_have_populated_dt()) {
                /* ... */
        } else {
#else
        {
#endif
                /* ... */
        }

of_have_populated_dt() is safe, see "include/linux/of.h":

#ifdef CONFIG_OF
static inline bool of_have_populated_dt(void)

{       
        return allnodes != NULL;
}       
#else /* CONFIG_OF */
static inline bool of_have_populated_dt(void)
{       
        return false;
}       

#endif /* CONFIG_OF */

Quoted 10 lines

arch/arm/mach-vexpress/v2m.c static void __init v2m_timer_init(void) · line 95

Quoted 8 lines
arch/arm/mach-vexpress/v2m.c +1 -3
@@ -63,20 +92,20 @@ static void __init v2m_timer_init(void)
              writel(scctrl, sysctl_base + SCCTRL);
      }
 
-     timer01_base = ioremap(V2M_TIMER01, SZ_4K);
-     WARN_ON(!timer01_base);
-     if (timer01_base) {
+     WARN_ON(!timer01_base || timer01_irq != NO_IRQ);

Is that supposed to be !timer01_base || timer01_irq == NO_IRQ ?

Yes, I spotted and fixed this in the mean time.

Quoted 7 lines

If so, is might be better to write

WARN_ON(!(expr));

if (expr) {
        ...

so that the conditions are clear inverses.

Good point, will do.

Quoted 10 lines

arch/arm/mach-vexpress/v2m.c MACHINE_START(VEXPRESS, "ARM-Versatile Express") · line 501

Quoted 4 lines
arch/arm/mach-vexpress/v2m.c +0 -0
@@ -470,3 +499,99 @@ MACHINE_START(VEXPRESS, "ARM-Versatile Express")
      .timer          = &v2m_timer,
      .init_machine   = v2m_init,
 MACHINE_END

It would be useful to have a comment somewhere indicating that the DT_MACHINE_START() entries live in the corresponding ct-*.c files for DT-enabled coretiles.

Not essential, though ... most people do know how to use grep.

Where exactly would you see that comment?

Thanks for the review!

Pawe?

#10 lore raw

PATCH v2 2/4 ARM: vexpress: Add DT support in v2m

Quoted 70 lines · Pawel Moll
Quoted 4 lines · Dave Martin

[Since this text is now stable enough to be proofread, I'll list minor pedantic nits along with the other comments -- they aren't vital to the meaning though, and the documentation still "works" if they aren't acted on.]

[snip]

Most appreciated! I'll "process" all your suggestions, thanks!

Quoted 50 lines
Quoted 23 lines
arch/arm/mach-vexpress/v2m.c +17 -2
@@ -50,10 +55,34 @@ static void __iomem *v2m_sysreg_base;
 
 static void __init v2m_timer_init(void)
 {
-     void __iomem *sysctl_base;
-     void __iomem *timer01_base;
+     void __iomem *sysctl_base = NULL;
+     void __iomem *timer01_base = NULL;
+     unsigned int timer01_irq = NO_IRQ;
+
+     if (of_have_populated_dt()) {
+#if defined(CONFIG_ARCH_VEXPRESS_DT)
+             int err;
+             const char *path;
+             struct device_node *node;
+
+             node = of_find_compatible_node(NULL, NULL, "arm,sp810");
+             if (node)
+                     sysctl_base = of_iomap(node, 0);
+
+             err = of_property_read_string(of_aliases, "timer", &path);
+             if (!err)
+                     node = of_find_node_by_path(path);

arch/arm/mach-vexpress/v2m.c static void __iomem *v2m_sysreg_base; · line 84

Quoted 10 lines
arch/arm/mach-vexpress/v2m.c +10 -0
+             if (node) {
+                     timer01_base = of_iomap(node, 0);
+                     timer01_irq = irq_of_parse_and_map(node, 0);
+             }
+#endif
+     } else {
+             sysctl_base = ioremap(V2M_SYSCTL, SZ_4K);
+             timer01_base = ioremap(V2M_TIMER01, SZ_4K);
+             timer01_irq = IRQ_V2M_TIMER0;
+     }

Do we even have of_have_populated_dt() in a non-DT kernel?

Maybe change this to

#if defined(CONFIG_ARCH_VEXPRESS_DT)
        if (of_have_populated_dt()) {
                /* ... */
        } else
#endif
        /* follow on from previous else */
        {
                /* ... */
        }

...or if that feels a little unclear, maybe do this:

Quoted 9 lines
#if defined(CONFIG_ARCH_VEXPRESS_DT)
        if (of_have_populated_dt()) {
                /* ... */
        } else {
#else
        {
#endif
                /* ... */
        }
Quoted 1 line

of_have_populated_dt() is safe, see "include/linux/of.h":

You're right, but this code is still making assumptions about the relationship between a build-time option (defined( CONFIG_ARCH_VEXPRESS_DT)) and a run-time condition (of_have_populated_dt()). The relationship between the two is far from transparent.

The effective condition we want is if(of_have_populated_dt() && defined(CONFIG_ARCH_VEXPRESS_DT)). This is implemented in my versions, but in your case the code can compile as

if(of_have_populated_dt()) { } else {
	sysctl_base = ioremap(V2M_SYSCTL, SZ_4K);
	...
}

I don't believe we should be writing code which can compile as if(condition) { } else { do something useful; } unless there are scenarios under which executing that empty block (and skipping the else) would be the correct thing to do. In this code, that's never the right thing.

I don't know how likely this is to be an issue, but we should avoid putting too many booby-traps in the code for future maintainers.

Since you have the #ifdef anyway, I don't see a strong argument against moving it into the correct place.

Quoted 44 lines

#ifdef CONFIG_OF
static inline bool of_have_populated_dt(void)

{       
        return allnodes != NULL;
}       
#else /* CONFIG_OF */
static inline bool of_have_populated_dt(void)
{       
        return false;
}       

#endif /* CONFIG_OF */

Quoted 10 lines

arch/arm/mach-vexpress/v2m.c static void __init v2m_timer_init(void) · line 95

Quoted 8 lines
arch/arm/mach-vexpress/v2m.c +1 -3
@@ -63,20 +92,20 @@ static void __init v2m_timer_init(void)
              writel(scctrl, sysctl_base + SCCTRL);
      }
 
-     timer01_base = ioremap(V2M_TIMER01, SZ_4K);
-     WARN_ON(!timer01_base);
-     if (timer01_base) {
+     WARN_ON(!timer01_base || timer01_irq != NO_IRQ);

Is that supposed to be !timer01_base || timer01_irq == NO_IRQ ?

Yes, I spotted and fixed this in the mean time.

Quoted 7 lines

If so, is might be better to write

WARN_ON(!(expr));

if (expr) {
        ...

so that the conditions are clear inverses.

Good point, will do.

Quoted 9 lines

arch/arm/mach-vexpress/v2m.c MACHINE_START(VEXPRESS, "ARM-Versatile Express") · line 501

Quoted 4 lines
arch/arm/mach-vexpress/v2m.c +0 -0
@@ -470,3 +499,99 @@ MACHINE_START(VEXPRESS, "ARM-Versatile Express")
      .timer          = &v2m_timer,
      .init_machine   = v2m_init,
 MACHINE_END

It would be useful to have a comment somewhere indicating that the DT_MACHINE_START() entries live in the corresponding ct-*.c files for DT-enabled coretiles.

Quoted 3 lines
Quoted 1 line

Not essential, though ... most people do know how to use grep.

Where exactly would you see that comment?

Next to the MACHINE_START() probably makes sense. That was the point at which I wondered where the DT equivalent(s) were.

Cheers
---Dave

author
#11 lore raw

PATCH v2 3/4 ARM: vexpress: Initial RS1 memory map support

In reply to Pawel Moll

This patch adds support for RS1 memory map based Versatile Express motherboard.

---
 arch/arm/boot/dts/vexpress-v2m-rs1.dtsi           |  192 +++++++++++++++++++++
 arch/arm/mach-vexpress/Kconfig                    |    8 +
 arch/arm/mach-vexpress/Makefile.boot              |    6 +
 arch/arm/mach-vexpress/include/mach/debug-macro.S |   37 ++++-
 arch/arm/mach-vexpress/include/mach/uncompress.h  |   13 ++-
 arch/arm/mach-vexpress/v2m.c                      |   64 +++++++-
 6 files changed, 314 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/boot/dts/vexpress-v2m-rs1.dtsi
arch/arm/boot/dts/vexpress-v2m-rs1.dtsi new file +192 -0
new file mode 100644
index 0000000..c8af670
@@ -0,0 +1,192 @@
+/*
+ * ARM Ltd. Versatile Express
+ *
+ * Motherboard Express uATX
+ * V2M-P1
+ *
+ * HBI-0190D
+ *
+ * RS1 memory map ("ARM Cortex-A Series memory map" in the board's
+ * Technical Reference Manual)
+ *
+ * WARNING! The hardware described in this file is independent from the
+ * original variant (vexpress-v2m.dtsi), but there is a strong
+ * correspondence between the two configurations.
+ *
+ * TAKE CARE WHEN MAINTAINING THIS FILE TO PROPAGATE ANY RELEVANT
+ * CHANGES TO vexpress-v2m.dtsi!
+ */
+
+/ {
+	motherboard {
+		compatible = "simple-bus";
+		arm,v2m-memory-map = "rs1";
+		#address-cells = <2>; /* SMB chipselect number and offset */
+		#size-cells = <1>;
+		#interrupt-cells = <1>;
+
+		flash at 0,00000000 {
+			compatible = "arm,vexpress-flash", "cfi-flash";
+			reg = <0 0x00000000 0x04000000>,
+			      <4 0x00000000 0x04000000>;
+			bank-width = <4>;
+		};
+
+		psram at 1,00000000 {
+			compatible = "mtd-ram";
+			reg = <1 0x00000000 0x02000000>;
+			bank-width = <4>;
+		};
+
+		ethernet at 2,02000000 {
+			compatible = "smsc,lan9118", "smsc,lan9115";
+			reg = <2 0x02000000 0x10000>;
+			interrupts = <15>;
+			phy-mode = "mii";
+			reg-io-width = <4>;
+			smsc,irq-active-high;
+			smsc,irq-push-pull;
+		};
+
+		usb at 2,03000000 {
+			compatible = "nxp,usb-isp1761";
+			reg = <2 0x03000000 0x20000>;
+			interrupts = <16>;
+			port1-otg;
+		};
+
+		iofpga at 3,00000000 {
+			compatible = "arm,amba-bus", "simple-bus";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0 3 0 0x200000>;
+
+			sysreg at 010000 {
+				compatible = "arm,vexpress-sysreg";
+				reg = <0x010000 0x1000>;
+			};
+
+			sysctl at 020000 {
+				compatible = "arm,sp810", "arm,primecell";
+				reg = <0x020000 0x1000>;
+			};
+
+			/* PCI-E I2C bus */
+			mb_i2c_pcie: i2c at 030000 {
+				compatible = "arm,versatile-i2c";
+				reg = <0x030000 0x1000>;
+
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				pcie-switch at 60 {
+					compatible = "idt,89hpes32h8";
+					reg = <0x60>;
+				};
+			};
+
+			aaci at 040000 {
+				compatible = "arm,pl041", "arm,primecell";
+				reg = <0x040000 0x1000>;
+				interrupts = <11>;
+			};
+
+			mmci at 050000 {
+				compatible = "arm,pl180", "arm,primecell";
+				reg = <0x050000 0x1000>;
+				interrupts = <9 10>;
+			};
+
+			kmi at 060000 {
+				compatible = "arm,pl050", "arm,primecell";
+				reg = <0x060000 0x1000>;
+				interrupts = <12>;
+			};
+
+			kmi at 070000 {
+				compatible = "arm,pl050", "arm,primecell";
+				reg = <0x070000 0x1000>;
+				interrupts = <13>;
+			};
+
+			mb_serial0: uart at 090000 {
+				compatible = "arm,pl011", "arm,primecell";
+				reg = <0x090000 0x1000>;
+				interrupts = <5>;
+			};
+
+			mb_serial1: uart at 0a0000 {
+				compatible = "arm,pl011", "arm,primecell";
+				reg = <0x0a0000 0x1000>;
+				interrupts = <6>;
+			};
+
+			mb_serial2: uart at 0b0000 {
+				compatible = "arm,pl011", "arm,primecell";
+				reg = <0x0b0000 0x1000>;
+				interrupts = <7>;
+			};
+
+			mb_serial3: uart at 0c0000 {
+				compatible = "arm,pl011", "arm,primecell";
+				reg = <0x0c0000 0x1000>;
+				interrupts = <8>;
+			};
+
+			wdt at 0f0000 {
+				compatible = "arm,sp805", "arm,primecell";
+				reg = <0x0f0000 0x1000>;
+				interrupts = <0>;
+			};
+
+			mb_timer01: timer at 110000 {
+				compatible = "arm,sp804", "arm,primecell";
+				reg = <0x110000 0x1000>;
+				interrupts = <2>;
+			};
+
+			mb_timer23: timer at 120000 {
+				compatible = "arm,sp804", "arm,primecell";
+				reg = <0x120000 0x1000>;
+			};
+
+			/* DVI I2C bus */
+			mb_i2c_dvi: i2c at 160000 {
+				compatible = "arm,versatile-i2c";
+				reg = <0x160000 0x1000>;
+
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				dvi-transmitter at 39 {
+					compatible = "sil,sii9022-tpi", "sil,sii9022";
+					reg = <0x39>;
+				};
+
+				dvi-transmitter at 60 {
+					compatible = "sil,sii9022-cpi", "sil,sii9022";
+					reg = <0x60>;
+				};
+			};
+
+			rtc at 170000 {
+				compatible = "arm,pl031", "arm,primecell";
+				reg = <0x170000 0x1000>;
+				interrupts = <4>;
+			};
+
+			compact-flash at 1a0000 {
+				compatible = "ata-generic";
+				reg = <0x1a0000 0x100
+				       0x1a0100 0xf00>;
+				reg-shift = <2>;
+			};
+
+			clcd at 1f0000 {
+				compatible = "arm,pl111", "arm,primecell";
+				reg = <0x1f0000 0x1000>;
+				interrupts = <14>;
+			};
+		};
+	};
+};
arch/arm/mach-vexpress/Kconfig +8 -0
index 6a6fa22..2180888 100644
@@ -15,4 +15,12 @@ config ARCH_VEXPRESS_DT
 	help
 	  VE platform *requiring* Flattened Device Tree to boot.
 
+config ARCH_VEXPRESS_RS1
+	bool
+	select AUTO_ZRELADDR
+	select ARM_PATCH_PHYS_VIRT
+	help
+	  RS1 VE memory map (i.a. motherboard peripherals at
+	  0x1c000000, RAM at 0x80000000).
+
 endmenu
arch/arm/mach-vexpress/Makefile.boot +6 -0
index 8630b3d..05b77a5 100644
@@ -1,3 +1,9 @@
+ifeq ($(CONFIG_ARCH_VEXPRESS_RS1),y)
+   zreladdr-y	+= 0x80008000
+params_phys-y	:= 0x80000100
+initrd_phys-y	:= 0x80800000
+else
    zreladdr-y	+= 0x60008000
 params_phys-y	:= 0x60000100
 initrd_phys-y	:= 0x60800000
+endif
arch/arm/mach-vexpress/include/mach/debug-macro.S +33 -4
index fd9e6c7..8010ff9 100644
@@ -10,12 +10,41 @@
  * published by the Free Software Foundation.
  */
 
-#define DEBUG_LL_UART_OFFSET	0x00009000
+#define DEBUG_LL_PHYS_BASE		0x10000000
+#define DEBUG_LL_UART_OFFSET		0x00009000
+
+#define DEBUG_LL_PHYS_BASE_RS1		0x1c000000
+#define DEBUG_LL_UART_OFFSET_RS1	0x00090000
+
+#define DEBUG_LL_VIRT_BASE		0xf8000000
 
 		.macro	addruart,rp,rv,tmp
-		mov	\rp, #DEBUG_LL_UART_OFFSET
-		orr	\rv, \rp, #0xf8000000	@ virtual base
-		orr	\rp, \rp, #0x10000000	@ physical base
+
+		@ Check the MMU state
+#if defined(CONFIG_MMU)
+		mrc	p15, 0, \tmp, c1, c0	@ SCTRL
+		tst	\tmp, #1		@ MMU enabled?
+		moveq	\tmp, #DEBUG_LL_PHYS_BASE
+		movne	\tmp, #DEBUG_LL_VIRT_BASE
+#else
+		mov	\tmp, #DEBUG_LL_PHYS_BASE
+#endif
+
+		@ PL011 present in "original" place?
+		orr	\tmp, \tmp, #DEBUG_LL_UART_OFFSET
+		ldr	\tmp, [\tmp, #0xfe0]	@ PeriphID0
+		teq	\tmp, #0x11		@ PL011
+
+		@ Original memory map
+		moveq	\rp, #DEBUG_LL_UART_OFFSET
+		orreq	\rv, \rp, #DEBUG_LL_VIRT_BASE
+		orreq	\rp, \rp, #DEBUG_LL_PHYS_BASE
+
+		@ RS1 memory map
+		movne	\rp, #DEBUG_LL_UART_OFFSET_RS1
+		orrne	\rv, \rp, #DEBUG_LL_VIRT_BASE
+		orrne	\rp, \rp, #DEBUG_LL_PHYS_BASE_RS1
+
 		.endm
 
 #include <asm/hardware/debug-pl01x.S>
arch/arm/mach-vexpress/include/mach/uncompress.h +12 -1
index 7972c57..c491565 100644
@@ -22,7 +22,18 @@
 #define AMBA_UART_CR(base)	(*(volatile unsigned char *)((base) + 0x30))
 #define AMBA_UART_FR(base)	(*(volatile unsigned char *)((base) + 0x18))
 
-#define get_uart_base()	(0x10000000 + 0x00009000)
+#define AMBA_PERIPH_ID0(base)	(*(volatile unsigned char *)((base) + 0xfe0))
+
+#define UART_BASE	0x10009000
+#define UART_BASE_RS1	0x1c090000
+
+static unsigned long get_uart_base(void)
+{
+	if (AMBA_PERIPH_ID0(UART_BASE) == 0x11)
+		return UART_BASE;
+	else
+		return UART_BASE_RS1;
+}
 
 /*
  * This does not append a newline
arch/arm/mach-vexpress/v2m.c +63 -1

91 lines not on this page · raw message

Signature · 1 line
1.6.3.3
author
#12 lore raw

PATCH v2 4/4 ARM: vexpress: DT-based support for CoreTiles Express A5x2 and A9x4

In reply to Pawel Moll

This patch adds Device Trees for ARM Ltd. CoreTile Express A5x2 and CoreTile Express A9x4 used with V2M motherboard and an initial implementation of the DT machine support (this code is separate from the current core tile code).

---
 arch/arm/boot/dts/vexpress-v2p-ca5s.dts |  132 ++++++++++++++++++++++++++++
 arch/arm/boot/dts/vexpress-v2p-ca9.dts  |  146 +++++++++++++++++++++++++++++++
 arch/arm/mach-vexpress/Kconfig          |   21 +++++
 arch/arm/mach-vexpress/Makefile         |    1 +
 arch/arm/mach-vexpress/v2p-ca5s_ca9.c   |  115 ++++++++++++++++++++++++
 5 files changed, 415 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/vexpress-v2p-ca5s.dts
 create mode 100644 arch/arm/boot/dts/vexpress-v2p-ca9.dts
 create mode 100644 arch/arm/mach-vexpress/v2p-ca5s_ca9.c
arch/arm/boot/dts/vexpress-v2p-ca5s.dts new file +132 -0
new file mode 100644
index 0000000..84e05cd
@@ -0,0 +1,132 @@
+/*
+ * ARM Ltd. Versatile Express
+ *
+ * CoreTile Express A5x2
+ * Cortex-A5 MPCore (V2P-CA5s)
+ *
+ * HBI-0225B
+ */
+
+/dts-v1/;
+
+/include/ "skeleton.dtsi"
+
+/ {
+	model = "V2P-CA5s";
+	arm,hbi = <0x225>;
+	compatible = "arm,vexpress-v2p-ca5s";
+	interrupt-parent = <&gic>;
+
+	aliases {
+		serial0 = &mb_serial0;
+		serial1 = &mb_serial1;
+		serial2 = &mb_serial2;
+		serial3 = &mb_serial3;
+		i2c0 = &mb_i2c_dvi;
+		i2c1 = &mb_i2c_pcie;
+		timer = &mb_timer01;
+	};
+
+	memory at 80000000 {
+		device_type = "memory";
+		reg = <0x80000000 0x40000000>;
+	};
+
+	hdlcd at 2a110000 {
+		compatible = "arm,hdlcd";
+		reg = <0x2a110000 0x1000>;
+		interrupts = <0 85 4>;
+	};
+
+	memory-controller at 2a150000 {
+		compatible = "arm,pl341", "arm,primecell";
+		reg = <0x2a150000 0x1000>;
+	};
+
+	memory-controller at 2a190000 {
+		compatible = "arm,pl354", "arm,primecell";
+		reg = <0x2a190000 0x1000>;
+		interrupts = <0 86 4>,
+			     <0 87 4>;
+	};
+
+	gic: interrupt-controller at 2c001000 {
+		compatible = "arm,cortex-a9-gic";
+		#interrupt-cells = <3>;
+		#address-cells = <0>;
+		interrupt-controller;
+		reg = <0x2c001000 0x1000>,
+		      <0x2c000100 0x100>;
+	};
+
+	L2: cache-controller at 2c0f0000 {
+		compatible = "arm,pl310-cache";
+		reg = <0x2c0f0000 0x1000>;
+		interrupts = <0 84 4>;
+		cache-level = <2>;
+		arm,data-latency = <0>;
+		arm,tag-latency = <0>;
+	};
+
+	pmu {
+		compatible = "arm,cortex-a9-pmu";
+		interrupts = <0 68 4>,
+			     <0 69 4>;
+	};
+
+	motherboard {
+		ranges = <0 0 0x08000000 0x04000000>,
+			 <1 0 0x14000000 0x04000000>,
+			 <2 0 0x18000000 0x04000000>,
+			 <3 0 0x1c000000 0x04000000>,
+			 <4 0 0x0c000000 0x04000000>,
+			 <5 0 0x10000000 0x04000000>;
+
+		interrupt-map-mask = <0 0 63>;
+		interrupt-map = <0 0  0 &gic 0  0 4>,
+				<0 0  1 &gic 0  1 4>,
+				<0 0  2 &gic 0  2 4>,
+				<0 0  3 &gic 0  3 4>,
+				<0 0  4 &gic 0  4 4>,
+				<0 0  5 &gic 0  5 4>,
+				<0 0  6 &gic 0  6 4>,
+				<0 0  7 &gic 0  7 4>,
+				<0 0  8 &gic 0  8 4>,
+				<0 0  9 &gic 0  9 4>,
+				<0 0 10 &gic 0 10 4>,
+				<0 0 11 &gic 0 11 4>,
+				<0 0 12 &gic 0 12 4>,
+				<0 0 13 &gic 0 13 4>,
+				<0 0 14 &gic 0 14 4>,
+				<0 0 15 &gic 0 15 4>,
+				<0 0 16 &gic 0 16 4>,
+				<0 0 17 &gic 0 17 4>,
+				<0 0 18 &gic 0 18 4>,
+				<0 0 19 &gic 0 19 4>,
+				<0 0 20 &gic 0 20 4>,
+				<0 0 21 &gic 0 21 4>,
+				<0 0 22 &gic 0 22 4>,
+				<0 0 23 &gic 0 23 4>,
+				<0 0 24 &gic 0 24 4>,
+				<0 0 25 &gic 0 25 4>,
+				<0 0 26 &gic 0 26 4>,
+				<0 0 27 &gic 0 27 4>,
+				<0 0 28 &gic 0 28 4>,
+				<0 0 29 &gic 0 29 4>,
+				<0 0 30 &gic 0 30 4>,
+				<0 0 31 &gic 0 31 4>,
+				<0 0 32 &gic 0 32 4>,
+				<0 0 33 &gic 0 33 4>,
+				<0 0 34 &gic 0 34 4>,
+				<0 0 35 &gic 0 35 4>,
+				<0 0 36 &gic 0 36 4>,
+				<0 0 37 &gic 0 37 4>,
+				<0 0 38 &gic 0 38 4>,
+				<0 0 39 &gic 0 39 4>,
+				<0 0 40 &gic 0 40 4>,
+				<0 0 41 &gic 0 41 4>,
+				<0 0 42 &gic 0 42 4>;
+	};
+};
+
+/include/ "vexpress-v2m-rs1.dtsi"
arch/arm/boot/dts/vexpress-v2p-ca9.dts new file +146 -0

146 lines not on this page · raw message

arch/arm/mach-vexpress/Kconfig +21 -0
index 2180888..0f31125 100644
@@ -23,4 +23,25 @@ config ARCH_VEXPRESS_RS1
 	  RS1 VE memory map (i.a. motherboard peripherals at
 	  0x1c000000, RAM at 0x80000000).
 
+config ARCH_VEXPRESS_V2P_CA5S_CA9
+	bool "CoreTile Express A5x2 and A9x4 based platform support"
+	select ARCH_VEXPRESS_RS1
+	select ARCH_VEXPRESS_DT
+	select ARM_ERRATA_720789
+	select ARM_ERRATA_751472
+	select ARM_ERRATA_753970
+	help
+	  This option enables support for systems using any of the following
+	  ARM core tiles on the Versatile Express motherboard:
+
+	  - CoreTile Express A5x2 (V2P-CA5s)
+	  - CoreTile Express A9x4 (V2P-CA9)
+
+	  You must boot using a Flattened Device Tree in order to use these
+	  platforms.  The traditional (ATAGs) boot method is not usable on
+	  these boards with this option.
+
+	  If you want your kernel to run on one of these platforms and your
+	  bootloader supports Flattened Device Tree based booting, say Y.
+
 endmenu
arch/arm/mach-vexpress/Makefile +1 -0
index 90551b9..06e3687 100644
@@ -4,5 +4,6 @@
 
 obj-y					:= v2m.o
 obj-$(CONFIG_ARCH_VEXPRESS_CA9X4)	+= ct-ca9x4.o
+obj-$(CONFIG_ARCH_VEXPRESS_V2P_CA5S_CA9) += v2p-ca5s_ca9.o
 obj-$(CONFIG_SMP)			+= platsmp.o
 obj-$(CONFIG_HOTPLUG_CPU)		+= hotplug.o
arch/arm/mach-vexpress/v2p-ca5s_ca9.c new file +115 -0

115 lines not on this page · raw message

Signature · 1 line
1.6.3.3
#13 lore raw

PATCH v2 4/4 ARM: vexpress: DT-based support for CoreTiles Express A5x2 and A9x4

Quoted 312 lines · Pawel Moll

This patch adds Device Trees for ARM Ltd. CoreTile Express A5x2 and CoreTile Express A9x4 used with V2M motherboard and an initial implementation of the DT machine support (this code is separate from the current core tile code).

---
 arch/arm/boot/dts/vexpress-v2p-ca5s.dts |  132 ++++++++++++++++++++++++++++
 arch/arm/boot/dts/vexpress-v2p-ca9.dts  |  146 +++++++++++++++++++++++++++++++
 arch/arm/mach-vexpress/Kconfig          |   21 +++++
 arch/arm/mach-vexpress/Makefile         |    1 +
 arch/arm/mach-vexpress/v2p-ca5s_ca9.c   |  115 ++++++++++++++++++++++++
 5 files changed, 415 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/vexpress-v2p-ca5s.dts
 create mode 100644 arch/arm/boot/dts/vexpress-v2p-ca9.dts
 create mode 100644 arch/arm/mach-vexpress/v2p-ca5s_ca9.c
arch/arm/boot/dts/vexpress-v2p-ca5s.dts new file +132 -0
new file mode 100644
index 0000000..84e05cd
@@ -0,0 +1,132 @@
+/*
+ * ARM Ltd. Versatile Express
+ *
+ * CoreTile Express A5x2
+ * Cortex-A5 MPCore (V2P-CA5s)
+ *
+ * HBI-0225B
+ */
+
+/dts-v1/;
+
+/include/ "skeleton.dtsi"
+
+/ {
+	model = "V2P-CA5s";
+	arm,hbi = <0x225>;
+	compatible = "arm,vexpress-v2p-ca5s";
+	interrupt-parent = <&gic>;
+
+	aliases {
+		serial0 = &mb_serial0;
+		serial1 = &mb_serial1;
+		serial2 = &mb_serial2;
+		serial3 = &mb_serial3;
+		i2c0 = &mb_i2c_dvi;
+		i2c1 = &mb_i2c_pcie;
+		timer = &mb_timer01;
+	};
+
+	memory at 80000000 {
+		device_type = "memory";
+		reg = <0x80000000 0x40000000>;
+	};
+
+	hdlcd at 2a110000 {
+		compatible = "arm,hdlcd";
+		reg = <0x2a110000 0x1000>;
+		interrupts = <0 85 4>;
+	};
+
+	memory-controller at 2a150000 {
+		compatible = "arm,pl341", "arm,primecell";
+		reg = <0x2a150000 0x1000>;
+	};
+
+	memory-controller at 2a190000 {
+		compatible = "arm,pl354", "arm,primecell";
+		reg = <0x2a190000 0x1000>;
+		interrupts = <0 86 4>,
+			     <0 87 4>;
+	};
+
+	gic: interrupt-controller at 2c001000 {
+		compatible = "arm,cortex-a9-gic";
+		#interrupt-cells = <3>;
+		#address-cells = <0>;
+		interrupt-controller;
+		reg = <0x2c001000 0x1000>,
+		      <0x2c000100 0x100>;
+	};
+
+	L2: cache-controller at 2c0f0000 {
+		compatible = "arm,pl310-cache";
+		reg = <0x2c0f0000 0x1000>;
+		interrupts = <0 84 4>;
+		cache-level = <2>;
+		arm,data-latency = <0>;
+		arm,tag-latency = <0>;
+	};
+
+	pmu {
+		compatible = "arm,cortex-a9-pmu";
+		interrupts = <0 68 4>,
+			     <0 69 4>;
+	};
+
+	motherboard {
+		ranges = <0 0 0x08000000 0x04000000>,
+			 <1 0 0x14000000 0x04000000>,
+			 <2 0 0x18000000 0x04000000>,
+			 <3 0 0x1c000000 0x04000000>,
+			 <4 0 0x0c000000 0x04000000>,
+			 <5 0 0x10000000 0x04000000>;
+
+		interrupt-map-mask = <0 0 63>;
+		interrupt-map = <0 0  0 &gic 0  0 4>,
+				<0 0  1 &gic 0  1 4>,
+				<0 0  2 &gic 0  2 4>,
+				<0 0  3 &gic 0  3 4>,
+				<0 0  4 &gic 0  4 4>,
+				<0 0  5 &gic 0  5 4>,
+				<0 0  6 &gic 0  6 4>,
+				<0 0  7 &gic 0  7 4>,
+				<0 0  8 &gic 0  8 4>,
+				<0 0  9 &gic 0  9 4>,
+				<0 0 10 &gic 0 10 4>,
+				<0 0 11 &gic 0 11 4>,
+				<0 0 12 &gic 0 12 4>,
+				<0 0 13 &gic 0 13 4>,
+				<0 0 14 &gic 0 14 4>,
+				<0 0 15 &gic 0 15 4>,
+				<0 0 16 &gic 0 16 4>,
+				<0 0 17 &gic 0 17 4>,
+				<0 0 18 &gic 0 18 4>,
+				<0 0 19 &gic 0 19 4>,
+				<0 0 20 &gic 0 20 4>,
+				<0 0 21 &gic 0 21 4>,
+				<0 0 22 &gic 0 22 4>,
+				<0 0 23 &gic 0 23 4>,
+				<0 0 24 &gic 0 24 4>,
+				<0 0 25 &gic 0 25 4>,
+				<0 0 26 &gic 0 26 4>,
+				<0 0 27 &gic 0 27 4>,
+				<0 0 28 &gic 0 28 4>,
+				<0 0 29 &gic 0 29 4>,
+				<0 0 30 &gic 0 30 4>,
+				<0 0 31 &gic 0 31 4>,
+				<0 0 32 &gic 0 32 4>,
+				<0 0 33 &gic 0 33 4>,
+				<0 0 34 &gic 0 34 4>,
+				<0 0 35 &gic 0 35 4>,
+				<0 0 36 &gic 0 36 4>,
+				<0 0 37 &gic 0 37 4>,
+				<0 0 38 &gic 0 38 4>,
+				<0 0 39 &gic 0 39 4>,
+				<0 0 40 &gic 0 40 4>,
+				<0 0 41 &gic 0 41 4>,
+				<0 0 42 &gic 0 42 4>;
+	};
+};
+
+/include/ "vexpress-v2m-rs1.dtsi"
arch/arm/boot/dts/vexpress-v2p-ca9.dts new file +146 -0
new file mode 100644
index 0000000..ae6b70c
@@ -0,0 +1,146 @@
+/*
+ * ARM Ltd. Versatile Express
+ *
+ * CoreTile Express A9x4
+ * Cortex-A9 MPCore (V2P-CA9)
+ *
+ * HBI-0191B
+ */
+
+/dts-v1/;
+
+/include/ "skeleton.dtsi"
+
+/ {
+	model = "V2P-CA9";
+	arm,hbi = <0x191>;
+	compatible = "arm,vexpress-v2p-ca9";
+	interrupt-parent = <&gic>;
+
+	aliases {
+		serial0 = &mb_serial0;
+		serial1 = &mb_serial1;
+		serial2 = &mb_serial2;
+		serial3 = &mb_serial3;
+		i2c0 = &mb_i2c_dvi;
+		i2c1 = &mb_i2c_pcie;
+		timer = &mb_timer01;
+	};
+
+	memory at 60000000 {
+		device_type = "memory";
+		reg = <0x60000000 0x40000000>;
+	};
+
+	clcd at 10020000 {
+		compatible = "arm,pl111", "arm,primecell";
+		reg = <0x10020000 0x1000>;
+		interrupts = <0 44 4>;
+	};
+
+	memory-controller at 100e0000 {
+		compatible = "arm,pl341", "arm,primecell";
+		reg = <0x100e0000 0x1000>;
+	};
+
+	memory-controller at 100e1000 {
+		compatible = "arm,pl354", "arm,primecell";
+		reg = <0x100e1000 0x1000>;
+		interrupts = <0 45 4>,
+			     <0 46 4>;
+	};
+
+	timer at 100e4000 {
+		compatible = "arm,sp804", "arm,primecell";
+		reg = <0x100e4000 0x1000>;
+		interrupts = <0 48 4>,
+			     <0 49 4>;
+	};
+
+	watchdog at 100e5000 {
+		compatible = "arm,sp805", "arm,primecell";
+		reg = <0x100e5000 0x1000>;
+		interrupts = <0 51 4>;
+	};
+
+	gic: interrupt-controller at 1e001000 {
+		compatible = "arm,cortex-a9-gic";
+		#interrupt-cells = <3>;
+		#address-cells = <0>;
+		interrupt-controller;
+		reg = <0x1e001000 0x1000>,
+		      <0x1e000100 0x100>;
+	};
+
+	L2: cache-controller at 1e00a000 {
+		compatible = "arm,pl310-cache";
+		reg = <0x1e00a000 0x1000>;
+		interrupts = <0 43 4>;
+		cache-level = <2>;
+		arm,data-latency = <0>;
+		arm,tag-latency = <0>;
+	};
+
+	pmu {
+		compatible = "arm,cortex-a9-pmu";
+		interrupts = <0 60 4>,
+			     <0 61 4>,
+			     <0 62 4>,
+			     <0 63 4>;
+	};
+
+	motherboard {
+		ranges = <0 0 0x40000000 0x04000000>,
+			 <1 0 0x44000000 0x04000000>,
+			 <2 0 0x48000000 0x04000000>,
+			 <3 0 0x4c000000 0x04000000>,
+			 <7 0 0x10000000 0x00020000>;
+
+		interrupt-map-mask = <0 0 63>;
+		interrupt-map = <0 0  0 &gic 0  0 4>,
+				<0 0  1 &gic 0  1 4>,
+				<0 0  2 &gic 0  2 4>,
+				<0 0  3 &gic 0  3 4>,
+				<0 0  4 &gic 0  4 4>,
+				<0 0  5 &gic 0  5 4>,
+				<0 0  6 &gic 0  6 4>,
+				<0 0  7 &gic 0  7 4>,
+				<0 0  8 &gic 0  8 4>,
+				<0 0  9 &gic 0  9 4>,
+				<0 0 10 &gic 0 10 4>,
+				<0 0 11 &gic 0 11 4>,
+				<0 0 12 &gic 0 12 4>,
+				<0 0 13 &gic 0 13 4>,
+				<0 0 14 &gic 0 14 4>,
+				<0 0 15 &gic 0 15 4>,
+				<0 0 16 &gic 0 16 4>,
+				<0 0 17 &gic 0 17 4>,
+				<0 0 18 &gic 0 18 4>,
+				<0 0 19 &gic 0 19 4>,
+				<0 0 20 &gic 0 20 4>,
+				<0 0 21 &gic 0 21 4>,
+				<0 0 22 &gic 0 22 4>,
+				<0 0 23 &gic 0 23 4>,
+				<0 0 24 &gic 0 24 4>,
+				<0 0 25 &gic 0 25 4>,
+				<0 0 26 &gic 0 26 4>,
+				<0 0 27 &gic 0 27 4>,
+				<0 0 28 &gic 0 28 4>,
+				<0 0 29 &gic 0 29 4>,
+				<0 0 30 &gic 0 30 4>,
+				<0 0 31 &gic 0 31 4>,
+				<0 0 32 &gic 0 32 4>,
+				<0 0 33 &gic 0 33 4>,
+				<0 0 34 &gic 0 34 4>,
+				<0 0 35 &gic 0 35 4>,
+				<0 0 36 &gic 0 36 4>,
+				<0 0 37 &gic 0 37 4>,
+				<0 0 38 &gic 0 38 4>,
+				<0 0 39 &gic 0 39 4>,
+				<0 0 40 &gic 0 40 4>,
+				<0 0 41 &gic 0 41 4>,
+				<0 0 42 &gic 0 42 4>;
+	};
+};
+
+/include/ "vexpress-v2m.dtsi"
arch/arm/mach-vexpress/Kconfig +0 -0
index 2180888..0f31125 100644

arch/arm/mach-vexpress/Kconfig config ARCH_VEXPRESS_RS1 · line 29

Quoted 7 lines
arch/arm/mach-vexpress/Kconfig +4 -0
@@ -23,4 +23,25 @@ config ARCH_VEXPRESS_RS1
 	  RS1 VE memory map (i.a. motherboard peripherals at
 	  0x1c000000, RAM at 0x80000000).
 
+config ARCH_VEXPRESS_V2P_CA5S_CA9
+	bool "CoreTile Express A5x2 and A9x4 based platform support"
+	select ARCH_VEXPRESS_RS1
+	select ARCH_VEXPRESS_DT

Shouldn't we depend on CPU_V7, ARM_GIC and CACHE_PL310 here? I get a lot of moaning from Kconfig about unmet dependencies. I think the coretiles do have a CPU etc. on them...

arch/arm/mach-vexpress/Kconfig config ARCH_VEXPRESS_RS1 · line 31

Quoted 2 lines
arch/arm/mach-vexpress/Kconfig +2 -0
+	select ARM_ERRATA_720789
+	select ARM_ERRATA_751472

The workarounds for these errata both erroneously depend on CONFIG_SMP; however, I don't think that's a bug in these patches -- selecting those options here feels correct.

I'll follow up with some separate patches to fix these.

arch/arm/mach-vexpress/Kconfig config ARCH_VEXPRESS_RS1 · line 32

Quoted 1 line
arch/arm/mach-vexpress/Kconfig +1 -0
+	select ARM_ERRATA_753970

Will has a patch, now in Russell's fixes branch, which renames this to PL310_ERRATA_753970 for compatibility with other people's patches. This erratum workaround depends on CACHE_PL310, but since the PL310 is a property of the CoreTile which must be configured in, that dependency seems reasonable.

Cheers
---Dave

author
#14 lore raw

PATCH v2 4/4 ARM: vexpress: DT-based support for CoreTiles Express A5x2 and A9x4

Quoted 8 lines · Dave Martin

arch/arm/mach-vexpress/Kconfig config ARCH_VEXPRESS_RS1 · line 29

Quoted 4 lines
arch/arm/mach-vexpress/Kconfig +4 -0
+config ARCH_VEXPRESS_V2P_CA5S_CA9
+	bool "CoreTile Express A5x2 and A9x4 based platform support"
+	select ARCH_VEXPRESS_RS1
+	select ARCH_VEXPRESS_DT

Shouldn't we depend on CPU_V7, ARM_GIC and CACHE_PL310 here? I get a lot of moaning from Kconfig about unmet dependencies. I think the coretiles do have a CPU etc. on them...

CPU_V7 and ARM_GIC - definitely, thanks for spotting that.

CACHE_PL310 - I don't think so, as it's just a special case of CACHE_L2X0, which is optional. The tile works fine with the L2 cache disabled.

Quoted 6 lines

arch/arm/mach-vexpress/Kconfig config ARCH_VEXPRESS_RS1 · line 31

Quoted 2 lines
arch/arm/mach-vexpress/Kconfig +2 -0
+	select ARM_ERRATA_720789
+	select ARM_ERRATA_751472

The workarounds for these errata both erroneously depend on CONFIG_SMP; however, I don't think that's a bug in these patches -- selecting those options here feels correct.

Yes, I've just mirrored what the ARCH_VEXPRESS_CA9X4 selects.

Quoted 7 lines

arch/arm/mach-vexpress/Kconfig config ARCH_VEXPRESS_RS1 · line 32

Quoted 1 line
arch/arm/mach-vexpress/Kconfig +1 -0
+	select ARM_ERRATA_753970

Will has a patch, now in Russell's fixes branch, which renames this to PL310_ERRATA_753970 for compatibility with other people's patches. This erratum workaround depends on CACHE_PL310, but since the PL310 is a property of the CoreTile which must be configured in, that dependency seems reasonable.

As the PL310 is optional I think I'll just do:

        select PL310_ERRATA_753970 if CACHE_PL310

Cheers!

Pawel

#15 lore raw

PATCH v2 4/4 ARM: vexpress: DT-based support for CoreTiles Express A5x2 and A9x4

Quoted 33 lines · Pawel Moll
Quoted 8 lines · Dave Martin

arch/arm/mach-vexpress/Kconfig config ARCH_VEXPRESS_RS1 · line 29

Quoted 4 lines
arch/arm/mach-vexpress/Kconfig +4 -0
+config ARCH_VEXPRESS_V2P_CA5S_CA9
+	bool "CoreTile Express A5x2 and A9x4 based platform support"
+	select ARCH_VEXPRESS_RS1
+	select ARCH_VEXPRESS_DT

Shouldn't we depend on CPU_V7, ARM_GIC and CACHE_PL310 here? I get a lot of moaning from Kconfig about unmet dependencies. I think the coretiles do have a CPU etc. on them...

CPU_V7 and ARM_GIC - definitely, thanks for spotting that.

CACHE_PL310 - I don't think so, as it's just a special case of CACHE_L2X0, which is optional. The tile works fine with the L2 cache disabled.

Quoted 6 lines

arch/arm/mach-vexpress/Kconfig config ARCH_VEXPRESS_RS1 · line 31

Quoted 2 lines
arch/arm/mach-vexpress/Kconfig +2 -0
+	select ARM_ERRATA_720789
+	select ARM_ERRATA_751472

The workarounds for these errata both erroneously depend on CONFIG_SMP; however, I don't think that's a bug in these patches -- selecting those options here feels correct.

Yes, I've just mirrored what the ARCH_VEXPRESS_CA9X4 selects.

Quoted 7 lines

arch/arm/mach-vexpress/Kconfig config ARCH_VEXPRESS_RS1 · line 32

Quoted 1 line
arch/arm/mach-vexpress/Kconfig +1 -0
+	select ARM_ERRATA_753970

Will has a patch, now in Russell's fixes branch, which renames this to PL310_ERRATA_753970 for compatibility with other people's patches. This erratum workaround depends on CACHE_PL310, but since the PL310 is a property of the CoreTile which must be configured in, that dependency seems reasonable.

Quoted 3 lines

As the PL310 is optional I think I'll just do:

        select PL310_ERRATA_753970 if CACHE_PL310

OK, I think that's appropriate in this case.

Cheers
---Dave

#16 lore raw

v2 cover Versatile Express DT support

In reply to Pawel Moll
Quoted 39 lines · Pawel Moll

Hello again,

This version of the series (hopefully) addresses all the suggestions made by Dave, Rob and Russell.

The compatible values are specific for the tiles now and the memory map variant is defined as a custom property in the motherboard node.

Tested on V2P-CA9 coretile both with ATAGs and DT and V2P-CA5s with DT.

All comments, as always, welcomed!

Pawel

Pawel Moll (4):
ARM: vexpress: Get rid of MMIO_P2V
ARM: vexpress: Add DT support in v2m
ARM: vexpress: Initial RS1 memory map support
ARM: vexpress: DT-based support for CoreTiles Express A5x2 and A9x4

 Documentation/devicetree/bindings/arm/vexpress    |  101 ++++++++
 arch/arm/boot/dts/vexpress-v2m-rs1.dtsi           |  192 +++++++++++++++
 arch/arm/boot/dts/vexpress-v2m.dtsi               |  191 +++++++++++++++
 arch/arm/boot/dts/vexpress-v2p-ca5s.dts           |  132 ++++++++++
 arch/arm/boot/dts/vexpress-v2p-ca9.dts            |  146 +++++++++++
 arch/arm/include/asm/hardware/arm_timer.h         |    5 +
 arch/arm/mach-vexpress/Kconfig                    |   35 +++
 arch/arm/mach-vexpress/Makefile                   |    1 +
 arch/arm/mach-vexpress/Makefile.boot              |    6 +
 arch/arm/mach-vexpress/core.h                     |   21 ++-
 arch/arm/mach-vexpress/ct-ca9x4.c                 |   52 +---
 arch/arm/mach-vexpress/include/mach/ct-ca9x4.h    |   13 +-
 arch/arm/mach-vexpress/include/mach/debug-macro.S |   37 +++-
 arch/arm/mach-vexpress/include/mach/motherboard.h |   58 +++--
 arch/arm/mach-vexpress/include/mach/uncompress.h  |   13 +-
 arch/arm/mach-vexpress/platsmp.c                  |    4 +-
 arch/arm/mach-vexpress/v2m.c                      |  265 ++++++++++++++++++---
Quoted 8 lines
 arch/arm/mach-vexpress/v2p-ca5s_ca9.c             |  115 +++++++++
 18 files changed, 1272 insertions(+), 115 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/vexpress
 create mode 100644 arch/arm/boot/dts/vexpress-v2m-rs1.dtsi
 create mode 100644 arch/arm/boot/dts/vexpress-v2m.dtsi
 create mode 100644 arch/arm/boot/dts/vexpress-v2p-ca5s.dts
 create mode 100644 arch/arm/boot/dts/vexpress-v2p-ca9.dts
 create mode 100644 arch/arm/mach-vexpress/v2p-ca5s_ca9.c

Other than Dave's comments, looks good. For the series:

There are a number of compatible strings for various peripherals defined without documentation, but you're not really using them so I think it's fine for now. BTW, I believe Dave said he was going to document some of the primecell peripherals. :)

Rob

#17 lore raw

v2 cover Versatile Express DT support

Quoted 49 lines · Rob Herring
Quoted 39 lines · Pawel Moll

Hello again,

This version of the series (hopefully) addresses all the suggestions made by Dave, Rob and Russell.

The compatible values are specific for the tiles now and the memory map variant is defined as a custom property in the motherboard node.

Tested on V2P-CA9 coretile both with ATAGs and DT and V2P-CA5s with DT.

All comments, as always, welcomed!

Pawel

Pawel Moll (4):
ARM: vexpress: Get rid of MMIO_P2V
ARM: vexpress: Add DT support in v2m
ARM: vexpress: Initial RS1 memory map support
ARM: vexpress: DT-based support for CoreTiles Express A5x2 and A9x4

 Documentation/devicetree/bindings/arm/vexpress    |  101 ++++++++
 arch/arm/boot/dts/vexpress-v2m-rs1.dtsi           |  192 +++++++++++++++
 arch/arm/boot/dts/vexpress-v2m.dtsi               |  191 +++++++++++++++
 arch/arm/boot/dts/vexpress-v2p-ca5s.dts           |  132 ++++++++++
 arch/arm/boot/dts/vexpress-v2p-ca9.dts            |  146 +++++++++++
 arch/arm/include/asm/hardware/arm_timer.h         |    5 +
 arch/arm/mach-vexpress/Kconfig                    |   35 +++
 arch/arm/mach-vexpress/Makefile                   |    1 +
 arch/arm/mach-vexpress/Makefile.boot              |    6 +
 arch/arm/mach-vexpress/core.h                     |   21 ++-
 arch/arm/mach-vexpress/ct-ca9x4.c                 |   52 +---
 arch/arm/mach-vexpress/include/mach/ct-ca9x4.h    |   13 +-
 arch/arm/mach-vexpress/include/mach/debug-macro.S |   37 +++-
 arch/arm/mach-vexpress/include/mach/motherboard.h |   58 +++--
 arch/arm/mach-vexpress/include/mach/uncompress.h  |   13 +-
 arch/arm/mach-vexpress/platsmp.c                  |    4 +-
 arch/arm/mach-vexpress/v2m.c                      |  265 ++++++++++++++++++---
Quoted 8 lines
 arch/arm/mach-vexpress/v2p-ca5s_ca9.c             |  115 +++++++++
 18 files changed, 1272 insertions(+), 115 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/vexpress
 create mode 100644 arch/arm/boot/dts/vexpress-v2m-rs1.dtsi
 create mode 100644 arch/arm/boot/dts/vexpress-v2m.dtsi
 create mode 100644 arch/arm/boot/dts/vexpress-v2p-ca5s.dts
 create mode 100644 arch/arm/boot/dts/vexpress-v2p-ca9.dts
 create mode 100644 arch/arm/mach-vexpress/v2p-ca5s_ca9.c
Quoted 8 lines

Other than Dave's comments, looks good. For the series:

There are a number of compatible strings for various peripherals defined without documentation, but you're not really using them so I think it's fine for now. BTW, I believe Dave said he was going to document some of the primecell peripherals. :)

I hadn't forgotten ... I was going to follow up on those shortly :)

Cheers
---Dave

#18 lore raw

v2 cover Versatile Express DT support

In reply to Rob Herring
Quoted 49 lines · Rob Herring
Quoted 39 lines · Pawel Moll

Hello again,

This version of the series (hopefully) addresses all the suggestions made by Dave, Rob and Russell.

The compatible values are specific for the tiles now and the memory map variant is defined as a custom property in the motherboard node.

Tested on V2P-CA9 coretile both with ATAGs and DT and V2P-CA5s with DT.

All comments, as always, welcomed!

Pawel

Pawel Moll (4):
ARM: vexpress: Get rid of MMIO_P2V
ARM: vexpress: Add DT support in v2m
ARM: vexpress: Initial RS1 memory map support
ARM: vexpress: DT-based support for CoreTiles Express A5x2 and A9x4

 Documentation/devicetree/bindings/arm/vexpress    |  101 ++++++++
 arch/arm/boot/dts/vexpress-v2m-rs1.dtsi           |  192 +++++++++++++++
 arch/arm/boot/dts/vexpress-v2m.dtsi               |  191 +++++++++++++++
 arch/arm/boot/dts/vexpress-v2p-ca5s.dts           |  132 ++++++++++
 arch/arm/boot/dts/vexpress-v2p-ca9.dts            |  146 +++++++++++
 arch/arm/include/asm/hardware/arm_timer.h         |    5 +
 arch/arm/mach-vexpress/Kconfig                    |   35 +++
 arch/arm/mach-vexpress/Makefile                   |    1 +
 arch/arm/mach-vexpress/Makefile.boot              |    6 +
 arch/arm/mach-vexpress/core.h                     |   21 ++-
 arch/arm/mach-vexpress/ct-ca9x4.c                 |   52 +---
 arch/arm/mach-vexpress/include/mach/ct-ca9x4.h    |   13 +-
 arch/arm/mach-vexpress/include/mach/debug-macro.S |   37 +++-
 arch/arm/mach-vexpress/include/mach/motherboard.h |   58 +++--
 arch/arm/mach-vexpress/include/mach/uncompress.h  |   13 +-
 arch/arm/mach-vexpress/platsmp.c                  |    4 +-
 arch/arm/mach-vexpress/v2m.c                      |  265 ++++++++++++++++++---
Quoted 8 lines
 arch/arm/mach-vexpress/v2p-ca5s_ca9.c             |  115 +++++++++
 18 files changed, 1272 insertions(+), 115 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/vexpress
 create mode 100644 arch/arm/boot/dts/vexpress-v2m-rs1.dtsi
 create mode 100644 arch/arm/boot/dts/vexpress-v2m.dtsi
 create mode 100644 arch/arm/boot/dts/vexpress-v2p-ca5s.dts
 create mode 100644 arch/arm/boot/dts/vexpress-v2p-ca9.dts
 create mode 100644 arch/arm/mach-vexpress/v2p-ca5s_ca9.c
Quoted 8 lines

Other than Dave's comments, looks good. For the series:

There are a number of compatible strings for various peripherals defined without documentation, but you're not really using them so I think it's fine for now. BTW, I believe Dave said he was going to document some of the primecell peripherals. :)

Oh, btw, git am reports a few whitespace errors on the last full post of the series (v2).

Can you shove the series through checkpatch.pl and/or git am and fix any minor issues, now that the series is relatively stable?

Thanks
---Dave

author
#19 lore raw

v2 cover Versatile Express DT support

Quoted 5 lines · Dave Martin

Oh, btw, git am reports a few whitespace errors on the last full post of the series (v2).

Can you shove the series through checkpatch.pl and/or git am and fix any minor issues, now that the series is relatively stable?

I did, actually:

8<--------------------------------------------------------------------

$ scripts/checkpatch.pl 0001-ARM-vexpress-Get-rid-of-MMIO_P2V.patch 
total: 0 errors, 0 warnings, 363 lines checked

0001-ARM-vexpress-Get-rid-of-MMIO_P2V.patch has no obvious style problems and is ready for submission.

$ scripts/checkpatch.pl 0002-ARM-vexpress-Add-DT-support-in-v2m.patch 
total: 0 errors, 0 warnings, 505 lines checked

0002-ARM-vexpress-Add-DT-support-in-v2m.patch has no obvious style problems and is ready for submission.

$ scripts/checkpatch.pl 0003-ARM-vexpress-Initial-RS1-memory-map-support.patch 
WARNING: Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt
#308: FILE: arch/arm/mach-vexpress/include/mach/uncompress.h:25:
+#define AMBA_PERIPH_ID0(base)	(*(volatile unsigned char *)((base) + 0xfe0))

total: 0 errors, 1 warnings, 368 lines checked

0003-ARM-vexpress-Initial-RS1-memory-map-support.patch has style problems, please review.

If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS.

$ scripts/checkpatch.pl 0004-ARM-vexpress-DT-based-support-for-CoreTiles-Express-.patch 
total: 0 errors, 0 warnings, 424 lines checked

0004-ARM-vexpress-DT-based-support-for-CoreTiles-Express-.patch has no obvious style problems and is ready for submission. 8<--------------------------------------------------------------------

In the past I noticed that same - sometimes git am is complaining when chechpatch is clean. I never was determined to figure out why, though...

Pawe?

#20 lore raw

v2 cover Versatile Express DT support

Quoted 32 lines · Pawel Moll
Quoted 5 lines · Dave Martin

Oh, btw, git am reports a few whitespace errors on the last full post of the series (v2).

Can you shove the series through checkpatch.pl and/or git am and fix any minor issues, now that the series is relatively stable?

I did, actually:

8<--------------------------------------------------------------------

$ scripts/checkpatch.pl 0001-ARM-vexpress-Get-rid-of-MMIO_P2V.patch 
total: 0 errors, 0 warnings, 363 lines checked

0001-ARM-vexpress-Get-rid-of-MMIO_P2V.patch has no obvious style problems and is ready for submission.

$ scripts/checkpatch.pl 0002-ARM-vexpress-Add-DT-support-in-v2m.patch 
total: 0 errors, 0 warnings, 505 lines checked

0002-ARM-vexpress-Add-DT-support-in-v2m.patch has no obvious style problems and is ready for submission.

$ scripts/checkpatch.pl 0003-ARM-vexpress-Initial-RS1-memory-map-support.patch 
WARNING: Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt
#308: FILE: arch/arm/mach-vexpress/include/mach/uncompress.h:25:
+#define AMBA_PERIPH_ID0(base)	(*(volatile unsigned char *)((base) + 0xfe0))

total: 0 errors, 1 warnings, 368 lines checked

0003-ARM-vexpress-Initial-RS1-memory-map-support.patch has style problems, please review.

If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS.

$ scripts/checkpatch.pl 0004-ARM-vexpress-DT-based-support-for-CoreTiles-Express-.patch 
total: 0 errors, 0 warnings, 424 lines checked
Quoted 6 lines

0004-ARM-vexpress-DT-based-support-for-CoreTiles-Express-.patch has no obvious style problems and is ready for submission. 8<--------------------------------------------------------------------

In the past I noticed that same - sometimes git am is complaining when chechpatch is clean. I never was determined to figure out why, though...

Maybe those whitespace issues are only being reported by git am. We can still fix them though, no?

Cheers
---Dave

author
#21 lore raw

v2 cover Versatile Express DT support

In reply to Rob Herring
Quoted 3 lines · Rob Herring

Other than Dave's comments, looks good. For the series:

Thanks!

Quoted 4 lines

There are a number of compatible strings for various peripherals defined without documentation, but you're not really using them so I think it's fine for now. BTW, I believe Dave said he was going to document some of the primecell peripherals. :)

Yep, we agreed with Dave that the ones I'll take care of soon are MMCI (PL180) and the VE sysregs, the rest is his :-)

On that subject - some time ago I sent a patch adding "sil" vendor string, as this one the only non-documented one I used:

http://article.gmane.org/gmane.linux.drivers.devicetree/9362/

Cheers!

Pawe?

#22 lore raw

v2 cover Versatile Express DT support

Quoted 12 lines · Pawel Moll
Quoted 3 lines · Rob Herring

Other than Dave's comments, looks good. For the series:

Thanks!

Quoted 4 lines

There are a number of compatible strings for various peripherals defined without documentation, but you're not really using them so I think it's fine for now. BTW, I believe Dave said he was going to document some of the primecell peripherals. :)

Quoted 7 lines

Yep, we agreed with Dave that the ones I'll take care of soon are MMCI (PL180) and the VE sysregs, the rest is his :-)

On that subject - some time ago I sent a patch adding "sil" vendor string, as this one the only non-documented one I used:

http://article.gmane.org/gmane.linux.drivers.devicetree/9362/

Okay. I'll apply.

But that's just a vendor. There's still binding docs needed for the actual sil9022 device and some others.

Rob

author
#23 lore raw

v2 cover Versatile Express DT support

Quoted 4 lines · Rob Herring

Okay. I'll apply.

But that's just a vendor. There's still binding docs needed for the actual sil9022 device and some others.

I think the sil one is the only undocumented device we use now, except for the primecells that Dave and I will take care of?

I will also cover the sii9022, if only I get clearance from our legals (the datasheet we got is under NDA) to write a driver for it (the device is quite complex, so I wouldn't like to define bindings without testing them first).

Cheers!

Pawe?