Skip to contentSkip to conversation

Introduce netdev.h header file and remove externs

PATCH New Ben Warren 2 participants 18 messages Sep 1, 2008

Subsystems (3)
lore
Share & tools
lore

Ben Warren

author
#0 lore raw

PATCH v2 1/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().

---
 board/atmel/atngw100/atngw100.c              |    3 +-
 board/atmel/atstk1000/atstk1000.c            |    3 +-
 board/bf537-stamp/bf537-stamp.c              |    3 +-
 board/earthlcd/favr-32-ezkit/favr-32-ezkit.c |    3 +-
 board/freescale/mpc8610hpcd/mpc8610hpcd.c    |    8 +--
 board/mimc/mimc200/mimc200.c                 |    3 +-
 board/miromico/hammerhead/hammerhead.c       |    3 +-
 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 +-
 drivers/net/bfin_mac.c                       |    1 +
 drivers/net/greth.c                          |    1 +
 drivers/net/macb.c                           |    1 +
 drivers/net/mcffec.c                         |    1 +
 drivers/net/sk98lin/uboot_drv.c              |    1 +
 drivers/net/uli526x.c                        |    1 +
 include/netdev.h                             |   66 ++++++++++++++++++++++++++
 22 files changed, 88 insertions(+), 34 deletions(-)
 create mode 100644 include/netdev.h
board/atmel/atngw100/atngw100.c +1 -2
index 7f3e485..fa1a2aa 100644
@@ -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)
 {
board/atmel/atstk1000/atstk1000.c +1 -2
index 915b1c3..94523b5 100644
@@ -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)
 {
board/bf537-stamp/bf537-stamp.c +1 -2
index a9b7a68..4567213 100644
@@ -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);
board/earthlcd/favr-32-ezkit/favr-32-ezkit.c +1 -2
index da69e75..da05589 100644
@@ -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]);
board/freescale/mpc8610hpcd/mpc8610hpcd.c +2 -6
index af79fc2..130f7aa 100644
@@ -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);
 }
board/mimc/mimc200/mimc200.c +1 -2
index 4ece11a..8516dcb 100644
@@ -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]);
board/miromico/hammerhead/hammerhead.c +1 -2
index 738ece2..d3875f4 100644
@@ -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)
 {
board/sl8245/sl8245.c +1 -2
index c853755..e66272e 100644
@@ -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;
cpu/leon2/cpu.c +1 -2
index 5de1c52..d6e23b1 100644
@@ -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)
 {
cpu/leon3/cpu.c +1 -1
index 1725fdb..976f311 100644
@@ -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)
cpu/mcf523x/cpu.c +1 -2
index 8d2152d..bdc152f 100644
@@ -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);
cpu/mcf52x2/cpu.c +1 -2
index 2af31cb..167097a 100644
@@ -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);
cpu/mcf532x/cpu.c +1 -2
index 20d0d5c..260d6e6 100644
@@ -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);
cpu/mcf5445x/cpu.c +1 -2
index ab342dd..a30c327 100644
@@ -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);
cpu/mcf547x_8x/cpu.c +1 -3
index 1ba7aa8..ab4ad28 100644
@@ -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)
drivers/net/bfin_mac.c +1 -0
index 3ee5d96..c5e74b8 100644
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <config.h>
 #include <net.h>
+#include <netdev.h>
 #include <command.h>
 #include <malloc.h>
 
drivers/net/greth.c +1 -0
index 90c5338..79bc4d9 100644
@@ -27,6 +27,7 @@
 #include <common.h>
 #include <command.h>
 #include <net.h>
+#include <netdev.h>
 #include <malloc.h>
 #include <asm/processor.h>
 #include <ambapp.h>
drivers/net/macb.c +1 -0
index aa39284..08bebf7 100644
@@ -40,6 +40,7 @@
  */
 
 #include <net.h>
+#include <netdev.h>
 #include <malloc.h>
 
 #include <linux/mii.h>
drivers/net/mcffec.c +1 -0
index 50d6508..f93cf59 100644
@@ -32,6 +32,7 @@
 
 #include <command.h>
 #include <net.h>
+#include <netdev.h>
 #include <miiphy.h>
 
 #undef	ET_DEBUG
drivers/net/sk98lin/uboot_drv.c +1 -0
index 205e7d2..0199b33 100644
@@ -24,6 +24,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 
 #include "h/skdrv1st.h"
 #include "h/skdrv2nd.h"
drivers/net/uli526x.c +1 -0
index d87638c..9ea5ac2 100644
@@ -16,6 +16,7 @@
 #include <common.h>
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <asm/io.h>
 #include <pci.h>
 #include <miiphy.h>
include/netdev.h new file +66 -0

66 lines not on this page · raw message

Signature · 1 line
1.5.4.3
author
#1 lore raw

PATCH v2 2/17 Moved initialization of Ethernet controllers on Atmel AT91 to board_eth_init()

Removed at91sam9_eth_initialize() from net/eth.c

---
 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
board/atmel/at91cap9adk/at91cap9adk.c +11 -0
index c5082a0..787d64d 100644
@@ -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;
+}
board/atmel/at91sam9260ek/at91sam9260ek.c +11 -0
index 06d8512..913e3fb 100644
@@ -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;
+}
board/atmel/at91sam9263ek/at91sam9263ek.c +11 -0
index 927fc91..c705074 100644
@@ -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;
+}
cpu/arm926ejs/at91/Makefile +0 -1
index 44cde1a..2d2a888 100644
@@ -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
cpu/arm926ejs/at91/ether.c deleted +0 -35
deleted file mode 100644
index 7e11fe4..0000000
@@ -1,35 +0,0 @@
-/*
- * (C) Copyright 2007-2008
- * Stelian Pop <[email protected]>
- * 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
net/eth.c +0 -5
index 85fa0da..71feb07 100644
@@ -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");
Signature · 1 line
1.5.4.3
author
#2 lore raw

PATCH v2 3/17 Moved initialization of RTL8169 Ethernet controller to board_eth_init()

Affected boards:

	linkstation
	r7780mp

Removed initialization of the driver from net/eth.c

---
 board/linkstation/linkstation.c |    6 ++++++
 board/r7780mp/r7780mp.c         |    6 ++++++
 drivers/net/rtl8169.c           |    1 +
 include/netdev.h                |    4 ++++
 net/eth.c                       |    5 -----
 5 files changed, 17 insertions(+), 5 deletions(-)
board/linkstation/linkstation.c +6 -0
index 241cf03..afb96ae 100644
@@ -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);
+}
board/r7780mp/r7780mp.c +6 -0
index 19c35d3..efbeec9 100644
@@ -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);
+}
drivers/net/rtl8169.c +1 -0
index 7c00926..e9f6391 100644
@@ -55,6 +55,7 @@
 #include <common.h>
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <asm/io.h>
 #include <pci.h>
 
include/netdev.h +4 -0
index 3ec9212..954de39 100644
@@ -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 uli526x_initialize(bd_t *bis);
 
@@ -56,6 +57,9 @@ int uli526x_initialize(bd_t *bis);
 static inline 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
net/eth.c +0 -5
index 71feb07..69f66b4 100644
@@ -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);
Signature · 1 line
1.5.4.3
author
#3 lore raw

PATCH v2 4/17 Moved initialization of RTL8139 Ethernet controller to board_eth_init()

Affected boards:

	hidden_dragon
	MPC8544DS
	MPC8610HPCN
	R2DPLUS
	TB0229

Removed initialization of the driver from net/eth.c

---
 board/freescale/mpc8544ds/mpc8544ds.c     |    8 ++++----
 board/freescale/mpc8641hpcn/mpc8641hpcn.c |    8 ++++++++
 board/hidden_dragon/hidden_dragon.c       |    6 ++++++
 board/r2dplus/r2dplus.c                   |    5 +++++
 board/tb0229/tb0229.c                     |    5 +++++
 drivers/net/rtl8139.c                     |    1 +
 include/netdev.h                          |    4 ++++
 net/eth.c                                 |    4 ----
 8 files changed, 33 insertions(+), 8 deletions(-)
board/freescale/mpc8544ds/mpc8544ds.c +4 -4
index 1e29773..eaf6fa3 100644
@@ -33,6 +33,7 @@
 #include <libfdt.h>
 #include <fdt_support.h>
 #include <tsec.h>
+#include <netdev.h>
 
 #include "../common/pixis.h"
 #include "../common/sgmii_riser.h"
@@ -465,9 +466,9 @@ get_board_sys_clk(ulong dummy)
 	return val;
 }
 
-#ifdef CONFIG_TSEC_ENET
 int board_eth_init(bd_t *bis)
 {
+#ifdef CONFIG_TSEC_ENET
 	struct tsec_info_struct tsec_info[2];
 	volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
 	uint io_sel = (gur->pordevsr & MPC85xx_PORDEVSR_IO_SEL) >> 19;
@@ -497,10 +498,9 @@ int board_eth_init(bd_t *bis)
 
 
 	tsec_eth_init(bis, tsec_info, num);
-
-	return 0;
-}
 #endif
+	return pci_eth_init(bis);
+}
 
 #if defined(CONFIG_OF_BOARD_SETUP)
 
board/freescale/mpc8641hpcn/mpc8641hpcn.c +8 -0
index 1bb563e..97f7f49 100644
@@ -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);
+}
board/hidden_dragon/hidden_dragon.c +6 -0
index 5713a33..2d7a787 100644
@@ -27,6 +27,7 @@
 #include <common.h>
 #include <mpc824x.h>
 #include <pci.h>
+#include <netdev.h>
 
 int checkboard (void)
 {
@@ -93,3 +94,8 @@ void pci_init_board(void)
 {
 	pci_mpc824x_init(&hose);
 }
+
+int board_eth_init(bd_t *bis)
+{
+	return pci_eth_init(bis);
+}
board/r2dplus/r2dplus.c +5 -0
index 8fb8ff6..b962dd1 100644
@@ -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);
+}
board/tb0229/tb0229.c +5 -0
index 921bd3a..2abb4a7 100644
@@ -46,3 +46,8 @@ int checkboard (void)
 
 	return 0;
 }
+
+int board_eth_init(bd_t *bis)
+{
+	return pci_eth_init(bis);
+}
drivers/net/rtl8139.c +1 -0
index 4fd20ac..d378ce3 100644
@@ -74,6 +74,7 @@
 #include <common.h>
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <asm/io.h>
 #include <pci.h>
 
include/netdev.h +4 -0
index 954de39..b333755 100644
@@ -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 uli526x_initialize(bd_t *bis);
@@ -57,6 +58,9 @@ int uli526x_initialize(bd_t *bis);
 static inline 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
net/eth.c +0 -4
index 69f66b4..092d426 100644
@@ -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);
Signature · 1 line
1.5.4.3
author
#4 lore raw

PATCH v2 5/17 Moved initialization of TSI108 Ethernet controller to board_eth_init()

Affected boards:

	mpc7448hpc2

Removed initialization of the driver from net/eth.c

---
 board/freescale/mpc7448hpc2/mpc7448hpc2.c |   10 ++++++++++
 drivers/net/tsi108_eth.c                  |    1 +
 include/netdev.h                          |    1 +
 net/eth.c                                 |    4 ----
 4 files changed, 12 insertions(+), 4 deletions(-)
board/freescale/mpc7448hpc2/mpc7448hpc2.c +10 -0
index 6f74c31..cfdbed5 100644
@@ -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;
+}
drivers/net/tsi108_eth.c +1 -0
index 2534097..50fa765 100644
@@ -34,6 +34,7 @@
 #include <common.h>
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <asm/cache.h>
 
 #ifdef DEBUG
include/netdev.h +1 -0
index b333755..5f6b38f 100644
@@ -49,6 +49,7 @@ 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 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()
net/eth.c +0 -4
index 092d426..65ebf2d 100644
@@ -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);
Signature · 1 line
1.5.4.3
author
#5 lore raw

PATCH v2 6/17 Moved initialization of NS8382X Ethernet controller to board_eth_init()

Affected boards:

	bc3450
	cpci5200
	mecp5200
	pf2000
	icecube
	o2dnt
	pm520
	sandpoint8245
	total5200
	tqm5200

Removed initialization of the driver from net/eth.c

---
 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 ++++++
 drivers/net/ns8382x.c         |    1 +
 include/netdev.h              |    4 ++++
 net/eth.c                     |    4 ----
 13 files changed, 65 insertions(+), 4 deletions(-)
board/bc3450/bc3450.c +6 -0
index a728dc6..e27c234 100644
@@ -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);
+}
board/esd/cpci5200/cpci5200.c +6 -0
index 20130ac..2a42e65 100644
@@ -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;
board/esd/mecp5200/mecp5200.c +6 -0
index 6d776b7..ff44abd 100644
@@ -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);
+}
board/esd/pf5200/pf5200.c +6 -0
index 7970f89..c4c0221 100644
@@ -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);
board/icecube/icecube.c +6 -0
index 760db73..2ab86be 100644
@@ -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);
+}
board/o2dnt/o2dnt.c +6 -0
index a4eed3a..37832de 100644
@@ -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);
+}
board/pm520/pm520.c +6 -0
index 83d9bcd..c9610fb 100644
@@ -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);
+}
board/sandpoint/sandpoint.c +6 -0
index 7429647..832baa2 100644
@@ -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);
+}
board/total5200/total5200.c +6 -0
index 1ae24c4..c1848fc 100644
@@ -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);
+}
board/tqc/tqm5200/tqm5200.c +6 -0
index 8b8e461..d75aa9b 100644
@@ -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);
+}
drivers/net/ns8382x.c +1 -0
index bb58438..a2d61af 100644
@@ -53,6 +53,7 @@
 #include <common.h>
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <asm/io.h>
 #include <pci.h>
 
include/netdev.h +4 -0
index 5f6b38f..97eff7a 100644
@@ -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);
@@ -59,6 +60,9 @@ int uli526x_initialize(bd_t *bis);
 static inline 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
net/eth.c +0 -4
index 65ebf2d..b846cad 100644
@@ -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);
Signature · 1 line
1.5.4.3
author
#6 lore raw

PATCH v2 7/17 Moved initialization of NATSEMI Ethernet controller to board_eth_init()

Affected boards:

	a3000

Removed initialization of the driver from net/eth.c

---
 board/a3000/a3000.c   |    7 +++++++
 drivers/net/natsemi.c |    1 +
 include/netdev.h      |    4 ++++
 net/eth.c             |    4 ----
 4 files changed, 12 insertions(+), 4 deletions(-)
board/a3000/a3000.c +7 -0
index c1eceaa..040ba89 100644
@@ -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);
+}
+
drivers/net/natsemi.c +1 -0
index 4aee048..ff8d2d7 100644
@@ -53,6 +53,7 @@
 #include <common.h>
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <asm/io.h>
 #include <pci.h>
 
include/netdev.h +4 -0
index 97eff7a..c5b0815 100644
@@ -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);
@@ -60,6 +61,9 @@ int uli526x_initialize(bd_t *bis);
 static inline 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
net/eth.c +0 -4
index b846cad..dc7b288 100644
@@ -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);
Signature · 1 line
1.5.4.3
author
#7 lore raw

PATCH v2 8/17 Moved initialization of PCNET Ethernet controller to board_eth_init()

Affected boards:

	PN62
	sc520_cdp

Removed initialization of the driver from net/eth.c

---
 board/pn62/pn62.c           |    6 ++++++
 board/sc520_cdp/sc520_cdp.c |    6 ++++++
 drivers/net/pcnet.c         |    1 +
 include/netdev.h            |    5 +++++
 net/eth.c                   |    4 ----
 5 files changed, 18 insertions(+), 4 deletions(-)
board/pn62/pn62.c +6 -0
index d905b29..60fc431 100644
@@ -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);
+}
board/sc520_cdp/sc520_cdp.c +6 -0
index 8050aa6..f21c730 100644
@@ -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);
+}
drivers/net/pcnet.c +1 -0
index a4f0214..99b6942 100644
@@ -26,6 +26,7 @@
 #include <common.h>
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <asm/io.h>
 #include <pci.h>
 
include/netdev.h +5 -0
index c5b0815..b1dadd8 100644
@@ -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);
@@ -61,6 +62,10 @@ int uli526x_initialize(bd_t *bis);
 static inline 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
net/eth.c +0 -4
index dc7b288..aa6b2c8 100644
@@ -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
Signature · 1 line
1.5.4.3
author
#8 lore raw

PATCH v2 9/17 Moved initialization of GT6426x Ethernet controller to board_eth_init()

Affected boards:

	EVB64260
	P3G4
	ZUMA

Removed initialization of the driver from net/eth.c

---
 board/evb64260/eth.c      |    1 +
 board/evb64260/evb64260.c |    8 +++++++-
 include/netdev.h          |    1 +
 net/eth.c                 |    7 -------
 4 files changed, 9 insertions(+), 8 deletions(-)
board/evb64260/eth.c +1 -0
index fa5b6d4..ca8bab5 100644
@@ -27,6 +27,7 @@ Skeleton NIC driver for Etherboot
 #include <asm/cache.h>
 #include <miiphy.h>
 #include <net.h>
+#include <netdev.h>
 
 #include "eth.h"
 #include "eth_addrtbl.h"
board/evb64260/evb64260.c +7 -1
index ab59941..bc108d0 100644
@@ -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;
+}
include/netdev.h +1 -0
index b1dadd8..666d12d 100644
@@ -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);
+void 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);
net/eth.c +0 -7
index aa6b2c8..99efa16 100644
@@ -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);
Signature · 1 line
1.5.4.3
author
#9 lore raw

PATCH v2 10/17 Moved initialization of 3COM Ethernet controller (AmigaOne) to board_eth_init()

Affected boards:
AmigaOneG3SE

Removed initialization of the driver from net/eth.c

---
 board/MAI/AmigaOneG3SE/AmigaOneG3SE.c |    9 +++++++++
 board/MAI/AmigaOneG3SE/enet.c         |    1 +
 include/netdev.h                      |    1 +
 net/eth.c                             |    4 ----
 4 files changed, 11 insertions(+), 4 deletions(-)
board/MAI/AmigaOneG3SE/AmigaOneG3SE.c +9 -0
index e118563..4d44001 100644
@@ -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;
+}
board/MAI/AmigaOneG3SE/enet.c +1 -0
index 5a90cc5..0b4dfe6 100644
@@ -28,6 +28,7 @@
 #include <common.h>
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <asm/io.h>
 #include <pci.h>
 
include/netdev.h +1 -0
index 666d12d..0c16dd6 100644
@@ -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);
 void gt6426x_eth_initialize(bd_t *bis);
 int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
net/eth.c +0 -4
index 99efa16..c4d7b63 100644
@@ -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);
Signature · 1 line
1.5.4.3
author
#10 lore raw

PATCH v2 11/17 Moved initialization of IncaIP Ethernet controller to board_eth_init

Affected boards:
IncaIP

Removed initialization of the driver from net/eth.c

---
 board/incaip/incaip.c    |    8 ++++++++
 drivers/net/inca-ip_sw.c |    3 ++-
 include/netdev.h         |    1 +
 net/eth.c                |    4 ----
 4 files changed, 11 insertions(+), 5 deletions(-)
board/incaip/incaip.c +8 -0
index ac7ad8f..6fe852c 100644
@@ -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
drivers/net/inca-ip_sw.c +2 -1
index d852a15..492f5ce 100644
@@ -28,6 +28,7 @@
 
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <asm/inca-ip.h>
 #include <asm/addrspace.h>
 
@@ -199,7 +200,7 @@ int inca_switch_initialize(bd_t * bis)
 	printf("Leaving inca_switch_initialize()\n");
 #endif
 
-	return 1;
+	return 0;
 }
 
 
include/netdev.h +1 -0
index 0c16dd6..f28039e 100644
@@ -45,6 +45,7 @@ int bfin_EMAC_initialize(bd_t *bis);
 int eth_3com_initialize (bd_t * bis);
 int greth_initialize(bd_t *bis);
 void 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);
net/eth.c +0 -4
index c4d7b63..0dfa70d 100644
@@ -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
Signature · 1 line
1.5.4.3
author
#11 lore raw

PATCH v2 12/17 Moved initialization of MPC512x_FEC Ethernet driver to CPU directory

Added a cpu_eth_init() function to MPC512x CPU directory and removed code from net/eth.c

---
 cpu/mpc512x/cpu.c         |   13 +++++++++++++
 drivers/net/mpc512x_fec.c |    1 +
 include/netdev.h          |    1 +
 net/eth.c                 |    4 ----
 4 files changed, 15 insertions(+), 4 deletions(-)
cpu/mpc512x/cpu.c +13 -0
index 1f39ac4..d432d99 100644
@@ -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
drivers/net/mpc512x_fec.c +1 -0
index 7caeeda..54283fb 100644
@@ -10,6 +10,7 @@
 #include <mpc512x.h>
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <miiphy.h>
 #include "mpc512x_fec.h"
 
include/netdev.h +1 -0
index f28039e..487d319 100644
@@ -49,6 +49,7 @@ 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 natsemi_initialize(bd_t *bis);
 int ns8382x_initialize(bd_t *bis);
 int pcnet_initialize(bd_t *bis);
net/eth.c +0 -4
index 0dfa70d..b61d0fc 100644
@@ -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
Signature · 1 line
1.5.4.3
author
#12 lore raw

PATCH v2 13/17 Moved initialization of MPC5xxx_FEC Ethernet driver to CPU directory

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

---
 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 +
 cpu/mpc5xxx/cpu.c                   |   13 +++++++++++++
 drivers/net/mpc5xxx_fec.c           |    1 +
 include/netdev.h                    |    1 +
 net/eth.c                           |    4 ----
 11 files changed, 27 insertions(+), 4 deletions(-)
board/bc3450/bc3450.c +1 -0
index e27c234..7ddf74c 100644
@@ -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);
 }
board/icecube/icecube.c +1 -0
index 2ab86be..d84ab3a 100644
@@ -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);
 }
board/matrix_vision/mvbc_p/mvbc_p.c +6 -0
index 3332f5a..648b45e 100644
@@ -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 */
+}
board/o2dnt/o2dnt.c +1 -0
index 37832de..19faf52 100644
@@ -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);
 }
board/pm520/pm520.c +1 -0
index c9610fb..a9d63cc 100644
@@ -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);
 }
board/total5200/total5200.c +1 -0
index c1848fc..ec00a67 100644
@@ -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);
 }
board/tqc/tqm5200/tqm5200.c +1 -0
index d75aa9b..5152331 100644
@@ -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);
 }
cpu/mpc5xxx/cpu.c +13 -0
index 0ed2899..1326c3c 100644
@@ -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
drivers/net/mpc5xxx_fec.c +1 -0
index 3d3eb8b..f8618b1 100644
@@ -11,6 +11,7 @@
 #include <mpc5xxx_sdma.h>
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <miiphy.h>
 #include "mpc5xxx_fec.h"
 
include/netdev.h +1 -0
index 487d319..f7738cc 100644
@@ -50,6 +50,7 @@ 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);
net/eth.c +0 -4
index b61d0fc..053179e 100644
@@ -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
Signature · 1 line
1.5.4.3
author
#13 lore raw

PATCH v2 14/17 Moved initialization of plb2800 Ethernet driver to board_eth_init

Affected boards:
purple

Removed initialization of controller from net/eth.c

---
 board/purple/purple.c     |    9 +++++++++
 drivers/net/plb2800_eth.c |    5 +++--
 include/netdev.h          |    1 +
 net/eth.c                 |    4 ----
 4 files changed, 13 insertions(+), 6 deletions(-)
board/purple/purple.c +9 -0
index 9775591..c129d7a 100644
@@ -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
+
drivers/net/plb2800_eth.c +3 -2
index dad842c..d799c73 100644
@@ -26,6 +26,7 @@
 #include <common.h>
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <asm/addrspace.h>
 
 
@@ -105,7 +106,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 +141,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)
include/netdev.h +1 -0
index f7738cc..1013a80 100644
@@ -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);
net/eth.c +0 -4
index 053179e..42c370b 100644
@@ -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
Signature · 1 line
1.5.4.3
author
#14 lore raw

PATCH v2 15/17 Moved initialization of E1000 Ethernet controller to board_eth_init()

Affected boards:

	ap1000
	mvbc_p
	PM854

Removed initialization of the driver from net/eth.c

---
 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 +-
 drivers/net/e1000.h                 |    1 +
 include/netdev.h                    |    4 ++++
 net/eth.c                           |    4 ----
 7 files changed, 21 insertions(+), 6 deletions(-)
board/amirix/ap1000/ap1000.c +7 -0
index 55277e7..8f30ed9 100644
@@ -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);
+}
+
board/matrix_vision/mvbc_p/mvbc_p.c +2 -1
index 648b45e..c88c4a6 100644
@@ -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);
 }
board/pm854/pm854.c +6 -0
index 7dbafb9..f366814 100644
@@ -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);
+}
drivers/net/e1000.c +1 -1
index c8b4e98..2dcaa2c 100644
@@ -3059,5 +3059,5 @@ e1000_initialize(bd_t * bis)
 
 		card_number++;
 	}
-	return 1;
+	return card_number;
 }
drivers/net/e1000.h +1 -0
index c258bc2..08042a8 100644
@@ -36,6 +36,7 @@
 #include <common.h>
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <asm/io.h>
 #include <pci.h>
 
include/netdev.h +4 -0
index 1013a80..fa4d92d 100644
@@ -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);
 void gt6426x_eth_initialize(bd_t *bis);
@@ -69,6 +70,9 @@ static inline 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
net/eth.c +0 -4
index 42c370b..f9a9957 100644
@@ -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
Signature · 1 line
1.5.4.3
author
#15 lore raw

PATCH v2 16/17 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

---
 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 ++++++++
 drivers/net/dc2114x.c           |    1 +
 include/netdev.h                |    4 ++++
 net/eth.c                       |    4 ----
 14 files changed, 79 insertions(+), 4 deletions(-)
board/cu824/cu824.c +6 -0
index ecf6328..0fd4223 100644
@@ -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);
+}
board/eltec/bab7xx/bab7xx.c +6 -0
index af52352..8c56116 100644
@@ -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);
+}
board/esd/adciop/adciop.c +6 -0
index 0f655b7..63aaf2c 100644
@@ -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);
+}
board/esd/dasa_sim/dasa_sim.c +6 -0
index fb0c77e..e061878 100644
@@ -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);
+}
board/mousse/mousse.c +6 -0
index f8f1529..7b61266 100644
@@ -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);
+}
board/mpc8540eval/mpc8540eval.c +12 -0
index 7c54458..028a70f 100644
@@ -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);
+}
board/musenki/musenki.c +6 -0
index b2b70e7..6f9eeb2 100644
@@ -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);
+}
board/mvblue/mvblue.c +6 -0
index a979102..056fee7 100644
@@ -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
board/pcippc2/pcippc2.c +6 -0
index c1917c1..a3dbdc8 100644
@@ -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);
+}
board/sbc8240/sbc8240.c +6 -0
index 175720d..075e377 100644
@@ -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);
+}
board/stxssa/stxssa.c +8 -0
index 124e123..71e9b08 100644
@@ -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);
+}
+
drivers/net/dc2114x.c +1 -0
index 8117239..c0137a7 100644
@@ -21,6 +21,7 @@
 #include <common.h>
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <pci.h>
 
 #undef DEBUG_SROM
include/netdev.h +4 -0
index fa4d92d..d8d1209 100644
@@ -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);
@@ -70,6 +71,9 @@ static inline 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
net/eth.c +0 -4
index f9a9957..ab37bc2 100644
@@ -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);
Signature · 1 line
1.5.4.3
author
#16 lore raw

PATCH v2 17/17 Moved initialization of EEPRO100 Ethernet controller to board_eth_init()

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 Also, wrapped contents of pci_eth_init() by CONFIG_PCI.

---
 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 ++++++
 drivers/net/eepro100.c                    |    1 +
 include/netdev.h                          |    8 ++++++++
 net/eth.c                                 |    4 ----
 30 files changed, 170 insertions(+), 4 deletions(-)
board/Marvell/db64360/db64360.c +6 -0
index 2a810a6..c03d03d 100644
@@ -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);
+}
board/Marvell/db64460/db64460.c +6 -0
index 1ae898d..8a05cd2 100644
@@ -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);
+}
board/amcc/katmai/katmai.c +6 -0
index 08d89d7..172b581 100644
@@ -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);
+}
board/amcc/taihu/taihu.c +6 -0
index 254e3eb..266f260 100644
@@ -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);
+}
board/amcc/taishan/taishan.c +6 -0
index fdd82e7..cd432cb 100644
@@ -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);
+}
board/amcc/yucca/yucca.c +6 -0
index 84c3938..e0c1268 100644
@@ -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);
+}
board/cpc45/cpc45.c +6 -0
index f4e867c..16ead75 100644
@@ -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);
+}
board/cpu87/cpu87.c +6 -0
index f5a5de5..454987c 100644
@@ -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);
+}
board/eXalion/eXalion.c +6 -0
index 385b498..c5dff24 100644
@@ -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);
+}
board/eltec/elppc/elppc.c +6 -0
index 1b70605..d3ac278 100644
@@ -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);
+}
board/etin/debris/debris.c +6 -0
index 763760f..3fcf78e 100644
@@ -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);
+}
board/etin/kvme080/kvme080.c +6 -0
index bfd6854..be6924d 100644
@@ -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);
+}
board/freescale/mpc8315erdb/mpc8315erdb.c +7 -0
index 3eecee2..0330218 100644
@@ -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);
+}
board/integratorap/integratorap.c +7 -0
index e659907..687c486 100644
@@ -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);
+}
board/ixdp425/ixdp425.c +6 -0
index e0d7637..b379c75 100644
@@ -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);
+}
board/oxc/oxc.c +6 -0
index b61d399..eb7eeb8 100644
@@ -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);
+}
board/pm826/pm826.c +6 -0
index 7ee3ab6..d8b0929 100644
@@ -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);
+}
board/pm828/pm828.c +6 -0
index 6038e97..b163d5b 100644
@@ -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);
+}
board/pm854/pm854.c +1 -0
index f366814..90523bd 100644
@@ -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);
 }
board/pm856/pm856.c +7 -0
index bd4c065..ee33286 100644
@@ -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);
+}
board/ppmc7xx/ppmc7xx.c +6 -0
index 061e01e..9c87c10 100644
@@ -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);
+}
board/sc3/sc3.c +6 -0
index 3d1a654..6c82fe7 100644
@@ -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);
+}
board/sc520_spunk/sc520_spunk.c +6 -0
index 038d479..0b11caa 100644
@@ -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);
+}
board/sorcery/sorcery.c +6 -0
index 2b789d4..e4fb146 100644
@@ -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);
+}
board/tqc/tqm8272/tqm8272.c +6 -0
index a0ec254..3a2376c 100644
@@ -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);
+}
board/tqc/tqm85xx/tqm85xx.c +7 -0
index ae3c245..0e5bc2f 100644
@@ -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);
+}
board/utx8245/utx8245.c +6 -0
index e2a961a..e7ca669 100644
@@ -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);
+}
drivers/net/eepro100.c +1 -0
index 9de0fb5..d6539c0 100644
@@ -24,6 +24,7 @@
 #include <common.h>
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <asm/io.h>
 #include <pci.h>
 #include <miiphy.h>
include/netdev.h +8 -0
index d8d1209..8b181f7 100644
@@ -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);
 void gt6426x_eth_initialize(bd_t *bis);
@@ -71,6 +72,11 @@ static inline int pci_eth_init(bd_t *bis)
 {
 	int num = 0;
 
+#ifdef CONFIG_PCI
+
+#ifdef CONFIG_EEPRO100
+	num += eepro100_initialize(bis);
+#endif
 #ifdef CONFIG_TULIP
 	num += dc21x4x_initialize(bis);
 #endif
@@ -95,6 +101,8 @@ static inline int pci_eth_init(bd_t *bis)
 #if defined(CONFIG_ULI526)
 	num += uli526x_initialize(bis);
 #endif
+
+#endif  /* CONFIG_PCI */
 	return num;
 }
 
net/eth.c +0 -4
index ab37bc2..432dd60 100644
@@ -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);
Signature · 1 line
1.5.4.3