Net: Clean up LAN91C96 Support
[oweals/u-boot.git] / board / dave / B2 / B2.c
index a6ab91791011de8327ebc6be1e232b05d5ad26a5..096ebbd16c84e0b2dd18d0270745bd1ba0c3b485 100644 (file)
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <asm/hardware.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * Miscelaneous platform dependent initialization
  */
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        u32 temp;
 
        /* Configuration Port Control Register*/
@@ -77,16 +79,16 @@ int board_init (void)
        INTCON = 0x05;
 
     /*
-       Configure chip ethernet interrupt as High level
-       Port G EINT 0-7 EINT0 -> CHIP ETHERNET
+       Configure chip ethernet interrupt as High level
+       Port G EINT 0-7 EINT0 -> CHIP ETHERNET
     */
        temp = EXTINT;
-       temp &= ~0x7;
+       temp &= ~0x7;
     temp |= 0x1; /*LEVEL_HIGH*/
        EXTINT = temp;
 
     /*
-       Reset SMSC LAN91C96 chip
+       Reset SMSC LAN91C96 chip
     */
     temp= PCONF;
     temp |= 0x00000040;
@@ -109,7 +111,7 @@ int board_init (void)
     PDATF = temp;
 
        /* arch number MACH_TYPE_MBA44B0 */
-       gd->bd->bi_arch_number = 178;
+       gd->bd->bi_arch_number = MACH_TYPE_S3C44B0;
 
        /* location of boot parameters */
        gd->bd->bi_boot_params = 0x0c000100;
@@ -119,10 +121,19 @@ int board_init (void)
 
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
        return (0);
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+       int rc = 0;
+#ifdef CONFIG_LAN91C96
+       rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE);
+#endif
+       return rc;
+}
+#endif