diff options
author | Sonic Zhang <sonic.zhang@analog.com> | 2010-08-05 03:49:26 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-03-18 04:01:04 -0400 |
commit | c6345ab1a3d17f4b6c80ac79d7fb0f006b32fdaa (patch) | |
tree | 8f3980f69cba2e3269aa9688426fca95be56d7a6 /arch/blackfin/mach-bf561 | |
parent | 6f546bc3ac9eedbf770bf3bcbc45ce2ea32c94ad (diff) |
Blackfin: SMP: work around anomaly 05000491
In order to safely work around anomaly 05000491, we have to execute IFLUSH
from L1 instruction sram. The trouble with multi-core systems is that all
L1 sram is visible only to the active core. So we can't just place the
functions into L1 and call it directly. We need to setup a jump table and
place the entry point in external memory. This will call the right func
based on the active core.
In the process, convert from the manual relocation of a small bit of code
into Core B's L1 to the more general framework we already have in place
for loading arbitrary pieces of code into L1.
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/mach-bf561')
-rw-r--r-- | arch/blackfin/mach-bf561/secondary.S | 7 | ||||
-rw-r--r-- | arch/blackfin/mach-bf561/smp.c | 9 |
2 files changed, 6 insertions, 10 deletions
diff --git a/arch/blackfin/mach-bf561/secondary.S b/arch/blackfin/mach-bf561/secondary.S index 148e50764555..4c462838f4e1 100644 --- a/arch/blackfin/mach-bf561/secondary.S +++ b/arch/blackfin/mach-bf561/secondary.S | |||
@@ -13,7 +13,11 @@ | |||
13 | #include <asm/asm-offsets.h> | 13 | #include <asm/asm-offsets.h> |
14 | #include <asm/trace.h> | 14 | #include <asm/trace.h> |
15 | 15 | ||
16 | __INIT | 16 | /* |
17 | * This code must come first as CoreB is hardcoded (in hardware) | ||
18 | * to start at the beginning of its L1 instruction memory. | ||
19 | */ | ||
20 | .section .l1.text.head | ||
17 | 21 | ||
18 | /* Lay the initial stack into the L1 scratch area of Core B */ | 22 | /* Lay the initial stack into the L1 scratch area of Core B */ |
19 | #define INITIAL_STACK (COREB_L1_SCRATCH_START + L1_SCRATCH_LENGTH - 12) | 23 | #define INITIAL_STACK (COREB_L1_SCRATCH_START + L1_SCRATCH_LENGTH - 12) |
@@ -160,7 +164,6 @@ ENTRY(_coreb_trampoline_start) | |||
160 | .LWAIT_HERE: | 164 | .LWAIT_HERE: |
161 | jump .LWAIT_HERE; | 165 | jump .LWAIT_HERE; |
162 | ENDPROC(_coreb_trampoline_start) | 166 | ENDPROC(_coreb_trampoline_start) |
163 | ENTRY(_coreb_trampoline_end) | ||
164 | 167 | ||
165 | #ifdef CONFIG_HOTPLUG_CPU | 168 | #ifdef CONFIG_HOTPLUG_CPU |
166 | .section ".text" | 169 | .section ".text" |
diff --git a/arch/blackfin/mach-bf561/smp.c b/arch/blackfin/mach-bf561/smp.c index 1074a7ef81c7..82b94e137886 100644 --- a/arch/blackfin/mach-bf561/smp.c +++ b/arch/blackfin/mach-bf561/smp.c | |||
@@ -30,18 +30,11 @@ void __init platform_init_cpus(void) | |||
30 | 30 | ||
31 | void __init platform_prepare_cpus(unsigned int max_cpus) | 31 | void __init platform_prepare_cpus(unsigned int max_cpus) |
32 | { | 32 | { |
33 | int len; | 33 | bfin_relocate_coreb_l1_mem(); |
34 | |||
35 | len = &coreb_trampoline_end - &coreb_trampoline_start + 1; | ||
36 | BUG_ON(len > L1_CODE_LENGTH); | ||
37 | |||
38 | dma_memcpy((void *)COREB_L1_CODE_START, &coreb_trampoline_start, len); | ||
39 | 34 | ||
40 | /* Both cores ought to be present on a bf561! */ | 35 | /* Both cores ought to be present on a bf561! */ |
41 | cpu_set(0, cpu_present_map); /* CoreA */ | 36 | cpu_set(0, cpu_present_map); /* CoreA */ |
42 | cpu_set(1, cpu_present_map); /* CoreB */ | 37 | cpu_set(1, cpu_present_map); /* CoreB */ |
43 | |||
44 | printk(KERN_INFO "CoreB bootstrap code to SRAM %p via DMA.\n", (void *)COREB_L1_CODE_START); | ||
45 | } | 38 | } |
46 | 39 | ||
47 | int __init setup_profiling_timer(unsigned int multiplier) /* not supported */ | 40 | int __init setup_profiling_timer(unsigned int multiplier) /* not supported */ |