From b45264ee85cbd92020640a32e02fb434fd557108 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 4 Feb 2008 19:26:53 -0500 Subject: add gitignores for Blackfin pieces Signed-off-by: Mike Frysinger --- examples/smc91111_eeprom | Bin 0 -> 13643 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100755 examples/smc91111_eeprom (limited to 'examples') diff --git a/examples/smc91111_eeprom b/examples/smc91111_eeprom new file mode 100755 index 000000000..1009fecac Binary files /dev/null and b/examples/smc91111_eeprom differ -- cgit v1.2.3 From 32a9f5f2160a034ea87ea651b233ef7c635e55cf Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 4 Feb 2008 19:26:54 -0500 Subject: make smc91111_eeprom managment simpler by depending on the board configuration file rather than a hardcoded list of boards Signed-off-by: Mike Frysinger --- examples/.gitignore | 1 + examples/Makefile | 6 +----- examples/smc91111_eeprom.c | 12 ++++++++++++ 3 files changed, 14 insertions(+), 5 deletions(-) (limited to 'examples') diff --git a/examples/.gitignore b/examples/.gitignore index f54702478..059b09641 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 71a8c7f3a..79af4b07c 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... diff --git a/examples/smc91111_eeprom.c b/examples/smc91111_eeprom.c index b8a3594e9..1e1129a33 100644 --- a/examples/smc91111_eeprom.c +++ b/examples/smc91111_eeprom.c @@ -31,6 +31,8 @@ #include #include "../drivers/net/smc91111.h" +#ifdef CONFIG_DRIVER_SMC91111 + #define SMC_BASE_ADDRESS CONFIG_SMC91111_BASE #define EEPROM 0x1; #define MAC 0x2; @@ -387,3 +389,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 -- cgit v1.2.3 From 0858b835e7ea501ea084d34cef75932f098342bb Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 4 Feb 2008 19:26:55 -0500 Subject: add support for Blackfin symbol prefixes to examples Signed-off-by: Mike Frysinger --- Makefile | 2 +- blackfin_config.mk | 2 ++ examples/Makefile | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/Makefile b/Makefile index 2413ed629..dc023a9bb 100644 --- a/Makefile +++ b/Makefile @@ -312,7 +312,7 @@ $(obj)u-boot.dis: $(obj)u-boot $(OBJDUMP) -d $< > $@ $(obj)u-boot: depend $(SUBDIRS) $(OBJS) $(LIBS) $(LDSCRIPT) - UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\ + UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\ cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) \ --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \ -Map u-boot.map -o u-boot diff --git a/blackfin_config.mk b/blackfin_config.mk index beb9498e7..e91318e9b 100644 --- a/blackfin_config.mk +++ b/blackfin_config.mk @@ -23,3 +23,5 @@ PLATFORM_RELFLAGS += -ffixed-P5 PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN + +SYM_PREFIX = _ diff --git a/examples/Makefile b/examples/Makefile index 79af4b07c..d63fa7032 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -162,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): -- cgit v1.2.3 From 6b9097e5e7490aa7b828c6f1a1c7a0e875df8464 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 4 Feb 2008 19:26:56 -0500 Subject: use C code rather than inline assembly Signed-off-by: Mike Frysinger --- examples/smc91111_eeprom.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'examples') diff --git a/examples/smc91111_eeprom.c b/examples/smc91111_eeprom.c index 1e1129a33..f5d8c6ab4 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"); -- cgit v1.2.3