Introduce netdev.h header file and remove externs
Subsystems (3)
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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_6426xgt6426x_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
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
@@ -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
@@ -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
@@ -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
@@ -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_6426xgt6426x_eth_initialize (bis);#endif
Signature · 1 line
1.5.4.3
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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -3059,5 +3059,5 @@ e1000_initialize(bd_t * bis) card_number++; } -return 1 ; +return card_number; }
include/netdev.h +4 -0
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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) asmvolatile ("sync" ); } } + +int board_eth_init (bd_t *bis) +{ +return pci_eth_init (bis); +}
board/freescale/mpc8315erdb/mpc8315erdb.c +7 -0
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH 1/17 Introduce netdev.h header file and remove externs
In reply to Ben WarrenQuoted 4 lines · Ben Warren
This addresses all drivers whose initializers have already been moved to board_eth_init()/cpu_eth_init().
Signed-off-by Ben Warren <[email protected]>
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
@@ -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
@@ -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
@@ -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
@@ -40,6 +40,7 @@*/ #include <net.h> +#include <netdev.h> #include <malloc.h> #include <linux/mii.h>
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 )
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().
Signed-off-by Ben Warren <[email protected]>
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.has 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.hin the other drivers too.
OK, that makes sense.
Quoted 81 lines
board/earthlcd/favr-32-ezkit/favr-32-ezkit.c +1
-2@@ -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@@ -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@@ -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@@ -40,6 +40,7 @@*/ #include <net.h> +#include <netdev.h> #include <malloc.h> #include <linux/mii.h> include/netdev.h +0
-0
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