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

Haavard Skinnemoen hskinnemoen at gmail.com
Thu Aug 31 20:26:18 CEST 2006


On 8/29/06, Haavard Skinnemoen <hskinnemoen at 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




More information about the U-Boot mailing list