summaryrefslogtreecommitdiff
path: root/board/esd/dasa_sim/eeprom.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2009-03-21 22:15:49 +0100
committerWolfgang Denk <wd@denx.de>2009-03-21 22:15:49 +0100
commitee1702d75a30d076139d1841383a1fa7220a0e11 (patch)
treeb008c231b7d5e4e52ac49aec9a49bc73413aaf30 /board/esd/dasa_sim/eeprom.c
parente60beb13cf0135dc71c541021487b5ccc4d269cb (diff)
parentfaac4fd852e39cb1d7a740801b060e41aeacef1f (diff)
downloadu-boot-imx-ee1702d75a30d076139d1841383a1fa7220a0e11.zip
u-boot-imx-ee1702d75a30d076139d1841383a1fa7220a0e11.tar.gz
u-boot-imx-ee1702d75a30d076139d1841383a1fa7220a0e11.tar.bz2
Merge branch 'next' of ../next
Diffstat (limited to 'board/esd/dasa_sim/eeprom.c')
-rw-r--r--board/esd/dasa_sim/eeprom.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/board/esd/dasa_sim/eeprom.c b/board/esd/dasa_sim/eeprom.c
index 1b4c7b3..aa6f52c 100644
--- a/board/esd/dasa_sim/eeprom.c
+++ b/board/esd/dasa_sim/eeprom.c
@@ -24,7 +24,7 @@
#include <common.h>
#include <command.h>
-
+#include <asm/io.h>
#define EEPROM_CAP 0x50000358
#define EEPROM_DATA 0x5000035c
@@ -33,23 +33,23 @@
unsigned int eepromReadLong(int offs)
{
unsigned int value;
- volatile unsigned short ret;
+ unsigned short ret;
int count;
- *(unsigned short *)EEPROM_CAP = offs;
+ out_be16((void *)EEPROM_CAP, offs);
count = 0;
for (;;)
{
count++;
- ret = *(unsigned short *)EEPROM_CAP;
+ ret = in_be16((void *)EEPROM_CAP);
if ((ret & 0x8000) != 0)
break;
}
- value = *(unsigned long *)EEPROM_DATA;
+ value = in_be32((void *)EEPROM_DATA);
return value;
}
@@ -69,18 +69,18 @@ unsigned char eepromReadByte(int offs)
void eepromWriteLong(int offs, unsigned int value)
{
- volatile unsigned short ret;
+ unsigned short ret;
int count;
count = 0;
- *(unsigned long *)EEPROM_DATA = value;
- *(unsigned short *)EEPROM_CAP = 0x8000 + offs;
+ out_be32((void *)EEPROM_DATA, value);
+ out_be16((void *)EEPROM_CAP, 0x8000 + offs);
for (;;)
{
count++;
- ret = *(unsigned short *)EEPROM_CAP;
+ ret = in_be16((void *)EEPROM_CAP);
if ((ret & 0x8000) == 0)
break;