summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2009-03-10 10:24:21 +0000
committerCatalin Marinas <catalin.marinas@arm.com>2009-03-10 10:24:21 +0000
commit70e1b8d308f635eaeb7dad14fc5c79f082a147ef (patch)
treef2f18def46154f282cf393423e401fc2d953a350 /arch
parentf034a4ab31b0663a5b68c65503122bed1eaca349 (diff)
RealView: Initialise the L2 cache via early_initcall
This is required on SMP systems where the L2 cache is already enabled when the kernel is started (e.g. in non-secure mode) and boot_secondary() needs to call outer_clean_range(). Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-realview/platsmp.c3
-rw-r--r--arch/arm/mach-realview/realview_eb.c24
-rw-r--r--arch/arm/mach-realview/realview_pb11mp.c22
-rw-r--r--arch/arm/mach-realview/realview_pbx.c15
4 files changed, 45 insertions, 19 deletions
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c
index 3d16b77c937c..6baa96f02d45 100644
--- a/arch/arm/mach-realview/platsmp.c
+++ b/arch/arm/mach-realview/platsmp.c
@@ -128,8 +128,11 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
* Note that "pen_release" is the hardware CPU ID, whereas
* "cpu" is Linux's internal ID.
*/
+ flush_cache_all();
+ outer_clean_range(__pa(&secondary_data), __pa(&secondary_data + 1));
pen_release = cpu;
flush_cache_all();
+ outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
/*
* XXX
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index 3762405c6c34..f439ccae6b1f 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -364,20 +364,28 @@ static struct sys_timer realview_eb_timer = {
.init = realview_eb_timer_init,
};
+#ifdef CONFIG_CACHE_L2X0
+static int __init realview_eb_l2x0_init(void)
+{
+ if (machine_is_realview_eb_mp())
+ /*
+ * 1MB (128KB/way), 8-way associativity, evmon/parity/share
+ * Bits: .... ...0 0111 1001 0000 .... .... ....
+ */
+ l2x0_init(__io_address(REALVIEW_EB11MP_L220_BASE),
+ 0x00790000, 0xfe000fff);
+ return 0;
+}
+early_initcall(realview_eb_l2x0_init);
+#endif
+
static void __init realview_eb_init(void)
{
int i;
- if (core_tile_eb11mp() || core_tile_a9mp()) {
+ if (core_tile_eb11mp() || core_tile_a9mp())
realview_eb11mp_fixup();
-#ifdef CONFIG_CACHE_L2X0
- /* 1MB (128KB/way), 8-way associativity, evmon/parity/share enabled
- * Bits: .... ...0 0111 1001 0000 .... .... .... */
- l2x0_init(__io_address(REALVIEW_EB11MP_L220_BASE), 0x00790000, 0xfe000fff);
-#endif
- }
-
clk_register(&realview_clcd_clk);
realview_flash_register(&realview_eb_flash_resource, 1);
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c
index d32722772d59..95e48e11370e 100644
--- a/arch/arm/mach-realview/realview_pb11mp.c
+++ b/arch/arm/mach-realview/realview_pb11mp.c
@@ -282,16 +282,26 @@ static struct sys_timer realview_pb11mp_timer = {
.init = realview_pb11mp_timer_init,
};
+#ifdef CONFIG_CACHE_L2X0
+static int __init realview_pb11mp_l2x0_init(void)
+{
+ if (machine_is_realview_pb11mp()) {
+ /*
+ * 1MB (128KB/way), 8-way associativity, evmon/parity/share
+ * Bits: .... ...0 0111 1001 0000 .... .... ....
+ */
+ l2x0_init(__io_address(REALVIEW_TC11MP_L220_BASE),
+ 0x00790000, 0xfe000fff);
+ }
+ return 0;
+}
+early_initcall(realview_pb11mp_l2x0_init);
+#endif
+
static void __init realview_pb11mp_init(void)
{
int i;
-#ifdef CONFIG_CACHE_L2X0
- /* 1MB (128KB/way), 8-way associativity, evmon/parity/share enabled
- * Bits: .... ...0 0111 1001 0000 .... .... .... */
- l2x0_init(__io_address(REALVIEW_TC11MP_L220_BASE), 0x00790000, 0xfe000fff);
-#endif
-
clk_register(&realview_clcd_clk);
realview_flash_register(realview_pb11mp_flash_resource,
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c
index 0b7767147db8..3c3cc050303c 100644
--- a/arch/arm/mach-realview/realview_pbx.c
+++ b/arch/arm/mach-realview/realview_pbx.c
@@ -289,12 +289,10 @@ static struct sys_timer realview_pbx_timer = {
.init = realview_pbx_timer_init,
};
-static void __init realview_pbx_init(void)
-{
- int i;
-
#ifdef CONFIG_CACHE_L2X0
- if (core_tile_pbxa9mp()) {
+static int __init realview_pbx_l2x0_init(void)
+{
+ if (machine_is_realview_pbx() && core_tile_pbxa9mp()) {
void __iomem *l2x0_base =
__io_address(REALVIEW_PBX_TILE_L220_BASE);
@@ -306,8 +304,15 @@ static void __init realview_pbx_init(void)
* Bits: .. 0 0 0 0 1 00 1 0 1 001 0 000 0 .... .... .... */
l2x0_init(l2x0_base, 0x02520000, 0xc0000fff);
}
+ return 0;
+}
+early_initcall(realview_pbx_l2x0_init);
#endif
+static void __init realview_pbx_init(void)
+{
+ int i;
+
clk_register(&realview_clcd_clk);
realview_flash_register(realview_pbx_flash_resources,