aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/mips/bcm63xx/prom.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/mips/bcm63xx/prom.c b/arch/mips/bcm63xx/prom.c
index f3ff28f4c258..3b21454c56a0 100644
--- a/arch/mips/bcm63xx/prom.c
+++ b/arch/mips/bcm63xx/prom.c
@@ -8,7 +8,11 @@
8 8
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/bootmem.h> 10#include <linux/bootmem.h>
11#include <linux/smp.h>
11#include <asm/bootinfo.h> 12#include <asm/bootinfo.h>
13#include <asm/bmips.h>
14#include <asm/smp-ops.h>
15#include <asm/mipsregs.h>
12#include <bcm63xx_board.h> 16#include <bcm63xx_board.h>
13#include <bcm63xx_cpu.h> 17#include <bcm63xx_cpu.h>
14#include <bcm63xx_io.h> 18#include <bcm63xx_io.h>
@@ -54,6 +58,43 @@ void __init prom_init(void)
54 58
55 /* do low level board init */ 59 /* do low level board init */
56 board_prom_init(); 60 board_prom_init();
61
62 if (IS_ENABLED(CONFIG_CPU_BMIPS4350) && IS_ENABLED(CONFIG_SMP)) {
63 /* set up SMP */
64 register_smp_ops(&bmips_smp_ops);
65
66 /*
67 * BCM6328 might not have its second CPU enabled, while BCM6358
68 * needs special handling for its shared TLB, so disable SMP
69 * for now.
70 */
71 if (BCMCPU_IS_6328()) {
72 bmips_smp_enabled = 0;
73 } else if (BCMCPU_IS_6358()) {
74 bmips_smp_enabled = 0;
75 }
76
77 if (!bmips_smp_enabled)
78 return;
79
80 /*
81 * The bootloader has set up the CPU1 reset vector at
82 * 0xa000_0200.
83 * This conflicts with the special interrupt vector (IV).
84 * The bootloader has also set up CPU1 to respond to the wrong
85 * IPI interrupt.
86 * Here we will start up CPU1 in the background and ask it to
87 * reconfigure itself then go back to sleep.
88 */
89 memcpy((void *)0xa0000200, &bmips_smp_movevec, 0x20);
90 __sync();
91 set_c0_cause(C_SW0);
92 cpumask_set_cpu(1, &bmips_booted_mask);
93
94 /*
95 * FIXME: we really should have some sort of hazard barrier here
96 */
97 }
57} 98}
58 99
59void __init prom_free_prom_memory(void) 100void __init prom_free_prom_memory(void)