Commit 8ca0b3f9 authored by Ben Warren's avatar Ben Warren
Browse files

Moved initialization of TULIP Ethernet controller to board_eth_init()



Affected boards:
	cu824
	bab7xx
	adciop
	dasa_sim
	mousse
	mpc8540eval
	musenki
	mvblue
	pcippc2/pcippc6
	sbc8240
	stxssa

Removed initialization of the driver from net/eth.c
Signed-off-by: default avatarBen Warren <biggerbadderben@gmail.com>
parent ad3381cf
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <mpc824x.h> #include <mpc824x.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <pci.h> #include <pci.h>
#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR; DECLARE_GLOBAL_DATA_PTR;
...@@ -91,3 +92,8 @@ void pci_init_board(void) ...@@ -91,3 +92,8 @@ void pci_init_board(void)
{ {
pci_mpc824x_init(&hose); pci_mpc824x_init(&hose);
} }
int board_eth_init(bd_t *bis)
{
return pci_eth_init(bis);
}
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <74xx_7xx.h> #include <74xx_7xx.h>
#include <ns87308.h> #include <ns87308.h>
#include <video_fb.h> #include <video_fb.h>
#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR; DECLARE_GLOBAL_DATA_PTR;
...@@ -244,3 +245,8 @@ void video_get_info_str (int line_number, char *info) ...@@ -244,3 +245,8 @@ void video_get_info_str (int line_number, char *info)
#endif #endif
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
int board_eth_init(bd_t *bis)
{
return pci_eth_init(bis);
}
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
*/ */
#include <common.h> #include <common.h>
#include <netdev.h>
#include "adciop.h" #include "adciop.h"
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
...@@ -95,3 +96,8 @@ int testdram (void) ...@@ -95,3 +96,8 @@ int testdram (void)
} }
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
int board_eth_init(bd_t *bis)
{
return pci_eth_init(bis);
}
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
*/ */
#include <common.h> #include <common.h>
#include <netdev.h>
#include "dasa_sim.h" #include "dasa_sim.h"
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
...@@ -222,3 +223,8 @@ int testdram (void) ...@@ -222,3 +223,8 @@ int testdram (void)
} }
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
int board_eth_init(bd_t *bis)
{
return pci_eth_init(bis);
}
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <common.h> #include <common.h>
#include <mpc824x.h> #include <mpc824x.h>
#include <netdev.h>
#include <asm/processor.h> #include <asm/processor.h>
#include "mousse.h" #include "mousse.h"
...@@ -84,3 +85,8 @@ int misc_init_f (void) ...@@ -84,3 +85,8 @@ int misc_init_f (void)
get_tod (); get_tod ();
return 0; return 0;
} }
int board_eth_init(bd_t *bis)
{
return pci_eth_init(bis);
}
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
*/ */
#include <common.h> #include <common.h>
#include <netdev.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/mmu.h> #include <asm/mmu.h>
#include <asm/immap_85xx.h> #include <asm/immap_85xx.h>
...@@ -247,3 +248,14 @@ long int fixed_sdram (void) ...@@ -247,3 +248,14 @@ long int fixed_sdram (void)
return (CFG_SDRAM_SIZE * 1024 * 1024); return (CFG_SDRAM_SIZE * 1024 * 1024);
} }
#endif /* !defined(CONFIG_SPD_EEPROM) */ #endif /* !defined(CONFIG_SPD_EEPROM) */
int board_eth_init(bd_t *bis)
{
/*
* This board either has PCI NICs or uses the CPU's TSECs
* pci_eth_init() will return 0 if no NICs found, so in that case
* returning -1 will force cpu_eth_init() to be called.
*/
int num = pci_eth_init(bis);
return (num <= 0 ? -1 : num);
}
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <common.h> #include <common.h>
#include <mpc824x.h> #include <mpc824x.h>
#include <pci.h> #include <pci.h>
#include <netdev.h>
int checkboard (void) int checkboard (void)
{ {
...@@ -102,3 +103,8 @@ void pci_init_board(void) ...@@ -102,3 +103,8 @@ void pci_init_board(void)
{ {
pci_mpc824x_init(&hose); pci_mpc824x_init(&hose);
} }
int board_eth_init(bd_t *bis)
{
return pci_eth_init(bis);
}
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <mpc824x.h> #include <mpc824x.h>
#include <asm/io.h> #include <asm/io.h>
#include <ns16550.h> #include <ns16550.h>
#include <netdev.h>
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
#include <pci.h> #include <pci.h>
...@@ -245,4 +246,9 @@ void pci_init_board (void) ...@@ -245,4 +246,9 @@ void pci_init_board (void)
{ {
pci_mpc824x_init (&hose); pci_mpc824x_init (&hose);
} }
int board_eth_init(bd_t *bis)
{
return pci_eth_init(bis);
}
#endif #endif
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <linux/mtd/doc2000.h> #include <linux/mtd/doc2000.h>
#include <watchdog.h> #include <watchdog.h>
#include <pci.h> #include <pci.h>
#include <netdev.h>
#include "hardware.h" #include "hardware.h"
#include "pcippc2.h" #include "pcippc2.h"
...@@ -243,3 +244,8 @@ U_BOOT_CMD( ...@@ -243,3 +244,8 @@ U_BOOT_CMD(
#endif #endif
#endif /* CONFIG_WATCHDOG */ #endif /* CONFIG_WATCHDOG */
int board_eth_init(bd_t *bis)
{
return pci_eth_init(bis);
}
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <mpc824x.h> #include <mpc824x.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <pci.h> #include <pci.h>
#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR; DECLARE_GLOBAL_DATA_PTR;
...@@ -103,3 +104,8 @@ int misc_init_r (void) ...@@ -103,3 +104,8 @@ int misc_init_r (void)
return (0); return (0);
} }
#endif /* CONFIG_MISC_INIT_R */ #endif /* CONFIG_MISC_INIT_R */
int board_eth_init(bd_t *bis)
{
return pci_eth_init(bis);
}
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <spd_sdram.h> #include <spd_sdram.h>
#include <miiphy.h> #include <miiphy.h>
#include <netdev.h>
long int fixed_sdram (void); long int fixed_sdram (void);
...@@ -400,3 +401,10 @@ pci_init_board(void) ...@@ -400,3 +401,10 @@ pci_init_board(void)
pci_mpc85xx_init(hose); pci_mpc85xx_init(hose);
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
} }
int board_eth_init(bd_t *bis)
{
cpu_eth_init(bis); /* Initialize TSECs first */
return pci_eth_init(bis);
}
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <common.h> #include <common.h>
#include <malloc.h> #include <malloc.h>
#include <net.h> #include <net.h>
#include <netdev.h>
#include <pci.h> #include <pci.h>
#undef DEBUG_SROM #undef DEBUG_SROM
......
...@@ -42,6 +42,7 @@ int cpu_eth_init(bd_t *bis); ...@@ -42,6 +42,7 @@ int cpu_eth_init(bd_t *bis);
/* Driver initialization prototypes */ /* Driver initialization prototypes */
int bfin_EMAC_initialize(bd_t *bis); int bfin_EMAC_initialize(bd_t *bis);
int dc21x4x_initialize(bd_t *bis);
int e1000_initialize(bd_t *bis); int e1000_initialize(bd_t *bis);
int eth_3com_initialize (bd_t * bis); int eth_3com_initialize (bd_t * bis);
int greth_initialize(bd_t *bis); int greth_initialize(bd_t *bis);
...@@ -70,6 +71,9 @@ static inline int pci_eth_init(bd_t *bis) ...@@ -70,6 +71,9 @@ static inline int pci_eth_init(bd_t *bis)
{ {
int num = 0; int num = 0;
#ifdef CONFIG_TULIP
num += dc21x4x_initialize(bis);
#endif
#ifdef CONFIG_E1000 #ifdef CONFIG_E1000
num += e1000_initialize(bis); num += e1000_initialize(bis);
#endif #endif
......
...@@ -40,7 +40,6 @@ int cpu_eth_init(bd_t *bis) __attribute((weak, alias("__def_eth_init"))); ...@@ -40,7 +40,6 @@ int cpu_eth_init(bd_t *bis) __attribute((weak, alias("__def_eth_init")));
int board_eth_init(bd_t *bis) __attribute((weak, alias("__def_eth_init"))); int board_eth_init(bd_t *bis) __attribute((weak, alias("__def_eth_init")));
extern int au1x00_enet_initialize(bd_t*); extern int au1x00_enet_initialize(bd_t*);
extern int dc21x4x_initialize(bd_t*);
extern int eepro100_initialize(bd_t*); extern int eepro100_initialize(bd_t*);
extern int fec_initialize(bd_t*); extern int fec_initialize(bd_t*);
extern int mpc8220_fec_initialize(bd_t*); extern int mpc8220_fec_initialize(bd_t*);
...@@ -194,9 +193,6 @@ int eth_initialize(bd_t *bis) ...@@ -194,9 +193,6 @@ int eth_initialize(bd_t *bis)
#endif #endif
#ifdef CONFIG_EEPRO100 #ifdef CONFIG_EEPRO100
eepro100_initialize(bis); eepro100_initialize(bis);
#endif
#ifdef CONFIG_TULIP
dc21x4x_initialize(bis);
#endif #endif
if (!eth_devices) { if (!eth_devices) {
puts ("No ethernet found.\n"); puts ("No ethernet found.\n");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment