Commit e1d7480b5de1fd4830bf7cf5e2237d3b0846d08d
1 parent
a0aad08f94
Exists in
master
and in
54 other branches
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
board/icecube/icecube.c
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 | } |
board/o2dnt/o2dnt.c
board/pm520/pm520.c
board/total5200/total5200.c
board/tqc/tqm5200/tqm5200.c
cpu/mpc5xxx/cpu.c
... | ... | @@ -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
include/netdev.h
... | ... | @@ -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); |
net/eth.c
... | ... | @@ -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); |