Commit 19403633dd70333893c2da7926a1d0dcd6dab7d8

Authored by Ben Warren
1 parent ccdd12f83e

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 <biggerbadderben@gmail.com>

Showing 13 changed files with 65 additions and 4 deletions Side-by-side Diff

board/bc3450/bc3450.c
... ... @@ -33,6 +33,7 @@
33 33 #include <common.h>
34 34 #include <mpc5xxx.h>
35 35 #include <pci.h>
  36 +#include <netdev.h>
36 37  
37 38 #ifdef CONFIG_VIDEO_SM501
38 39 #include <sm501.h>
... ... @@ -669,4 +670,9 @@
669 670 }
670 671  
671 672 #endif /* CONFIG_VIDEO_SM501 */
  673 +
  674 +int board_eth_init(bd_t *bis)
  675 +{
  676 + return pci_eth_init(bis);
  677 +}
board/esd/cpci5200/cpci5200.c
... ... @@ -32,6 +32,7 @@
32 32 #include <mpc5xxx.h>
33 33 #include <pci.h>
34 34 #include <command.h>
  35 +#include <netdev.h>
35 36  
36 37 #include "mt46v16m16-75.h"
37 38  
... ... @@ -257,6 +258,11 @@
257 258 *(vu_long *) MPC5XXX_SIMPLEIO_GPIO_DATA_OUTPUT |= GPIO_USB0;
258 259 __asm__ volatile ("sync");
259 260 }
  261 +}
  262 +
  263 +int board_eth_init(bd_t *bis)
  264 +{
  265 + return pci_eth_init(bis);
260 266 }
261 267  
262 268 int do_writepci(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
board/esd/mecp5200/mecp5200.c
... ... @@ -32,6 +32,7 @@
32 32 #include <mpc5xxx.h>
33 33 #include <pci.h>
34 34 #include <command.h>
  35 +#include <netdev.h>
35 36  
36 37 #include "mt46v16m16-75.h"
37 38  
... ... @@ -258,5 +259,10 @@
258 259 *(vu_long *) MPC5XXX_SIMPLEIO_GPIO_DATA_OUTPUT |= GPIO_USB0;
259 260 __asm__ volatile ("sync");
260 261 }
  262 +}
  263 +
  264 +int board_eth_init(bd_t *bis)
  265 +{
  266 + return pci_eth_init(bis);
261 267 }
board/esd/pf5200/pf5200.c
... ... @@ -32,6 +32,7 @@
32 32 #include <mpc5xxx.h>
33 33 #include <pci.h>
34 34 #include <command.h>
  35 +#include <netdev.h>
35 36  
36 37 #include "mt46v16m16-75.h"
37 38  
... ... @@ -262,6 +263,11 @@
262 263  
263 264 *(vu_char *) (CFG_CS1_START + 1) = 0x02; /* Disable driver for KB11 */
264 265 __asm__ volatile ("sync");
  266 +}
  267 +
  268 +int board_eth_init(bd_t *bis)
  269 +{
  270 + return pci_eth_init(bis);
265 271 }
266 272  
267 273 void power_set_reset(int power)
board/icecube/icecube.c
... ... @@ -29,6 +29,7 @@
29 29 #include <pci.h>
30 30 #include <asm/processor.h>
31 31 #include <libfdt.h>
  32 +#include <netdev.h>
32 33  
33 34 #if defined(CONFIG_LITE5200B)
34 35 #include "mt46v32m16.h"
... ... @@ -390,4 +391,9 @@
390 391 ft_cpu_setup(blob, bd);
391 392 }
392 393 #endif
  394 +
  395 +int board_eth_init(bd_t *bis)
  396 +{
  397 + return pci_eth_init(bis);
  398 +}
... ... @@ -27,6 +27,7 @@
27 27 #include <common.h>
28 28 #include <mpc5xxx.h>
29 29 #include <pci.h>
  30 +#include <netdev.h>
30 31  
31 32 #define SDRAM_MODE 0x00CD0000
32 33 #define SDRAM_CONTROL 0x504F0000
... ... @@ -180,4 +181,9 @@
180 181 pci_mpc5xxx_init(&hose);
181 182 }
182 183 #endif
  184 +
  185 +int board_eth_init(bd_t *bis)
  186 +{
  187 + return pci_eth_init(bis);
  188 +}
... ... @@ -27,6 +27,7 @@
27 27 #include <common.h>
28 28 #include <mpc5xxx.h>
29 29 #include <pci.h>
  30 +#include <netdev.h>
30 31  
31 32 #if defined(CONFIG_MPC5200_DDR)
32 33 #include "mt46v16m16-75.h"
... ... @@ -321,4 +322,9 @@
321 322 doc_probe (CFG_DOC_BASE);
322 323 }
323 324 #endif
  325 +
  326 +int board_eth_init(bd_t *bis)
  327 +{
  328 + return pci_eth_init(bis);
  329 +}
board/sandpoint/sandpoint.c
... ... @@ -24,6 +24,7 @@
24 24 #include <common.h>
25 25 #include <mpc824x.h>
26 26 #include <pci.h>
  27 +#include <netdev.h>
27 28  
28 29 int checkboard (void)
29 30 {
... ... @@ -98,5 +99,10 @@
98 99 void pci_init_board(void)
99 100 {
100 101 pci_mpc824x_init(&hose);
  102 +}
  103 +
  104 +int board_eth_init(bd_t *bis)
  105 +{
  106 + return pci_eth_init(bis);
101 107 }
board/total5200/total5200.c
... ... @@ -27,6 +27,7 @@
27 27 #include <common.h>
28 28 #include <mpc5xxx.h>
29 29 #include <pci.h>
  30 +#include <netdev.h>
30 31  
31 32 #include "sdram.h"
32 33  
... ... @@ -308,4 +309,9 @@
308 309 }
309 310  
310 311 #endif /* CONFIG_VIDEO_SED13806 */
  312 +
  313 +int board_eth_init(bd_t *bis)
  314 +{
  315 + return pci_eth_init(bis);
  316 +}
board/tqc/tqm5200/tqm5200.c
... ... @@ -32,6 +32,7 @@
32 32 #include <pci.h>
33 33 #include <asm/processor.h>
34 34 #include <libfdt.h>
  35 +#include <netdev.h>
35 36  
36 37 #ifdef CONFIG_VIDEO_SM501
37 38 #include <sm501.h>
... ... @@ -749,4 +750,9 @@
749 750 fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
750 751 }
751 752 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
  753 +
  754 +int board_eth_init(bd_t *bis)
  755 +{
  756 + return pci_eth_init(bis);
  757 +}
drivers/net/ns8382x.c
... ... @@ -53,6 +53,7 @@
53 53 #include <common.h>
54 54 #include <malloc.h>
55 55 #include <net.h>
  56 +#include <netdev.h>
56 57 #include <asm/io.h>
57 58 #include <pci.h>
58 59  
... ... @@ -46,6 +46,7 @@
46 46 int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
47 47 int mcdmafec_initialize(bd_t *bis);
48 48 int mcffec_initialize(bd_t *bis);
  49 +int ns8382x_initialize(bd_t *bis);
49 50 int rtl8139_initialize(bd_t *bis);
50 51 int rtl8169_initialize(bd_t *bis);
51 52 int skge_initialize(bd_t *bis);
... ... @@ -59,6 +60,9 @@
59 60 static inline int pci_eth_init(bd_t *bis)
60 61 {
61 62 int num = 0;
  63 +#ifdef CONFIG_NS8382X
  64 + num += ns8382x_initialize(bis);
  65 +#endif
62 66 #if defined(CONFIG_RTL8139)
63 67 num += rtl8139_initialize(bis);
64 68 #endif
... ... @@ -56,7 +56,6 @@
56 56 extern int mv6436x_eth_initialize(bd_t *);
57 57 extern int mv6446x_eth_initialize(bd_t *);
58 58 extern int natsemi_initialize(bd_t*);
59   -extern int ns8382x_initialize(bd_t*);
60 59 extern int pcnet_initialize(bd_t*);
61 60 extern int plb2800_eth_initialize(bd_t*);
62 61 extern int ppc_4xx_eth_initialize(bd_t *);
... ... @@ -237,9 +236,6 @@
237 236 #endif
238 237 #ifdef CONFIG_NATSEMI
239 238 natsemi_initialize(bis);
240   -#endif
241   -#ifdef CONFIG_NS8382X
242   - ns8382x_initialize(bis);
243 239 #endif
244 240 if (!eth_devices) {
245 241 puts ("No ethernet found.\n");