From 89973f8a82c28ad893c4c3cc56839a8e10fe5f13 Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Sun, 31 Aug 2008 22:22:04 -0700 Subject: Introduce netdev.h header file and remove externs This addresses all drivers whose initializers have already been moved to board_eth_init()/cpu_eth_init(). Signed-off-by: Ben Warren --- include/netdev.h | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 include/netdev.h (limited to 'include/netdev.h') diff --git a/include/netdev.h b/include/netdev.h new file mode 100644 index 0000000000..3ec9212ce1 --- /dev/null +++ b/include/netdev.h @@ -0,0 +1,66 @@ +/* + * (C) Copyright 2008 + * Benjamin Warren, biggerbadderben@gmail.com + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +/* + * netdev.h - definitions an prototypes for network devices + */ + +#ifndef _NETDEV_H_ +#define _NETDEV_H_ + +/* + * Board and CPU-specific initialization functions + * board_eth_init() has highest priority. cpu_eth_init() only + * gets called if board_eth_init() isn't instantiated or fails. + * Return values: + * 0: success + * -1: failure + */ + +int board_eth_init(bd_t *bis); +int cpu_eth_init(bd_t *bis); + +/* Driver initialization prototypes */ +int bfin_EMAC_initialize(bd_t *bis); +int greth_initialize(bd_t *bis); +int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); +int mcdmafec_initialize(bd_t *bis); +int mcffec_initialize(bd_t *bis); +int skge_initialize(bd_t *bis); +int uli526x_initialize(bd_t *bis); + +/* Boards with PCI network controllers can call this from their board_eth_init() + * function to initialize whatever's on board. + * Return value is total # of devices found */ + +static inline int pci_eth_init(bd_t *bis) +{ + int num = 0; +#if defined(CONFIG_ULI526) + num += uli526x_initialize(bis); +#endif + return num; +} + +#endif /* _NETDEV_H_ */ + -- cgit From 02d69891d95ee76b0e86e1715a4dc0b964a57cb7 Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Sun, 31 Aug 2008 09:49:42 -0700 Subject: Moved initialization of RTL8169 Ethernet controller to board_eth_init() Affected boards: linkstation r7780mp Removed initialization of the driver from net/eth.c Signed-off-by: Ben Warren --- include/netdev.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/netdev.h') diff --git a/include/netdev.h b/include/netdev.h index 3ec9212ce1..954de39185 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -46,6 +46,7 @@ int greth_initialize(bd_t *bis); int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); int mcdmafec_initialize(bd_t *bis); int mcffec_initialize(bd_t *bis); +int rtl8169_initialize(bd_t *bis); int skge_initialize(bd_t *bis); int uli526x_initialize(bd_t *bis); @@ -56,6 +57,9 @@ int uli526x_initialize(bd_t *bis); static inline int pci_eth_init(bd_t *bis) { int num = 0; +#if defined(CONFIG_RTL8169) + num += rtl8169_initialize(bis); +#endif #if defined(CONFIG_ULI526) num += uli526x_initialize(bis); #endif -- cgit From 0b252f50ae218ae15bfb63af44227972686ebc56 Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Sun, 31 Aug 2008 21:41:08 -0700 Subject: 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 Signed-off-by: Ben Warren --- include/netdev.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/netdev.h') diff --git a/include/netdev.h b/include/netdev.h index 954de39185..b333755ba0 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -46,6 +46,7 @@ int greth_initialize(bd_t *bis); int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); int mcdmafec_initialize(bd_t *bis); int mcffec_initialize(bd_t *bis); +int rtl8139_initialize(bd_t *bis); int rtl8169_initialize(bd_t *bis); int skge_initialize(bd_t *bis); int uli526x_initialize(bd_t *bis); @@ -57,6 +58,9 @@ int uli526x_initialize(bd_t *bis); static inline int pci_eth_init(bd_t *bis) { int num = 0; +#if defined(CONFIG_RTL8139) + num += rtl8139_initialize(bis); +#endif #if defined(CONFIG_RTL8169) num += rtl8169_initialize(bis); #endif -- cgit From ccdd12f83ef93719fbe85f642aa4dc648b9498f0 Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Sun, 31 Aug 2008 09:59:33 -0700 Subject: Moved initialization of TSI108 Ethernet controller to board_eth_init() Affected boards: mpc7448hpc2 Removed initialization of the driver from net/eth.c Signed-off-by: Ben Warren --- include/netdev.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/netdev.h') diff --git a/include/netdev.h b/include/netdev.h index b333755ba0..5f6b38f3db 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -49,6 +49,7 @@ int mcffec_initialize(bd_t *bis); int rtl8139_initialize(bd_t *bis); int rtl8169_initialize(bd_t *bis); int skge_initialize(bd_t *bis); +int tsi108_eth_initialize(bd_t *bis); int uli526x_initialize(bd_t *bis); /* Boards with PCI network controllers can call this from their board_eth_init() -- cgit From 19403633dd70333893c2da7926a1d0dcd6dab7d8 Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Sun, 31 Aug 2008 10:03:22 -0700 Subject: 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 Signed-off-by: Ben Warren --- include/netdev.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/netdev.h') diff --git a/include/netdev.h b/include/netdev.h index 5f6b38f3db..97eff7a700 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -46,6 +46,7 @@ int greth_initialize(bd_t *bis); int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); int mcdmafec_initialize(bd_t *bis); int mcffec_initialize(bd_t *bis); +int ns8382x_initialize(bd_t *bis); int rtl8139_initialize(bd_t *bis); int rtl8169_initialize(bd_t *bis); int skge_initialize(bd_t *bis); @@ -59,6 +60,9 @@ int uli526x_initialize(bd_t *bis); static inline int pci_eth_init(bd_t *bis) { int num = 0; +#ifdef CONFIG_NS8382X + num += ns8382x_initialize(bis); +#endif #if defined(CONFIG_RTL8139) num += rtl8139_initialize(bis); #endif -- cgit From b902b8dda5e1fd4d5fe2f202c71ee3521d2c40ed Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Sun, 31 Aug 2008 10:07:16 -0700 Subject: Moved initialization of NATSEMI Ethernet controller to board_eth_init() Affected boards: a3000 Removed initialization of the driver from net/eth.c Signed-off-by: Ben Warren --- include/netdev.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/netdev.h') diff --git a/include/netdev.h b/include/netdev.h index 97eff7a700..c5b0815e04 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -46,6 +46,7 @@ int greth_initialize(bd_t *bis); int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); int mcdmafec_initialize(bd_t *bis); int mcffec_initialize(bd_t *bis); +int natsemi_initialize(bd_t *bis); int ns8382x_initialize(bd_t *bis); int rtl8139_initialize(bd_t *bis); int rtl8169_initialize(bd_t *bis); @@ -60,6 +61,9 @@ int uli526x_initialize(bd_t *bis); static inline int pci_eth_init(bd_t *bis) { int num = 0; +#ifdef CONFIG_NATSEMI + num += natsemi_initialize(bis); +#endif #ifdef CONFIG_NS8382X num += ns8382x_initialize(bis); #endif -- cgit From e3090534d62045dcb73f5392bacc64a4e8e443dc Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Sun, 31 Aug 2008 10:08:43 -0700 Subject: Moved initialization of PCNET Ethernet controller to board_eth_init() Affected boards: PN62 sc520_cdp Removed initialization of the driver from net/eth.c Signed-off-by: Ben Warren --- include/netdev.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/netdev.h') diff --git a/include/netdev.h b/include/netdev.h index c5b0815e04..b1dadd84b3 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -48,6 +48,7 @@ int mcdmafec_initialize(bd_t *bis); int mcffec_initialize(bd_t *bis); int natsemi_initialize(bd_t *bis); int ns8382x_initialize(bd_t *bis); +int pcnet_initialize(bd_t *bis); int rtl8139_initialize(bd_t *bis); int rtl8169_initialize(bd_t *bis); int skge_initialize(bd_t *bis); @@ -61,6 +62,10 @@ int uli526x_initialize(bd_t *bis); static inline int pci_eth_init(bd_t *bis) { int num = 0; + +#ifdef CONFIG_PCNET + num += pcnet_initialize(bis); +#endif #ifdef CONFIG_NATSEMI num += natsemi_initialize(bis); #endif -- cgit From 6aca145e067efe75398e9fac97822bd3700de0b2 Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Sun, 31 Aug 2008 10:13:34 -0700 Subject: Moved initialization of GT6426x Ethernet controller to board_eth_init() Affected boards: EVB64260 P3G4 ZUMA Removed initialization of the driver from net/eth.c Signed-off-by: Ben Warren --- include/netdev.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/netdev.h') diff --git a/include/netdev.h b/include/netdev.h index b1dadd84b3..666d12d389 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -43,6 +43,7 @@ int cpu_eth_init(bd_t *bis); /* Driver initialization prototypes */ int bfin_EMAC_initialize(bd_t *bis); int greth_initialize(bd_t *bis); +void gt6426x_eth_initialize(bd_t *bis); int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); int mcdmafec_initialize(bd_t *bis); int mcffec_initialize(bd_t *bis); -- cgit From 164846eeb25cb2a5ede7ab9371fdca7f4831a055 Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Sun, 31 Aug 2008 10:15:26 -0700 Subject: Moved initialization of 3COM Ethernet controller (AmigaOne) to board_eth_init() Affected boards: AmigaOneG3SE Removed initialization of the driver from net/eth.c Signed-off-by: Ben Warren --- include/netdev.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/netdev.h') diff --git a/include/netdev.h b/include/netdev.h index 666d12d389..0c16dd612c 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -42,6 +42,7 @@ int cpu_eth_init(bd_t *bis); /* Driver initialization prototypes */ int bfin_EMAC_initialize(bd_t *bis); +int eth_3com_initialize (bd_t * bis); int greth_initialize(bd_t *bis); void gt6426x_eth_initialize(bd_t *bis); int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); -- cgit From 8218bd2aa68820b878a8413493ae17fd8d21f944 Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Sun, 31 Aug 2008 10:16:59 -0700 Subject: Moved initialization of IncaIP Ethernet controller to board_eth_init Affected boards: IncaIP Removed initialization of the driver from net/eth.c Signed-off-by: Ben Warren --- include/netdev.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/netdev.h') diff --git a/include/netdev.h b/include/netdev.h index 0c16dd612c..f28039ea06 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -45,6 +45,7 @@ int bfin_EMAC_initialize(bd_t *bis); int eth_3com_initialize (bd_t * bis); int greth_initialize(bd_t *bis); void gt6426x_eth_initialize(bd_t *bis); +int inca_switch_initialize(bd_t *bis); int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); int mcdmafec_initialize(bd_t *bis); int mcffec_initialize(bd_t *bis); -- cgit From a0aad08f9427ac00218bdb2cb649833ce6ec9b8d Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Sun, 31 Aug 2008 10:36:38 -0700 Subject: 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 Signed-off-by: Ben Warren --- include/netdev.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/netdev.h') diff --git a/include/netdev.h b/include/netdev.h index f28039ea06..487d319b78 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -49,6 +49,7 @@ int inca_switch_initialize(bd_t *bis); int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); int mcdmafec_initialize(bd_t *bis); int mcffec_initialize(bd_t *bis); +int mpc512x_fec_initialize(bd_t *bis); int natsemi_initialize(bd_t *bis); int ns8382x_initialize(bd_t *bis); int pcnet_initialize(bd_t *bis); -- cgit From e1d7480b5de1fd4830bf7cf5e2237d3b0846d08d Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Sun, 31 Aug 2008 10:39:12 -0700 Subject: 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 Signed-off-by: Ben Warren --- include/netdev.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/netdev.h') diff --git a/include/netdev.h b/include/netdev.h index 487d319b78..f7738cc463 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -50,6 +50,7 @@ int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); int mcdmafec_initialize(bd_t *bis); int mcffec_initialize(bd_t *bis); int mpc512x_fec_initialize(bd_t *bis); +int mpc5xxx_fec_initialize(bd_t *bis); int natsemi_initialize(bd_t *bis); int ns8382x_initialize(bd_t *bis); int pcnet_initialize(bd_t *bis); -- cgit From 4fce2aceaf8afd31a252bc782c9dbc497bf40487 Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Sun, 31 Aug 2008 10:40:51 -0700 Subject: Moved initialization of plb2800 Ethernet driver to board_eth_init Affected boards: purple Removed initialization of controller from net/eth.c Signed-off-by: Ben Warren --- include/netdev.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/netdev.h') diff --git a/include/netdev.h b/include/netdev.h index f7738cc463..1013a803ab 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -54,6 +54,7 @@ int mpc5xxx_fec_initialize(bd_t *bis); int natsemi_initialize(bd_t *bis); int ns8382x_initialize(bd_t *bis); int pcnet_initialize(bd_t *bis); +int plb2800_eth_initialize(bd_t *bis); int rtl8139_initialize(bd_t *bis); int rtl8169_initialize(bd_t *bis); int skge_initialize(bd_t *bis); -- cgit From ad3381cf4167120db5c7b88e4970245e1d5c0a32 Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Sun, 31 Aug 2008 10:44:19 -0700 Subject: 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 Signed-off-by: Ben Warren --- include/netdev.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/netdev.h') diff --git a/include/netdev.h b/include/netdev.h index 1013a803ab..fa4d92d755 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -42,6 +42,7 @@ int cpu_eth_init(bd_t *bis); /* Driver initialization prototypes */ int bfin_EMAC_initialize(bd_t *bis); +int e1000_initialize(bd_t *bis); int eth_3com_initialize (bd_t * bis); int greth_initialize(bd_t *bis); void gt6426x_eth_initialize(bd_t *bis); @@ -69,6 +70,9 @@ static inline int pci_eth_init(bd_t *bis) { int num = 0; +#ifdef CONFIG_E1000 + num += e1000_initialize(bis); +#endif #ifdef CONFIG_PCNET num += pcnet_initialize(bis); #endif -- cgit From 8ca0b3f99c4fce7a599dcaf92ae095496dc8c8e0 Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Sun, 31 Aug 2008 10:45:44 -0700 Subject: Moved initialization of TULIP Ethernet controller to board_eth_init() Affected boards: cu824 bab7xx adciop dasa_sim mousse mpc8540eval musenki mvblue pcippc2/pcippc6 sbc8240 stxssa Removed initialization of the driver from net/eth.c Signed-off-by: Ben Warren --- include/netdev.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/netdev.h') diff --git a/include/netdev.h b/include/netdev.h index fa4d92d755..d8d1209dff 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -42,6 +42,7 @@ int cpu_eth_init(bd_t *bis); /* Driver initialization prototypes */ int bfin_EMAC_initialize(bd_t *bis); +int dc21x4x_initialize(bd_t *bis); int e1000_initialize(bd_t *bis); int eth_3com_initialize (bd_t * bis); int greth_initialize(bd_t *bis); @@ -70,6 +71,9 @@ static inline int pci_eth_init(bd_t *bis) { int num = 0; +#ifdef CONFIG_TULIP + num += dc21x4x_initialize(bis); +#endif #ifdef CONFIG_E1000 num += e1000_initialize(bis); #endif -- cgit From 10efa024b8ffd9e6aaca63da8bddfdffdc672274 Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Sun, 31 Aug 2008 20:37:00 -0700 Subject: Moved initialization of EEPRO100 Ethernet controller to board_eth_init() Affected boards: db64360 db64460 katmai taihu taishan yucca cpc45 cpu87 eXalion elppc debris kvme080 mpc8315erdb integratorap ixdp425 oxc pm826 pm828 pm854 pm856 ppmc7xx sc3 sc520_spunk sorcery tqm8272 tqm85xx utx8245 Removed initialization of the driver from net/eth.c Also, wrapped contents of pci_eth_init() by CONFIG_PCI. Signed-off-by: Ben Warren --- include/netdev.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/netdev.h') diff --git a/include/netdev.h b/include/netdev.h index d8d1209dff..8b181f77e1 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -44,6 +44,7 @@ int cpu_eth_init(bd_t *bis); int bfin_EMAC_initialize(bd_t *bis); int dc21x4x_initialize(bd_t *bis); int e1000_initialize(bd_t *bis); +int eepro100_initialize(bd_t *bis); int eth_3com_initialize (bd_t * bis); int greth_initialize(bd_t *bis); void gt6426x_eth_initialize(bd_t *bis); @@ -71,6 +72,11 @@ static inline int pci_eth_init(bd_t *bis) { int num = 0; +#ifdef CONFIG_PCI + +#ifdef CONFIG_EEPRO100 + num += eepro100_initialize(bis); +#endif #ifdef CONFIG_TULIP num += dc21x4x_initialize(bis); #endif @@ -95,6 +101,8 @@ static inline int pci_eth_init(bd_t *bis) #if defined(CONFIG_ULI526) num += uli526x_initialize(bis); #endif + +#endif /* CONFIG_PCI */ return num; } -- cgit