u-boot-brain/arch/mips
Paul Burton d8b326976a MIPS: Clear instruction hazards in flush_cache()
When writing code, for example during relocation, we ensure that the
icache has a coherent view of the new instructions with a call to
flush_cache(). This handles the bulk of the work to ensure the new
instructions will execute as expected, however it does not ensure that
the CPU pipeline doesn't already contain instructions taken from a stale
view of the affected memory. This could theoretically be a problem for
relocation, but in practice typically isn't because we sync caches for
enough code after the entry point of the newly written code that by the
time the CPU pipeline might possibly fetch any of it we'll have long ago
written it back & invalidated any stale icache entries. This is however
a problem for shorter regions of code.

In preparation for later patches which write shorter segments of code,
ensure any instruction hazards are cleared by flush_cache() by
introducing & using a new instruction_hazard_barrier() function which
makes use of the jr.hb instruction to clear the hazard.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: u-boot@lists.denx.de
2017-11-28 21:59:30 +01:00
..
cpu MIPS: Drop unused PTR_COUNT_SHIFT from u-boot.lds 2017-11-28 21:59:30 +01:00
dts mips: bmips: fix BCM3380 periph clock frequency 2017-05-31 15:45:29 +02:00
include/asm MIPS: Clear instruction hazards in flush_cache() 2017-11-28 21:59:30 +01:00
lib MIPS: Clear instruction hazards in flush_cache() 2017-11-28 21:59:30 +01:00
mach-ath79 board_f: Rename initdram() to dram_init() 2017-04-13 09:40:57 -04:00
mach-au1x00 Fix spelling of "resetting". 2016-10-31 10:13:17 -04:00
mach-bmips mips: bmips: add board descriptions 2017-05-31 14:49:55 +02:00
mach-pic32 board_f: Rename initdram() to dram_init() 2017-04-13 09:40:57 -04:00
config.mk MIPS: Stop building position independent code 2017-07-25 20:44:00 +02:00
Kconfig env: Convert CONFIG_ENV_IS_IN... to a choice 2017-08-15 20:50:01 -04:00
Makefile MIPS: add initial infrastructure for Broadcom MIPS SoCs 2017-05-10 16:16:09 +02:00
Makefile.postlink MIPS: Stop building position independent code 2017-07-25 20:44:00 +02:00