Skip to contentSkip to conversation

do_bootm() and flush_cache()

U-Boot-Users Scott McNutt 2 participants 3 messages Mar 23, 2005 – Mar 24, 2005

lore
Share & tools
lore
#0 lore raw

I'm looking for some guidance:

On some processors (e.g. Nios-II), the instruction and data caches can't be disabled. The code for loadb, loads, etc. call flush_cache() ... so life is good.

But after reviewing do_bootm(), I don't see where the caches are flushed. A call to flush_cache() after moving/decompressing the image seems appropriate, but I'm not sure if this would break other architectures ...

... do I need to wrap an ifdef around a call to flush_cache() ?

Regards,
--Scott

#1 lore raw
Quoted 4 lines · In message <[email protected]> you wrote:

But after reviewing do_bootm(), I don't see where the caches are flushed. A call to flush_cache() after moving/decompressing the image seems appropriate, but

Why?

Best regards,

Wolfgang Denk

Signature · 3 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Open the pod bay doors, HAL."                    - Dave Bowman, 2001
#2 lore raw
Quoted 6 lines
Quoted 3 lines

But after reviewing do_bootm(), I don't see where the caches are flushed. A call to flush_cache() after moving/decompressing the image seems appropriate, but

Why?

After the move/decompression, the data cache must be flushed to main memory ... otherwise an instruction cache miss (after jumping into the kernel) may read in a (potentially) stale line. (Neither cache can be disabled.)

Regards,
--Scott