Index: cpu/ppc4xx/405gp_enet.c =================================================================== RCS file: /cvsroot/u-boot/u-boot/cpu/ppc4xx/405gp_enet.c,v retrieving revision 1.2 diff -c -b -w -r1.2 405gp_enet.c *** cpu/ppc4xx/405gp_enet.c 23 May 2003 11:20:59 -0000 1.2 --- cpu/ppc4xx/405gp_enet.c 4 Jun 2003 20:57:38 -0000 *************** *** 173,189 **** static int is_receiving = 0; /* sync with eth interrupt */ static int print_speed = 1; /* print speed message upon start */ - static void enet_rcv (unsigned long malisr); - /*-----------------------------------------------------------------------------+ * Prototypes and externals. *-----------------------------------------------------------------------------*/ ! void mal_err (unsigned long isr, unsigned long uic, unsigned long mal_def, unsigned long mal_errr); ! void emac_err (unsigned long isr); ! ! void eth_halt (void) { mtdcr (malier, 0x00000000); /* disable mal interrupts */ out32 (EMAC_IER, 0x00000000); /* disable emac interrupts */ --- 173,188 ---- static int is_receiving = 0; /* sync with eth interrupt */ static int print_speed = 1; /* print speed message upon start */ /*-----------------------------------------------------------------------------+ * Prototypes and externals. *-----------------------------------------------------------------------------*/ ! static void enet_rcv (unsigned long malisr); ! static int enetInt(void); ! static void mal_err (unsigned long isr, unsigned long uic, unsigned long mal_def, unsigned long mal_errr); ! static void emac_err (unsigned long isr); ! static void ppc_4xx_eth_halt (struct eth_device *dev) { mtdcr (malier, 0x00000000); /* disable mal interrupts */ out32 (EMAC_IER, 0x00000000); /* disable emac interrupts */ *************** *** 202,208 **** } ! int eth_init (bd_t * bis) { int i; unsigned long reg; --- 201,207 ---- } ! static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis) { int i; unsigned long reg; *************** *** 478,488 **** bis_save = bis; first_init = 1; ! return (0); } ! int eth_send (volatile void *ptr, int len) { struct enet_frame *ef_ptr; ulong time_start, time_now; --- 477,487 ---- bis_save = bis; first_init = 1; ! return (1); } ! static int ppc_4xx_eth_send (struct eth_device *dev, volatile void *ptr, int len) { struct enet_frame *ef_ptr; ulong time_start, time_now; *************** *** 539,545 **** return (-1); } } else { ! return (0); } } } --- 538,544 ---- return (-1); } } else { ! return (len); } } } *************** *** 696,702 **** /*-----------------------------------------------------------------------------+ * MAL Error Routine *-----------------------------------------------------------------------------*/ ! void mal_err (unsigned long isr, unsigned long uic, unsigned long maldef, unsigned long mal_errr) { mtdcr (malesr, isr); /* clear interrupt */ --- 695,701 ---- /*-----------------------------------------------------------------------------+ * MAL Error Routine *-----------------------------------------------------------------------------*/ ! static void mal_err (unsigned long isr, unsigned long uic, unsigned long maldef, unsigned long mal_errr) { mtdcr (malesr, isr); /* clear interrupt */ *************** *** 724,730 **** /*-----------------------------------------------------------------------------+ * EMAC Error Routine *-----------------------------------------------------------------------------*/ ! void emac_err (unsigned long isr) { printf ("EMAC error occured.... ISR = %lx\n", isr); out32 (EMAC_ISR, isr); --- 723,729 ---- /*-----------------------------------------------------------------------------+ * EMAC Error Routine *-----------------------------------------------------------------------------*/ ! static void emac_err (unsigned long isr) { printf ("EMAC error occured.... ISR = %lx\n", isr); out32 (EMAC_ISR, isr); *************** *** 816,822 **** } ! int eth_rx (void) { int length; int user_index; --- 815,821 ---- } ! static int ppc_4xx_eth_rx (struct eth_device *dev) { int length; int user_index; *************** *** 863,867 **** --- 862,908 ---- return length; } + + #if defined(CONFIG_NET_MULTI) + int ppc_4xx_eth_initialize(bd_t *bis) + { + struct eth_device *dev; + int eth_num = 0; + + dev = malloc (sizeof *dev); + if (dev == NULL) { + printf(__FUNCTION__ ": Cannot allocate eth_device\n"); + return (-1); + } + + sprintf(dev->name, "ppc_4xx_eth%d", eth_num); + dev->priv = (void *) eth_num; + dev->init = ppc_4xx_eth_init; + dev->halt = ppc_4xx_eth_halt; + dev->send = ppc_4xx_eth_send; + dev->recv = ppc_4xx_eth_rx; + + eth_register (dev); + } + #else /* !defined(CONFIG_NET_MULTI) */ + void eth_halt (void) + { + ppc_4xx_eth_halt(NULL); + } + + int eth_init (bd_t *bis) + { + return (ppc_4xx_eth_init(NULL, bis)); + } + int eth_send(volatile void *packet, int length) + { + return (ppc_4xx_eth_send(NULL, packet, length)); + } + + int eth_rx(void) + { + return (ppc_4xx_eth_rx(NULL)); + } + #endif /* !defined(CONFIG_NET_MULTI) */ #endif /* CONFIG_405GP */ Index: include/405gp_enet.h =================================================================== RCS file: /cvsroot/u-boot/u-boot/include/405gp_enet.h,v retrieving revision 1.1.1.1 diff -c -b -w -r1.1.1.1 405gp_enet.h *** include/405gp_enet.h 16 Aug 2002 13:30:52 -0000 1.1.1.1 --- include/405gp_enet.h 4 Jun 2003 20:57:39 -0000 *************** *** 241,246 **** /*-----------------------------------------------------------------------------+ | Function prototypes for device table. +-----------------------------------------------------------------------------*/ - int enetInt(void); - #endif /* _enetLib_h_ */ --- 241,244 ---- Index: net/eth.c =================================================================== RCS file: /cvsroot/u-boot/u-boot/net/eth.c,v retrieving revision 1.7 diff -c -b -w -r1.7 eth.c *** net/eth.c 3 Jun 2003 23:54:43 -0000 1.7 --- net/eth.c 4 Jun 2003 20:57:40 -0000 *************** *** 41,46 **** --- 41,47 ---- extern int fec_initialize(bd_t*); extern int scc_initialize(bd_t*); extern int inca_switch_initialize(bd_t*); + extern int ppc_4xx_eth_initialize(bd_t *); extern int plb2800_eth_initialize(bd_t*); static struct eth_device *eth_devices, *eth_current; *************** *** 98,103 **** --- 99,107 ---- eth_devices = NULL; eth_current = NULL; + #if (defined(CONFIG_405GP) || defined(CONFIG_440)|| defined(CONFIG_405EP) + ppc_4xx_eth_initialize(bis); + #endif #ifdef CONFIG_INCA_IP_SWITCH inca_switch_initialize(bis); #endif