@@ -1,6 +1,6 @@
#ifndef __ASM_R8A7791_H__
#define __ASM_R8A7791_H__
-extern struct smp_operations r8a7791_smp_ops;
+bool r8a7791_smp_init(void);
#endif /* __ASM_R8A7791_H__ */
@@ -29,7 +29,7 @@ static const char *r8a7791_boards_compat
};
DT_MACHINE_START(R8A7791_DT, "Generic R8A7791 (Flattened Device Tree)")
- .smp = smp_ops(r8a7791_smp_ops),
+ .smp_init = r8a7791_smp_init,
.init_early = shmobile_init_delay,
.init_time = rcar_gen2_timer_init,
.init_late = shmobile_init_late,
@@ -54,7 +54,7 @@ static int r8a7791_smp_boot_secondary(un
return shmobile_smp_apmu_boot_secondary(cpu, idle);
}
-struct smp_operations r8a7791_smp_ops __initdata = {
+static struct smp_operations r8a7791_smp_ops __initdata = {
.smp_prepare_cpus = r8a7791_smp_prepare_cpus,
.smp_boot_secondary = r8a7791_smp_boot_secondary,
#ifdef CONFIG_HOTPLUG_CPU
@@ -63,3 +63,12 @@ struct smp_operations r8a7791_smp_ops __
.cpu_kill = shmobile_smp_apmu_cpu_kill,
#endif
};
+
+bool __init r8a7791_smp_init(void)
+{
+ /* only setup when no other DT based method is detected */
+ if (!platform_can_secondary_boot())
+ smp_set_ops(&r8a7791_smp_ops);
+
+ return true;
+}