]> git.ipfire.org Git - people/ms/linux.git/commitdiff
ARM: mvebu: use a separate function to set the boot address of CPUs
authorGregory CLEMENT <gregory.clement@free-electrons.com>
Mon, 14 Apr 2014 13:50:33 +0000 (15:50 +0200)
committerJason Cooper <jason@lakedaemon.net>
Thu, 24 Apr 2014 05:24:30 +0000 (05:24 +0000)
Setting the start (or boot) address of a CPU is no more used only
during SMP bring up on Armada 370/XP, but it will also be used by the
CPU idle function of Armada XP, and by the Armada 38x SMP support.

Therefore this commit creates a separate PMSU function to set the boot
address of a CPU with the PMSU.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Link: https://lkml.kernel.org/r/1397483433-25836-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/1397483433-25836-7-git-send-email-thomas.petazzoni@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
arch/arm/mach-mvebu/pmsu.c

index 4ae3ea1af7c38646cd9c3eba48ad61a6be0ca571..8361281f91805878283e9ecee9c3a75d47af7e2f 100644 (file)
@@ -41,6 +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)
+{
+       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)
 {
@@ -53,8 +59,7 @@ int armada_xp_boot_cpu(unsigned int cpu_id, void *boot_addr)
 
        hw_cpu = cpu_logical_map(cpu_id);
 
-       writel(virt_to_phys(boot_addr), pmsu_mp_base +
-                       PMSU_BOOT_ADDR_REDIRECT_OFFSET(hw_cpu));
+       mvebu_pmsu_set_cpu_boot_addr(hw_cpu, boot_addr);
 
        ret = mvebu_cpu_reset_deassert(hw_cpu);
        if (ret) {