diff options
| author | Ben Warren <biggerbadderben@gmail.com> | 2008-08-26 22:16:25 -0700 | 
|---|---|---|
| committer | Ben Warren <biggerbadderben@gmail.com> | 2008-08-26 22:16:25 -0700 | 
| commit | 86882b80771309bceb11c6accfd7f6f90ade8bfc (patch) | |
| tree | 0004ca8c6e9c31b0ee46f0dd07f49e01711e75ef | |
| parent | b31da88b9c160d80d42a59cbbb31e24f27184d5c (diff) | |
| download | olio-uboot-2014.01-86882b80771309bceb11c6accfd7f6f90ade8bfc.tar.xz olio-uboot-2014.01-86882b80771309bceb11c6accfd7f6f90ade8bfc.zip | |
Moved initialization of MCFFEC Ethernet driver to CPU directory
Added a cpu_eth_init() function to coldfire CPU directories and
removed code from net/eth.c
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
| -rw-r--r-- | cpu/mcf523x/cpu.c | 14 | ||||
| -rw-r--r-- | cpu/mcf52x2/cpu.c | 15 | ||||
| -rw-r--r-- | cpu/mcf532x/cpu.c | 14 | ||||
| -rw-r--r-- | cpu/mcf5445x/cpu.c | 14 | ||||
| -rw-r--r-- | cpu/mcf547x_8x/cpu.c | 16 | ||||
| -rw-r--r-- | drivers/net/mcffec.c | 2 | ||||
| -rw-r--r-- | net/eth.c | 4 | 
7 files changed, 72 insertions, 7 deletions
| diff --git a/cpu/mcf523x/cpu.c b/cpu/mcf523x/cpu.c index f0d954b3f..8d2152d9c 100644 --- a/cpu/mcf523x/cpu.c +++ b/cpu/mcf523x/cpu.c @@ -107,3 +107,17 @@ int watchdog_init(void)  	return (0);  }  #endif				/* CONFIG_WATCHDOG */ + +#if defined(CONFIG_MCFFEC) +/* Default initializations for MCFFEC controllers.  To override, + * create a board-specific function called: + * 	int board_eth_init(bd_t *bis) + */ + +extern int mcffec_initialize(bd_t*); + +int cpu_eth_init(bd_t *bis) +{ +	return mcffec_initialize(bis); +} +#endif diff --git a/cpu/mcf52x2/cpu.c b/cpu/mcf52x2/cpu.c index d5d3d339c..2af31cbb9 100644 --- a/cpu/mcf52x2/cpu.c +++ b/cpu/mcf52x2/cpu.c @@ -321,3 +321,18 @@ int do_reset(cmd_tbl_t * cmdtp, bd_t * bd, int flag, int argc, char *argv[])  	return 0;  };  #endif + +#if defined(CONFIG_MCFFEC) +/* Default initializations for MCFFEC controllers.  To override, + * create a board-specific function called: + * 	int board_eth_init(bd_t *bis) + */ + +extern int mcffec_initialize(bd_t*); + +int cpu_eth_init(bd_t *bis) +{ +	return mcffec_initialize(bis); +} +#endif + diff --git a/cpu/mcf532x/cpu.c b/cpu/mcf532x/cpu.c index 61541ab0f..20d0d5cf2 100644 --- a/cpu/mcf532x/cpu.c +++ b/cpu/mcf532x/cpu.c @@ -129,3 +129,17 @@ int watchdog_init(void)  	return (0);  }  #endif				/* CONFIG_WATCHDOG */ + +#if defined(CONFIG_MCFFEC) +/* Default initializations for MCFFEC controllers.  To override, + * create a board-specific function called: + * 	int board_eth_init(bd_t *bis) + */ + +extern int mcffec_initialize(bd_t*); + +int cpu_eth_init(bd_t *bis) +{ +	return mcffec_initialize(bis); +} +#endif diff --git a/cpu/mcf5445x/cpu.c b/cpu/mcf5445x/cpu.c index e601b8949..ab342ddeb 100644 --- a/cpu/mcf5445x/cpu.c +++ b/cpu/mcf5445x/cpu.c @@ -95,3 +95,17 @@ int checkcpu(void)  	return 0;  } + +#if defined(CONFIG_MCFFEC) +/* Default initializations for MCFFEC controllers.  To override, + * create a board-specific function called: + * 	int board_eth_init(bd_t *bis) + */ + +extern int mcffec_initialize(bd_t*); + +int cpu_eth_init(bd_t *bis) +{ +	return mcffec_initialize(bis); +} +#endif diff --git a/cpu/mcf547x_8x/cpu.c b/cpu/mcf547x_8x/cpu.c index e29b45c4c..1ba7aa80a 100644 --- a/cpu/mcf547x_8x/cpu.c +++ b/cpu/mcf547x_8x/cpu.c @@ -142,11 +142,23 @@ int watchdog_init(void)  }  #endif				/* CONFIG_HW_WATCHDOG */ -#if defined(CONFIG_FSLDMAFEC) +#if defined(CONFIG_FSLDMAFEC) || defined(CONFIG_MCFFEC) +/* Default initializations for MCFFEC controllers.  To override, + * create a board-specific function called: + * 	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)  { -	return mcdmafec_initialize(bis); +#if defined(CONFIG_FSLDMAFEC) +	mcdmafec_initialize(bis); +#endif +#if defined(CONFIG_MCFFEC) +	mcffec_initialize(bis); +#endif +	return 0;  }  #endif diff --git a/drivers/net/mcffec.c b/drivers/net/mcffec.c index 58ed5e32c..6e69b466b 100644 --- a/drivers/net/mcffec.c +++ b/drivers/net/mcffec.c @@ -599,5 +599,5 @@ int mcffec_initialize(bd_t * bis)  	/* default speed */  	bis->bi_ethspeed = 10; -	return 1; +	return 0;  } @@ -70,7 +70,6 @@ extern int npe_initialize(bd_t *);  extern int uec_initialize(int);  extern int bfin_EMAC_initialize(bd_t *);  extern int greth_initialize(bd_t *); -extern int mcffec_initialize(bd_t*);  extern int at91sam9_eth_initialize(bd_t *);  #ifdef CONFIG_API @@ -271,9 +270,6 @@ int eth_initialize(bd_t *bis)  #if defined(CONFIG_GRETH)  	greth_initialize(bis);  #endif -#if defined(CONFIG_MCFFEC) -	mcffec_initialize(bis); -#endif  #if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \      defined(CONFIG_AT91SAM9263)  	at91sam9_eth_initialize(bis); |