All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] JFFS2 + cache coherency
@ 2009-06-02 19:22 Renaud barbier
  0 siblings, 0 replies; only message in thread
From: Renaud barbier @ 2009-06-02 19:22 UTC (permalink / raw)
  To: u-boot

My system is based on MPc8544.

I am loading a small standalone program (2KB) from the JFFS2 partition 
(NOR flash)

My program crashes while it does not crash if loaded from a tftp server.

After investifgation using Codewarrior I noticed that there is a difference
between the memory and Dcache content.
Some number of words (8 = cache line)) are all zero in Dcache. Hence 
when jumping  the program crashes
 as I guess the instruction cache is picking the instructions from the 
Dcache.

When the program is loaded from a tftp server both the cache (in 
copyback mode) and DDR
are set with the same data and therefore the program works.
When loaded from a JFFS2 partition, the data are loaded to inode buffer 
(flash to memory with cache inhibited)
 in memory and then (mem)copied to the destination address (memory to 
memory). (Hope I got this right).
This is why the cache/memory is not in sync.

The problem does not exist  when the cache is write-through.

Also the Freescale documentation on cache cohenrency specifies that 
software should make sure
that the cache/memory are synchronized before jumping to a new location.

Hence, I think  the cache should be flushed in or after do_jffs2_fsload.
A call to flush_dcache(); fixes the problem.

Let me know if you think I am right regarding this issue.

cheers,
Renaud

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-02 19:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-02 19:22 [U-Boot] JFFS2 + cache coherency Renaud barbier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.