From: Lei Wen <leiwen@marvell.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [U-BOOT] [PATCH] arm: fix flush cache function on arm926ejs
Date: Tue, 11 Jan 2011 23:40:20 +0800 [thread overview]
Message-ID: <1294760420-28029-1-git-send-email-leiwen@marvell.com> (raw)
flush_cache function should only be called when the dcache is on.
And original flush method for arm926ejs seems don't work, replace
it with new version.
Test on Marvell Pantheon pxa920 board with usb ether function.
Signed-off-by: Lei Wen <leiwen@marvell.com>
---
arch/arm/lib/cache.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/lib/cache.c b/arch/arm/lib/cache.c
index 30686fe..b8d5eee 100644
--- a/arch/arm/lib/cache.c
+++ b/arch/arm/lib/cache.c
@@ -27,16 +27,16 @@
void flush_cache (unsigned long dummy1, unsigned long dummy2)
{
+ if (!dcache_status())
+ return;
#if defined(CONFIG_OMAP2420) || defined(CONFIG_ARM1136)
void arm1136_cache_flush(void);
arm1136_cache_flush();
#endif
#ifdef CONFIG_ARM926EJS
- /* test and clean, page 2-23 of arm926ejs manual */
- asm("0: mrc p15, 0, r15, c7, c10, 3\n\t" "bne 0b\n" : : : "memory");
- /* disable write buffer as well (page 2-22) */
- asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0));
+ /* clean & invalidate all D cache */
+ asm("mcr p15, 0, %0, c7, c14, 0" : : "r" (0));
#endif
#ifdef CONFIG_OMAP34XX
void v7_flush_cache_all(void);
--
1.7.0.4
next reply other threads:[~2011-01-11 15:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-11 15:40 Lei Wen [this message]
2011-01-11 19:53 ` [U-Boot] [U-BOOT] [PATCH] arm: fix flush cache function on arm926ejs Albert ARIBAUD
2011-01-12 4:27 ` Lei Wen
2011-01-12 4:31 ` Lei Wen
2011-01-12 18:49 ` 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=1294760420-28029-1-git-send-email-leiwen@marvell.com \
--to=leiwen@marvell.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