Commit e1d7480b5de1fd4830bf7cf5e2237d3b0846d08d

Authored by Ben Warren
1 parent a0aad08f94

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

Showing 11 changed files with 27 additions and 4 deletions Side-by-side Diff

board/bc3450/bc3450.c
... ... @@ -673,6 +673,7 @@
673 673  
674 674 int board_eth_init(bd_t *bis)
675 675 {
  676 + cpu_eth_init(bis); /* Built in FEC comes first */
676 677 return pci_eth_init(bis);
677 678 }
board/icecube/icecube.c
... ... @@ -394,6 +394,7 @@
394 394  
395 395 int board_eth_init(bd_t *bis)
396 396 {
  397 + cpu_eth_init(bis); /* Built in FEC comes first */
397 398 return pci_eth_init(bis);
398 399 }
board/matrix_vision/mvbc_p/mvbc_p.c
... ... @@ -35,6 +35,7 @@
35 35 #include <fpga.h>
36 36 #include <environment.h>
37 37 #include <fdt_support.h>
  38 +#include <netdev.h>
38 39 #include <asm/io.h>
39 40 #include "fpga.h"
40 41 #include "mvbc_p.h"
... ... @@ -323,5 +324,10 @@
323 324 {
324 325 ft_cpu_setup(blob, bd);
325 326 fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
  327 +}
  328 +
  329 +int board_eth_init(bd_t *bis)
  330 +{
  331 + return cpu_eth_init(bis); /* Built in FEC comes first */
326 332 }
... ... @@ -184,6 +184,7 @@
184 184  
185 185 int board_eth_init(bd_t *bis)
186 186 {
  187 + cpu_eth_init(bis); /* Built in FEC comes first */
187 188 return pci_eth_init(bis);
188 189 }
... ... @@ -325,6 +325,7 @@
325 325  
326 326 int board_eth_init(bd_t *bis)
327 327 {
  328 + cpu_eth_init(bis); /* Built in FEC comes first */
328 329 return pci_eth_init(bis);
329 330 }
board/total5200/total5200.c
... ... @@ -312,6 +312,7 @@
312 312  
313 313 int board_eth_init(bd_t *bis)
314 314 {
  315 + cpu_eth_init(bis); /* Built in FEC comes first */
315 316 return pci_eth_init(bis);
316 317 }
board/tqc/tqm5200/tqm5200.c
... ... @@ -753,6 +753,7 @@
753 753  
754 754 int board_eth_init(bd_t *bis)
755 755 {
  756 + cpu_eth_init(bis); /* Built in FEC comes first */
756 757 return pci_eth_init(bis);
757 758 }
... ... @@ -29,6 +29,7 @@
29 29 #include <watchdog.h>
30 30 #include <command.h>
31 31 #include <mpc5xxx.h>
  32 +#include <netdev.h>
32 33 #include <asm/io.h>
33 34 #include <asm/processor.h>
34 35  
... ... @@ -155,4 +156,16 @@
155 156 return (*save_addr & 0x0000ffff);
156 157 }
157 158 #endif /* CONFIG_BOOTCOUNT_LIMIT */
  159 +
  160 +#ifdef CONFIG_MPC5xxx_FEC
  161 +/* Default initializations for FEC controllers. To override,
  162 + * create a board-specific function called:
  163 + * int board_eth_init(bd_t *bis)
  164 + */
  165 +
  166 +int cpu_eth_init(bd_t *bis)
  167 +{
  168 + return mpc5xxx_fec_initialize(bis);
  169 +}
  170 +#endif
drivers/net/mpc5xxx_fec.c
... ... @@ -11,6 +11,7 @@
11 11 #include <mpc5xxx_sdma.h>
12 12 #include <malloc.h>
13 13 #include <net.h>
  14 +#include <netdev.h>
14 15 #include <miiphy.h>
15 16 #include "mpc5xxx_fec.h"
16 17  
... ... @@ -50,6 +50,7 @@
50 50 int mcdmafec_initialize(bd_t *bis);
51 51 int mcffec_initialize(bd_t *bis);
52 52 int mpc512x_fec_initialize(bd_t *bis);
  53 +int mpc5xxx_fec_initialize(bd_t *bis);
53 54 int natsemi_initialize(bd_t *bis);
54 55 int ns8382x_initialize(bd_t *bis);
55 56 int pcnet_initialize(bd_t *bis);
... ... @@ -44,7 +44,6 @@
44 44 extern int e1000_initialize(bd_t*);
45 45 extern int eepro100_initialize(bd_t*);
46 46 extern int fec_initialize(bd_t*);
47   -extern int mpc5xxx_fec_initialize(bd_t*);
48 47 extern int mpc8220_fec_initialize(bd_t*);
49 48 extern int mv6436x_eth_initialize(bd_t *);
50 49 extern int mv6446x_eth_initialize(bd_t *);
... ... @@ -172,9 +171,6 @@
172 171 #endif
173 172 #ifdef SCC_ENET
174 173 scc_initialize(bis);
175   -#endif
176   -#if defined(CONFIG_MPC5xxx_FEC)
177   - mpc5xxx_fec_initialize(bis);
178 174 #endif
179 175 #if defined(CONFIG_MPC8220_FEC)
180 176 mpc8220_fec_initialize(bis);