From e4c2d10c036828dbe157316603756215bba292a0 Mon Sep 17 00:00:00 2001 From: Catalin Marinas Date: Mon, 1 Dec 2008 14:54:58 +0000 Subject: [PATCH] --- yaml --- r: 123641 b: refs/heads/master c: 1bbdf637baa708a2f0f46ead56c6c618b7dad7a8 h: refs/heads/master i: 123639: 89ea72db58dbcd80eb4c07cdf2e1b47a1dc6fc91 v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-realview/core.c | 2 +- .../arm/mach-realview/include/mach/board-eb.h | 3 ++ trunk/arch/arm/mach-realview/platsmp.c | 41 ++++++++----------- 4 files changed, 21 insertions(+), 27 deletions(-) diff --git a/[refs] b/[refs] index 259c05f2649a..260c824a5177 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ebac6546df7e8bd17f66f029c616ea9ee3c595ae +refs/heads/master: 1bbdf637baa708a2f0f46ead56c6c618b7dad7a8 diff --git a/trunk/arch/arm/mach-realview/core.c b/trunk/arch/arm/mach-realview/core.c index b62799262c6f..65c39a73d1cb 100644 --- a/trunk/arch/arm/mach-realview/core.c +++ b/trunk/arch/arm/mach-realview/core.c @@ -50,7 +50,7 @@ #define REALVIEW_REFCOUNTER (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_24MHz_OFFSET) -/* used by entry-macro.S */ +/* used by entry-macro.S and platsmp.c */ void __iomem *gic_cpu_base_addr; /* diff --git a/trunk/arch/arm/mach-realview/include/mach/board-eb.h b/trunk/arch/arm/mach-realview/include/mach/board-eb.h index cdbf551fd3de..268d7701fa9b 100644 --- a/trunk/arch/arm/mach-realview/include/mach/board-eb.h +++ b/trunk/arch/arm/mach-realview/include/mach/board-eb.h @@ -193,4 +193,7 @@ #define core_tile_a9mp() 0 #endif +#define machine_is_realview_eb_mp() \ + (machine_is_realview_eb() && (core_tile_eb11mp() || core_tile_a9mp())) + #endif /* __ASM_ARCH_BOARD_EB_H */ diff --git a/trunk/arch/arm/mach-realview/platsmp.c b/trunk/arch/arm/mach-realview/platsmp.c index faeb01c76f66..8fce85f33033 100644 --- a/trunk/arch/arm/mach-realview/platsmp.c +++ b/trunk/arch/arm/mach-realview/platsmp.c @@ -23,6 +23,8 @@ #include #include +#include "core.h" + extern void realview_secondary_startup(void); /* @@ -31,16 +33,20 @@ extern void realview_secondary_startup(void); */ volatile int __cpuinitdata pen_release = -1; +static void __iomem *scu_base_addr(void) +{ + if (machine_is_realview_eb_mp()) + return __io_address(REALVIEW_EB11MP_SCU_BASE); + else if (machine_is_realview_pb11mp()) + return __io_address(REALVIEW_TC11MP_SCU_BASE); + else + return (void __iomem *)0; +} + static unsigned int __init get_core_count(void) { unsigned int ncores; - void __iomem *scu_base = 0; - - if (machine_is_realview_eb() && - (core_tile_eb11mp() || core_tile_a9mp())) - scu_base = __io_address(REALVIEW_EB11MP_SCU_BASE); - else if (machine_is_realview_pb11mp()) - scu_base = __io_address(REALVIEW_TC11MP_SCU_BASE); + void __iomem *scu_base = scu_base_addr(); if (scu_base) { ncores = __raw_readl(scu_base + SCU_CONFIG); @@ -57,15 +63,7 @@ static unsigned int __init get_core_count(void) static void scu_enable(void) { u32 scu_ctrl; - void __iomem *scu_base; - - if (machine_is_realview_eb() && - (core_tile_eb11mp() || core_tile_a9mp())) - scu_base = __io_address(REALVIEW_EB11MP_SCU_BASE); - else if (machine_is_realview_pb11mp()) - scu_base = __io_address(REALVIEW_TC11MP_SCU_BASE); - else - BUG(); + void __iomem *scu_base = scu_base_addr(); scu_ctrl = __raw_readl(scu_base + SCU_CTRL); scu_ctrl |= 1; @@ -90,11 +88,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu) * core (e.g. timer irq), then they will not have been enabled * for us: do so */ - if (machine_is_realview_eb() && - (core_tile_eb11mp() || core_tile_a9mp())) - gic_cpu_init(0, __io_address(REALVIEW_EB11MP_GIC_CPU_BASE)); - else if (machine_is_realview_pb11mp()) - gic_cpu_init(0, __io_address(REALVIEW_TC11MP_GIC_CPU_BASE)); + gic_cpu_init(0, gic_cpu_base_addr); /* * let the primary processor know we're out of the @@ -235,10 +229,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) * dummy (!CONFIG_LOCAL_TIMERS), it was already registers in * realview_timer_init */ - if ((machine_is_realview_eb() && - (core_tile_eb11mp() || core_tile_a9mp())) || - machine_is_realview_pb11mp()) - local_timer_setup(); + local_timer_setup(); #endif /*