diff options
author | Marian Balakowicz <m8@semihalf.com> | 2008-02-21 17:18:01 +0100 |
---|---|---|
committer | Marian Balakowicz <m8@semihalf.com> | 2008-02-21 17:18:01 +0100 |
commit | 20c93959330aba8b5bbdbfde1ef319e99eba235d (patch) | |
tree | ef82297e3aeb904f94584e6d136fac55ec32c317 /examples | |
parent | 5cf746c303710329f8040d9c62ee354313e3e91f (diff) | |
parent | 928d1d77f8623c120d8763e20e1ca58df9c5c4c6 (diff) |
Merge branch 'master' of /home/git/u-boot
Diffstat (limited to 'examples')
-rw-r--r-- | examples/.gitignore | 1 | ||||
-rw-r--r-- | examples/Makefile | 8 | ||||
-rw-r--r-- | examples/smc91111_eeprom.c | 31 | ||||
-rw-r--r-- | examples/stubs.c | 4 | ||||
-rw-r--r-- | examples/test_burst_lib.S | 2 | ||||
-rw-r--r-- | examples/x86-testapp.c | 6 |
6 files changed, 29 insertions, 23 deletions
diff --git a/examples/.gitignore b/examples/.gitignore index f5470247848..059b09641a7 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 71a8c7f3ab9..d63fa703232 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.c b/examples/smc91111_eeprom.c index b8a3594e9e5..f5d8c6ab42c 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 diff --git a/examples/stubs.c b/examples/stubs.c index 571c4d50a43..9b3cadde33f 100644 --- a/examples/stubs.c +++ b/examples/stubs.c @@ -25,14 +25,14 @@ gd_t *global_data; : : "i"(XF_ ## x * sizeof(void *)) : "eax", "ecx"); #elif defined(CONFIG_PPC) /* - * r29 holds the pointer to the global_data, r11 is a call-clobbered + * r2 holds the pointer to the global_data, r11 is a call-clobbered * register */ #define EXPORT_FUNC(x) \ asm volatile ( \ " .globl " #x "\n" \ #x ":\n" \ -" lwz %%r11, %0(%%r29)\n" \ +" lwz %%r11, %0(%%r2)\n" \ " lwz %%r11, %1(%%r11)\n" \ " mtctr %%r11\n" \ " bctr\n" \ diff --git a/examples/test_burst_lib.S b/examples/test_burst_lib.S index 5bb49814284..aef4e324224 100644 --- a/examples/test_burst_lib.S +++ b/examples/test_burst_lib.S @@ -70,7 +70,7 @@ mmu_init: * we can load the instruction and data TLB registers with the * same values. */ - lwz r9,20(r29) /* gd->ram_size */ + lwz r9,20(r2) /* gd->ram_size */ addis r9,r9,-0x80 mr r8, r9 /* Higher 8 Meg in SDRAM */ diff --git a/examples/x86-testapp.c b/examples/x86-testapp.c index a1ab319ae88..e8603d9bac6 100644 --- a/examples/x86-testapp.c +++ b/examples/x86-testapp.c @@ -30,11 +30,11 @@ asm volatile ( \ asm volatile ( \ " .globl mon_" #x "\n" \ "mon_" #x ":\n" \ -" lwz %%r11, %0(%%r29)\n" \ +" lwz %%r11, %0(%%r2)\n" \ " lwz %%r11, %1(%%r11)\n" \ " mtctr %%r11\n" \ " bctr\n" \ - : : "i"(offsetof(xxx_t, pfunc)), "i"(XF_ ## x * sizeof(void *)) : "r11", "r29"); + : : "i"(offsetof(xxx_t, pfunc)), "i"(XF_ ## x * sizeof(void *)) : "r11", "r2"); #elif defined(__arm__) #define EXPORT_FUNC(x) \ asm volatile ( \ @@ -67,7 +67,7 @@ int main(void) #if defined(__i386__) xxx_t *pq; #elif defined(__powerpc__) - register volatile xxx_t *pq asm("r29"); + register volatile xxx_t *pq asm("r2"); #elif defined(__arm__) register volatile xxx_t *pq asm("r8"); #elif defined(__mips__) |