aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorGregory CLEMENT <gregory.clement@free-electrons.com>2014-04-14 09:54:03 -0400
committerJason Cooper <jason@lakedaemon.net>2014-05-08 12:08:14 -0400
commit00504be42add413614bdaa943612787d6fd297f5 (patch)
tree6f43eb8d04c0f8dbb33b39c13f7e26ecf11dde70 /arch/arm
parent5194efc5c649a7fa622eae9af7df5dbcec940ea4 (diff)
ARM: mvebu: add function to set the resume boot address for Armada 375
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> Link: https://lkml.kernel.org/r/1397483648-26611-7-git-send-email-thomas.petazzoni@free-electrons.com Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Link: https://lkml.kernel.org/r/1397483648-26611-7-git-send-email-thomas.petazzoni@free-electrons.com Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-mvebu/common.h1
-rw-r--r--arch/arm/mach-mvebu/system-controller.c15
2 files changed, 15 insertions, 1 deletions
diff --git a/arch/arm/mach-mvebu/common.h b/arch/arm/mach-mvebu/common.h
index 2b88eb00de89..b67fb7a10d8b 100644
--- a/arch/arm/mach-mvebu/common.h
+++ b/arch/arm/mach-mvebu/common.h
@@ -20,6 +20,7 @@
20void mvebu_restart(enum reboot_mode mode, const char *cmd); 20void mvebu_restart(enum reboot_mode mode, const char *cmd);
21int mvebu_cpu_reset_deassert(int cpu); 21int mvebu_cpu_reset_deassert(int cpu);
22void mvebu_pmsu_set_cpu_boot_addr(int hw_cpu, void *boot_addr); 22void mvebu_pmsu_set_cpu_boot_addr(int hw_cpu, void *boot_addr);
23void mvebu_system_controller_set_cpu_boot_addr(void *boot_addr);
23 24
24void armada_xp_cpu_die(unsigned int cpu); 25void armada_xp_cpu_die(unsigned int cpu);
25 26
diff --git a/arch/arm/mach-mvebu/system-controller.c b/arch/arm/mach-mvebu/system-controller.c
index 614ba6832ff3..0c5524ac75b7 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 {
37 37
38 u32 rstoutn_mask_reset_out_en; 38 u32 rstoutn_mask_reset_out_en;
39 u32 system_soft_reset; 39 u32 system_soft_reset;
40
41 u32 resume_boot_addr;
40}; 42};
41static struct mvebu_system_controller *mvebu_sc; 43static struct mvebu_system_controller *mvebu_sc;
42 44
@@ -52,6 +54,7 @@ static const struct mvebu_system_controller armada_375_system_controller = {
52 .system_soft_reset_offset = 0x58, 54 .system_soft_reset_offset = 0x58,
53 .rstoutn_mask_reset_out_en = 0x1, 55 .rstoutn_mask_reset_out_en = 0x1,
54 .system_soft_reset = 0x1, 56 .system_soft_reset = 0x1,
57 .resume_boot_addr = 0xd4,
55}; 58};
56 59
57static const struct mvebu_system_controller orion_system_controller = { 60static const struct mvebu_system_controller orion_system_controller = {
@@ -98,6 +101,16 @@ void mvebu_restart(enum reboot_mode mode, const char *cmd)
98 ; 101 ;
99} 102}
100 103
104#ifdef CONFIG_SMP
105void mvebu_system_controller_set_cpu_boot_addr(void *boot_addr)
106{
107 BUG_ON(system_controller_base == NULL);
108 BUG_ON(mvebu_sc->resume_boot_addr == 0);
109 writel(virt_to_phys(boot_addr), system_controller_base +
110 mvebu_sc->resume_boot_addr);
111}
112#endif
113
101static int __init mvebu_system_controller_init(void) 114static int __init mvebu_system_controller_init(void)
102{ 115{
103 const struct of_device_id *match; 116 const struct of_device_id *match;
@@ -114,4 +127,4 @@ static int __init mvebu_system_controller_init(void)
114 return 0; 127 return 0;
115} 128}
116 129
117arch_initcall(mvebu_system_controller_init); 130early_initcall(mvebu_system_controller_init);