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 05/10] ARM: mvebu: add function to set the resume boot address for Armada 375
Date: Fri, 28 Mar 2014 14:07:01 +0100	[thread overview]
Message-ID: <1396012026-5997-6-git-send-email-thomas.petazzoni@free-electrons.com> (raw)
In-Reply-To: <1396012026-5997-1-git-send-email-thomas.petazzoni@free-electrons.com>

From: Gregory CLEMENT <gregory.clement@free-electrons.com>

In order to boot the secondary CPUs on Armada 375, we need to set the
boot address of these CPUs, through a register part of the System
Controller (this deviates from the Armada XP design, where the boot
address was defined using a register part of the PMSU unit).

Therefore, this commit adds a new helper function in the System
Controller driver to set the secondary CPU boot address.

Moreover, it moves the System Controller initialization as an
early_initcall(), since arch_initcall() is too late for an SMP-related
initialization.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 arch/arm/mach-mvebu/common.h            |  1 +
 arch/arm/mach-mvebu/system-controller.c | 15 ++++++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-mvebu/common.h b/arch/arm/mach-mvebu/common.h
index 2b88eb0..b67fb7a 100644
--- a/arch/arm/mach-mvebu/common.h
+++ b/arch/arm/mach-mvebu/common.h
@@ -20,6 +20,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 mvebu_system_controller_set_cpu_boot_addr(void *boot_addr);
 
 void armada_xp_cpu_die(unsigned int cpu);
 
diff --git a/arch/arm/mach-mvebu/system-controller.c b/arch/arm/mach-mvebu/system-controller.c
index 1806187..3d4489e 100644
--- a/arch/arm/mach-mvebu/system-controller.c
+++ b/arch/arm/mach-mvebu/system-controller.c
@@ -37,6 +37,8 @@ struct mvebu_system_controller {
 
 	u32 rstoutn_mask_reset_out_en;
 	u32 system_soft_reset;
+
+	u32 resume_boot_addr;
 };
 static struct mvebu_system_controller *mvebu_sc;
 
@@ -52,6 +54,7 @@ static const struct mvebu_system_controller armada_375_system_controller = {
 	.system_soft_reset_offset = 0x58,
 	.rstoutn_mask_reset_out_en = 0x1,
 	.system_soft_reset = 0x1,
+	.resume_boot_addr = 0xd4,
 };
 
 static const struct mvebu_system_controller orion_system_controller = {
@@ -98,6 +101,16 @@ void mvebu_restart(enum reboot_mode mode, const char *cmd)
 		;
 }
 
+#ifdef CONFIG_SMP
+void mvebu_system_controller_set_cpu_boot_addr(void *boot_addr)
+{
+	BUG_ON(system_controller_base == NULL);
+	BUG_ON(mvebu_sc->resume_boot_addr == 0);
+	writel(virt_to_phys(boot_addr), system_controller_base +
+	       mvebu_sc->resume_boot_addr);
+}
+#endif
+
 static int __init mvebu_system_controller_init(void)
 {
 	struct device_node *np;
@@ -115,4 +128,4 @@ static int __init mvebu_system_controller_init(void)
 	return 0;
 }
 
-arch_initcall(mvebu_system_controller_init);
+early_initcall(mvebu_system_controller_init);
-- 
1.8.3.2

  parent reply	other threads:[~2014-03-28 13:07 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 ` [PATCH 01/10] ARM: mvebu: move Armada XP specific SMP initialization to platsmp.c Thomas Petazzoni
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 ` Thomas Petazzoni [this message]
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-6-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.