Skip to contentSkip to conversation

Introduce netdev.h header file and remove externs

PATCH New Ben Warren 2 participants 19 messages Aug 31, 2008

Subsystems (3)
lore
Share & tools
lore

Ben Warren

author
#0 lore raw

PATCH 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/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
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/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/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)
cpu/mpc83xx/cpu.c +1 -2
index 52e4476..21b7afa 100644
@@ -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)
cpu/mpc85xx/cpu.c +1 -2
index 2fe3cea..92410b4 100644
@@ -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)
cpu/mpc86xx/cpu.c +1 -2
index ecea5b0..7155ceb 100644
@@ -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)
include/netdev.h new file +67 -0

67 lines not on this page · raw message

Signature · 1 line
1.5.4.3
author
#1 lore raw

PATCH 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 4e508a0..d68988d 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 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 ++++++
 include/netdev.h                |    4 ++++
 net/eth.c                       |    5 -----
 4 files changed, 16 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);
+}
include/netdev.h +4 -0
index a3a717c..afd46ae 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 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
net/eth.c +0 -5
index d68988d..2639801 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 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       |    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(-)
board/freescale/mpc8544ds/mpc8544ds.c +8 -0
index 4e976b7..e16fff2 100644
@@ -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);
+}
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 +5 -0
index 5713a33..8cc727b 100644
@@ -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);
+}
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);
+}
include/netdev.h +4 -0
index afd46ae..9a5a26c 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 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
net/eth.c +0 -4
index 2639801..a3923bb 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 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 ++++++++++
 include/netdev.h                          |    1 +
 net/eth.c                                 |    4 ----
 3 files changed, 11 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;
+}
include/netdev.h +1 -0
index 9a5a26c..810d3e6 100644
@@ -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()
net/eth.c +0 -4
index a3923bb..1147709 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 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 ++++++
 include/netdev.h              |    4 ++++
 net/eth.c                     |    4 ----
 12 files changed, 64 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);
+}
include/netdev.h +4 -0
index 810d3e6..c8f4413 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);
@@ -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
net/eth.c +0 -4
index 1147709..9747138 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 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 +++++++
 include/netdev.h    |    4 ++++
 net/eth.c           |    4 ----
 3 files changed, 11 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);
+}
+
include/netdev.h +4 -0
index c8f4413..3a51ae4 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);
@@ -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
net/eth.c +0 -4
index 9747138..65dd888 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 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 ++++++
 include/netdev.h            |    5 +++++
 net/eth.c                   |    4 ----
 4 files changed, 17 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);
+}
include/netdev.h +5 -0
index 3a51ae4..79d6e4d 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);
@@ -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
net/eth.c +0 -4
index 65dd888..f23f27f 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 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/evb64260.c |    8 +++++++-
 include/netdev.h          |    1 +
 net/eth.c                 |    7 -------
 3 files changed, 8 insertions(+), 8 deletions(-)
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 79d6e4d..454a9a4 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);
+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);
net/eth.c +0 -7
index f23f27f..5a3d0e8 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 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 +++++++++
 include/netdev.h                      |    1 +
 net/eth.c                             |    4 ----
 3 files changed, 10 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;
+}
include/netdev.h +1 -0
index 454a9a4..bea9fac 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);
 int gt6426x_eth_initialize(bd_t *bis);
 int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
net/eth.c +0 -4
index 5a3d0e8..bedb4ff 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 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 |    2 +-
 include/netdev.h         |    1 +
 net/eth.c                |    4 ----
 4 files changed, 10 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 +1 -1
index d852a15..27c28c7 100644
@@ -199,7 +199,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 bea9fac..258248c 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);
 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);
net/eth.c +0 -4
index bedb4ff..93c18c5 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 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 +++++++++++++
 cpu/mpc5xxx/cpu.c |   13 +++++++++++++
 include/netdev.h  |    2 ++
 net/eth.c         |    4 ----
 4 files changed, 28 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
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
include/netdev.h +2 -0
index 258248c..f6b6052 100644
@@ -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);
net/eth.c +0 -4
index 93c18c5..4c7c912 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 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 +
 net/eth.c                           |    4 ----
 8 files changed, 12 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);
 }
net/eth.c +0 -4
index 4c7c912..fdd9a8a 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 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 |    4 ++--
 include/netdev.h          |    1 +
 net/eth.c                 |    4 ----
 4 files changed, 12 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 +2 -2
index dad842c..cc19304 100644
@@ -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)
include/netdev.h +1 -0
index f6b6052..746ab1c 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 fdd9a8a..ab9d034 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 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 +-
 include/netdev.h                    |    4 ++++
 net/eth.c                           |    4 ----
 6 files changed, 20 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;
 }
include/netdev.h +4 -0
index 746ab1c..9da05d9 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);
 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
net/eth.c +0 -4
index ab9d034..0761065 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 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 ++++++++
 include/netdev.h                |    4 ++++
 net/eth.c                       |    4 ----
 13 files changed, 78 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..e1a1d2b 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);
+}
+
include/netdev.h +4 -0
index 9da05d9..a775e50 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);
@@ -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
net/eth.c +0 -4
index 0761065..0dfeab6 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 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

---
 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(-)
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);
+}
include/netdev.h +4 -0
index a775e50..ef7f23e 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);
 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
net/eth.c +0 -4
index 0dfeab6..de85ed8 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
#17 lore raw

PATCH 1/17 Introduce netdev.h header file and remove externs

In reply to Ben Warren
Quoted 4 lines · Ben Warren

This addresses all drivers whose initializers have already been moved to board_eth_init()/cpu_eth_init().

Nice. There are a few things though...

Quoted 3 lines
---
 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.

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/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)
 {
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>
include/netdev.h +1 -1
index a3a717c..610a2db 100644
@@ -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)
author
#18 lore raw

PATCH 1/17 Introduce netdev.h header file and remove externs

Quoted 6 lines · Haavard Skinnemoen
Quoted 4 lines · Ben Warren

This addresses all drivers whose initializers have already been moved to board_eth_init()/cpu_eth_init().

Quoted 9 lines

Nice. There are a few things though...

Quoted 3 lines
---
 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.

Quoted 4 lines

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.

Quoted 7 lines

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.

Quoted 81 lines
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/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)
 {
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>
include/netdev.h +0 -0
index a3a717c..610a2db 100644

include/netdev.h int uli526x_initialize(bd_t *bis); · line 60

Quoted 8 lines
include/netdev.h +1 -1
@@ -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