From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] ARM v7: Flush icache when executing a program with go
Date: Thu, 16 May 2013 09:14:06 +0200 [thread overview]
Message-ID: <20130516071406.6AD19380635@gemini.denx.de> (raw)
In-Reply-To: <1368669278.27007.43.camel@localhost>
Dear Henrik Nordstr?m,
In message <1368669278.27007.43.camel@localhost> you wrote:
>
> > So my suggestion is to implement the icache_flush in common/bmmt_cmd.c
> > as follows:
...
> From what I can tell there is no need to theck icache_status(). It's
> always safe to call invalidate_icache_all().
>
> So it's back to use the compiler define for ARMv7.
I don't think this would be an acceptable approach. There are several
serious issues with the suggested patch.
First, I think your solution in not complete. Invalidating the
instruction cache is only one part of what needs to be done. You
should also make sure to flush the data cache.
Second, flushing _all_ caches may be a time consuming operation on
some systems, and it is not necessary. It should be sufficient to
flush the address range where the loaded code resides.
Third, Albert is perfectly right: there is no reason to make this
architecture specific. We should NOT add such code here and there on
a per-arch base; this results only in code fragmentation, duplication
and a maintenance nightmare.
Finally, a very similar topic has been discussed here not so long ago;
please see the thread "command/cache: Add flush command" at [1], [2],
and [3]; see especially the attempt of a summary at [4].
[1] http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/156449
[2] http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/158038
[3] http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/158101
[4] http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/158101/focus=158559
In the summary I tried to explain what I think we should do to strive
for more common code; unfortunately did not follow this suggestion but
decided to keep his code out-of-tree. But I still think this is what
should be done, also in your case.
We should not add architecture-specific code like you suggested.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"A dirty mind is a joy forever." - Randy Kunkee
next prev parent reply other threads:[~2013-05-16 7:14 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-14 14:16 [U-Boot] ARM v7: Flush icache when executing a program with go Henrik Nordström
2013-05-15 15:11 ` Albert ARIBAUD
2013-05-15 16:34 ` Henrik Nordström
2013-05-15 16:44 ` Albert ARIBAUD
2013-05-15 16:51 ` Tom Rini
2013-05-15 17:39 ` Albert ARIBAUD
2013-05-16 1:54 ` Henrik Nordström
2013-05-16 7:14 ` Wolfgang Denk [this message]
2013-05-16 13:37 ` Tom Rini
2013-05-16 15:37 ` Henrik Nordström
2013-05-16 22:13 ` Wolfgang Denk
2013-05-17 12:16 ` Henrik Nordström
2013-05-20 0:55 ` Kuo-Jung Su
2013-05-21 12:37 ` Wolfgang Denk
2013-05-21 12:26 ` Wolfgang Denk
2013-05-21 21:57 ` Henrik Nordström
2013-05-21 12:38 ` Kees Jongenburger
2013-05-21 16:45 ` Albert ARIBAUD
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=20130516071406.6AD19380635@gemini.denx.de \
--to=wd@denx.de \
--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