u-boot/arch/mips/cpu
Paul Burton d263cda5ae MIPS: Fix cache maintenance in relocate_code & simplify
The relocate_code function was handling cache maintenance incorrectly.
It copied U-Boot to its new location, flushed the caches & then
proceeded to apply relocations & jump to the new code without flushing
the caches again. This is problematic as the instruction cache could
potentially have already fetched instructions that hadn't had relocs
applied.

Rework this to perform the flush_cache call using the code in the
original copy of U-Boot, after having applied relocations to the new
copy of U-Boot. The new U-Boot can then be jumped to safely once that
cache flush has been performed.

As part of this, since the old U-Boot is used up until after that cache
flush, complexity around loading values from the GOT using a jump & link
instruction & loads from a table is removed. Instead we can simply load
the needed values with PTR_LA fromt the original GOT.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
2016-09-21 16:25:43 +02:00
..
mips32 MIPS: unify CPU code in arch/mips/cpu/ 2015-01-30 14:19:58 +01:00
mips64 MIPS: unify CPU code in arch/mips/cpu/ 2015-01-30 14:19:58 +01:00
cm_init.S MIPS: Map CM Global Control Registers 2016-09-21 15:04:04 +02:00
cpu.c MIPS: Probe cache line sizes once during boot 2016-09-21 15:04:04 +02:00
interrupts.c MIPS: unify CPU code in arch/mips/cpu/ 2015-01-30 14:19:58 +01:00
Makefile MIPS: Map CM Global Control Registers 2016-09-21 15:04:04 +02:00
start.S MIPS: Fix cache maintenance in relocate_code & simplify 2016-09-21 16:25:43 +02:00
time.c MIPS: unify CPU code in arch/mips/cpu/ 2015-01-30 14:19:58 +01:00
u-boot-spl.lds MIPS: provide a default u-boot-spl.lds 2016-05-31 09:38:11 +02:00
u-boot.lds MIPS: Fix cache maintenance in relocate_code & simplify 2016-09-21 16:25:43 +02:00