[U-Boot-Users] What is flush_cache() supposed to do?

Hi all,
When doing some cleanups to the AVR32 port, I just noticed that I haven't actually implemented flush_cache(). What is the purpose of that function? Should it flush the icache, the dcache or both?
Things seem to work fine as it is, even though the AT32AP7000 has a write-back cache which is enabled all the time in u-boot. Also, it seems to be called mostly from commands that load things into memory, but not all (ext2load does not seem to call it, for example.)
I do however flush the caches before transferring control to the Linux kernel. Maybe that's what saves me?
Haavard

On 8/29/06, Haavard Skinnemoen hskinnemoen@atmel.com wrote:
Hi all,
When doing some cleanups to the AVR32 port, I just noticed that I haven't actually implemented flush_cache(). What is the purpose of that function? Should it flush the icache, the dcache or both?
Things seem to work fine as it is, even though the AT32AP7000 has a write-back cache which is enabled all the time in u-boot. Also, it seems to be called mostly from commands that load things into memory, but not all (ext2load does not seem to call it, for example.)
To answer my own question, I'm guessing most of the commands that load stuff into memory needs to flush the cache so that it is possible to jump to the chunk of code afterwards using the "go" command.
If that's indeed the purpose of flush_cache(), there's a real bug in the AVR32 port which I will fix in the next patchset by making sure the given region is written back to RAM and that the icache is invalidated for the same region.
Haavard
participants (2)
-
Haavard Skinnemoen
-
Haavard Skinnemoen