diff options
author | Michal Simek <monstr@monstr.eu> | 2009-01-05 13:29:32 +0100 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2009-01-23 10:39:59 +0100 |
commit | e9b737deb2c30125362d20e24170617476026e94 (patch) | |
tree | 5343cda3a837595ed07fbefb8402a96936bcbe1d /lib_microblaze | |
parent | b4f8dda35bfad447b4106828232705b2e878d168 (diff) | |
download | u-boot-imx-e9b737deb2c30125362d20e24170617476026e94.zip u-boot-imx-e9b737deb2c30125362d20e24170617476026e94.tar.gz u-boot-imx-e9b737deb2c30125362d20e24170617476026e94.tar.bz2 |
microblaze: Add cache flush
Diffstat (limited to 'lib_microblaze')
-rw-r--r-- | lib_microblaze/cache.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib_microblaze/cache.c b/lib_microblaze/cache.c index a2f7493..4b2e8e3 100644 --- a/lib_microblaze/cache.c +++ b/lib_microblaze/cache.c @@ -26,6 +26,18 @@ void flush_cache (ulong addr, ulong size) { - /* MicroBlaze have write thruough cache. nothing to do. */ - return; + int i; + for (i = 0; i < size; i += 4) + asm volatile ( +#ifdef CONFIG_ICACHE + "wic %0, r0;" +#endif + "nop;" +#ifdef CONFIG_DCACHE + "wdc %0, r0;" +#endif + "nop;" + : + : "r" (addr + i) + : "memory"); } |