All of lore.kernel.org
 help / color / mirror / Atom feed
From: thomas.petazzoni@free-electrons.com (Thomas Petazzoni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/10] ARM: mvebu: move Armada XP specific SMP initialization to platsmp.c
Date: Fri, 28 Mar 2014 14:06:57 +0100	[thread overview]
Message-ID: <1396012026-5997-2-git-send-email-thomas.petazzoni@free-electrons.com> (raw)
In-Reply-To: <1396012026-5997-1-git-send-email-thomas.petazzoni@free-electrons.com>

The pmsu.c driver contained an armada_xp_boot_cpu() function that sets
the boot address of a secondary CPUs and deasserts the reset. However,
the Armada 375 needs a slightly different logic, so it makes more
sense to move this code into the Armada XP specific platsmp.c.

In order to achieve this, the mvebu_pmsu_set_cpu_boot_addr() function
is exported. It will be needed for both the Armada XP and Armada 38x
SMP implementations.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 arch/arm/mach-mvebu/common.h  |  1 +
 arch/arm/mach-mvebu/platsmp.c | 10 +++++++++-
 arch/arm/mach-mvebu/pmsu.c    | 26 +-------------------------
 3 files changed, 11 insertions(+), 26 deletions(-)

diff --git a/arch/arm/mach-mvebu/common.h b/arch/arm/mach-mvebu/common.h
index cfb129b..2b88eb0 100644
--- a/arch/arm/mach-mvebu/common.h
+++ b/arch/arm/mach-mvebu/common.h
@@ -19,6 +19,7 @@
 
 void mvebu_restart(enum reboot_mode mode, const char *cmd);
 int mvebu_cpu_reset_deassert(int cpu);
+void mvebu_pmsu_set_cpu_boot_addr(int hw_cpu, void *boot_addr);
 
 void armada_xp_cpu_die(unsigned int cpu);
 
diff --git a/arch/arm/mach-mvebu/platsmp.c b/arch/arm/mach-mvebu/platsmp.c
index a6da03f..e98075f 100644
--- a/arch/arm/mach-mvebu/platsmp.c
+++ b/arch/arm/mach-mvebu/platsmp.c
@@ -77,9 +77,17 @@ static void armada_xp_secondary_init(unsigned int cpu)
 
 static int armada_xp_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
+	int ret, hw_cpu;
+
 	pr_info("Booting CPU %d\n", cpu);
 
-	armada_xp_boot_cpu(cpu, armada_xp_secondary_startup);
+	hw_cpu = cpu_logical_map(cpu);
+	mvebu_pmsu_set_cpu_boot_addr(hw_cpu, armada_xp_secondary_startup);
+	ret = mvebu_cpu_reset_deassert(hw_cpu);
+	if (ret) {
+		pr_warn("unable to boot CPU: %d\n", ret);
+		return ret;
+	}
 
 	return 0;
 }
diff --git a/arch/arm/mach-mvebu/pmsu.c b/arch/arm/mach-mvebu/pmsu.c
index 8361281..a1508de 100644
--- a/arch/arm/mach-mvebu/pmsu.c
+++ b/arch/arm/mach-mvebu/pmsu.c
@@ -41,36 +41,12 @@ static struct of_device_id of_pmsu_table[] = {
 	{ /* end of list */ },
 };
 
-static void mvebu_pmsu_set_cpu_boot_addr(int hw_cpu, void *boot_addr)
+void mvebu_pmsu_set_cpu_boot_addr(int hw_cpu, void *boot_addr)
 {
 	writel(virt_to_phys(boot_addr), pmsu_mp_base +
 		PMSU_BOOT_ADDR_REDIRECT_OFFSET(hw_cpu));
 }
 
-#ifdef CONFIG_SMP
-int armada_xp_boot_cpu(unsigned int cpu_id, void *boot_addr)
-{
-	int hw_cpu, ret;
-
-	if (!pmsu_mp_base) {
-		pr_warn("Can't boot CPU. PMSU is uninitialized\n");
-		return -ENODEV;
-	}
-
-	hw_cpu = cpu_logical_map(cpu_id);
-
-	mvebu_pmsu_set_cpu_boot_addr(hw_cpu, boot_addr);
-
-	ret = mvebu_cpu_reset_deassert(hw_cpu);
-	if (ret) {
-		pr_warn("unable to boot CPU: %d\n", ret);
-		return ret;
-	}
-
-	return 0;
-}
-#endif
-
 static int __init armada_370_xp_pmsu_init(void)
 {
 	struct device_node *np;
-- 
1.8.3.2

  reply	other threads:[~2014-03-28 13:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28 13:06 [PATCH 00/10] SMP support for Armada 375 and 38x Thomas Petazzoni
2014-03-28 13:06 ` Thomas Petazzoni [this message]
2014-03-28 13:06 ` [PATCH 02/10] irqchip: irq-armada-370-xp: do the set_smp_cross_call() in the driver Thomas Petazzoni
2014-03-28 13:06 ` [PATCH 03/10] irqchip: irq-armada-370-xp: use cpu notifier to initialize secondary CPUs Thomas Petazzoni
2014-03-28 13:07 ` [PATCH 04/10] ARM: mvebu: add Armada 375/38x support in cpu-reset Thomas Petazzoni
2014-03-28 13:07 ` [PATCH 05/10] ARM: mvebu: add function to set the resume boot address for Armada 375 Thomas Petazzoni
2014-03-28 13:07 ` [PATCH 06/10] ARM: mvebu: add Armada 38x compatible string to pmsu Thomas Petazzoni
2014-03-28 13:07 ` [PATCH 07/10] ARM: mvebu: add SMP support for Armada 375 and Armada 38x Thomas Petazzoni
2014-03-28 18:13   ` Stephen Boyd
2014-03-28 18:19     ` Thomas Petazzoni
2014-03-28 13:07 ` [PATCH 08/10] ARM: mvebu: add workaround for SMP support for Armada 375 stepping Z1 Thomas Petazzoni
2014-03-28 13:07 ` [PATCH 09/10] ARM: mvebu: add SMP support in the Armada 375 device tree Thomas Petazzoni
2014-03-28 13:07 ` [PATCH 10/10] ARM: mvebu: add SMP support in the Armada 38x " Thomas Petazzoni
2014-03-28 17:42 ` [PATCH 00/10] SMP support for Armada 375 and 38x Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1396012026-5997-2-git-send-email-thomas.petazzoni@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.