aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-02-26 02:16:08 -0500
committerArnd Bergmann <arnd@arndb.de>2016-03-18 12:36:37 -0400
commit307d40c56b0c86315859ee724b51748260f50e65 (patch)
tree1de7c97153af3e4551af439cf5abbc574d437a3d
parent9eca796ee385ee61488fbe62fa83224e13abcfe0 (diff)
ARM: uniphier: rework SMP code to support new System Bus binding
During the review process of the UniPhier System Bus driver (drivers/bus/uniphier.c), the current binding of the System Bus Controller turned out to be no good. In order to use the driver, some nodes in the device trees must be tweaked. It would also have impacts on the SMP code because the SMP related registers are located in the System Bus Controller block. This commit reworks the smp_operations to support the new binding, but still supports the old binding, too. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r--arch/arm/mach-uniphier/platsmp.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/arch/arm/mach-uniphier/platsmp.c b/arch/arm/mach-uniphier/platsmp.c
index 8d988f53318c..69141357afe8 100644
--- a/arch/arm/mach-uniphier/platsmp.c
+++ b/arch/arm/mach-uniphier/platsmp.c
@@ -30,7 +30,7 @@
30 * The secondary CPUs check this register from the boot ROM for the jump 30 * The secondary CPUs check this register from the boot ROM for the jump
31 * destination. After that, it can be reused as a scratch register. 31 * destination. After that, it can be reused as a scratch register.
32 */ 32 */
33#define UNIPHIER_SBC_ROM_BOOT_RSV2 0x1208 33#define UNIPHIER_SMPCTRL_ROM_RSV2 0x208
34 34
35static void __iomem *uniphier_smp_rom_boot_rsv2; 35static void __iomem *uniphier_smp_rom_boot_rsv2;
36static unsigned int uniphier_smp_max_cpus; 36static unsigned int uniphier_smp_max_cpus;
@@ -98,17 +98,24 @@ static int __init uniphier_smp_prepare_trampoline(unsigned int max_cpus)
98 phys_addr_t rom_rsv2_phys; 98 phys_addr_t rom_rsv2_phys;
99 int ret; 99 int ret;
100 100
101 np = of_find_compatible_node(NULL, NULL, 101 np = of_find_compatible_node(NULL, NULL, "socionext,uniphier-smpctrl");
102 "socionext,uniphier-system-bus-controller");
103 of_node_put(np); 102 of_node_put(np);
104 ret = of_address_to_resource(np, 1, &res); 103 ret = of_address_to_resource(np, 0, &res);
105 if (ret) { 104 if (!ret) {
106 pr_err("failed to get resource of system-bus-controller\n"); 105 rom_rsv2_phys = res.start + UNIPHIER_SMPCTRL_ROM_RSV2;
107 return ret; 106 } else {
107 /* try old binding too */
108 np = of_find_compatible_node(NULL, NULL,
109 "socionext,uniphier-system-bus-controller");
110 of_node_put(np);
111 ret = of_address_to_resource(np, 1, &res);
112 if (ret) {
113 pr_err("failed to get resource of SMP control\n");
114 return ret;
115 }
116 rom_rsv2_phys = res.start + 0x1000 + UNIPHIER_SMPCTRL_ROM_RSV2;
108 } 117 }
109 118
110 rom_rsv2_phys = res.start + UNIPHIER_SBC_ROM_BOOT_RSV2;
111
112 ret = uniphier_smp_copy_trampoline(rom_rsv2_phys); 119 ret = uniphier_smp_copy_trampoline(rom_rsv2_phys);
113 if (ret) 120 if (ret)
114 return ret; 121 return ret;