public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Renaud barbier <renaud.barbier@ge.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] JFFS2 + cache coherency
Date: Tue, 02 Jun 2009 20:22:50 +0100	[thread overview]
Message-ID: <4A257C0A.7090802@ge.com> (raw)

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

                 reply	other threads:[~2009-06-02 19:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A257C0A.7090802@ge.com \
    --to=renaud.barbier@ge.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox