X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=examples%2Fsmc91111_eeprom.c;h=f5d8c6ab42c16799335d6d87b1f3ef11eadf95eb;hb=b7e24d283e34727c2a6cdfdac2e09a426c579b73;hp=98e3e86ffa555906b0eb34c2cd3fff40fb425767;hpb=7b230f61db319d87d51449d4620d520822813fbb;p=u-boot diff --git a/examples/smc91111_eeprom.c b/examples/smc91111_eeprom.c index 98e3e86ffa..f5d8c6ab42 100644 --- a/examples/smc91111_eeprom.c +++ b/examples/smc91111_eeprom.c @@ -29,7 +29,14 @@ #include #include -#include "../drivers/smc91111.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; @@ -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