From patchwork Wed Sep 12 14:58:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11355 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 4924F23E29 for ; Wed, 12 Sep 2012 14:58:43 +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 9411D3EFA21F for ; Wed, 12 Sep 2012 14:58:42 +0000 (UTC) Received: by ieak11 with SMTP id k11so3001848iea.11 for ; Wed, 12 Sep 2012 07:58:42 -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=ynhkX+HAUM1V+K8b6Slxl5CIgJcUfkaKNG6IUOgqxg0=; b=Pxxh2he81IX+zHB7m7bN3YQbf9XvPkqp4Dy+RkQc2I4Shg7mmO+1BcCoTjQTZFylUt nJqdwJh9WFjHXO5D4KM5t+ZRFR6pJXmPdmzo2x4xfA9rvmvv9rPz5fAx3OxFOaZdmXsJ dgGq3f4fG6nPX9RV2NW67Vv0Ca7StaSElqPNe/gOlM83PylGGqsR1tFwSqPtN0NXfTxi OBJOSQZlGxrB+SW2cSkW9I6dG9kCIW/dWeQyOWyqvAybkUTi3CjD/KuA+flDco/O1jTh 6oFpP1jGXgYNmsz+U+4gt2MifQgCTtaSXUTPfnOrt4QDde0cNBTeeMiyE4afenrlahol l7dA== Received: by 10.50.195.134 with SMTP id ie6mr21577525igc.28.1347461921955; Wed, 12 Sep 2012 07:58:41 -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 ex8csp75413igc; Wed, 12 Sep 2012 07:58:41 -0700 (PDT) Received: by 10.216.197.12 with SMTP id s12mr12470113wen.4.1347461919679; Wed, 12 Sep 2012 07:58:39 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de. [212.227.17.9]) by mx.google.com with ESMTP id x78si27461835wei.137.2012.09.12.07.58.39; Wed, 12 Sep 2012 07:58:39 -0700 (PDT) Received-SPF: neutral (google.com: 212.227.17.9 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.17.9; Authentication-Results: mx.google.com; spf=neutral (google.com: 212.227.17.9 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 0MY0P5-1T0afx2Ujf-00WqGk; Wed, 12 Sep 2012 16:58:38 +0200 From: Arnd Bergmann To: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Rob Herring , Arnd Bergmann Subject: [PATCH v9 09/13] ARM: SoC: convert highbank to SoC descriptor Date: Wed, 12 Sep 2012 16:58:22 +0200 Message-Id: <1347461906-13527-10-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:9btqniBXj3IbGVlNbg+3RWjGSIUpa/hHl9Xhnlw9Oyv H/Pq9J6A5lVsDm5676UR6oMPCcRS/oF+Wz77jj1qP46xsGSFit sc1jsdApshX9wr100WfyjF+wcnF/Ti6rLJg91XhdhpPDcIUBz6 FYyegOMtZwRYHO4P2kp5WvEl1R8FP1XnkXjPv6/3XTN6hMrQsy qeffzp+MnpTApzZu59r8V7PjmDpVUkzuRZZzERcYhXgEO2jSqW IsVf5Avhg96WKvQEdEpWAM6rYtUySSFrhz0d+uWgFyZ7z1n+Ii 09gRsZLmYPnzSrVKloaSJER/eIGpDLOeJtl5lLm2gTjojJf0pf OQSuUPf6Fuy3o3AlfZnTlDfvN6qiEKXuY1Z67Cx8oWKVXecMI2 xE+EAwUgQVPRb56k5sPnbeh2kKVMh6xg+A= X-Gm-Message-State: ALoCoQkLfhYRdqxKaV9qSpjJYGecKoeXsoxZdBshLLeSOefLeFkwPF02N5wFzlMDKjY66DZOoFbN From: Marc Zyngier Convert the highbank platform to use the SoC descriptor to provide its SMP and CPU hotplug operations. Cc: Rob Herring Signed-off-by: Marc Zyngier Signed-off-by: Arnd Bergmann --- arch/arm/mach-highbank/core.h | 3 +++ arch/arm/mach-highbank/highbank.c | 1 + arch/arm/mach-highbank/hotplug.c | 16 +--------------- arch/arm/mach-highbank/platsmp.c | 18 ++++++++++++++---- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/arch/arm/mach-highbank/core.h b/arch/arm/mach-highbank/core.h index 141ed51..598ee78 100644 --- a/arch/arm/mach-highbank/core.h +++ b/arch/arm/mach-highbank/core.h @@ -9,3 +9,6 @@ static inline void highbank_lluart_map_io(void) {} #endif extern void highbank_smc1(int fn, int arg); +extern void highbank_cpu_die(unsigned int cpu); + +extern struct smp_operations highbank_smp_ops; diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c index d75b0a7..709bd72 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b/arch/arm/mach-highbank/highbank.c @@ -162,6 +162,7 @@ static const char *highbank_match[] __initconst = { }; DT_MACHINE_START(HIGHBANK, "Highbank") + .smp = smp_ops(highbank_smp_ops), .map_io = highbank_map_io, .init_irq = highbank_init_irq, .timer = &highbank_timer, diff --git a/arch/arm/mach-highbank/hotplug.c b/arch/arm/mach-highbank/hotplug.c index 977cebb..1277da3 100644 --- a/arch/arm/mach-highbank/hotplug.c +++ b/arch/arm/mach-highbank/hotplug.c @@ -24,16 +24,11 @@ extern void secondary_startup(void); -int platform_cpu_kill(unsigned int cpu) -{ - return 1; -} - /* * platform-specific code to shutdown a CPU * */ -void platform_cpu_die(unsigned int cpu) +void highbank_cpu_die(unsigned int cpu) { flush_cache_all(); @@ -45,12 +40,3 @@ void platform_cpu_die(unsigned int cpu) /* We should never return from idle */ panic("highbank: cpu %d unexpectedly exit from shutdown\n", cpu); } - -int platform_cpu_disable(unsigned int cpu) -{ - /* - * CPU0 should not be shut down via hotplug. cpu_idle can WFI - * or a proper shutdown or hibernate should be used. - */ - return cpu == 0 ? -EPERM : 0; -} diff --git a/arch/arm/mach-highbank/platsmp.c b/arch/arm/mach-highbank/platsmp.c index d01364c..fa9560e 100644 --- a/arch/arm/mach-highbank/platsmp.c +++ b/arch/arm/mach-highbank/platsmp.c @@ -25,12 +25,12 @@ extern void secondary_startup(void); -void __cpuinit platform_secondary_init(unsigned int cpu) +static void __cpuinit highbank_secondary_init(unsigned int cpu) { gic_secondary_init(0); } -int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) +static int __cpuinit highbank_boot_secondary(unsigned int cpu, struct task_struct *idle) { gic_raise_softirq(cpumask_of(cpu), 0); return 0; @@ -40,7 +40,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) * 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 highbank_smp_init_cpus(void) { unsigned int i, ncores; @@ -61,7 +61,7 @@ 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 highbank_smp_prepare_cpus(unsigned int max_cpus) { int i; @@ -76,3 +76,13 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus) for (i = 1; i < max_cpus; i++) highbank_set_cpu_jump(i, secondary_startup); } + +struct smp_operations highbank_smp_ops __initdata = { + .smp_init_cpus = highbank_smp_init_cpus, + .smp_prepare_cpus = highbank_smp_prepare_cpus, + .smp_secondary_init = highbank_secondary_init, + .smp_boot_secondary = highbank_boot_secondary, +#ifdef CONFIG_HOTPLUG_CPU + .cpu_die = highbank_cpu_die, +#endif +};