Skip to contentSkip to conversation

ARM: vexpress: add support for multiple core tiles

PATCH RESEND New Will Deacon 1 participant 1 message Feb 14, 2011

Subsystems (3)

v1 of 5 New Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 ARM: vexpress: add support for multiple core tiles

The current Versatile Express BSP defines the MACHINE_START macro in the core tile code.

This patch moves this into the generic board code and introduces a method for determining the current tile at runtime, allowing the Kernel to have support for multiple tiles compiled in. Tile-specific functions are executed via a descriptor struct containing the correct implementations for the current tile.

Cc Russell King - ARM Linux <[email protected]>

---

Russell - this has been sitting in your patch system for a while now and I've been rebasing it onto -next so that it applies cleanly. I haven't seen any conflicts lately so I wondered if there was anything else pending or if this can now be merged? It's a pre-requisite for the A5 and A15 BSPs which we hope to post soon.

 arch/arm/mach-vexpress/core.h                     |    6 --
 arch/arm/mach-vexpress/ct-ca9x4.c                 |   45 ++++++++++-----
 arch/arm/mach-vexpress/include/mach/ct-ca9x4.h    |    2 +
 arch/arm/mach-vexpress/include/mach/motherboard.h |   22 +++++++
 arch/arm/mach-vexpress/platsmp.c                  |   31 +---------
 arch/arm/mach-vexpress/v2m.c                      |   65 +++++++++++++++++----
 6 files changed, 110 insertions(+), 61 deletions(-)
arch/arm/mach-vexpress/core.h +0 -6
index e0312a1..f439715 100644
@@ -17,9 +17,3 @@ struct amba_device name##_device = {		\
 	.irq		= IRQ_##base,		\
 	/* .dma		= DMA_##base,*/		\
 }
-
-struct map_desc;
-
-void v2m_map_io(struct map_desc *tile, size_t num);
-void v2m_init_early(void);
-extern struct sys_timer v2m_timer;
arch/arm/mach-vexpress/ct-ca9x4.c +30 -15

79 lines not on this page · raw message

arch/arm/mach-vexpress/include/mach/ct-ca9x4.h +2 -0
index f9e2f8d..a34d3d4 100644
@@ -45,4 +45,6 @@
 #define IRQ_CT_CA9X4_PMU_CPU2	94
 #define IRQ_CT_CA9X4_PMU_CPU3	95
 
+extern struct ct_desc ct_ca9x4_desc;
+
 #endif
arch/arm/mach-vexpress/include/mach/motherboard.h +22 -0
index 98a8ded..0a3a375 100644
@@ -118,4 +118,26 @@
 int v2m_cfg_write(u32 devfn, u32 data);
 int v2m_cfg_read(u32 devfn, u32 *data);
 
+/*
+ * Core tile IDs
+ */
+#define V2M_CT_ID_CA9		0x0c000191
+#define V2M_CT_ID_UNSUPPORTED	0xff000191
+#define V2M_CT_ID_MASK		0xff000fff
+
+struct ct_desc {
+	u32			id;
+	const char		*name;
+	void			(*map_io)(void);
+	void			(*init_early)(void);
+	void			(*init_irq)(void);
+	void			(*init_tile)(void);
+#ifdef CONFIG_SMP
+	void			(*init_cpu_map)(void);
+	void			(*smp_enable)(unsigned int);
+#endif
+};
+
+extern struct ct_desc *ct_desc;
+
 #endif
arch/arm/mach-vexpress/platsmp.c +2 -29
index 1892702..2b5f7ac 100644
@@ -13,10 +13,8 @@
 #include <linux/smp.h>
 #include <linux/io.h>
 
-#include <asm/smp_scu.h>
 #include <asm/unified.h>
 
-#include <mach/ct-ca9x4.h>
 #include <mach/motherboard.h>
 #define V2M_PA_CS7 0x10000000
 
@@ -24,47 +22,22 @@
 
 extern void versatile_secondary_startup(void);
 
-static void __iomem *scu_base_addr(void)
-{
-	return MMIO_P2V(A9_MPCORE_SCU);
-}
-
 /*
  * Initialise the CPU possible map early - this describes the CPUs
  * which may be present or become present in the system.
  */
 void __init smp_init_cpus(void)
 {
-	void __iomem *scu_base = scu_base_addr();
-	unsigned int i, ncores;
-
-	ncores = scu_base ? scu_get_core_count(scu_base) : 1;
-
-	/* sanity check */
-	if (ncores > NR_CPUS) {
-		printk(KERN_WARNING
-		       "vexpress: no. of cores (%d) greater than configured "
-		       "maximum of %d - clipping\n",
-		       ncores, NR_CPUS);
-		ncores = NR_CPUS;
-	}
-
-	for (i = 0; i < ncores; i++)
-		set_cpu_possible(i, true);
+	ct_desc->init_cpu_map();
 }
 
 void __init platform_smp_prepare_cpus(unsigned int max_cpus)
 {
-	int i;
-
 	/*
 	 * Initialise the present map, which describes the set of CPUs
 	 * actually populated at the present time.
 	 */
-	for (i = 0; i < max_cpus; i++)
-		set_cpu_present(i, true);
-
-	scu_enable(scu_base_addr());
+	ct_desc->smp_enable(max_cpus);
 
 	/*
 	 * Write the address of secondary startup into the
arch/arm/mach-vexpress/v2m.c +54 -11

101 lines not on this page · raw message

Signature · 1 line
1.7.0.4