public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC] command/cache: Add flush_cache command
Date: Thu, 18 Apr 2013 12:09:46 -0500	[thread overview]
Message-ID: <1366304986.9938.5@snotra> (raw)
In-Reply-To: <loom.20130403T151459-101@post.gmane.org> (from jimccrown@gmail.com on Wed Apr  3 09:02:15 2013)

On 04/03/2013 09:02:15 AM, Jim Chargin wrote:
> I apologize for being so late with this question.
> 
> York Sun <yorksun <at> freescale.com> writes:
> 
> >
> > When we need the copied code/data in the main memory, we can flush  
> the
> > cache now. It uses the existing function flush_cache. Syntax is
> >
> > flush_cache <addr> <size>
> >
> > The addr and size are given in hexadecimal. Like memory command,  
> there is
> > no sanity check for the parameters.
> >
> 
> Are there symptoms for a specific system failure you can provide?

Generally you'd see code behaving in a way that is different than the  
instructions in memory (as seen by a load instruction) would suggest.   
Often it's obvious, such as an illegal instruction trap on on opcode  
that is valid, but it could be arbitrary depending on what the old  
contents of memory were (especially if there had been valid (but  
different) code there before).

> My problem is that when a stand alone application, which is copied  
> from NOR
> flash to DDR, is started with the "go" command, it sometimes  
> experiences a
> program check (illegal instruction) after a block of 32 zero bytes  
> "appears" in
> memory.

Maybe the old contents of memory contained a dcbz?  Or somehow confused  
a legimate dcbz to target the wrong address.

> I'm using a U-Boot for a custom Freescale P1022-based board,  
> currently based on
> the old 2010.12 U-Boot as patched by Freescale in their
> SDK_V1_0_20110429_ltib.iso. Unfortunately, upgrading to a more recent  
> version of
> U-Boot is not possible at this time, no more recent version is  
> available from
> Freescale and I don't have the resources to verify all their patches  
> apply
> correctly to a release directly from DENX.

You can find the latest Freescale U-Boot at:
http://git.freescale.com/git/cgit.cgi/ppc/sdk/u-boot.git/
git://git.freescale.com/ppc/sdk/u-boot.git

...though there's a good chance that you would not need anything from  
the SDK if you run the latest upstream U-Boot.  You'd still need to  
apply your own patches for the custom board, of course.

> (By the way, I would not leave the "flush_dcache();  
> invalidate_icache();" in
> do_go(), I merely found that for demonstrating a possible solution,  
> this change
> easier than switching to a stand alone app that starts with bootm, or  
> similar)

It seems reasonably likely that this is the cause of your problem; in  
any case, the flush is architecturally required.

-Scott

      reply	other threads:[~2013-04-18 17:09 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-19 20:29 [U-Boot] [RFC] command/cache: Add flush_cache command York Sun
2013-03-19 22:01 ` Albert ARIBAUD
2013-03-19 22:07   ` York Sun
2013-03-19 23:32     ` Scott Wood
2013-03-20 13:59       ` Albert ARIBAUD
2013-03-20 14:58         ` Wolfgang Denk
2013-03-20 16:43           ` Scott Wood
2013-03-20 17:38             ` Albert ARIBAUD
2013-03-20 18:16               ` Scott Wood
2013-03-20 19:15             ` Tom Rini
2013-03-20 19:36               ` Scott Wood
2013-03-20 19:59                 ` Tom Rini
2013-03-20 21:31                   ` Scott Wood
2013-03-21  5:42                     ` Wolfgang Denk
2013-03-21  5:39                   ` Wolfgang Denk
2013-03-21 12:29                     ` Tom Rini
2013-03-21 13:37                       ` Wolfgang Denk
2013-03-21 18:22                         ` Scott Wood
2013-03-21 19:25                           ` Wolfgang Denk
2013-03-21 20:34                             ` Scott Wood
2013-03-22  6:30                               ` Albert ARIBAUD
2013-03-22 12:17                                 ` Tom Rini
2013-03-22 14:03                                   ` Wolfgang Denk
2013-03-22 14:29                                     ` Tom Rini
2013-03-22 15:57                                       ` Albert ARIBAUD
2013-03-22 16:48                                       ` Scott Wood
2013-03-22 17:19                                         ` Tom Rini
2013-03-22 20:39                                       ` Wolfgang Denk
2013-03-20 22:11                 ` Albert ARIBAUD
2013-03-20 22:35                   ` Scott Wood
2013-03-20 23:33                     ` Michael Cashwell
2013-03-20 23:48                       ` Scott Wood
2013-03-21  0:27                         ` Michael Cashwell
2013-03-21  0:31                           ` Scott Wood
2013-03-21  5:02                             ` Sricharan R
2013-03-21 18:51                               ` Scott Wood
2013-03-21 17:58                     ` Albert ARIBAUD
2013-03-21 18:07                       ` Scott Wood
2013-03-21 19:21                         ` Wolfgang Denk
2013-03-20 19:40               ` York Sun
2013-03-20 14:51 ` Wolfgang Denk
2013-03-20 16:44   ` Scott Wood
2013-04-03 14:02 ` Jim Chargin
2013-04-18 17:09   ` Scott Wood [this message]

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=1366304986.9938.5@snotra \
    --to=scottwood@freescale.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