From patchwork Wed Sep 12 14:58:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11363 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 6388D23E29 for ; Wed, 12 Sep 2012 14:58:56 +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 057CE3EFA223 for ; Wed, 12 Sep 2012 14:58:55 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id k11so3001858iea.11 for ; Wed, 12 Sep 2012 07:58:55 -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=q5pF6zIDQ5y7au7THVo1M23RmIbYhZSV4g12u4aJ6zU=; b=dAck8bfLDDmTZy7tkZmIC8S0GPwJMQghCSH3R9QX3SmngeFiO0MtAFPF233r9rwqv1 h0Vv11URfHXLcLcJilOBKn7makL3RAoENTT+Mmph5kgnEeNwOabkpZKUa1KQibbNW5LW RYaMlzzyzHGd7rxeS2tKXqFQJ5isRzbhv7I91tjVka/36UkgSDdmuYhN6az/grFaXHG6 7quQzgAFQN3cuRKSmO0N7xBxAvoVSUZQYagEUl3P9qf4rwaUmPCX9sy4nWxMReE/zmMn MY0FauIlMy0nu5IXuQVci/zOeWss/3JJpKs6XuhjeBAJ0oDco1733hABflLuffiJLltZ 7c5g== Received: by 10.50.237.41 with SMTP id uz9mr21234514igc.43.1347461935778; Wed, 12 Sep 2012 07:58:55 -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 ex8csp75436igc; Wed, 12 Sep 2012 07:58:54 -0700 (PDT) Received: by 10.204.147.1 with SMTP id j1mr6074683bkv.110.1347461934144; Wed, 12 Sep 2012 07:58:54 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de. [212.227.17.10]) by mx.google.com with ESMTP id fw14si12699013bkc.16.2012.09.12.07.58.53; Wed, 12 Sep 2012 07:58:54 -0700 (PDT) Received-SPF: neutral (google.com: 212.227.17.10 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.17.10; Authentication-Results: mx.google.com; spf=neutral (google.com: 212.227.17.10 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 0LqacI-1Th2PV00he-00eILT; Wed, 12 Sep 2012 16:58:39 +0200 From: Arnd Bergmann To: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Shawn Guo , Arnd Bergmann Subject: [PATCH v9 10/13] ARM: SoC: convert imx6q to SoC descriptor Date: Wed, 12 Sep 2012 16:58:23 +0200 Message-Id: <1347461906-13527-11-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:s4TvzrSSUYcdZn1VWLbDDKomKdzN99Rul/w3pkyCdLj 3+TyL77bYhgho17DVJnxc1Rl4FNrO46a9M7K8kUh3RNnEp+S5s nXjroioWxm20ixlImQ68TSW6YATeK1W8stziMukIJXPebKLMsp NIO5cdXchML5tjIHB8vPX5/uSIRgvi4/73ptxDYPYO8PH1xrgL Ryp39Fv1XUCUYGYMvKBusdS6OJgh4q3fPrcI66SFSWCAbsJbBH zjJHclQ0693ba0omL/zZJ5IlhaTczM3T6rRGvSWnoxpcl+/SYy MJxGSWiWP+3hHDExcAgdof2SfP74aUufvX2lNynNo9Gz8emdoY zfU3+LKm8qV32iffpmsWRMhA28ZlIJpjhkVJkWOyQO8R0PpQ15 c335l6RZi9RbpEkuZBHI4WjcL+L55+PYl4= X-Gm-Message-State: ALoCoQkngmCD5Anqyou1pWJhIFqS820b77au6HXLARSTbSzRKdDZ17W0YjRrONUJpg3xcW/YXTKU From: Marc Zyngier Convert the imx6q platform to use the SoC descriptor to provide its SMP and CPU hotplug operations. Cc: Shawn Guo Signed-off-by: Marc Zyngier Signed-off-by: Arnd Bergmann --- arch/arm/mach-imx/hotplug.c | 16 +--------------- arch/arm/mach-imx/mach-imx6q.c | 1 + arch/arm/mach-imx/platsmp.c | 18 ++++++++++++++---- arch/arm/plat-mxc/include/mach/common.h | 4 ++++ 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/arch/arm/mach-imx/hotplug.c b/arch/arm/mach-imx/hotplug.c index f8f7437..b07b778 100644 --- a/arch/arm/mach-imx/hotplug.c +++ b/arch/arm/mach-imx/hotplug.c @@ -15,11 +15,6 @@ #include #include -int platform_cpu_kill(unsigned int cpu) -{ - return 1; -} - static inline void cpu_enter_lowpower(void) { unsigned int v; @@ -47,7 +42,7 @@ static inline void cpu_enter_lowpower(void) * * Called with IRQs disabled */ -void platform_cpu_die(unsigned int cpu) +void imx_cpu_die(unsigned int cpu) { cpu_enter_lowpower(); imx_enable_cpu(cpu, false); @@ -56,12 +51,3 @@ void platform_cpu_die(unsigned int cpu) while (1) ; } - -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-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 045b3f6..ef0b52f 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -226,6 +226,7 @@ static const char *imx6q_dt_compat[] __initdata = { }; DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad (Device Tree)") + .smp = smp_ops(imx6q_soc_desc), .map_io = imx6q_map_io, .init_irq = imx6q_init_irq, .handle_irq = imx6q_handle_irq, diff --git a/arch/arm/mach-imx/platsmp.c b/arch/arm/mach-imx/platsmp.c index ab98c6f..2ac43e1 100644 --- a/arch/arm/mach-imx/platsmp.c +++ b/arch/arm/mach-imx/platsmp.c @@ -41,7 +41,7 @@ void __init imx_scu_map_io(void) scu_base = IMX_IO_ADDRESS(base); } -void __cpuinit platform_secondary_init(unsigned int cpu) +static void __cpuinit imx_secondary_init(unsigned int cpu) { /* * if any interrupts are already enabled for the primary @@ -51,7 +51,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu) gic_secondary_init(0); } -int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) +static int __cpuinit imx_boot_secondary(unsigned int cpu, struct task_struct *idle) { imx_set_cpu_jump(cpu, v7_secondary_startup); imx_enable_cpu(cpu, true); @@ -62,7 +62,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 imx_smp_init_cpus(void) { int i, ncores; @@ -79,7 +79,17 @@ void imx_smp_prepare(void) scu_enable(scu_base); } -void __init platform_smp_prepare_cpus(unsigned int max_cpus) +static void __init imx_smp_prepare_cpus(unsigned int max_cpus) { imx_smp_prepare(); } + +struct smp_operations imx_smp_ops __initdata = { + .smp_init_cpus = imx_smp_init_cpus, + .smp_prepare_cpus = imx_smp_prepare_cpus, + .smp_secondary_init = imx_secondary_init, + .smp_boot_secondary = imx_boot_secondary, +#ifdef CONFIG_HOTPLUG_CPU + .cpu_die = imx_cpu_die, +#endif +}; diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/plat-mxc/include/mach/common.h index 7128e97..e8b5150 100644 --- a/arch/arm/plat-mxc/include/mach/common.h +++ b/arch/arm/plat-mxc/include/mach/common.h @@ -145,6 +145,8 @@ extern void imx53_smd_common_init(void); extern int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode); extern void imx6q_clock_map_io(void); +extern void imx_cpu_die(unsigned int cpu); + #ifdef CONFIG_PM extern void imx6q_pm_init(void); extern void imx51_pm_init(void); @@ -161,4 +163,6 @@ extern int mx51_neon_fixup(void); static inline int mx51_neon_fixup(void) { return 0; } #endif +extern struct smp_operations imx_smp_ops; + #endif