[U-Boot] [PATCH 01/17] Introduce netdev.h header file and remove externs

This addresses all drivers whose initializers have already been moved to board_eth_init()/cpu_eth_init().
Signed-off-by: Ben Warren biggerbadderben@gmail.com --- board/atmel/atngw100/atngw100.c | 3 +- board/atmel/atstk1000/atstk1000.c | 3 +- board/bf537-stamp/bf537-stamp.c | 3 +- board/freescale/mpc8610hpcd/mpc8610hpcd.c | 8 +--- board/sl8245/sl8245.c | 3 +- cpu/leon2/cpu.c | 3 +- cpu/leon3/cpu.c | 2 +- cpu/mcf523x/cpu.c | 3 +- cpu/mcf52x2/cpu.c | 3 +- cpu/mcf532x/cpu.c | 3 +- cpu/mcf5445x/cpu.c | 3 +- cpu/mcf547x_8x/cpu.c | 4 +- cpu/mpc83xx/cpu.c | 3 +- cpu/mpc85xx/cpu.c | 3 +- cpu/mpc86xx/cpu.c | 3 +- include/netdev.h | 67 +++++++++++++++++++++++++++++ 16 files changed, 83 insertions(+), 34 deletions(-) create mode 100644 include/netdev.h
diff --git a/board/atmel/atngw100/atngw100.c b/board/atmel/atngw100/atngw100.c index 7f3e485..fa1a2aa 100644 --- a/board/atmel/atngw100/atngw100.c +++ b/board/atmel/atngw100/atngw100.c @@ -26,6 +26,7 @@ #include <asm/arch/clk.h> #include <asm/arch/gpio.h> #include <asm/arch/hmatrix.h> +#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -93,8 +94,6 @@ void board_init_info(void) gd->bd->bi_phy_id[1] = 0x03; }
-extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); - #ifdef CONFIG_CMD_NET int board_eth_init(bd_t *bi) { diff --git a/board/atmel/atstk1000/atstk1000.c b/board/atmel/atstk1000/atstk1000.c index 915b1c3..94523b5 100644 --- a/board/atmel/atstk1000/atstk1000.c +++ b/board/atmel/atstk1000/atstk1000.c @@ -26,6 +26,7 @@ #include <asm/arch/clk.h> #include <asm/arch/gpio.h> #include <asm/arch/hmatrix.h> +#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -116,8 +117,6 @@ void board_init_info(void) gd->bd->bi_phy_id[1] = 0x11; }
-extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); - #ifdef CONFIG_CMD_NET int board_eth_init(bd_t *bi) { diff --git a/board/bf537-stamp/bf537-stamp.c b/board/bf537-stamp/bf537-stamp.c index a9b7a68..4567213 100644 --- a/board/bf537-stamp/bf537-stamp.c +++ b/board/bf537-stamp/bf537-stamp.c @@ -32,6 +32,7 @@ #include <asm/io.h> #include <net.h> #include <asm/mach-common/bits/bootrom.h> +#include <netdev.h>
/** * is_valid_ether_addr - Determine if the given Ethernet address is valid @@ -156,8 +157,6 @@ int misc_init_r(void)
#if defined(CONFIG_BFIN_MAC)
-extern int bfin_EMAC_initialize(bd_t *bis); - int board_eth_init(bd_t *bis) { return bfin_EMAC_initialize(bis); diff --git a/board/freescale/mpc8610hpcd/mpc8610hpcd.c b/board/freescale/mpc8610hpcd/mpc8610hpcd.c index af79fc2..130f7aa 100644 --- a/board/freescale/mpc8610hpcd/mpc8610hpcd.c +++ b/board/freescale/mpc8610hpcd/mpc8610hpcd.c @@ -32,6 +32,7 @@ #include <libfdt.h> #include <fdt_support.h> #include <spd_sdram.h> +#include <netdev.h>
#include "../common/pixis.h"
@@ -520,12 +521,7 @@ get_board_sys_clk(ulong dummy) return val; }
-extern int uli526x_initialize(bd_t *); - int board_eth_init(bd_t *bis) { -#if defined(CONFIG_ULI526) - uli526x_initialize(bis); -#endif - return 0; + return pci_eth_init(bis); } diff --git a/board/sl8245/sl8245.c b/board/sl8245/sl8245.c index c853755..e66272e 100644 --- a/board/sl8245/sl8245.c +++ b/board/sl8245/sl8245.c @@ -24,6 +24,7 @@ #include <common.h> #include <mpc824x.h> #include <pci.h> +#include <netdev.h>
int checkboard (void) { @@ -67,8 +68,6 @@ void pci_init_board(void) pci_mpc824x_init(&hose); }
-extern int skge_initialize(bd_t *bis); - int board_eth_init(bd_t *bis) { int rc = 0; diff --git a/cpu/leon2/cpu.c b/cpu/leon2/cpu.c index 5de1c52..d6e23b1 100644 --- a/cpu/leon2/cpu.c +++ b/cpu/leon2/cpu.c @@ -25,6 +25,7 @@ #include <common.h> #include <watchdog.h> #include <command.h> +#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -57,8 +58,6 @@ int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
/* ------------------------------------------------------------------------- */
-extern int greth_initialize(bd_t *bis); - #ifdef CONFIG_GRETH int cpu_eth_init(bd_t *bis) { diff --git a/cpu/leon3/cpu.c b/cpu/leon3/cpu.c index 1725fdb..976f311 100644 --- a/cpu/leon3/cpu.c +++ b/cpu/leon3/cpu.c @@ -25,6 +25,7 @@ #include <common.h> #include <watchdog.h> #include <command.h> +#include <netdev.h>
#include <asm/io.h> #include <asm/processor.h> @@ -65,7 +66,6 @@ u64 flash_read64(void *addr) }
/* ------------------------------------------------------------------------- */ -extern int greth_initialize(bd_t *bis);
#ifdef CONFIG_GRETH int cpu_eth_init(bd_t *bis) diff --git a/cpu/mcf523x/cpu.c b/cpu/mcf523x/cpu.c index 8d2152d..bdc152f 100644 --- a/cpu/mcf523x/cpu.c +++ b/cpu/mcf523x/cpu.c @@ -28,6 +28,7 @@ #include <common.h> #include <watchdog.h> #include <command.h> +#include <netdev.h>
#include <asm/immap.h>
@@ -114,8 +115,6 @@ int watchdog_init(void) * int board_eth_init(bd_t *bis) */
-extern int mcffec_initialize(bd_t*); - int cpu_eth_init(bd_t *bis) { return mcffec_initialize(bis); diff --git a/cpu/mcf52x2/cpu.c b/cpu/mcf52x2/cpu.c index 2af31cb..167097a 100644 --- a/cpu/mcf52x2/cpu.c +++ b/cpu/mcf52x2/cpu.c @@ -32,6 +32,7 @@ #include <watchdog.h> #include <command.h> #include <asm/immap.h> +#include <netdev.h>
#ifdef CONFIG_M5271 /* @@ -328,8 +329,6 @@ int do_reset(cmd_tbl_t * cmdtp, bd_t * bd, int flag, int argc, char *argv[]) * int board_eth_init(bd_t *bis) */
-extern int mcffec_initialize(bd_t*); - int cpu_eth_init(bd_t *bis) { return mcffec_initialize(bis); diff --git a/cpu/mcf532x/cpu.c b/cpu/mcf532x/cpu.c index 20d0d5c..260d6e6 100644 --- a/cpu/mcf532x/cpu.c +++ b/cpu/mcf532x/cpu.c @@ -28,6 +28,7 @@ #include <common.h> #include <watchdog.h> #include <command.h> +#include <netdev.h>
#include <asm/immap.h>
@@ -136,8 +137,6 @@ int watchdog_init(void) * int board_eth_init(bd_t *bis) */
-extern int mcffec_initialize(bd_t*); - int cpu_eth_init(bd_t *bis) { return mcffec_initialize(bis); diff --git a/cpu/mcf5445x/cpu.c b/cpu/mcf5445x/cpu.c index ab342dd..a30c327 100644 --- a/cpu/mcf5445x/cpu.c +++ b/cpu/mcf5445x/cpu.c @@ -28,6 +28,7 @@ #include <common.h> #include <watchdog.h> #include <command.h> +#include <netdev.h>
#include <asm/immap.h>
@@ -102,8 +103,6 @@ int checkcpu(void) * int board_eth_init(bd_t *bis) */
-extern int mcffec_initialize(bd_t*); - int cpu_eth_init(bd_t *bis) { return mcffec_initialize(bis); diff --git a/cpu/mcf547x_8x/cpu.c b/cpu/mcf547x_8x/cpu.c index 1ba7aa8..ab4ad28 100644 --- a/cpu/mcf547x_8x/cpu.c +++ b/cpu/mcf547x_8x/cpu.c @@ -28,6 +28,7 @@ #include <common.h> #include <watchdog.h> #include <command.h> +#include <netdev.h>
#include <asm/immap.h>
@@ -148,9 +149,6 @@ int watchdog_init(void) * int board_eth_init(bd_t *bis) */
-extern int mcdmafec_initialize(bd_t *bis); -extern int mcffec_initialize(bd_t*); - int cpu_eth_init(bd_t *bis) { #if defined(CONFIG_FSLDMAFEC) diff --git a/cpu/mpc83xx/cpu.c b/cpu/mpc83xx/cpu.c index 52e4476..21b7afa 100644 --- a/cpu/mpc83xx/cpu.c +++ b/cpu/mpc83xx/cpu.c @@ -32,6 +32,7 @@ #include <mpc83xx.h> #include <asm/processor.h> #include <libfdt.h> +#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -364,8 +365,6 @@ int dma_xfer(void *dest, u32 count, void *src) * int board_eth_init(bd_t *bis) */
-extern int tsec_initialize(bd_t * bis, int index, char *devname); - int cpu_eth_init(bd_t *bis) { #if defined(CONFIG_TSEC1) diff --git a/cpu/mpc85xx/cpu.c b/cpu/mpc85xx/cpu.c index 2fe3cea..92410b4 100644 --- a/cpu/mpc85xx/cpu.c +++ b/cpu/mpc85xx/cpu.c @@ -30,6 +30,7 @@ #include <command.h> #include <asm/cache.h> #include <asm/io.h> +#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -366,8 +367,6 @@ void upmconfig (uint upm, uint * table, uint size) * int board_eth_init(bd_t *bis) */
-extern int tsec_initialize(bd_t * bis, int index, char *devname); - int cpu_eth_init(bd_t *bis) { #if defined(CONFIG_TSEC1) diff --git a/cpu/mpc86xx/cpu.c b/cpu/mpc86xx/cpu.c index ecea5b0..7155ceb 100644 --- a/cpu/mpc86xx/cpu.c +++ b/cpu/mpc86xx/cpu.c @@ -29,6 +29,7 @@ #include <asm/mmu.h> #include <mpc86xx.h> #include <asm/fsl_law.h> +#include <netdev.h>
int @@ -311,8 +312,6 @@ void mpc86xx_reginfo(void) * int board_eth_init(bd_t *bis) */
-extern int tsec_initialize(bd_t * bis, int index, char *devname); - int cpu_eth_init(bd_t *bis) { #if defined(CONFIG_TSEC1) diff --git a/include/netdev.h b/include/netdev.h new file mode 100644 index 0000000..a3a717c --- /dev/null +++ b/include/netdev.h @@ -0,0 +1,67 @@ +/* + * (C) Copyright 2008 + * Benjamin Warren, biggerbadderben@gmail.com + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +/* + * netdev.h - definitions an prototypes for network devices + */ + +#ifndef _NETDEV_H_ +#define _NETDEV_H_ + +/* + * Board and CPU-specific initialization functions + * board_eth_init() has highest priority. cpu_eth_init() only + * gets called if board_eth_init() isn't instantiated or fails. + * Return values: + * 0: success + * -1: failure + */ + +int board_eth_init(bd_t *bis); +int cpu_eth_init(bd_t *bis); + +/* Driver initialization prototypes */ +int bfin_EMAC_initialize(bd_t *bis); +int greth_initialize(bd_t *bis); +int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); +int mcdmafec_initialize(bd_t *bis); +int mcffec_initialize(bd_t *bis); +int skge_initialize(bd_t *bis); +int tsec_initialize(bd_t *bis, int index, char *devname); +int uli526x_initialize(bd_t *bis); + +/* Boards with PCI network controllers can call this from their board_eth_init() + * function to initialize whatever's on board. + * Return value is total # of devices found */ + +static int pci_eth_init(bd_t *bis) +{ + int num = 0; +#if defined(CONFIG_ULI526) + num += uli526x_initialize(bis); +#endif + return num; +} + +#endif /* _NETDEV_H_ */ +

Removed at91sam9_eth_initialize() from net/eth.c
Signed-off-by: Ben Warren biggerbadderben@gmail.com --- board/atmel/at91cap9adk/at91cap9adk.c | 11 +++++++++ board/atmel/at91sam9260ek/at91sam9260ek.c | 11 +++++++++ board/atmel/at91sam9263ek/at91sam9263ek.c | 11 +++++++++ cpu/arm926ejs/at91/Makefile | 1 - cpu/arm926ejs/at91/ether.c | 35 ----------------------------- net/eth.c | 5 ---- 6 files changed, 33 insertions(+), 41 deletions(-) delete mode 100644 cpu/arm926ejs/at91/ether.c
diff --git a/board/atmel/at91cap9adk/at91cap9adk.c b/board/atmel/at91cap9adk/at91cap9adk.c index c5082a0..787d64d 100644 --- a/board/atmel/at91cap9adk/at91cap9adk.c +++ b/board/atmel/at91cap9adk/at91cap9adk.c @@ -30,11 +30,13 @@ #include <asm/arch/at91_rstc.h> #include <asm/arch/gpio.h> #include <asm/arch/io.h> +#include <asm/arch/hardware.h> #include <lcd.h> #include <atmel_lcdc.h> #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB) #include <net.h> #endif +#include <netdev.h>
#define MP_BLOCK_3_BASE 0xFDF00000
@@ -376,3 +378,12 @@ void reset_phy(void) #endif } #endif + +int board_eth_init(bd_t *bis) +{ + int rc = 0; +#ifdef CONFIG_MACB + rc = macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00); +#endif + return rc; +} diff --git a/board/atmel/at91sam9260ek/at91sam9260ek.c b/board/atmel/at91sam9260ek/at91sam9260ek.c index 06d8512..913e3fb 100644 --- a/board/atmel/at91sam9260ek/at91sam9260ek.c +++ b/board/atmel/at91sam9260ek/at91sam9260ek.c @@ -30,9 +30,11 @@ #include <asm/arch/at91_rstc.h> #include <asm/arch/gpio.h> #include <asm/arch/io.h> +#include <asm/arch/hardware.h> #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB) #include <net.h> #endif +#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -248,3 +250,12 @@ void reset_phy(void) #endif } #endif + +int board_eth_init(bd_t *bis) +{ + int rc = 0; +#ifdef CONFIG_MACB + rc = macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00); +#endif + return rc; +} diff --git a/board/atmel/at91sam9263ek/at91sam9263ek.c b/board/atmel/at91sam9263ek/at91sam9263ek.c index 927fc91..c705074 100644 --- a/board/atmel/at91sam9263ek/at91sam9263ek.c +++ b/board/atmel/at91sam9263ek/at91sam9263ek.c @@ -31,11 +31,13 @@ #include <asm/arch/at91_rstc.h> #include <asm/arch/gpio.h> #include <asm/arch/io.h> +#include <asm/arch/hardware.h> #include <lcd.h> #include <atmel_lcdc.h> #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB) #include <net.h> #endif +#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -308,3 +310,12 @@ void reset_phy(void) #endif } #endif + +int board_eth_init(bd_t *bis) +{ + int rc = 0; +#ifdef CONFIG_MACB + rc = macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00); +#endif + return rc; +} diff --git a/cpu/arm926ejs/at91/Makefile b/cpu/arm926ejs/at91/Makefile index 44cde1a..2d2a888 100644 --- a/cpu/arm926ejs/at91/Makefile +++ b/cpu/arm926ejs/at91/Makefile @@ -25,7 +25,6 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(SOC).a
-COBJS-y += ether.o COBJS-y += timer.o COBJS-$(CONFIG_HAS_DATAFLASH) +=spi.o COBJS-y += usb.o diff --git a/cpu/arm926ejs/at91/ether.c b/cpu/arm926ejs/at91/ether.c deleted file mode 100644 index 7e11fe4..0000000 --- a/cpu/arm926ejs/at91/ether.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) Copyright 2007-2008 - * Stelian Pop stelian.pop@leadtechdesign.com - * Lead Tech Design <www.leadtechdesign.com> - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ - -#include <common.h> -#include <asm/arch/hardware.h> - -extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); - -#if defined(CONFIG_MACB) && defined(CONFIG_CMD_NET) -void at91sam9_eth_initialize(bd_t *bi) -{ - macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00); -} -#endif diff --git a/net/eth.c b/net/eth.c index 4e508a0..d68988d 100644 --- a/net/eth.c +++ b/net/eth.c @@ -66,7 +66,6 @@ extern int scc_initialize(bd_t*); extern int tsi108_eth_initialize(bd_t*); extern int npe_initialize(bd_t *); extern int uec_initialize(int); -extern int at91sam9_eth_initialize(bd_t *);
#ifdef CONFIG_API extern void (*push_packet)(volatile void *, int); @@ -254,10 +253,6 @@ int eth_initialize(bd_t *bis) #if defined(CONFIG_RTL8169) rtl8169_initialize(bis); #endif -#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \ - defined(CONFIG_AT91SAM9263) - at91sam9_eth_initialize(bis); -#endif
if (!eth_devices) { puts ("No ethernet found.\n");

Affected boards: linkstation r7780mp
Removed initialization of the driver from net/eth.c
Signed-off-by: Ben Warren biggerbadderben@gmail.com --- board/linkstation/linkstation.c | 6 ++++++ board/r7780mp/r7780mp.c | 6 ++++++ include/netdev.h | 4 ++++ net/eth.c | 5 ----- 4 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/board/linkstation/linkstation.c b/board/linkstation/linkstation.c index 241cf03..afb96ae 100644 --- a/board/linkstation/linkstation.c +++ b/board/linkstation/linkstation.c @@ -26,6 +26,7 @@ #include <mpc824x.h> #include <asm/io.h> #include <ns16550.h> +#include <netdev.h>
#ifdef CONFIG_PCI #include <pci.h> @@ -128,3 +129,8 @@ int board_early_init_f (void) out_8((volatile u8*)UART_DCR, 1); return 0; } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/r7780mp/r7780mp.c b/board/r7780mp/r7780mp.c index 19c35d3..efbeec9 100644 --- a/board/r7780mp/r7780mp.c +++ b/board/r7780mp/r7780mp.c @@ -23,6 +23,7 @@ #include <asm/processor.h> #include <asm/io.h> #include <asm/pci.h> +#include <netdev.h> #include "r7780mp.h"
int checkboard(void) @@ -77,3 +78,8 @@ void pci_init_board(void) { pci_sh7780_init(&hose); } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/include/netdev.h b/include/netdev.h index a3a717c..afd46ae 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -46,6 +46,7 @@ int greth_initialize(bd_t *bis); int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); int mcdmafec_initialize(bd_t *bis); int mcffec_initialize(bd_t *bis); +int rtl8169_initialize(bd_t *bis); int skge_initialize(bd_t *bis); int tsec_initialize(bd_t *bis, int index, char *devname); int uli526x_initialize(bd_t *bis); @@ -57,6 +58,9 @@ int uli526x_initialize(bd_t *bis); static int pci_eth_init(bd_t *bis) { int num = 0; +#if defined(CONFIG_RTL8169) + num += rtl8169_initialize(bis); +#endif #if defined(CONFIG_ULI526) num += uli526x_initialize(bis); #endif diff --git a/net/eth.c b/net/eth.c index d68988d..2639801 100644 --- a/net/eth.c +++ b/net/eth.c @@ -61,7 +61,6 @@ extern int pcnet_initialize(bd_t*); extern int plb2800_eth_initialize(bd_t*); extern int ppc_4xx_eth_initialize(bd_t *); extern int rtl8139_initialize(bd_t*); -extern int rtl8169_initialize(bd_t*); extern int scc_initialize(bd_t*); extern int tsi108_eth_initialize(bd_t*); extern int npe_initialize(bd_t *); @@ -250,10 +249,6 @@ int eth_initialize(bd_t *bis) #if defined(CONFIG_RTL8139) rtl8139_initialize(bis); #endif -#if defined(CONFIG_RTL8169) - rtl8169_initialize(bis); -#endif - if (!eth_devices) { puts ("No ethernet found.\n"); show_boot_progress (-64);

Affected boards: hidden_dragon MPC8544DS MPC8610HPCN R2DPLUS TB0229
Removed initialization of the driver from net/eth.c
Signed-off-by: Ben Warren biggerbadderben@gmail.com --- board/freescale/mpc8544ds/mpc8544ds.c | 8 ++++++++ board/freescale/mpc8641hpcn/mpc8641hpcn.c | 8 ++++++++ board/hidden_dragon/hidden_dragon.c | 5 +++++ board/r2dplus/r2dplus.c | 5 +++++ board/tb0229/tb0229.c | 5 +++++ include/netdev.h | 4 ++++ net/eth.c | 4 ---- 7 files changed, 35 insertions(+), 4 deletions(-)
diff --git a/board/freescale/mpc8544ds/mpc8544ds.c b/board/freescale/mpc8544ds/mpc8544ds.c index 4e976b7..e16fff2 100644 --- a/board/freescale/mpc8544ds/mpc8544ds.c +++ b/board/freescale/mpc8544ds/mpc8544ds.c @@ -32,6 +32,7 @@ #include <miiphy.h> #include <libfdt.h> #include <fdt_support.h> +#include <netdev.h>
#include "../common/pixis.h"
@@ -507,3 +508,10 @@ ft_board_setup(void *blob, bd_t *bd) } } #endif + +int board_eth_init(bd_t *bis) +{ + /* Initialize TSECs */ + cpu_eth_init(bis); + return pci_eth_init(bis); +} diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c b/board/freescale/mpc8641hpcn/mpc8641hpcn.c index 1bb563e..97f7f49 100644 --- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c +++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c @@ -29,6 +29,7 @@ #include <asm/io.h> #include <libfdt.h> #include <fdt_support.h> +#include <netdev.h>
#include "../common/pixis.h"
@@ -379,3 +380,10 @@ get_board_sys_clk(ulong dummy)
return val; } + +int board_eth_init(bd_t *bis) +{ + /* Initialize TSECs */ + cpu_eth_init(bis); + return pci_eth_init(bis); +} diff --git a/board/hidden_dragon/hidden_dragon.c b/board/hidden_dragon/hidden_dragon.c index 5713a33..8cc727b 100644 --- a/board/hidden_dragon/hidden_dragon.c +++ b/board/hidden_dragon/hidden_dragon.c @@ -93,3 +93,8 @@ void pci_init_board(void) { pci_mpc824x_init(&hose); } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/r2dplus/r2dplus.c b/board/r2dplus/r2dplus.c index 8fb8ff6..b962dd1 100644 --- a/board/r2dplus/r2dplus.c +++ b/board/r2dplus/r2dplus.c @@ -76,3 +76,8 @@ void pci_init_board(void) { pci_sh7751_init(&hose); } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/tb0229/tb0229.c b/board/tb0229/tb0229.c index 921bd3a..2abb4a7 100644 --- a/board/tb0229/tb0229.c +++ b/board/tb0229/tb0229.c @@ -46,3 +46,8 @@ int checkboard (void)
return 0; } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/include/netdev.h b/include/netdev.h index afd46ae..9a5a26c 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -46,6 +46,7 @@ int greth_initialize(bd_t *bis); int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); int mcdmafec_initialize(bd_t *bis); int mcffec_initialize(bd_t *bis); +int rtl8139_initialize(bd_t *bis); int rtl8169_initialize(bd_t *bis); int skge_initialize(bd_t *bis); int tsec_initialize(bd_t *bis, int index, char *devname); @@ -58,6 +59,9 @@ int uli526x_initialize(bd_t *bis); static int pci_eth_init(bd_t *bis) { int num = 0; +#if defined(CONFIG_RTL8139) + num += rtl8139_initialize(bis); +#endif #if defined(CONFIG_RTL8169) num += rtl8169_initialize(bis); #endif diff --git a/net/eth.c b/net/eth.c index 2639801..a3923bb 100644 --- a/net/eth.c +++ b/net/eth.c @@ -60,7 +60,6 @@ extern int ns8382x_initialize(bd_t*); extern int pcnet_initialize(bd_t*); extern int plb2800_eth_initialize(bd_t*); extern int ppc_4xx_eth_initialize(bd_t *); -extern int rtl8139_initialize(bd_t*); extern int scc_initialize(bd_t*); extern int tsi108_eth_initialize(bd_t*); extern int npe_initialize(bd_t *); @@ -246,9 +245,6 @@ int eth_initialize(bd_t *bis) #if defined(CONFIG_TSI108_ETH) tsi108_eth_initialize(bis); #endif -#if defined(CONFIG_RTL8139) - rtl8139_initialize(bis); -#endif if (!eth_devices) { puts ("No ethernet found.\n"); show_boot_progress (-64);

Affected boards: mpc7448hpc2
Removed initialization of the driver from net/eth.c
Signed-off-by: Ben Warren biggerbadderben@gmail.com --- board/freescale/mpc7448hpc2/mpc7448hpc2.c | 10 ++++++++++ include/netdev.h | 1 + net/eth.c | 4 ---- 3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/board/freescale/mpc7448hpc2/mpc7448hpc2.c b/board/freescale/mpc7448hpc2/mpc7448hpc2.c index 6f74c31..cfdbed5 100644 --- a/board/freescale/mpc7448hpc2/mpc7448hpc2.c +++ b/board/freescale/mpc7448hpc2/mpc7448hpc2.c @@ -32,6 +32,7 @@ #include <common.h> #include <74xx_7xx.h> #include <fdt_support.h> +#include <netdev.h>
#undef DEBUG
@@ -92,3 +93,12 @@ ft_board_setup(void *blob, bd_t *bd) fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize); } #endif + +int board_eth_init(bd_t *bis) +{ + int rc = 0; +#if defined(CONFIG_TSI108_ETH) + rc = tsi108_eth_initialize(bis); +#endif + return rc; +} diff --git a/include/netdev.h b/include/netdev.h index 9a5a26c..810d3e6 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -50,6 +50,7 @@ int rtl8139_initialize(bd_t *bis); int rtl8169_initialize(bd_t *bis); int skge_initialize(bd_t *bis); int tsec_initialize(bd_t *bis, int index, char *devname); +int tsi108_eth_initialize(bd_t *bis); int uli526x_initialize(bd_t *bis);
/* Boards with PCI network controllers can call this from their board_eth_init() diff --git a/net/eth.c b/net/eth.c index a3923bb..1147709 100644 --- a/net/eth.c +++ b/net/eth.c @@ -61,7 +61,6 @@ extern int pcnet_initialize(bd_t*); extern int plb2800_eth_initialize(bd_t*); extern int ppc_4xx_eth_initialize(bd_t *); extern int scc_initialize(bd_t*); -extern int tsi108_eth_initialize(bd_t*); extern int npe_initialize(bd_t *); extern int uec_initialize(int);
@@ -242,9 +241,6 @@ int eth_initialize(bd_t *bis) #ifdef CONFIG_NS8382X ns8382x_initialize(bis); #endif -#if defined(CONFIG_TSI108_ETH) - tsi108_eth_initialize(bis); -#endif if (!eth_devices) { puts ("No ethernet found.\n"); show_boot_progress (-64);

Affected boards: bc3450 cpci5200 mecp5200 pf2000 icecube o2dnt pm520 sandpoint8245 total5200 tqm5200
Removed initialization of the driver from net/eth.c
Signed-off-by: Ben Warren biggerbadderben@gmail.com --- board/bc3450/bc3450.c | 6 ++++++ board/esd/cpci5200/cpci5200.c | 6 ++++++ board/esd/mecp5200/mecp5200.c | 6 ++++++ board/esd/pf5200/pf5200.c | 6 ++++++ board/icecube/icecube.c | 6 ++++++ board/o2dnt/o2dnt.c | 6 ++++++ board/pm520/pm520.c | 6 ++++++ board/sandpoint/sandpoint.c | 6 ++++++ board/total5200/total5200.c | 6 ++++++ board/tqc/tqm5200/tqm5200.c | 6 ++++++ include/netdev.h | 4 ++++ net/eth.c | 4 ---- 12 files changed, 64 insertions(+), 4 deletions(-)
diff --git a/board/bc3450/bc3450.c b/board/bc3450/bc3450.c index a728dc6..e27c234 100644 --- a/board/bc3450/bc3450.c +++ b/board/bc3450/bc3450.c @@ -33,6 +33,7 @@ #include <common.h> #include <mpc5xxx.h> #include <pci.h> +#include <netdev.h>
#ifdef CONFIG_VIDEO_SM501 #include <sm501.h> @@ -669,3 +670,8 @@ int board_get_height (void) }
#endif /* CONFIG_VIDEO_SM501 */ + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/esd/cpci5200/cpci5200.c b/board/esd/cpci5200/cpci5200.c index 20130ac..2a42e65 100644 --- a/board/esd/cpci5200/cpci5200.c +++ b/board/esd/cpci5200/cpci5200.c @@ -32,6 +32,7 @@ #include <mpc5xxx.h> #include <pci.h> #include <command.h> +#include <netdev.h>
#include "mt46v16m16-75.h"
@@ -259,6 +260,11 @@ void init_ata_reset(void) } }
+int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} + int do_writepci(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) { unsigned int addr; diff --git a/board/esd/mecp5200/mecp5200.c b/board/esd/mecp5200/mecp5200.c index 6d776b7..ff44abd 100644 --- a/board/esd/mecp5200/mecp5200.c +++ b/board/esd/mecp5200/mecp5200.c @@ -32,6 +32,7 @@ #include <mpc5xxx.h> #include <pci.h> #include <command.h> +#include <netdev.h>
#include "mt46v16m16-75.h"
@@ -259,3 +260,8 @@ void init_power_switch(void) __asm__ volatile ("sync"); } } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/esd/pf5200/pf5200.c b/board/esd/pf5200/pf5200.c index 7970f89..c4c0221 100644 --- a/board/esd/pf5200/pf5200.c +++ b/board/esd/pf5200/pf5200.c @@ -32,6 +32,7 @@ #include <mpc5xxx.h> #include <pci.h> #include <command.h> +#include <netdev.h>
#include "mt46v16m16-75.h"
@@ -264,6 +265,11 @@ void init_power_switch(void) __asm__ volatile ("sync"); }
+int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} + void power_set_reset(int power) { debug("ide_set_reset(%d)\n", power); diff --git a/board/icecube/icecube.c b/board/icecube/icecube.c index 760db73..2ab86be 100644 --- a/board/icecube/icecube.c +++ b/board/icecube/icecube.c @@ -29,6 +29,7 @@ #include <pci.h> #include <asm/processor.h> #include <libfdt.h> +#include <netdev.h>
#if defined(CONFIG_LITE5200B) #include "mt46v32m16.h" @@ -390,3 +391,8 @@ ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); } #endif + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/o2dnt/o2dnt.c b/board/o2dnt/o2dnt.c index a4eed3a..37832de 100644 --- a/board/o2dnt/o2dnt.c +++ b/board/o2dnt/o2dnt.c @@ -27,6 +27,7 @@ #include <common.h> #include <mpc5xxx.h> #include <pci.h> +#include <netdev.h>
#define SDRAM_MODE 0x00CD0000 #define SDRAM_CONTROL 0x504F0000 @@ -180,3 +181,8 @@ void pci_init_board(void) pci_mpc5xxx_init(&hose); } #endif + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/pm520/pm520.c b/board/pm520/pm520.c index 83d9bcd..c9610fb 100644 --- a/board/pm520/pm520.c +++ b/board/pm520/pm520.c @@ -27,6 +27,7 @@ #include <common.h> #include <mpc5xxx.h> #include <pci.h> +#include <netdev.h>
#if defined(CONFIG_MPC5200_DDR) #include "mt46v16m16-75.h" @@ -321,3 +322,8 @@ void doc_init (void) doc_probe (CFG_DOC_BASE); } #endif + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/sandpoint/sandpoint.c b/board/sandpoint/sandpoint.c index 7429647..832baa2 100644 --- a/board/sandpoint/sandpoint.c +++ b/board/sandpoint/sandpoint.c @@ -24,6 +24,7 @@ #include <common.h> #include <mpc824x.h> #include <pci.h> +#include <netdev.h>
int checkboard (void) { @@ -99,3 +100,8 @@ void pci_init_board(void) { pci_mpc824x_init(&hose); } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/total5200/total5200.c b/board/total5200/total5200.c index 1ae24c4..c1848fc 100644 --- a/board/total5200/total5200.c +++ b/board/total5200/total5200.c @@ -27,6 +27,7 @@ #include <common.h> #include <mpc5xxx.h> #include <pci.h> +#include <netdev.h>
#include "sdram.h"
@@ -308,3 +309,8 @@ int board_get_height (void) }
#endif /* CONFIG_VIDEO_SED13806 */ + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/tqc/tqm5200/tqm5200.c b/board/tqc/tqm5200/tqm5200.c index 8b8e461..d75aa9b 100644 --- a/board/tqc/tqm5200/tqm5200.c +++ b/board/tqc/tqm5200/tqm5200.c @@ -32,6 +32,7 @@ #include <pci.h> #include <asm/processor.h> #include <libfdt.h> +#include <netdev.h>
#ifdef CONFIG_VIDEO_SM501 #include <sm501.h> @@ -749,3 +750,8 @@ void ft_board_setup(void *blob, bd_t *bd) fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize); } #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/include/netdev.h b/include/netdev.h index 810d3e6..c8f4413 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -46,6 +46,7 @@ int greth_initialize(bd_t *bis); int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); int mcdmafec_initialize(bd_t *bis); int mcffec_initialize(bd_t *bis); +int ns8382x_initialize(bd_t *bis); int rtl8139_initialize(bd_t *bis); int rtl8169_initialize(bd_t *bis); int skge_initialize(bd_t *bis); @@ -60,6 +61,9 @@ int uli526x_initialize(bd_t *bis); static int pci_eth_init(bd_t *bis) { int num = 0; +#ifdef CONFIG_NS8382X + num += ns8382x_initialize(bis); +#endif #if defined(CONFIG_RTL8139) num += rtl8139_initialize(bis); #endif diff --git a/net/eth.c b/net/eth.c index 1147709..9747138 100644 --- a/net/eth.c +++ b/net/eth.c @@ -56,7 +56,6 @@ extern int mpc8220_fec_initialize(bd_t*); extern int mv6436x_eth_initialize(bd_t *); extern int mv6446x_eth_initialize(bd_t *); extern int natsemi_initialize(bd_t*); -extern int ns8382x_initialize(bd_t*); extern int pcnet_initialize(bd_t*); extern int plb2800_eth_initialize(bd_t*); extern int ppc_4xx_eth_initialize(bd_t *); @@ -238,9 +237,6 @@ int eth_initialize(bd_t *bis) #ifdef CONFIG_NATSEMI natsemi_initialize(bis); #endif -#ifdef CONFIG_NS8382X - ns8382x_initialize(bis); -#endif if (!eth_devices) { puts ("No ethernet found.\n"); show_boot_progress (-64);

Affected boards: a3000
Removed initialization of the driver from net/eth.c
Signed-off-by: Ben Warren biggerbadderben@gmail.com --- board/a3000/a3000.c | 7 +++++++ include/netdev.h | 4 ++++ net/eth.c | 4 ---- 3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/board/a3000/a3000.c b/board/a3000/a3000.c index c1eceaa..040ba89 100644 --- a/board/a3000/a3000.c +++ b/board/a3000/a3000.c @@ -27,6 +27,7 @@ #include <common.h> #include <mpc824x.h> #include <pci.h> +#include <netdev.h>
int checkboard (void) { @@ -109,3 +110,9 @@ void pci_init_board(void) { pci_mpc824x_init(&hose); } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} + diff --git a/include/netdev.h b/include/netdev.h index c8f4413..3a51ae4 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -46,6 +46,7 @@ int greth_initialize(bd_t *bis); int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); int mcdmafec_initialize(bd_t *bis); int mcffec_initialize(bd_t *bis); +int natsemi_initialize(bd_t *bis); int ns8382x_initialize(bd_t *bis); int rtl8139_initialize(bd_t *bis); int rtl8169_initialize(bd_t *bis); @@ -61,6 +62,9 @@ int uli526x_initialize(bd_t *bis); static int pci_eth_init(bd_t *bis) { int num = 0; +#ifdef CONFIG_NATSEMI + num += natsemi_initialize(bis); +#endif #ifdef CONFIG_NS8382X num += ns8382x_initialize(bis); #endif diff --git a/net/eth.c b/net/eth.c index 9747138..65dd888 100644 --- a/net/eth.c +++ b/net/eth.c @@ -55,7 +55,6 @@ extern int mpc512x_fec_initialize(bd_t*); extern int mpc8220_fec_initialize(bd_t*); extern int mv6436x_eth_initialize(bd_t *); extern int mv6446x_eth_initialize(bd_t *); -extern int natsemi_initialize(bd_t*); extern int pcnet_initialize(bd_t*); extern int plb2800_eth_initialize(bd_t*); extern int ppc_4xx_eth_initialize(bd_t *); @@ -234,9 +233,6 @@ int eth_initialize(bd_t *bis) #ifdef CFG_GT_6426x gt6426x_eth_initialize(bis); #endif -#ifdef CONFIG_NATSEMI - natsemi_initialize(bis); -#endif if (!eth_devices) { puts ("No ethernet found.\n"); show_boot_progress (-64);

Affected boards: PN62 sc520_cdp
Removed initialization of the driver from net/eth.c
Signed-off-by: Ben Warren biggerbadderben@gmail.com --- board/pn62/pn62.c | 6 ++++++ board/sc520_cdp/sc520_cdp.c | 6 ++++++ include/netdev.h | 5 +++++ net/eth.c | 4 ---- 4 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/board/pn62/pn62.c b/board/pn62/pn62.c index d905b29..60fc431 100644 --- a/board/pn62/pn62.c +++ b/board/pn62/pn62.c @@ -23,6 +23,7 @@ #include <common.h> #include <mpc824x.h> #include <pci.h> +#include <netdev.h>
#include "pn62.h"
@@ -186,3 +187,8 @@ static int get_mac_address (int id, u8 * mac, char *string, int size) mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/sc520_cdp/sc520_cdp.c b/board/sc520_cdp/sc520_cdp.c index 8050aa6..f21c730 100644 --- a/board/sc520_cdp/sc520_cdp.c +++ b/board/sc520_cdp/sc520_cdp.c @@ -29,6 +29,7 @@ #include <asm/ic/sc520.h> #include <asm/ic/ali512x.h> #include <spi.h> +#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -629,3 +630,8 @@ ssize_t spi_write(uchar *addr, int alen, uchar *buffer, int len) #endif return res; } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/include/netdev.h b/include/netdev.h index 3a51ae4..79d6e4d 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -48,6 +48,7 @@ int mcdmafec_initialize(bd_t *bis); int mcffec_initialize(bd_t *bis); int natsemi_initialize(bd_t *bis); int ns8382x_initialize(bd_t *bis); +int pcnet_initialize(bd_t *bis); int rtl8139_initialize(bd_t *bis); int rtl8169_initialize(bd_t *bis); int skge_initialize(bd_t *bis); @@ -62,6 +63,10 @@ int uli526x_initialize(bd_t *bis); static int pci_eth_init(bd_t *bis) { int num = 0; + +#ifdef CONFIG_PCNET + num += pcnet_initialize(bis); +#endif #ifdef CONFIG_NATSEMI num += natsemi_initialize(bis); #endif diff --git a/net/eth.c b/net/eth.c index 65dd888..f23f27f 100644 --- a/net/eth.c +++ b/net/eth.c @@ -55,7 +55,6 @@ extern int mpc512x_fec_initialize(bd_t*); extern int mpc8220_fec_initialize(bd_t*); extern int mv6436x_eth_initialize(bd_t *); extern int mv6446x_eth_initialize(bd_t *); -extern int pcnet_initialize(bd_t*); extern int plb2800_eth_initialize(bd_t*); extern int ppc_4xx_eth_initialize(bd_t *); extern int scc_initialize(bd_t*); @@ -227,9 +226,6 @@ int eth_initialize(bd_t *bis) #ifdef CONFIG_3COM eth_3com_initialize(bis); #endif -#ifdef CONFIG_PCNET - pcnet_initialize(bis); -#endif #ifdef CFG_GT_6426x gt6426x_eth_initialize(bis); #endif

Affected boards: EVB64260 P3G4 ZUMA
Removed initialization of the driver from net/eth.c
Signed-off-by: Ben Warren biggerbadderben@gmail.com --- board/evb64260/evb64260.c | 8 +++++++- include/netdev.h | 1 + net/eth.c | 7 ------- 3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/board/evb64260/evb64260.c b/board/evb64260/evb64260.c index ab59941..bc108d0 100644 --- a/board/evb64260/evb64260.c +++ b/board/evb64260/evb64260.c @@ -31,6 +31,7 @@ #include <galileo/pci.h> #include <galileo/gt64260R.h> #include <net.h> +#include <netdev.h>
#include <asm/io.h> #include "eth.h" @@ -248,7 +249,6 @@ int board_early_init_f (void) sram_boot = 1; #endif
- if (!sram_boot) memoryMapDeviceSpace(DEVICE0, CFG_DEV0_SPACE, CFG_DEV0_SIZE);
memoryMapDeviceSpace(DEVICE1, CFG_DEV1_SPACE, CFG_DEV1_SIZE); @@ -443,3 +443,9 @@ display_mem_map(void) printf(" BOOT: base - 0x%08x\tsize - %dM bytes\twidth - %d bits\n", base, size>>20, width); } + +int board_eth_init(bd_t *bis) +{ + gt6426x_eth_initialize(bis); + return 0; +} diff --git a/include/netdev.h b/include/netdev.h index 79d6e4d..454a9a4 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -43,6 +43,7 @@ int cpu_eth_init(bd_t *bis); /* Driver initialization prototypes */ int bfin_EMAC_initialize(bd_t *bis); int greth_initialize(bd_t *bis); +int gt6426x_eth_initialize(bd_t *bis); int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); int mcdmafec_initialize(bd_t *bis); int mcffec_initialize(bd_t *bis); diff --git a/net/eth.c b/net/eth.c index f23f27f..5a3d0e8 100644 --- a/net/eth.c +++ b/net/eth.c @@ -39,10 +39,6 @@ static int __def_eth_init(bd_t *bis) 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")));
-#ifdef CFG_GT_6426x -extern int gt6426x_eth_initialize(bd_t *bis); -#endif - extern int au1x00_enet_initialize(bd_t*); extern int dc21x4x_initialize(bd_t*); extern int e1000_initialize(bd_t*); @@ -226,9 +222,6 @@ int eth_initialize(bd_t *bis) #ifdef CONFIG_3COM eth_3com_initialize(bis); #endif -#ifdef CFG_GT_6426x - gt6426x_eth_initialize(bis); -#endif if (!eth_devices) { puts ("No ethernet found.\n"); show_boot_progress (-64);

Affected boards: AmigaOneG3SE
Removed initialization of the driver from net/eth.c
Signed-off-by: Ben Warren biggerbadderben@gmail.com --- board/MAI/AmigaOneG3SE/AmigaOneG3SE.c | 9 +++++++++ include/netdev.h | 1 + net/eth.c | 4 ---- 3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/board/MAI/AmigaOneG3SE/AmigaOneG3SE.c b/board/MAI/AmigaOneG3SE/AmigaOneG3SE.c index e118563..4d44001 100644 --- a/board/MAI/AmigaOneG3SE/AmigaOneG3SE.c +++ b/board/MAI/AmigaOneG3SE/AmigaOneG3SE.c @@ -26,6 +26,7 @@ #include <common.h> #include <command.h> #include <pci.h> +#include <netdev.h> #include "articiaS.h" #include "memio.h" #include "via686.h" @@ -111,3 +112,11 @@ void pci_init_board (void) articiaS_pci_init (); #endif } + +int board_eth_init(bd_t *bis) +{ +#if defined(CONFIG_3COM) + eth_3com_initialize(bis); +#endif + return 0; +} diff --git a/include/netdev.h b/include/netdev.h index 454a9a4..bea9fac 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -42,6 +42,7 @@ int cpu_eth_init(bd_t *bis);
/* Driver initialization prototypes */ int bfin_EMAC_initialize(bd_t *bis); +int eth_3com_initialize (bd_t * bis); int greth_initialize(bd_t *bis); int gt6426x_eth_initialize(bd_t *bis); int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); diff --git a/net/eth.c b/net/eth.c index 5a3d0e8..bedb4ff 100644 --- a/net/eth.c +++ b/net/eth.c @@ -43,7 +43,6 @@ extern int au1x00_enet_initialize(bd_t*); extern int dc21x4x_initialize(bd_t*); extern int e1000_initialize(bd_t*); extern int eepro100_initialize(bd_t*); -extern int eth_3com_initialize(bd_t*); extern int fec_initialize(bd_t*); extern int inca_switch_initialize(bd_t*); extern int mpc5xxx_fec_initialize(bd_t*); @@ -219,9 +218,6 @@ int eth_initialize(bd_t *bis) #ifdef CONFIG_TULIP dc21x4x_initialize(bis); #endif -#ifdef CONFIG_3COM - eth_3com_initialize(bis); -#endif if (!eth_devices) { puts ("No ethernet found.\n"); show_boot_progress (-64);

Affected boards: IncaIP
Removed initialization of the driver from net/eth.c
Signed-off-by: Ben Warren biggerbadderben@gmail.com --- board/incaip/incaip.c | 8 ++++++++ drivers/net/inca-ip_sw.c | 2 +- include/netdev.h | 1 + net/eth.c | 4 ---- 4 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/board/incaip/incaip.c b/board/incaip/incaip.c index ac7ad8f..6fe852c 100644 --- a/board/incaip/incaip.c +++ b/board/incaip/incaip.c @@ -23,6 +23,7 @@
#include <common.h> #include <command.h> +#include <netdev.h> #include <asm/addrspace.h> #include <asm/inca-ip.h> #include <asm/io.h> @@ -116,3 +117,10 @@ int checkboard (void)
return 0; } + +#if defined(CONFIG_INCA_IP_SWITCH) +int board_eth_init(bd_t *bis) +{ + return inca_switch_initialize(bis); +} +#endif diff --git a/drivers/net/inca-ip_sw.c b/drivers/net/inca-ip_sw.c index d852a15..27c28c7 100644 --- a/drivers/net/inca-ip_sw.c +++ b/drivers/net/inca-ip_sw.c @@ -199,7 +199,7 @@ int inca_switch_initialize(bd_t * bis) printf("Leaving inca_switch_initialize()\n"); #endif
- return 1; + return 0; }
diff --git a/include/netdev.h b/include/netdev.h index bea9fac..258248c 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -45,6 +45,7 @@ int bfin_EMAC_initialize(bd_t *bis); int eth_3com_initialize (bd_t * bis); int greth_initialize(bd_t *bis); int gt6426x_eth_initialize(bd_t *bis); +int inca_switch_initialize(bd_t *bis); int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); int mcdmafec_initialize(bd_t *bis); int mcffec_initialize(bd_t *bis); diff --git a/net/eth.c b/net/eth.c index bedb4ff..93c18c5 100644 --- a/net/eth.c +++ b/net/eth.c @@ -44,7 +44,6 @@ extern int dc21x4x_initialize(bd_t*); extern int e1000_initialize(bd_t*); extern int eepro100_initialize(bd_t*); extern int fec_initialize(bd_t*); -extern int inca_switch_initialize(bd_t*); extern int mpc5xxx_fec_initialize(bd_t*); extern int mpc512x_fec_initialize(bd_t*); extern int mpc8220_fec_initialize(bd_t*); @@ -169,9 +168,6 @@ int eth_initialize(bd_t *bis) #if defined(CONFIG_4xx) && !defined(CONFIG_IOP480) && !defined(CONFIG_AP1000) ppc_4xx_eth_initialize(bis); #endif -#ifdef CONFIG_INCA_IP_SWITCH - inca_switch_initialize(bis); -#endif #ifdef CONFIG_PLB2800_ETHER plb2800_eth_initialize(bis); #endif

Added a cpu_eth_init() function to MPC512x CPU directory and removed code from net/eth.c
Signed-off-by: Ben Warren biggerbadderben@gmail.com --- cpu/mpc512x/cpu.c | 13 +++++++++++++ cpu/mpc5xxx/cpu.c | 13 +++++++++++++ include/netdev.h | 2 ++ net/eth.c | 4 ---- 4 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/cpu/mpc512x/cpu.c b/cpu/mpc512x/cpu.c index 1f39ac4..d432d99 100644 --- a/cpu/mpc512x/cpu.c +++ b/cpu/mpc512x/cpu.c @@ -30,6 +30,7 @@ #include <common.h> #include <command.h> #include <mpc512x.h> +#include <netdev.h> #include <asm/processor.h>
#if defined(CONFIG_OF_LIBFDT) @@ -195,3 +196,15 @@ void ft_cpu_setup(void *blob, bd_t *bd) #endif } #endif + +#ifdef CONFIG_MPC512x_FEC +/* Default initializations for FEC controllers. To override, + * create a board-specific function called: + * int board_eth_init(bd_t *bis) + */ + +int cpu_eth_init(bd_t *bis) +{ + return mpc512x_fec_initialize(bis); +} +#endif diff --git a/cpu/mpc5xxx/cpu.c b/cpu/mpc5xxx/cpu.c index 0ed2899..1326c3c 100644 --- a/cpu/mpc5xxx/cpu.c +++ b/cpu/mpc5xxx/cpu.c @@ -29,6 +29,7 @@ #include <watchdog.h> #include <command.h> #include <mpc5xxx.h> +#include <netdev.h> #include <asm/io.h> #include <asm/processor.h>
@@ -155,3 +156,15 @@ ulong bootcount_load (void) return (*save_addr & 0x0000ffff); } #endif /* CONFIG_BOOTCOUNT_LIMIT */ + +#ifdef CONFIG_MPC5xxx_FEC +/* Default initializations for FEC controllers. To override, + * create a board-specific function called: + * int board_eth_init(bd_t *bis) + */ + +int cpu_eth_init(bd_t *bis) +{ + return mpc5xxx_fec_initialize(bis); +} +#endif diff --git a/include/netdev.h b/include/netdev.h index 258248c..f6b6052 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -49,6 +49,8 @@ int inca_switch_initialize(bd_t *bis); int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); int mcdmafec_initialize(bd_t *bis); int mcffec_initialize(bd_t *bis); +int mpc512x_fec_initialize(bd_t *bis); +int mpc5xxx_fec_initialize(bd_t *bis); int natsemi_initialize(bd_t *bis); int ns8382x_initialize(bd_t *bis); int pcnet_initialize(bd_t *bis); diff --git a/net/eth.c b/net/eth.c index 93c18c5..4c7c912 100644 --- a/net/eth.c +++ b/net/eth.c @@ -45,7 +45,6 @@ extern int e1000_initialize(bd_t*); extern int eepro100_initialize(bd_t*); extern int fec_initialize(bd_t*); extern int mpc5xxx_fec_initialize(bd_t*); -extern int mpc512x_fec_initialize(bd_t*); extern int mpc8220_fec_initialize(bd_t*); extern int mv6436x_eth_initialize(bd_t *); extern int mv6446x_eth_initialize(bd_t *); @@ -177,9 +176,6 @@ int eth_initialize(bd_t *bis) #if defined(CONFIG_MPC5xxx_FEC) mpc5xxx_fec_initialize(bis); #endif -#if defined(CONFIG_MPC512x_FEC) - mpc512x_fec_initialize (bis); -#endif #if defined(CONFIG_MPC8220_FEC) mpc8220_fec_initialize(bis); #endif

Modified board_eth_init() functions of boards that have this FEC in addition to other Ethernet controllers.
Affected boards: bc3450 icecube mvbc_p o2dnt pm520 total5200 tq5200
Removed initialization of controller from net/eth.c
Signed-off-by: Ben Warren biggerbadderben@gmail.com --- board/bc3450/bc3450.c | 1 + board/icecube/icecube.c | 1 + board/matrix_vision/mvbc_p/mvbc_p.c | 6 ++++++ board/o2dnt/o2dnt.c | 1 + board/pm520/pm520.c | 1 + board/total5200/total5200.c | 1 + board/tqc/tqm5200/tqm5200.c | 1 + net/eth.c | 4 ---- 8 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/board/bc3450/bc3450.c b/board/bc3450/bc3450.c index e27c234..7ddf74c 100644 --- a/board/bc3450/bc3450.c +++ b/board/bc3450/bc3450.c @@ -673,5 +673,6 @@ int board_get_height (void)
int board_eth_init(bd_t *bis) { + cpu_eth_init(bis); /* Built in FEC comes first */ return pci_eth_init(bis); } diff --git a/board/icecube/icecube.c b/board/icecube/icecube.c index 2ab86be..d84ab3a 100644 --- a/board/icecube/icecube.c +++ b/board/icecube/icecube.c @@ -394,5 +394,6 @@ ft_board_setup(void *blob, bd_t *bd)
int board_eth_init(bd_t *bis) { + cpu_eth_init(bis); /* Built in FEC comes first */ return pci_eth_init(bis); } diff --git a/board/matrix_vision/mvbc_p/mvbc_p.c b/board/matrix_vision/mvbc_p/mvbc_p.c index 3332f5a..648b45e 100644 --- a/board/matrix_vision/mvbc_p/mvbc_p.c +++ b/board/matrix_vision/mvbc_p/mvbc_p.c @@ -35,6 +35,7 @@ #include <fpga.h> #include <environment.h> #include <fdt_support.h> +#include <netdev.h> #include <asm/io.h> #include "fpga.h" #include "mvbc_p.h" @@ -324,3 +325,8 @@ void ft_board_setup(void *blob, bd_t *bd) ft_cpu_setup(blob, bd); fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize); } + +int board_eth_init(bd_t *bis) +{ + return cpu_eth_init(bis); /* Built in FEC comes first */ +} diff --git a/board/o2dnt/o2dnt.c b/board/o2dnt/o2dnt.c index 37832de..19faf52 100644 --- a/board/o2dnt/o2dnt.c +++ b/board/o2dnt/o2dnt.c @@ -184,5 +184,6 @@ void pci_init_board(void)
int board_eth_init(bd_t *bis) { + cpu_eth_init(bis); /* Built in FEC comes first */ return pci_eth_init(bis); } diff --git a/board/pm520/pm520.c b/board/pm520/pm520.c index c9610fb..a9d63cc 100644 --- a/board/pm520/pm520.c +++ b/board/pm520/pm520.c @@ -325,5 +325,6 @@ void doc_init (void)
int board_eth_init(bd_t *bis) { + cpu_eth_init(bis); /* Built in FEC comes first */ return pci_eth_init(bis); } diff --git a/board/total5200/total5200.c b/board/total5200/total5200.c index c1848fc..ec00a67 100644 --- a/board/total5200/total5200.c +++ b/board/total5200/total5200.c @@ -312,5 +312,6 @@ int board_get_height (void)
int board_eth_init(bd_t *bis) { + cpu_eth_init(bis); /* Built in FEC comes first */ return pci_eth_init(bis); } diff --git a/board/tqc/tqm5200/tqm5200.c b/board/tqc/tqm5200/tqm5200.c index d75aa9b..5152331 100644 --- a/board/tqc/tqm5200/tqm5200.c +++ b/board/tqc/tqm5200/tqm5200.c @@ -753,5 +753,6 @@ void ft_board_setup(void *blob, bd_t *bd)
int board_eth_init(bd_t *bis) { + cpu_eth_init(bis); /* Built in FEC comes first */ return pci_eth_init(bis); } diff --git a/net/eth.c b/net/eth.c index 4c7c912..fdd9a8a 100644 --- a/net/eth.c +++ b/net/eth.c @@ -44,7 +44,6 @@ extern int dc21x4x_initialize(bd_t*); extern int e1000_initialize(bd_t*); extern int eepro100_initialize(bd_t*); extern int fec_initialize(bd_t*); -extern int mpc5xxx_fec_initialize(bd_t*); extern int mpc8220_fec_initialize(bd_t*); extern int mv6436x_eth_initialize(bd_t *); extern int mv6446x_eth_initialize(bd_t *); @@ -173,9 +172,6 @@ int eth_initialize(bd_t *bis) #ifdef SCC_ENET scc_initialize(bis); #endif -#if defined(CONFIG_MPC5xxx_FEC) - mpc5xxx_fec_initialize(bis); -#endif #if defined(CONFIG_MPC8220_FEC) mpc8220_fec_initialize(bis); #endif

Affected boards: purple
Removed initialization of controller from net/eth.c
Signed-off-by: Ben Warren biggerbadderben@gmail.com --- board/purple/purple.c | 9 +++++++++ drivers/net/plb2800_eth.c | 4 ++-- include/netdev.h | 1 + net/eth.c | 4 ---- 4 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/board/purple/purple.c b/board/purple/purple.c index 9775591..c129d7a 100644 --- a/board/purple/purple.c +++ b/board/purple/purple.c @@ -23,6 +23,7 @@
#include <common.h> #include <command.h> +#include <netdev.h> #include <asm/inca-ip.h> #include <asm/regdef.h> #include <asm/mipsregs.h> @@ -274,3 +275,11 @@ void copy_code (ulong dest_addr) start += CFG_CACHELINE_SIZE; } } + +#ifdef CONFIG_PLB2800_ETHER +int board_eth_init(bd_t *bis) +{ + return plb2800_eth_initialize(bis); +} +#endif + diff --git a/drivers/net/plb2800_eth.c b/drivers/net/plb2800_eth.c index dad842c..cc19304 100644 --- a/drivers/net/plb2800_eth.c +++ b/drivers/net/plb2800_eth.c @@ -105,7 +105,7 @@ int plb2800_eth_initialize(bd_t * bis) if (!(dev = (struct eth_device *) malloc (sizeof *dev))) { printf("Failed to allocate memory\n"); - return 0; + return -1; } memset(dev, 0, sizeof(*dev));
@@ -140,7 +140,7 @@ int plb2800_eth_initialize(bd_t * bis) printf("Leaving plb2800_eth_initialize()\n"); #endif
- return 1; + return 0; }
static int plb2800_eth_init(struct eth_device *dev, bd_t * bis) diff --git a/include/netdev.h b/include/netdev.h index f6b6052..746ab1c 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -54,6 +54,7 @@ int mpc5xxx_fec_initialize(bd_t *bis); int natsemi_initialize(bd_t *bis); int ns8382x_initialize(bd_t *bis); int pcnet_initialize(bd_t *bis); +int plb2800_eth_initialize(bd_t *bis); int rtl8139_initialize(bd_t *bis); int rtl8169_initialize(bd_t *bis); int skge_initialize(bd_t *bis); diff --git a/net/eth.c b/net/eth.c index fdd9a8a..ab9d034 100644 --- a/net/eth.c +++ b/net/eth.c @@ -47,7 +47,6 @@ extern int fec_initialize(bd_t*); extern int mpc8220_fec_initialize(bd_t*); extern int mv6436x_eth_initialize(bd_t *); extern int mv6446x_eth_initialize(bd_t *); -extern int plb2800_eth_initialize(bd_t*); extern int ppc_4xx_eth_initialize(bd_t *); extern int scc_initialize(bd_t*); extern int npe_initialize(bd_t *); @@ -166,9 +165,6 @@ int eth_initialize(bd_t *bis) #if defined(CONFIG_4xx) && !defined(CONFIG_IOP480) && !defined(CONFIG_AP1000) ppc_4xx_eth_initialize(bis); #endif -#ifdef CONFIG_PLB2800_ETHER - plb2800_eth_initialize(bis); -#endif #ifdef SCC_ENET scc_initialize(bis); #endif

Affected boards: ap1000 mvbc_p PM854
Removed initialization of the driver from net/eth.c
Signed-off-by: Ben Warren biggerbadderben@gmail.com --- board/amirix/ap1000/ap1000.c | 7 +++++++ board/matrix_vision/mvbc_p/mvbc_p.c | 3 ++- board/pm854/pm854.c | 6 ++++++ drivers/net/e1000.c | 2 +- include/netdev.h | 4 ++++ net/eth.c | 4 ---- 6 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/board/amirix/ap1000/ap1000.c b/board/amirix/ap1000/ap1000.c index 55277e7..8f30ed9 100644 --- a/board/amirix/ap1000/ap1000.c +++ b/board/amirix/ap1000/ap1000.c @@ -23,6 +23,7 @@
#include <common.h> #include <command.h> +#include <netdev.h> #include <asm/processor.h>
#include "powerspan.h" @@ -697,3 +698,9 @@ U_BOOT_CMD (swrecon, 1, 0, do_swreconfig, "swrecon - trigger a board reconfigure to the software selected configuration\n", "\n" " - trigger a board reconfigure to the software selected configuration\n"); + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} + diff --git a/board/matrix_vision/mvbc_p/mvbc_p.c b/board/matrix_vision/mvbc_p/mvbc_p.c index 648b45e..c88c4a6 100644 --- a/board/matrix_vision/mvbc_p/mvbc_p.c +++ b/board/matrix_vision/mvbc_p/mvbc_p.c @@ -328,5 +328,6 @@ void ft_board_setup(void *blob, bd_t *bd)
int board_eth_init(bd_t *bis) { - return cpu_eth_init(bis); /* Built in FEC comes first */ + cpu_eth_init(bis); /* Built in FEC comes first */ + return pci_eth_init(bis); } diff --git a/board/pm854/pm854.c b/board/pm854/pm854.c index 7dbafb9..f366814 100644 --- a/board/pm854/pm854.c +++ b/board/pm854/pm854.c @@ -27,6 +27,7 @@
#include <common.h> #include <pci.h> +#include <netdev.h> #include <asm/processor.h> #include <asm/mmu.h> #include <asm/immap_85xx.h> @@ -289,3 +290,8 @@ pci_init_board(void) pci_mpc85xx_init(&hose); #endif /* CONFIG_PCI */ } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c index c8b4e98..2dcaa2c 100644 --- a/drivers/net/e1000.c +++ b/drivers/net/e1000.c @@ -3059,5 +3059,5 @@ e1000_initialize(bd_t * bis)
card_number++; } - return 1; + return card_number; } diff --git a/include/netdev.h b/include/netdev.h index 746ab1c..9da05d9 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -42,6 +42,7 @@ int cpu_eth_init(bd_t *bis);
/* Driver initialization prototypes */ int bfin_EMAC_initialize(bd_t *bis); +int e1000_initialize(bd_t *bis); int eth_3com_initialize (bd_t * bis); int greth_initialize(bd_t *bis); int gt6426x_eth_initialize(bd_t *bis); @@ -70,6 +71,9 @@ static int pci_eth_init(bd_t *bis) { int num = 0;
+#ifdef CONFIG_E1000 + num += e1000_initialize(bis); +#endif #ifdef CONFIG_PCNET num += pcnet_initialize(bis); #endif diff --git a/net/eth.c b/net/eth.c index ab9d034..0761065 100644 --- a/net/eth.c +++ b/net/eth.c @@ -41,7 +41,6 @@ int board_eth_init(bd_t *bis) __attribute((weak, alias("__def_eth_init")));
extern int au1x00_enet_initialize(bd_t*); extern int dc21x4x_initialize(bd_t*); -extern int e1000_initialize(bd_t*); extern int eepro100_initialize(bd_t*); extern int fec_initialize(bd_t*); extern int mpc8220_fec_initialize(bd_t*); @@ -193,9 +192,6 @@ int eth_initialize(bd_t *bis) #if defined(CONFIG_IXP4XX_NPE) npe_initialize(bis); #endif -#ifdef CONFIG_E1000 - e1000_initialize(bis); -#endif #ifdef CONFIG_EEPRO100 eepro100_initialize(bis); #endif

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: Ben Warren biggerbadderben@gmail.com --- board/cu824/cu824.c | 6 ++++++ board/eltec/bab7xx/bab7xx.c | 6 ++++++ board/esd/adciop/adciop.c | 6 ++++++ board/esd/dasa_sim/dasa_sim.c | 6 ++++++ board/mousse/mousse.c | 6 ++++++ board/mpc8540eval/mpc8540eval.c | 12 ++++++++++++ board/musenki/musenki.c | 6 ++++++ board/mvblue/mvblue.c | 6 ++++++ board/pcippc2/pcippc2.c | 6 ++++++ board/sbc8240/sbc8240.c | 6 ++++++ board/stxssa/stxssa.c | 8 ++++++++ include/netdev.h | 4 ++++ net/eth.c | 4 ---- 13 files changed, 78 insertions(+), 4 deletions(-)
diff --git a/board/cu824/cu824.c b/board/cu824/cu824.c index ecf6328..0fd4223 100644 --- a/board/cu824/cu824.c +++ b/board/cu824/cu824.c @@ -28,6 +28,7 @@ #include <mpc824x.h> #include <asm/processor.h> #include <pci.h> +#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -91,3 +92,8 @@ void pci_init_board(void) { pci_mpc824x_init(&hose); } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/eltec/bab7xx/bab7xx.c b/board/eltec/bab7xx/bab7xx.c index af52352..8c56116 100644 --- a/board/eltec/bab7xx/bab7xx.c +++ b/board/eltec/bab7xx/bab7xx.c @@ -30,6 +30,7 @@ #include <74xx_7xx.h> #include <ns87308.h> #include <video_fb.h> +#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -244,3 +245,8 @@ void video_get_info_str (int line_number, char *info) #endif
/*---------------------------------------------------------------------------*/ + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/esd/adciop/adciop.c b/board/esd/adciop/adciop.c index 0f655b7..63aaf2c 100644 --- a/board/esd/adciop/adciop.c +++ b/board/esd/adciop/adciop.c @@ -22,6 +22,7 @@ */
#include <common.h> +#include <netdev.h> #include "adciop.h"
/* ------------------------------------------------------------------------- */ @@ -95,3 +96,8 @@ int testdram (void) }
/* ------------------------------------------------------------------------- */ + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/esd/dasa_sim/dasa_sim.c b/board/esd/dasa_sim/dasa_sim.c index fb0c77e..e061878 100644 --- a/board/esd/dasa_sim/dasa_sim.c +++ b/board/esd/dasa_sim/dasa_sim.c @@ -22,6 +22,7 @@ */
#include <common.h> +#include <netdev.h> #include "dasa_sim.h"
/* ------------------------------------------------------------------------- */ @@ -222,3 +223,8 @@ int testdram (void) }
/* ------------------------------------------------------------------------- */ + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/mousse/mousse.c b/board/mousse/mousse.c index f8f1529..7b61266 100644 --- a/board/mousse/mousse.c +++ b/board/mousse/mousse.c @@ -28,6 +28,7 @@
#include <common.h> #include <mpc824x.h> +#include <netdev.h> #include <asm/processor.h>
#include "mousse.h" @@ -84,3 +85,8 @@ int misc_init_f (void) get_tod (); return 0; } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/mpc8540eval/mpc8540eval.c b/board/mpc8540eval/mpc8540eval.c index 7c54458..e1a1d2b 100644 --- a/board/mpc8540eval/mpc8540eval.c +++ b/board/mpc8540eval/mpc8540eval.c @@ -24,6 +24,7 @@ */
#include <common.h> +#include <netdev.h> #include <asm/processor.h> #include <asm/mmu.h> #include <asm/immap_85xx.h> @@ -247,3 +248,14 @@ long int fixed_sdram (void) return (CFG_SDRAM_SIZE * 1024 * 1024); } #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); +} diff --git a/board/musenki/musenki.c b/board/musenki/musenki.c index b2b70e7..6f9eeb2 100644 --- a/board/musenki/musenki.c +++ b/board/musenki/musenki.c @@ -24,6 +24,7 @@ #include <common.h> #include <mpc824x.h> #include <pci.h> +#include <netdev.h>
int checkboard (void) { @@ -102,3 +103,8 @@ void pci_init_board(void) { pci_mpc824x_init(&hose); } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/mvblue/mvblue.c b/board/mvblue/mvblue.c index a979102..056fee7 100644 --- a/board/mvblue/mvblue.c +++ b/board/mvblue/mvblue.c @@ -9,6 +9,7 @@ #include <mpc824x.h> #include <asm/io.h> #include <ns16550.h> +#include <netdev.h>
#ifdef CONFIG_PCI #include <pci.h> @@ -245,4 +246,9 @@ void pci_init_board (void) { pci_mpc824x_init (&hose); } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} #endif diff --git a/board/pcippc2/pcippc2.c b/board/pcippc2/pcippc2.c index c1917c1..a3dbdc8 100644 --- a/board/pcippc2/pcippc2.c +++ b/board/pcippc2/pcippc2.c @@ -28,6 +28,7 @@ #include <linux/mtd/doc2000.h> #include <watchdog.h> #include <pci.h> +#include <netdev.h>
#include "hardware.h" #include "pcippc2.h" @@ -243,3 +244,8 @@ U_BOOT_CMD(
#endif #endif /* CONFIG_WATCHDOG */ + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/sbc8240/sbc8240.c b/board/sbc8240/sbc8240.c index 175720d..075e377 100644 --- a/board/sbc8240/sbc8240.c +++ b/board/sbc8240/sbc8240.c @@ -28,6 +28,7 @@ #include <mpc824x.h> #include <asm/processor.h> #include <pci.h> +#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -103,3 +104,8 @@ int misc_init_r (void) return (0); } #endif /* CONFIG_MISC_INIT_R */ + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/stxssa/stxssa.c b/board/stxssa/stxssa.c index 124e123..71e9b08 100644 --- a/board/stxssa/stxssa.c +++ b/board/stxssa/stxssa.c @@ -39,6 +39,7 @@ #include <asm/io.h> #include <spd_sdram.h> #include <miiphy.h> +#include <netdev.h>
long int fixed_sdram (void);
@@ -400,3 +401,10 @@ pci_init_board(void) pci_mpc85xx_init(hose); #endif /* CONFIG_PCI */ } + +int board_eth_init(bd_t *bis) +{ + cpu_eth_init(bis); /* Initialize TSECs first */ + return pci_eth_init(bis); +} + diff --git a/include/netdev.h b/include/netdev.h index 9da05d9..a775e50 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -42,6 +42,7 @@ int cpu_eth_init(bd_t *bis);
/* Driver initialization prototypes */ int bfin_EMAC_initialize(bd_t *bis); +int dc21x4x_initialize(bd_t *bis); int e1000_initialize(bd_t *bis); int eth_3com_initialize (bd_t * bis); int greth_initialize(bd_t *bis); @@ -71,6 +72,9 @@ static int pci_eth_init(bd_t *bis) { int num = 0;
+#ifdef CONFIG_TULIP + num += dc21x4x_initialize(bis); +#endif #ifdef CONFIG_E1000 num += e1000_initialize(bis); #endif diff --git a/net/eth.c b/net/eth.c index 0761065..0dfeab6 100644 --- a/net/eth.c +++ b/net/eth.c @@ -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")));
extern int au1x00_enet_initialize(bd_t*); -extern int dc21x4x_initialize(bd_t*); extern int eepro100_initialize(bd_t*); extern int fec_initialize(bd_t*); extern int mpc8220_fec_initialize(bd_t*); @@ -195,9 +194,6 @@ int eth_initialize(bd_t *bis) #ifdef CONFIG_EEPRO100 eepro100_initialize(bis); #endif -#ifdef CONFIG_TULIP - dc21x4x_initialize(bis); -#endif if (!eth_devices) { puts ("No ethernet found.\n"); show_boot_progress (-64);

Affected boards: db64360 db64460 katmai taihu taishan yucca cpc45 cpu87 eXalion elppc debris kvme080 mpc8315erdb integratorap ixdp425 oxc pm826 pm828 pm854 pm856 ppmc7xx sc3 sc520_spunk sorcery tqm8272 tqm85xx utx8245
Removed initialization of the driver from net/eth.c
Signed-off-by: Ben Warren biggerbadderben@gmail.com --- board/Marvell/db64360/db64360.c | 6 ++++++ board/Marvell/db64460/db64460.c | 6 ++++++ board/amcc/katmai/katmai.c | 6 ++++++ board/amcc/taihu/taihu.c | 6 ++++++ board/amcc/taishan/taishan.c | 6 ++++++ board/amcc/yucca/yucca.c | 6 ++++++ board/cpc45/cpc45.c | 6 ++++++ board/cpu87/cpu87.c | 6 ++++++ board/eXalion/eXalion.c | 6 ++++++ board/eltec/elppc/elppc.c | 6 ++++++ board/etin/debris/debris.c | 6 ++++++ board/etin/kvme080/kvme080.c | 6 ++++++ board/freescale/mpc8315erdb/mpc8315erdb.c | 7 +++++++ board/integratorap/integratorap.c | 7 +++++++ board/ixdp425/ixdp425.c | 6 ++++++ board/oxc/oxc.c | 6 ++++++ board/pm826/pm826.c | 6 ++++++ board/pm828/pm828.c | 6 ++++++ board/pm854/pm854.c | 1 + board/pm856/pm856.c | 7 +++++++ board/ppmc7xx/ppmc7xx.c | 6 ++++++ board/sc3/sc3.c | 6 ++++++ board/sc520_spunk/sc520_spunk.c | 6 ++++++ board/sorcery/sorcery.c | 6 ++++++ board/tqc/tqm8272/tqm8272.c | 6 ++++++ board/tqc/tqm85xx/tqm85xx.c | 7 +++++++ board/utx8245/utx8245.c | 6 ++++++ include/netdev.h | 4 ++++ net/eth.c | 4 ---- 29 files changed, 165 insertions(+), 4 deletions(-)
diff --git a/board/Marvell/db64360/db64360.c b/board/Marvell/db64360/db64360.c index 2a810a6..c03d03d 100644 --- a/board/Marvell/db64360/db64360.c +++ b/board/Marvell/db64360/db64360.c @@ -33,6 +33,7 @@ #include "../include/pci.h" #include "../include/mv_gen_reg.h" #include <net.h> +#include <netdev.h>
#include "eth.h" #include "mpsc.h" @@ -929,3 +930,8 @@ void board_prebootm_init () icache_disable (); dcache_disable (); } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/Marvell/db64460/db64460.c b/board/Marvell/db64460/db64460.c index 1ae898d..8a05cd2 100644 --- a/board/Marvell/db64460/db64460.c +++ b/board/Marvell/db64460/db64460.c @@ -33,6 +33,7 @@ #include "../include/pci.h" #include "../include/mv_gen_reg.h" #include <net.h> +#include <netdev.h>
#include "eth.h" #include "mpsc.h" @@ -929,3 +930,8 @@ void board_prebootm_init () icache_disable (); dcache_disable (); } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/amcc/katmai/katmai.c b/board/amcc/katmai/katmai.c index 08d89d7..172b581 100644 --- a/board/amcc/katmai/katmai.c +++ b/board/amcc/katmai/katmai.c @@ -27,6 +27,7 @@ #include <i2c.h> #include <libfdt.h> #include <fdt_support.h> +#include <netdev.h> #include <asm/processor.h> #include <asm/io.h> #include <asm/gpio.h> @@ -447,3 +448,8 @@ int post_hotkeys_pressed(void) return (ctrlc()); } #endif + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/amcc/taihu/taihu.c b/board/amcc/taihu/taihu.c index 254e3eb..266f260 100644 --- a/board/amcc/taihu/taihu.c +++ b/board/amcc/taihu/taihu.c @@ -28,6 +28,7 @@ #include <asm/processor.h> #include <asm/io.h> #include <spi.h> +#include <netdev.h> #include <asm/gpio.h>
extern int lcd_init(void); @@ -200,3 +201,8 @@ int pci_pre_init(struct pci_controller *hose) return 1; } #endif /* CONFIG_PCI */ + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/amcc/taishan/taishan.c b/board/amcc/taishan/taishan.c index fdd82e7..cd432cb 100644 --- a/board/amcc/taishan/taishan.c +++ b/board/amcc/taishan/taishan.c @@ -27,6 +27,7 @@ #include <asm/processor.h> #include <spd_sdram.h> #include <ppc4xx_enet.h> +#include <netdev.h>
#ifdef CFG_INIT_SHOW_RESET_REG void show_reset_reg(void); @@ -311,3 +312,8 @@ int post_hotkeys_pressed(void) return (ctrlc()); } #endif + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/amcc/yucca/yucca.c b/board/amcc/yucca/yucca.c index 84c3938..e0c1268 100644 --- a/board/amcc/yucca/yucca.c +++ b/board/amcc/yucca/yucca.c @@ -28,6 +28,7 @@ #include <common.h> #include <ppc4xx.h> #include <i2c.h> +#include <netdev.h> #include <asm/processor.h> #include <asm/io.h> #include <asm/4xx_pcie.h> @@ -952,3 +953,8 @@ int onboard_pci_arbiter_selected(int core_pci) #endif return (BOARD_OPTION_NOT_SELECTED); } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/cpc45/cpc45.c b/board/cpc45/cpc45.c index f4e867c..16ead75 100644 --- a/board/cpc45/cpc45.c +++ b/board/cpc45/cpc45.c @@ -27,6 +27,7 @@ #include <asm/io.h> #include <pci.h> #include <i2c.h> +#include <netdev.h>
int sysControlDisplay(int digit, uchar ascii_code); extern void Plx9030Init(void); @@ -273,3 +274,8 @@ void ide_led (uchar led, uchar status) writeb(val, BCSR_BASE + 0x04); } # endif + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/cpu87/cpu87.c b/board/cpu87/cpu87.c index f5a5de5..454987c 100644 --- a/board/cpu87/cpu87.c +++ b/board/cpu87/cpu87.c @@ -26,6 +26,7 @@ #include <mpc8260.h> #include "cpu87.h" #include <pci.h> +#include <netdev.h>
/* * I/O Port configuration table @@ -339,3 +340,8 @@ void pci_init_board(void) pci_mpc8250_init(&hose); } #endif + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/eXalion/eXalion.c b/board/eXalion/eXalion.c index 385b498..c5dff24 100644 --- a/board/eXalion/eXalion.c +++ b/board/eXalion/eXalion.c @@ -30,6 +30,7 @@ #include <asm/io.h> #include <pci.h> #include <ide.h> +#include <netdev.h> #include "piix_pci.h" #include "eXalion.h"
@@ -290,3 +291,8 @@ void pci_init_board (void) { pci_mpc824x_init (&hose); } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/eltec/elppc/elppc.c b/board/eltec/elppc/elppc.c index 1b70605..d3ac278 100644 --- a/board/eltec/elppc/elppc.c +++ b/board/eltec/elppc/elppc.c @@ -25,6 +25,7 @@ #include <command.h> #include <mpc106.h> #include <video_fb.h> +#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -172,3 +173,8 @@ void video_get_info_str (int line_number, char *info) return; } #endif + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/etin/debris/debris.c b/board/etin/debris/debris.c index 763760f..3fcf78e 100644 --- a/board/etin/debris/debris.c +++ b/board/etin/debris/debris.c @@ -25,6 +25,7 @@ #include <mpc824x.h> #include <pci.h> #include <i2c.h> +#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -177,3 +178,8 @@ int misc_init_r(void) (char*)&gd->bd->bi_enetaddr[0], 6); return 0; } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/etin/kvme080/kvme080.c b/board/etin/kvme080/kvme080.c index bfd6854..be6924d 100644 --- a/board/etin/kvme080/kvme080.c +++ b/board/etin/kvme080/kvme080.c @@ -25,6 +25,7 @@ #include <mpc824x.h> #include <pci.h> #include <i2c.h> +#include <netdev.h> #include <asm/processor.h>
int checkboard(void) @@ -191,3 +192,8 @@ void nvram_write(long dest, const void *src, size_t count) asm volatile("sync"); } } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/freescale/mpc8315erdb/mpc8315erdb.c b/board/freescale/mpc8315erdb/mpc8315erdb.c index 3eecee2..0330218 100644 --- a/board/freescale/mpc8315erdb/mpc8315erdb.c +++ b/board/freescale/mpc8315erdb/mpc8315erdb.c @@ -29,6 +29,7 @@ #include <fdt_support.h> #include <pci.h> #include <mpc83xx.h> +#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -165,3 +166,9 @@ void ft_board_setup(void *blob, bd_t *bd) fdt_tsec1_fixup(blob, bd); } #endif + +int board_eth_init(bd_t *bis) +{ + cpu_eth_init(bis); /* Initialize TSECs first */ + return pci_eth_init(bis); +} diff --git a/board/integratorap/integratorap.c b/board/integratorap/integratorap.c index e659907..687c486 100644 --- a/board/integratorap/integratorap.c +++ b/board/integratorap/integratorap.c @@ -39,6 +39,8 @@ #include <pci.h> #endif
+#include <netdev.h> + DECLARE_GLOBAL_DATA_PTR;
void flash__init (void); @@ -647,3 +649,8 @@ ulong get_tbclk (void) { return CFG_HZ_CLOCK/div_clock; } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/ixdp425/ixdp425.c b/board/ixdp425/ixdp425.c index e0d7637..b379c75 100644 --- a/board/ixdp425/ixdp425.c +++ b/board/ixdp425/ixdp425.c @@ -31,6 +31,7 @@ #include <common.h> #include <command.h> #include <malloc.h> +#include <netdev.h> #include <asm/arch/ixp425.h>
DECLARE_GLOBAL_DATA_PTR; @@ -118,3 +119,8 @@ void pci_init_board(void) pci_ixp_init(&hose); } #endif + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/oxc/oxc.c b/board/oxc/oxc.c index b61d399..eb7eeb8 100644 --- a/board/oxc/oxc.c +++ b/board/oxc/oxc.c @@ -25,6 +25,7 @@ #include <mpc824x.h> #include <pci.h> #include <i2c.h> +#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -215,3 +216,8 @@ int misc_init_r (void) #endif return (0); } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/pm826/pm826.c b/board/pm826/pm826.c index 7ee3ab6..d8b0929 100644 --- a/board/pm826/pm826.c +++ b/board/pm826/pm826.c @@ -25,6 +25,7 @@ #include <ioports.h> #include <mpc8260.h> #include <pci.h> +#include <netdev.h>
/* * I/O Port configuration table @@ -328,3 +329,8 @@ void pci_init_board(void) pci_mpc8250_init(&hose); } #endif + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/pm828/pm828.c b/board/pm828/pm828.c index 6038e97..b163d5b 100644 --- a/board/pm828/pm828.c +++ b/board/pm828/pm828.c @@ -25,6 +25,7 @@ #include <ioports.h> #include <mpc8260.h> #include <pci.h> +#include <netdev.h>
/* * I/O Port configuration table @@ -361,3 +362,8 @@ void pci_init_board(void) pci_mpc8250_init(&hose); } #endif + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/pm854/pm854.c b/board/pm854/pm854.c index f366814..90523bd 100644 --- a/board/pm854/pm854.c +++ b/board/pm854/pm854.c @@ -293,5 +293,6 @@ pci_init_board(void)
int board_eth_init(bd_t *bis) { + cpu_eth_init(bis); /* Intialize TSECs first */ return pci_eth_init(bis); } diff --git a/board/pm856/pm856.c b/board/pm856/pm856.c index bd4c065..ee33286 100644 --- a/board/pm856/pm856.c +++ b/board/pm856/pm856.c @@ -34,6 +34,7 @@ #include <ioports.h> #include <spd_sdram.h> #include <miiphy.h> +#include <netdev.h>
#if defined(CONFIG_DDR_ECC) extern void ddr_enable_ecc(unsigned int dram_size); @@ -444,3 +445,9 @@ pci_init_board(void) pci_mpc85xx_init(&hose); #endif /* CONFIG_PCI */ } + +int board_eth_init(bd_t *bis) +{ + cpu_eth_init(bis); /* Intialize TSECs first */ + return pci_eth_init(bis); +} diff --git a/board/ppmc7xx/ppmc7xx.c b/board/ppmc7xx/ppmc7xx.c index 061e01e..9c87c10 100644 --- a/board/ppmc7xx/ppmc7xx.c +++ b/board/ppmc7xx/ppmc7xx.c @@ -10,6 +10,7 @@
#include <common.h> #include <command.h> +#include <netdev.h>
/* Define some MPC107 (memory controller) registers */ @@ -102,3 +103,8 @@ void do_reset( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] ) /* Should never get here */ while(1); } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/sc3/sc3.c b/board/sc3/sc3.c index 3d1a654..6c82fe7 100644 --- a/board/sc3/sc3.c +++ b/board/sc3/sc3.c @@ -37,6 +37,7 @@ #include <pci.h> #include <i2c.h> #include <malloc.h> +#include <netdev.h>
#undef writel #undef writeb @@ -779,3 +780,8 @@ void pci_init_board(void) hose.config_table = pci_solidcard3_config_table; pci_405gp_init(&hose); } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/sc520_spunk/sc520_spunk.c b/board/sc520_spunk/sc520_spunk.c index 038d479..0b11caa 100644 --- a/board/sc520_spunk/sc520_spunk.c +++ b/board/sc520_spunk/sc520_spunk.c @@ -25,6 +25,7 @@ #include <common.h> #include <pci.h> #include <ssi.h> +#include <netdev.h> #include <asm/io.h> #include <asm/pci.h> #include <asm/ic/sc520.h> @@ -676,3 +677,8 @@ ssize_t spi_write(uchar *addr, int alen, uchar *buffer, int len) spi_eeprom_write(1, offset, buffer, len) : mw_eeprom_write(1, offset, buffer, len); } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/sorcery/sorcery.c b/board/sorcery/sorcery.c index 2b789d4..e4fb146 100644 --- a/board/sorcery/sorcery.c +++ b/board/sorcery/sorcery.c @@ -26,6 +26,7 @@ #include <asm/processor.h> #include <asm/mmu.h> #include <pci.h> +#include <netdev.h>
phys_size_t initdram (int board_type) { @@ -58,3 +59,8 @@ void pci_init_board (void) pci_mpc8220_init (&hose); #endif /* CONFIG_PCI */ } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/tqc/tqm8272/tqm8272.c b/board/tqc/tqm8272/tqm8272.c index a0ec254..3a2376c 100644 --- a/board/tqc/tqm8272/tqm8272.c +++ b/board/tqc/tqm8272/tqm8272.c @@ -26,6 +26,7 @@ #include <mpc8260.h>
#include <command.h> +#include <netdev.h> #ifdef CONFIG_PCI #include <pci.h> #include <asm/m8260_pci.h> @@ -1226,3 +1227,8 @@ void pci_init_board(void) pci_mpc8250_init(&hose); } #endif + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/tqc/tqm85xx/tqm85xx.c b/board/tqc/tqm85xx/tqm85xx.c index ae3c245..0e5bc2f 100644 --- a/board/tqc/tqm85xx/tqm85xx.c +++ b/board/tqc/tqm85xx/tqm85xx.c @@ -42,6 +42,7 @@ #include <flash.h> #include <libfdt.h> #include <fdt_support.h> +#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -743,3 +744,9 @@ int board_early_init_r (void) return (0); } #endif /* CONFIG_BOARD_EARLY_INIT_R */ + +int board_eth_init(bd_t *bis) +{ + cpu_eth_init(bis); /* Intialize TSECs first */ + return pci_eth_init(bis); +} diff --git a/board/utx8245/utx8245.c b/board/utx8245/utx8245.c index e2a961a..e7ca669 100644 --- a/board/utx8245/utx8245.c +++ b/board/utx8245/utx8245.c @@ -32,6 +32,7 @@ #include <asm/io.h> #include <asm/mmu.h> #include <pci.h> +#include <netdev.h>
#define SAVE_SZ 32
@@ -127,3 +128,8 @@ void pci_init_board (void)
icache_enable(); } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/include/netdev.h b/include/netdev.h index a775e50..ef7f23e 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -44,6 +44,7 @@ int cpu_eth_init(bd_t *bis); int bfin_EMAC_initialize(bd_t *bis); int dc21x4x_initialize(bd_t *bis); int e1000_initialize(bd_t *bis); +int eepro100_initialize(bd_t *bis); int eth_3com_initialize (bd_t * bis); int greth_initialize(bd_t *bis); int gt6426x_eth_initialize(bd_t *bis); @@ -72,6 +73,9 @@ static int pci_eth_init(bd_t *bis) { int num = 0;
+#ifdef CONFIG_EEPRO100 + num += eepro100_initialize(bis); +#endif #ifdef CONFIG_TULIP num += dc21x4x_initialize(bis); #endif diff --git a/net/eth.c b/net/eth.c index 0dfeab6..de85ed8 100644 --- a/net/eth.c +++ b/net/eth.c @@ -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")));
extern int au1x00_enet_initialize(bd_t*); -extern int eepro100_initialize(bd_t*); extern int fec_initialize(bd_t*); extern int mpc8220_fec_initialize(bd_t*); extern int mv6436x_eth_initialize(bd_t *); @@ -191,9 +190,6 @@ int eth_initialize(bd_t *bis) #if defined(CONFIG_IXP4XX_NPE) npe_initialize(bis); #endif -#ifdef CONFIG_EEPRO100 - eepro100_initialize(bis); -#endif if (!eth_devices) { puts ("No ethernet found.\n"); show_boot_progress (-64);

Ben Warren biggerbadderben@gmail.com wrote:
This addresses all drivers whose initializers have already been moved to board_eth_init()/cpu_eth_init().
Signed-off-by: Ben Warren biggerbadderben@gmail.com
Nice. There are a few things though...
board/atmel/atngw100/atngw100.c | 3 +- board/atmel/atstk1000/atstk1000.c | 3 +-
Three new avr32-based boards are missing: hammerhead, favr-32-ezkit and mimc200.
I see a new warning:
/home/hskinnemoen/work/u-boot/upstream/include/netdev.h:58: warning: 'pci_eth_init' defined but not used
Also, the drivers should include netdev.h as well, to catch mismatches when the prototype is changed.
The following patch fixes these three things, as far as avr32 is concerned at least. Might be a good idea to include netdev.h in the other drivers too.
diff --git a/board/earthlcd/favr-32-ezkit/favr-32-ezkit.c b/board/earthlcd/favr-32-ezkit/favr-32-ezkit.c index da69e75..da05589 100644 --- a/board/earthlcd/favr-32-ezkit/favr-32-ezkit.c +++ b/board/earthlcd/favr-32-ezkit/favr-32-ezkit.c @@ -18,6 +18,7 @@ * Place, Suite 330, Boston, MA 02111-1307 USA */ #include <common.h> +#include <netdev.h>
#include <asm/io.h> #include <asm/sdram.h> @@ -87,8 +88,6 @@ void board_init_info(void) }
#if defined(CONFIG_MACB) && defined(CONFIG_CMD_NET) -extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); - int board_eth_init(bd_t *bi) { return macb_eth_initialize(0, (void *)MACB0_BASE, bi->bi_phy_id[0]); diff --git a/board/mimc/mimc200/mimc200.c b/board/mimc/mimc200/mimc200.c index 4ece11a..8516dcb 100644 --- a/board/mimc/mimc200/mimc200.c +++ b/board/mimc/mimc200/mimc200.c @@ -20,6 +20,7 @@ * MA 02111-1307 USA */ #include <common.h> +#include <netdev.h>
#include <asm/io.h> #include <asm/sdram.h> @@ -195,8 +196,6 @@ void spi_cs_deactivate(struct spi_slave *slave) #endif /* CONFIG_ATMEL_SPI */
#ifdef CONFIG_CMD_NET -extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); - int board_eth_init(bd_t *bi) { macb_eth_initialize(0, (void *)MACB0_BASE, bi->bi_phy_id[0]); diff --git a/board/miromico/hammerhead/hammerhead.c b/board/miromico/hammerhead/hammerhead.c index 738ece2..d3875f4 100644 --- a/board/miromico/hammerhead/hammerhead.c +++ b/board/miromico/hammerhead/hammerhead.c @@ -25,6 +25,7 @@ #include "../cpu/at32ap/at32ap700x/sm.h"
#include <common.h> +#include <netdev.h>
#include <asm/io.h> #include <asm/sdram.h> @@ -51,8 +52,6 @@ static const struct sdram_config sdram_config = { .refresh_period = (781 * (SDRAMC_BUS_HZ / 1000)) / 100000, };
-extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); - #ifdef CONFIG_CMD_NET int board_eth_init(bd_t *bis) { diff --git a/drivers/net/macb.c b/drivers/net/macb.c index aa39284..08bebf7 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -40,6 +40,7 @@ */
#include <net.h> +#include <netdev.h> #include <malloc.h>
#include <linux/mii.h> diff --git a/include/netdev.h b/include/netdev.h index a3a717c..610a2db 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -54,7 +54,7 @@ int uli526x_initialize(bd_t *bis); * function to initialize whatever's on board. * Return value is total # of devices found */
-static int pci_eth_init(bd_t *bis) +static inline int pci_eth_init(bd_t *bis) { int num = 0; #if defined(CONFIG_ULI526)

On Sun, Aug 31, 2008 at 7:49 AM, Haavard Skinnemoen haavard.skinnemoen@atmel.com wrote:
Ben Warren biggerbadderben@gmail.com wrote:
This addresses all drivers whose initializers have already been moved to board_eth_init()/cpu_eth_init().
Signed-off-by: Ben Warren biggerbadderben@gmail.com
Nice. There are a few things though...
board/atmel/atngw100/atngw100.c | 3 +- board/atmel/atstk1000/atstk1000.c | 3 +-
Three new avr32-based boards are missing: hammerhead, favr-32-ezkit and mimc200.
Sorry I missed those.
I see a new warning:
/home/hskinnemoen/work/u-boot/upstream/include/netdev.h:58: warning: 'pci_eth_init' defined but not used
Yeah, that function should be inline. Stupid me.
Also, the drivers should include netdev.h as well, to catch mismatches when the prototype is changed.
The following patch fixes these three things, as far as avr32 is concerned at least. Might be a good idea to include netdev.h in the other drivers too.
OK, that makes sense.
diff --git a/board/earthlcd/favr-32-ezkit/favr-32-ezkit.c b/board/earthlcd/favr-32-ezkit/favr-32-ezkit.c index da69e75..da05589 100644 --- a/board/earthlcd/favr-32-ezkit/favr-32-ezkit.c +++ b/board/earthlcd/favr-32-ezkit/favr-32-ezkit.c @@ -18,6 +18,7 @@
- Place, Suite 330, Boston, MA 02111-1307 USA
*/ #include <common.h> +#include <netdev.h>
#include <asm/io.h> #include <asm/sdram.h> @@ -87,8 +88,6 @@ void board_init_info(void) }
#if defined(CONFIG_MACB) && defined(CONFIG_CMD_NET) -extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
int board_eth_init(bd_t *bi) { return macb_eth_initialize(0, (void *)MACB0_BASE, bi->bi_phy_id[0]); diff --git a/board/mimc/mimc200/mimc200.c b/board/mimc/mimc200/mimc200.c index 4ece11a..8516dcb 100644 --- a/board/mimc/mimc200/mimc200.c +++ b/board/mimc/mimc200/mimc200.c @@ -20,6 +20,7 @@
- MA 02111-1307 USA
*/ #include <common.h> +#include <netdev.h>
#include <asm/io.h> #include <asm/sdram.h> @@ -195,8 +196,6 @@ void spi_cs_deactivate(struct spi_slave *slave) #endif /* CONFIG_ATMEL_SPI */
#ifdef CONFIG_CMD_NET -extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
int board_eth_init(bd_t *bi) { macb_eth_initialize(0, (void *)MACB0_BASE, bi->bi_phy_id[0]); diff --git a/board/miromico/hammerhead/hammerhead.c b/board/miromico/hammerhead/hammerhead.c index 738ece2..d3875f4 100644 --- a/board/miromico/hammerhead/hammerhead.c +++ b/board/miromico/hammerhead/hammerhead.c @@ -25,6 +25,7 @@ #include "../cpu/at32ap/at32ap700x/sm.h"
#include <common.h> +#include <netdev.h>
#include <asm/io.h> #include <asm/sdram.h> @@ -51,8 +52,6 @@ static const struct sdram_config sdram_config = { .refresh_period = (781 * (SDRAMC_BUS_HZ / 1000)) / 100000, };
-extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
#ifdef CONFIG_CMD_NET int board_eth_init(bd_t *bis) { diff --git a/drivers/net/macb.c b/drivers/net/macb.c index aa39284..08bebf7 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -40,6 +40,7 @@ */
#include <net.h> +#include <netdev.h> #include <malloc.h>
#include <linux/mii.h> diff --git a/include/netdev.h b/include/netdev.h index a3a717c..610a2db 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -54,7 +54,7 @@ int uli526x_initialize(bd_t *bis);
- function to initialize whatever's on board.
- Return value is total # of devices found */
-static int pci_eth_init(bd_t *bis) +static inline int pci_eth_init(bd_t *bis) { int num = 0; #if defined(CONFIG_ULI526)
Thanks! I'll incorporate these changes into the next spin.
regards, Ben
participants (2)
-
Ben Warren
-
Haavard Skinnemoen