From patchwork Wed Sep 12 14:58:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11360 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 89CA523E29 for ; Wed, 12 Sep 2012 14:58:46 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 50E4D3EFA227 for ; Wed, 12 Sep 2012 14:58:46 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id k11so3001848iea.11 for ; Wed, 12 Sep 2012 07:58:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-provags-id:x-gm-message-state; bh=0ew8LjV355M8i72oUbEd2gFO5GOed9VhC38T6/442s4=; b=E2PyGGutPZaTKmZ8Ugv3KH00bGI/xfG2R0o6Od3PBPjpItB8DSpPOh0NNnPAm+B9cz ycN54dxUUp3hgrF0xysxC2SIE7S1HerD+i/BJ8AcUGdBlOXY4cTzH/g0uYDheT4/10FF 1rfyFFDvQNkqMWegDeOplZM5VSIUagfz9Uxt4pFdg61RM71ZVA0lPMaarHnm0dxYliKC qJkXnTaC/CDmEYzgUp8BUgpmKYrE8IJf+CKQZRfZhLyxuicwiIhEnlLPB6m0zRWcMkwV 7fCwX0q9FeA8KRe1MFsetYC0yzSIwudzDu0vmFly7IWIFRRgkIzP6ExerMgcGyKzZrfU JCgQ== Received: by 10.50.45.162 with SMTP id o2mr21739384igm.0.1347461926073; Wed, 12 Sep 2012 07:58:46 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp75424igc; Wed, 12 Sep 2012 07:58:45 -0700 (PDT) Received: by 10.204.148.78 with SMTP id o14mr6032354bkv.38.1347461924690; Wed, 12 Sep 2012 07:58:44 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de. [212.227.126.186]) by mx.google.com with ESMTP id ha10si12690502bkc.65.2012.09.12.07.58.44; Wed, 12 Sep 2012 07:58:44 -0700 (PDT) Received-SPF: neutral (google.com: 212.227.126.186 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.126.186; Authentication-Results: mx.google.com; spf=neutral (google.com: 212.227.126.186 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) smtp.mail=arnd@arndb.de Received: from klappe2.boeblingen.de.ibm.com (deibp9eh1--blueice3n2.emea.ibm.com [195.212.29.180]) by mrelayeu.kundenserver.de (node=mreu4) with ESMTP (Nemesis) id 0LtQrQ-1TdDDd24zU-010xx7; Wed, 12 Sep 2012 16:58:37 +0200 From: Arnd Bergmann To: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Linus Walleij , Arnd Bergmann Subject: [PATCH v9 07/13] ARM: SoC: convert ux500 to SoC descriptor Date: Wed, 12 Sep 2012 16:58:20 +0200 Message-Id: <1347461906-13527-8-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1347461906-13527-1-git-send-email-arnd@arndb.de> References: <1347461906-13527-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:/3JBjccM3rhndfzZH7xIvDQr92+/RHFQ054V+Q8mq8u 0WZSxW4/Fk7Meommq4pvdhih4zcBvkkOnJF0zpiOESVP5l5Ejt ks0o4uvVtwSYuC2bHS5HLIg9i11SIcfC8v9N+Ev8Vh8gYnleKE WjmP+70Ir3K6Elwgx4UiVqChEFpp1m78rTvwGsnJL/KB4kUs4G oHmn/0jVTApT7nnN5Rs3amXVGRtJvDC4mNulPTYL+G9mud24Gu nPnelkveoInKlZjX914aRGM64U4gXw6+A9G9TFFdqd26wlX2l2 9OJT+H6t/e4y+uMGKUvKohxFcaKj/bWFa6I8x/9sWSSxjFWUn8 5Xe92xi9Q2kvR9eTd6D0245f9Hh6d0AzllQdqug6Qz7O+081Ce P6dGLVWyn4E4WbzcNTPfi03Oc6GtaRMLE4= X-Gm-Message-State: ALoCoQn2cQ49tANnovCQ4FUGvthmeGj9+q8N3EnUX0BgBA2SvzzNsZwDkKuROH4Dcl8wRRvRMNaF From: Marc Zyngier Convert ux500 platforms to use the SoC descriptor to provide their SMP and CPU hotplug operations. Cc: Linus Walleij Signed-off-by: Marc Zyngier Signed-off-by: Arnd Bergmann --- arch/arm/mach-ux500/board-mop500.c | 4 ++++ arch/arm/mach-ux500/hotplug.c | 36 ++++++++---------------------- arch/arm/mach-ux500/include/mach/setup.h | 3 +++ arch/arm/mach-ux500/platsmp.c | 18 +++++++++++---- 4 files changed, 30 insertions(+), 31 deletions(-) diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index a534d88..1c6f74b 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -694,6 +694,7 @@ static void __init hrefv60_init_machine(void) MACHINE_START(U8500, "ST-Ericsson MOP500 platform") /* Maintainer: Srinidhi Kasagar */ .atag_offset = 0x100, + .smp = smp_ops(ux500_smp_ops), .map_io = u8500_map_io, .init_irq = ux500_init_irq, /* we re-use nomadik timer here */ @@ -705,6 +706,7 @@ MACHINE_END MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+") .atag_offset = 0x100, + .smp = smp_ops(ux500_smp_ops), .map_io = u8500_map_io, .init_irq = ux500_init_irq, .timer = &ux500_timer, @@ -715,6 +717,7 @@ MACHINE_END MACHINE_START(SNOWBALL, "Calao Systems Snowball platform") .atag_offset = 0x100, + .smp = smp_ops(ux500_smp_ops), .map_io = u8500_map_io, .init_irq = ux500_init_irq, /* we re-use nomadik timer here */ @@ -844,6 +847,7 @@ static const char * u8500_dt_board_compat[] = { DT_MACHINE_START(U8500_DT, "ST-Ericsson U8500 platform (Device Tree Support)") + .smp = smp_ops(ux500_smp_ops), .map_io = u8500_map_io, .init_irq = ux500_init_irq, /* we re-use nomadik timer here */ diff --git a/arch/arm/mach-ux500/hotplug.c b/arch/arm/mach-ux500/hotplug.c index c76f0f4..17b9a15 100644 --- a/arch/arm/mach-ux500/hotplug.c +++ b/arch/arm/mach-ux500/hotplug.c @@ -15,13 +15,20 @@ #include #include +#include + extern volatile int pen_release; -static inline void platform_do_lowpower(unsigned int cpu) +/* + * platform-specific code to shutdown a CPU + * + * Called with IRQs disabled + */ +void ux500_cpu_die(unsigned int cpu) { flush_cache_all(); - /* we put the platform to just WFI */ + /* directly enter low power state, skipping secure registers */ for (;;) { __asm__ __volatile__("dsb\n\t" "wfi\n\t" : : : "memory"); @@ -33,28 +40,3 @@ static inline void platform_do_lowpower(unsigned int cpu) } } } - -int platform_cpu_kill(unsigned int cpu) -{ - return 1; -} - -/* - * platform-specific code to shutdown a CPU - * - * Called with IRQs disabled - */ -void platform_cpu_die(unsigned int cpu) -{ - /* directly enter low power state, skipping secure registers */ - platform_do_lowpower(cpu); -} - -int platform_cpu_disable(unsigned int cpu) -{ - /* - * we don't allow CPU 0 to be shutdown (it is still too special - * e.g. clock tick interrupts) - */ - return cpu == 0 ? -EPERM : 0; -} diff --git a/arch/arm/mach-ux500/include/mach/setup.h b/arch/arm/mach-ux500/include/mach/setup.h index 7914e5e..6be4c4d 100644 --- a/arch/arm/mach-ux500/include/mach/setup.h +++ b/arch/arm/mach-ux500/include/mach/setup.h @@ -45,4 +45,7 @@ extern struct sys_timer ux500_timer; .type = MT_MEMORY, \ } +extern struct smp_operations ux500_smp_ops; +extern void ux500_cpu_die(unsigned int cpu); + #endif /* __ASM_ARCH_SETUP_H */ diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c index da1d5ad..b6f4e0e 100644 --- a/arch/arm/mach-ux500/platsmp.c +++ b/arch/arm/mach-ux500/platsmp.c @@ -58,7 +58,7 @@ static void __iomem *scu_base_addr(void) static DEFINE_SPINLOCK(boot_lock); -void __cpuinit platform_secondary_init(unsigned int cpu) +static void __cpuinit ux500_secondary_init(unsigned int cpu) { /* * if any interrupts are already enabled for the primary @@ -80,7 +80,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu) spin_unlock(&boot_lock); } -int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) +static int __cpuinit ux500_boot_secondary(unsigned int cpu, struct task_struct *idle) { unsigned long timeout; @@ -145,7 +145,7 @@ static void __init wakeup_secondary(void) * 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) +static void __init ux500_smp_init_cpus(void) { void __iomem *scu_base = scu_base_addr(); unsigned int i, ncores; @@ -165,9 +165,19 @@ void __init smp_init_cpus(void) set_smp_cross_call(gic_raise_softirq); } -void __init platform_smp_prepare_cpus(unsigned int max_cpus) +static void __init ux500_smp_prepare_cpus(unsigned int max_cpus) { scu_enable(scu_base_addr()); wakeup_secondary(); } + +struct smp_operations ux500_smp_ops __initdata = { + .smp_init_cpus = ux500_smp_init_cpus, + .smp_prepare_cpus = ux500_smp_prepare_cpus, + .smp_secondary_init = ux500_secondary_init, + .smp_boot_secondary = ux500_boot_secondary, +#ifdef CONFIG_HOTPLUG_CPU + .cpu_die = ux500_cpu_die, +#endif +};