1 From 10ea7fd6b854c3ecf745d053beba10c7e00c33c9 Mon Sep 17 00:00:00 2001
2 From: Kevin Cernekee <cernekee@gmail.com>
3 Date: Sat, 9 Jul 2011 12:15:06 -0700
4 Subject: [PATCH 01/13] MIPS: BCM63XX: Add SMP support to prom.c
6 This involves two changes to the BSP code:
8 1) register_smp_ops() for BMIPS SMP
10 2) The CPU1 boot vector on some of the BCM63xx platforms conflicts with
11 the special interrupt vector (IV). Move it to 0x8000_0380 at boot time,
12 to resolve the conflict.
14 Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
15 [jogo@openwrt: move smp ops registration below #ifdef guard, don't enable
17 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
19 arch/mips/bcm63xx/prom.c | 33 +++++++++++++++++++++++++++++++++
20 1 file changed, 33 insertions(+)
22 --- a/arch/mips/bcm63xx/prom.c
23 +++ b/arch/mips/bcm63xx/prom.c
26 #include <linux/init.h>
27 #include <linux/bootmem.h>
28 +#include <linux/smp.h>
29 #include <asm/bootinfo.h>
30 +#include <asm/bmips.h>
31 +#include <asm/smp-ops.h>
32 +#include <asm/mipsregs.h>
33 #include <bcm63xx_board.h>
34 #include <bcm63xx_cpu.h>
35 #include <bcm63xx_io.h>
36 @@ -52,6 +56,35 @@ void __init prom_init(void)
38 /* do low level board init */
41 +#if defined(CONFIG_CPU_BMIPS4350) && defined(CONFIG_SMP)
43 + register_smp_ops(&bmips_smp_ops);
46 + * BCM6328 does not have its second CPU enabled, while BCM6358
47 + * needs special handling for its shared TLB, so disable SMP for now.
49 + if (BCMCPU_IS_6328() || BCMCPU_IS_6358()) {
50 + bmips_smp_enabled = 0;
55 + * The bootloader has set up the CPU1 reset vector at 0xa000_0200.
56 + * This conflicts with the special interrupt vector (IV).
57 + * The bootloader has also set up CPU1 to respond to the wrong
59 + * Here we will start up CPU1 in the background and ask it to
60 + * reconfigure itself then go back to sleep.
62 + memcpy((void *)0xa0000200, &bmips_smp_movevec, 0x20);
64 + set_c0_cause(C_SW0);
65 + cpumask_set_cpu(1, &bmips_booted_mask);
67 + /* FIXME: we really should have some sort of hazard barrier here */
71 void __init prom_free_prom_memory(void)