From: Daniel Hellstrom <daniel@gaisler.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH 2/8] SPARC: SPARC cfi-flash support for 64-bit reads
Date: Thu, 13 Mar 2008 10:38:50 +0100 [thread overview]
Message-ID: <47D8F62A.2000108@gaisler.com> (raw)
For current SPARC architectures (LEON2 and LEON3) each read from the
FLASH must lead to a cache miss. This is because FLASH can not be set
non-cacheable since program code resides there, and alternatively disabling
cache is poor from performance view, or doing a cache flush between each
read
is even poorer.
Forcing a cache miss on a SPARC is done by a special instruction "lda" -
load alternative space, the alternative space number (ASI) is processor
implementation spcific and can be found by including <asm/processor.h>.
SPARC has implemented __raw_readq, it reads 64-bit from any 32-bit address.
Best Regards,
Daniel Hellstrom
drivers/mtd/cfi_flash.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 439c950..6fc6bc4 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -241,8 +241,12 @@ static u32 flash_read32(void *addr)
static u64 flash_read64(void *addr)
{
+#ifdef CONFIG_SPARC
+ return __raw_readq(addr);
+#else
/* No architectures currently implement __raw_readq() */
return *(volatile u64 *)addr;
+#endif
}
/*-----------------------------------------------------------------------
next reply other threads:[~2008-03-13 9:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-13 9:38 Daniel Hellstrom [this message]
2008-03-13 12:04 ` [U-Boot-Users] [PATCH 2/8] SPARC: SPARC cfi-flash support for 64-bit reads Wolfgang Denk
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=47D8F62A.2000108@gaisler.com \
--to=daniel@gaisler.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