Commit 9fb4c2b9 authored by Chris Dearman's avatar Chris Dearman Committed by Ralf Baechle

MIPS: R2: Fix problem with code that incorrectly modifies ebase.

Commit 566f74f6 had a change that
incorrectly modified ebase. This backs out the lines that modified
ebase.
In addition, the ebase exception vector is now allocated with correct
alignment and the ebase register updated according to the architecture
specification.

Based on original patch by David VomLehn <dvomlehn@cisco.com>.
Signed-off-by: default avatarDavid VomLehn <dvomlehn@cisco.com>
Signed-off-by: default avatarChris Dearman <chris@mips.com>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 89e18eb3
...@@ -1520,7 +1520,9 @@ void __cpuinit per_cpu_trap_init(void) ...@@ -1520,7 +1520,9 @@ void __cpuinit per_cpu_trap_init(void)
#endif /* CONFIG_MIPS_MT_SMTC */ #endif /* CONFIG_MIPS_MT_SMTC */
if (cpu_has_veic || cpu_has_vint) { if (cpu_has_veic || cpu_has_vint) {
unsigned long sr = set_c0_status(ST0_BEV);
write_c0_ebase(ebase); write_c0_ebase(ebase);
write_c0_status(sr);
/* Setting vector spacing enables EI/VI mode */ /* Setting vector spacing enables EI/VI mode */
change_c0_intctl(0x3e0, VECTORSPACING); change_c0_intctl(0x3e0, VECTORSPACING);
} }
...@@ -1602,8 +1604,6 @@ void __cpuinit set_uncached_handler(unsigned long offset, void *addr, ...@@ -1602,8 +1604,6 @@ void __cpuinit set_uncached_handler(unsigned long offset, void *addr,
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
unsigned long uncached_ebase = TO_UNCAC(ebase); unsigned long uncached_ebase = TO_UNCAC(ebase);
#endif #endif
if (cpu_has_mips_r2)
uncached_ebase += (read_c0_ebase() & 0x3ffff000);
if (!addr) if (!addr)
panic(panic_null_cerr); panic(panic_null_cerr);
...@@ -1635,9 +1635,11 @@ void __init trap_init(void) ...@@ -1635,9 +1635,11 @@ void __init trap_init(void)
return; /* Already done */ return; /* Already done */
#endif #endif
if (cpu_has_veic || cpu_has_vint) if (cpu_has_veic || cpu_has_vint) {
ebase = (unsigned long) alloc_bootmem_low_pages(0x200 + VECTORSPACING*64); unsigned long size = 0x200 + VECTORSPACING*64;
else { ebase = (unsigned long)
__alloc_bootmem(size, 1 << fls(size), 0);
} else {
ebase = CAC_BASE; ebase = CAC_BASE;
if (cpu_has_mips_r2) if (cpu_has_mips_r2)
ebase += (read_c0_ebase() & 0x3ffff000); ebase += (read_c0_ebase() & 0x3ffff000);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment