summaryrefslogtreecommitdiffstats
path: root/board/sc520_cdp/flash.c
diff options
context:
space:
mode:
authorGraeme Russ <graeme.russ@gmail.com>2009-08-23 12:59:56 +1000
committerWolfgang Denk <wd@denx.de>2009-09-04 21:56:45 +0200
commited7a1b681de1e31d18d5b92e2767ae8df3241687 (patch)
tree9ff41a5e184dd262ff56c52a5274f513a380e8e2 /board/sc520_cdp/flash.c
parent9b32f96b5b92ba13fdb4b5eb637734752235f260 (diff)
downloadtalos-obmc-uboot-ed7a1b681de1e31d18d5b92e2767ae8df3241687.tar.gz
talos-obmc-uboot-ed7a1b681de1e31d18d5b92e2767ae8df3241687.zip
i386: Replace [read, write]_mmcr_[byte, word, long] with memory mapped structure
Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
Diffstat (limited to 'board/sc520_cdp/flash.c')
-rw-r--r--board/sc520_cdp/flash.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/board/sc520_cdp/flash.c b/board/sc520_cdp/flash.c
index dcb8c57e81..64831b7eda 100644
--- a/board/sc520_cdp/flash.c
+++ b/board/sc520_cdp/flash.c
@@ -337,12 +337,12 @@ done: ;
unsigned micro; \
unsigned milli=0; \
\
- micro = *(volatile u16*)(0xfffef000+SC520_SWTMRMILLI); \
+ micro = sc520_mmcr->swtmrmilli; \
\
for (;;) { \
\
- milli += *(volatile u16*)(0xfffef000+SC520_SWTMRMILLI); \
- micro = *(volatile u16*)(0xfffef000+SC520_SWTMRMICRO); \
+ milli += sc520_mmcr->swtmrmilli; \
+ micro = sc520_mmcr->swtmrmicro; \
\
if ((delay) <= (micro + (milli * 1000))) { \
break; \
@@ -364,12 +364,12 @@ static u32 _amd_erase_flash(u32 addr, u32 sector)
/* Sector erase command comes last */
*(volatile u32*)(addr + sector) = 0x30303030;
- elapsed = *(volatile u16*)(0xfffef000+SC520_SWTMRMILLI); /* dummy read */
+ elapsed = sc520_mmcr->swtmrmilli; /* dummy read */
elapsed = 0;
__udelay(50);
while (((*(volatile u32*)(addr + sector)) & 0x80808080) != 0x80808080) {
- elapsed += *(volatile u16*)(0xfffef000+SC520_SWTMRMILLI);
+ elapsed += sc520_mmcr->swtmrmilli;
if (elapsed > ((CONFIG_SYS_FLASH_ERASE_TOUT/CONFIG_SYS_HZ) * 1000)) {
*(volatile u32*)(addr) = 0xf0f0f0f0;
return 1;
@@ -487,12 +487,12 @@ static int _amd_write_word(unsigned start, unsigned dest, unsigned data)
dest2[0] = data;
- elapsed = *(volatile u16*)(0xfffef000+SC520_SWTMRMILLI); /* dummy read */
+ elapsed = sc520_mmcr->swtmrmilli; /* dummy read */
elapsed = 0;
/* data polling for D7 */
while ((dest2[0] & 0x80808080) != (data2[0] & 0x80808080)) {
- elapsed += *(volatile u16*)(0xfffef000+SC520_SWTMRMILLI);
+ elapsed += sc520_mmcr->swtmrmilli;
if (elapsed > ((CONFIG_SYS_FLASH_WRITE_TOUT/CONFIG_SYS_HZ) * 1000)) {
addr2[0] = 0xf0f0f0f0;
return 1;
OpenPOWER on IntegriCloud