From dd35479a50f6c7c31ea491c07c5200c6dfd06a24 Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Mon, 23 Jun 2008 22:57:27 -0700 Subject: Add mechanisms for CPU and board-specific Ethernet initialization This patch is the first step in cleaning up net/eth.c, by moving Ethernet initialization to CPU or board-specific code. Initial implementation is only on the Freescale TSEC controller, but others will be added soon. Signed-off-by: Ben Warren --- cpu/mpc83xx/cpu.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'cpu/mpc83xx/cpu.c') diff --git a/cpu/mpc83xx/cpu.c b/cpu/mpc83xx/cpu.c index 36de78d2708..94d1a137e27 100644 --- a/cpu/mpc83xx/cpu.c +++ b/cpu/mpc83xx/cpu.c @@ -358,3 +358,23 @@ int dma_xfer(void *dest, u32 count, void *src) return ((int)dma_check()); } #endif /*CONFIG_DDR_ECC*/ + +#ifdef CONFIG_TSEC_ENET +/* Default initializations for TSEC controllers. To override, + * create a board-specific function called: + * int board_eth_init(bd_t *bis) + */ + +extern int tsec_initialize(bd_t * bis, int index, char *devname); + +int cpu_eth_init(bd_t *bis) +{ +#if defined(CONFIG_TSEC1) + tsec_initialize(bis, 0, CONFIG_TSEC1_NAME); +#endif +#if defined(CONFIG_TSEC2) + tsec_initialize(bis, 1, CONFIG_TSEC2_NAME); +#endif + return 0; +} +#endif -- cgit v1.2.3