summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2008-02-04 19:26:56 -0500
committerMike Frysinger <vapier@gentoo.org>2008-02-04 19:26:56 -0500
commit6b9097e5e7490aa7b828c6f1a1c7a0e875df8464 (patch)
treed34f053bad9c45f66c3e9121515661d99f3dfefb /examples
parent97c26e006d2fa6d4e1560933ee6f385d8b8908b9 (diff)
downloadu-boot-imx-6b9097e5e7490aa7b828c6f1a1c7a0e875df8464.zip
u-boot-imx-6b9097e5e7490aa7b828c6f1a1c7a0e875df8464.tar.gz
u-boot-imx-6b9097e5e7490aa7b828c6f1a1c7a0e875df8464.tar.bz2
use C code rather than inline assembly
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'examples')
-rw-r--r--examples/smc91111_eeprom.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/examples/smc91111_eeprom.c b/examples/smc91111_eeprom.c
index 1e1129a..f5d8c6a 100644
--- a/examples/smc91111_eeprom.c
+++ b/examples/smc91111_eeprom.c
@@ -33,6 +33,11 @@
#ifdef CONFIG_DRIVER_SMC91111
+#ifdef pFIO0_DIR
+# define pFIO_DIR pFIO0_DIR
+# define pFIO_FLAG_S pFIO0_FLAG_S
+#endif
+
#define SMC_BASE_ADDRESS CONFIG_SMC91111_BASE
#define EEPROM 0x1;
#define MAC 0x2;
@@ -61,17 +66,9 @@ int smc91111_eeprom (int argc, char *argv[])
return (0);
}
- asm ("p2.h = 0xFFC0;");
- asm ("p2.l = 0x0730;");
- asm ("r0 = 0x01;");
- asm ("w[p2] = r0;");
- asm ("ssync;");
-
- asm ("p2.h = 0xffc0;");
- asm ("p2.l = 0x0708;");
- asm ("r0 = 0x01;");
- asm ("w[p2] = r0;");
- asm ("ssync;");
+ *pFIO_DIR = 0x01;
+ *pFIO_FLAG_S = 0x01;
+ SSYNC();
if ((SMC_inw (BANK_SELECT) & 0xFF00) != 0x3300) {
printf ("Can't find SMSC91111\n");