]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: mvebu: move Armada XP specific SMP initialization to platsmp.c
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 14 Apr 2014 13:53:58 +0000 (15:53 +0200)
committerJason Cooper <jason@lakedaemon.net>
Thu, 8 May 2014 16:07:37 +0000 (16:07 +0000)
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>
Link: https://lkml.kernel.org/r/1397483648-26611-2-git-send-email-thomas.petazzoni@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
arch/arm/mach-mvebu/common.h
arch/arm/mach-mvebu/platsmp.c
arch/arm/mach-mvebu/pmsu.c

index cfb129b144c0bc3e973c22509d84c8b9bcdc91c2..2b88eb00de894c4e3365788ac05fdcf54b730afc 100644 (file)
@@ -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);
 
index a6da03f5b24ec921090af5508a2b6d87a66c7197..e98075f7175a67f1b6bda6f1d924c3a017f1a9ce 100644 (file)
@@ -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;
 }
index 8361281f91805878283e9ecee9c3a75d47af7e2f..a1508deecd26b96d08c29a3998c0697ad972a1ef 100644 (file)
@@ -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;