From: pawel.moll@arm.com (Pawel Moll)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] ARM: vexpress: Remove platform SMP functions from ct_desc
Date: Fri, 11 Nov 2011 18:27:03 +0000 [thread overview]
Message-ID: <1321036026-23411-3-git-send-email-pawel.moll@arm.com> (raw)
In-Reply-To: <1321036026-23411-1-git-send-email-pawel.moll@arm.com>
This patch removes platform SMP callbacks from ct_desc struct
and replaces them with global symbols in preparation for
DT-based support code.
This is a temporary measure till "SoC descriptors" code
gets into the main line.
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
---
arch/arm/mach-vexpress/core.h | 6 +++
arch/arm/mach-vexpress/ct-ca9x4.c | 50 +++++++++-----------
arch/arm/mach-vexpress/include/mach/motherboard.h | 4 --
arch/arm/mach-vexpress/platsmp.c | 7 ++-
4 files changed, 34 insertions(+), 33 deletions(-)
diff --git a/arch/arm/mach-vexpress/core.h b/arch/arm/mach-vexpress/core.h
index 27a622b..2139b37 100644
--- a/arch/arm/mach-vexpress/core.h
+++ b/arch/arm/mach-vexpress/core.h
@@ -23,3 +23,9 @@ struct amba_device name##_device = { \
#define V2T_PERIPH 0xf8200000
#define V2T_PERIPH_P2V(offset) ((void __iomem *)(V2T_PERIPH | (offset)))
+/* Will disappear once platform SMP calls are "abstracted" */
+#if defined(CONFIG_SMP)
+extern void (*vexpress_init_cpu_map)(void);
+extern void (*vexpress_smp_enable)(unsigned int);
+#endif
+
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
index 47c0733..d6dc80a 100644
--- a/arch/arm/mach-vexpress/ct-ca9x4.c
+++ b/arch/arm/mach-vexpress/ct-ca9x4.c
@@ -39,9 +39,32 @@ static struct map_desc ct_ca9x4_io_desc[] __initdata = {
},
};
+#ifdef CONFIG_SMP
+static void ct_ca9x4_init_cpu_map(void)
+{
+ int i, ncores;
+ ncores = scu_get_core_count(V2T_PERIPH_P2V(A9_MPCORE_SCU));
+
+ for (i = 0; i < ncores; ++i)
+ set_cpu_possible(i, true);
+
+ set_smp_cross_call(gic_raise_softirq);
+}
+
+static void ct_ca9x4_smp_enable(unsigned int max_cpus)
+{
+ scu_enable(V2T_PERIPH_P2V(A9_MPCORE_SCU));
+}
+#endif
+
static void __init ct_ca9x4_map_io(void)
{
iotable_init(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc));
+#ifdef CONFIG_SMP
+ /* Will be gone once the SoC descriptors are in */
+ vexpress_init_cpu_map = ct_ca9x4_init_cpu_map;
+ vexpress_smp_enable = ct_ca9x4_smp_enable;
+#endif
}
static void __init ct_ca9x4_init_irq(void)
@@ -188,29 +211,6 @@ static void __init ct_ca9x4_init(void)
platform_device_register(&pmu_device);
}
-#ifdef CONFIG_SMP
-static void ct_ca9x4_init_cpu_map(void)
-{
- int i, ncores = scu_get_core_count(V2TILE_PERIPH_P2V(A9_MPCORE_SCU));
-
- if (ncores > nr_cpu_ids) {
- pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",
- ncores, nr_cpu_ids);
- ncores = nr_cpu_ids;
- }
-
- for (i = 0; i < ncores; ++i)
- set_cpu_possible(i, true);
-
- set_smp_cross_call(gic_raise_softirq);
-}
-
-static void ct_ca9x4_smp_enable(unsigned int max_cpus)
-{
- scu_enable(V2TILE_PERIPH_P2V(A9_MPCORE_SCU));
-}
-#endif
-
struct ct_desc ct_ca9x4_desc __initdata = {
.id = V2M_CT_ID_CA9,
.name = "CA9x4",
@@ -218,8 +218,4 @@ struct ct_desc ct_ca9x4_desc __initdata = {
.init_early = ct_ca9x4_init_early,
.init_irq = ct_ca9x4_init_irq,
.init_tile = ct_ca9x4_init,
-#ifdef CONFIG_SMP
- .init_cpu_map = ct_ca9x4_init_cpu_map,
- .smp_enable = ct_ca9x4_smp_enable,
-#endif
};
diff --git a/arch/arm/mach-vexpress/include/mach/motherboard.h b/arch/arm/mach-vexpress/include/mach/motherboard.h
index da9ac29..848353b 100644
--- a/arch/arm/mach-vexpress/include/mach/motherboard.h
+++ b/arch/arm/mach-vexpress/include/mach/motherboard.h
@@ -129,10 +129,6 @@ struct ct_desc {
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;
diff --git a/arch/arm/mach-vexpress/platsmp.c b/arch/arm/mach-vexpress/platsmp.c
index e8be99d..b41e4e8 100644
--- a/arch/arm/mach-vexpress/platsmp.c
+++ b/arch/arm/mach-vexpress/platsmp.c
@@ -20,6 +20,9 @@
#include "core.h"
+void (*vexpress_init_cpu_map)(void);
+void (*vexpress_smp_enable)(unsigned int);
+
extern void versatile_secondary_startup(void);
/*
@@ -28,7 +31,7 @@ extern void versatile_secondary_startup(void);
*/
void __init smp_init_cpus(void)
{
- ct_desc->init_cpu_map();
+ vexpress_init_cpu_map();
}
void __init platform_smp_prepare_cpus(unsigned int max_cpus)
@@ -37,7 +40,7 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
* Initialise the present map, which describes the set of CPUs
* actually populated at the present time.
*/
- ct_desc->smp_enable(max_cpus);
+ vexpress_smp_enable(max_cpus);
/*
* Write the address of secondary startup into the
--
1.6.3.3
next prev parent reply other threads:[~2011-11-11 18:27 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-11 18:27 [PATCH 0/5] Versatile Express DT support, take 2 Pawel Moll
2011-11-11 18:27 ` [PATCH 1/5] ARM: vexpress: Get rid of MMIO_P2V Pawel Moll
2011-11-16 15:35 ` Dave Martin
2011-11-16 16:16 ` Pawel Moll
2011-11-16 17:28 ` Dave Martin
2011-11-16 17:30 ` Pawel Moll
2011-11-17 7:02 ` Ryan Harkin
2011-11-17 15:43 ` Russell King - ARM Linux
2011-11-18 12:20 ` Pawel Moll
2011-11-18 17:44 ` Russell King - ARM Linux
2011-11-11 18:27 ` Pawel Moll [this message]
2011-11-17 15:31 ` [PATCH 2/5] ARM: vexpress: Remove platform SMP functions from ct_desc Russell King - ARM Linux
2011-11-18 12:20 ` Pawel Moll
2011-11-11 18:27 ` [PATCH 3/5] ARM: vexpress: Add DT support in v2m Pawel Moll
2011-11-16 15:44 ` Dave Martin
2011-11-16 16:26 ` Rob Herring
2011-11-16 16:37 ` Pawel Moll
2011-11-16 16:59 ` Rob Herring
2011-11-16 17:07 ` Pawel Moll
2011-11-16 17:37 ` Pawel Moll
2011-11-16 19:14 ` Dave Martin
2011-11-16 17:39 ` Dave Martin
2011-11-16 17:50 ` Dave Martin
2011-11-16 17:55 ` Pawel Moll
2011-11-17 15:53 ` Russell King - ARM Linux
2011-11-18 12:20 ` Pawel Moll
2011-11-18 17:49 ` Russell King - ARM Linux
2011-11-16 16:35 ` Pawel Moll
2011-11-16 17:57 ` Dave Martin
2011-11-17 13:50 ` Pawel Moll
2011-11-17 14:41 ` Dave Martin
2011-11-17 16:05 ` Russell King - ARM Linux
2011-11-17 18:37 ` Dave Martin
2011-11-18 17:52 ` Russell King - ARM Linux
2011-11-18 12:20 ` Pawel Moll
2011-11-11 18:27 ` [PATCH 4/5] ARM: vexpress: Initial RS1 memory map support Pawel Moll
2011-11-16 15:42 ` Dave Martin
2011-11-16 16:28 ` Pawel Moll
2011-11-16 18:03 ` Dave Martin
2011-11-17 15:36 ` Russell King - ARM Linux
2011-11-18 12:20 ` Pawel Moll
2011-11-18 17:56 ` Russell King - ARM Linux
2011-11-11 18:27 ` [PATCH 5/5] ARM: vexpress: DT-based support for CoreTiles Express A5x2 and A9x4 Pawel Moll
2011-11-11 22:30 ` Rob Herring
2011-11-11 22:54 ` Pawel Moll
2011-11-16 15:36 ` Dave Martin
2011-11-16 16:22 ` Pawel Moll
2011-11-16 18:17 ` Dave Martin
2011-11-16 15:33 ` [PATCH 0/5] Versatile Express DT support, take 2 Dave Martin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1321036026-23411-3-git-send-email-pawel.moll@arm.com \
--to=pawel.moll@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).