summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2008-02-15 00:06:18 +0100
committerWolfgang Denk <wd@denx.de>2008-02-15 00:06:18 +0100
commit6f99eec3dc2285abfb93631003f7e5cadf2eab0f (patch)
tree1eaaa31eb768d8bfa68e9ff41eef53d37b64f21c /examples
parentf6921e3dc331293c873ec4d109fd5517a42a90b3 (diff)
parent30942b18b66f35f2ceedab39af10e9eccaa943cc (diff)
downloadu-boot-imx-6f99eec3dc2285abfb93631003f7e5cadf2eab0f.zip
u-boot-imx-6f99eec3dc2285abfb93631003f7e5cadf2eab0f.tar.gz
u-boot-imx-6f99eec3dc2285abfb93631003f7e5cadf2eab0f.tar.bz2
Merge branch 'master' of git://www.denx.de/git/u-boot-blackfin
Conflicts: Makefile doc/README.standalone Signed-off-by: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'examples')
-rw-r--r--examples/.gitignore1
-rw-r--r--examples/Makefile8
-rwxr-xr-xexamples/smc91111_eeprombin0 -> 13643 bytes
-rw-r--r--examples/smc91111_eeprom.c31
4 files changed, 23 insertions, 17 deletions
diff --git a/examples/.gitignore b/examples/.gitignore
index f547024..059b096 100644
--- a/examples/.gitignore
+++ b/examples/.gitignore
@@ -1,5 +1,6 @@
/hello_world
/interrupt
/sched
+/smc91111_eeprom
*.bin
*.srec
diff --git a/examples/Makefile b/examples/Makefile
index 71a8c7f..d63fa70 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -91,13 +91,9 @@ BIN += sched.bin
endif
ifeq ($(ARCH),blackfin)
-ifneq ($(BOARD),bf537-stamp)
-ifneq ($(BOARD),bf537-pnav)
ELF += smc91111_eeprom
SREC += smc91111_eeprom.srec
-BIN += smc91111_eeprom.bin
-endif
-endif
+BIN += smc91111_eeprom.bin
endif
# The following example is pretty 8xx specific...
@@ -166,7 +162,7 @@ $(LIB): $(obj).depend $(LIBOBJS)
$(ELF):
$(obj)%: $(obj)%.o $(LIB)
$(LD) -g $(EX_LDFLAGS) -Ttext $(LOAD_ADDR) \
- -o $@ -e $(notdir $(<:.o=)) $< $(LIB) \
+ -o $@ -e $(SYM_PREFIX)$(notdir $(<:.o=)) $< $(LIB) \
-L$(gcclibdir) -lgcc
$(SREC):
diff --git a/examples/smc91111_eeprom b/examples/smc91111_eeprom
new file mode 100755
index 0000000..1009fec
--- /dev/null
+++ b/examples/smc91111_eeprom
Binary files differ
diff --git a/examples/smc91111_eeprom.c b/examples/smc91111_eeprom.c
index b8a3594..f5d8c6a 100644
--- a/examples/smc91111_eeprom.c
+++ b/examples/smc91111_eeprom.c
@@ -31,6 +31,13 @@
#include <exports.h>
#include "../drivers/net/smc91111.h"
+#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;
@@ -59,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");
@@ -387,3 +386,13 @@ void dump_reg (void)
printf ("\n");
}
}
+
+#else
+
+int smc91111_eeprom (int argc, char *argv[])
+{
+ printf("Not supported for this board\n");
+ return 1;
+}
+
+#endif