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/mpc86xx/cpu.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'cpu/mpc86xx') diff --git a/cpu/mpc86xx/cpu.c b/cpu/mpc86xx/cpu.c index e26bf36..4eaed05 100644 --- a/cpu/mpc86xx/cpu.c +++ b/cpu/mpc86xx/cpu.c @@ -290,3 +290,30 @@ void mpc86xx_reginfo(void) printf("\tBR7\t0x%08X\tOR7\t0x%08X \n", in_be32(&lbc->br7), in_be32(&lbc->or7)); } + +#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 +#if defined(CONFIG_TSEC3) + tsec_initialize(bis, 2, CONFIG_TSEC3_NAME); +#endif +#if defined(CONFIG_TSEC4) + tsec_initialize(bis, 3, CONFIG_TSEC4_NAME); +#endif + return 0; +} +#endif + -- cgit v1.1 From 4188f0491886b3b486164e819c0a83fdb97efd7d Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Thu, 10 Jul 2008 01:13:30 +0200 Subject: Minor coding style cleanup; update CHANGELOG Signed-off-by: Wolfgang Denk --- cpu/mpc86xx/cpu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'cpu/mpc86xx') diff --git a/cpu/mpc86xx/cpu.c b/cpu/mpc86xx/cpu.c index 4eaed05..7d2b591 100644 --- a/cpu/mpc86xx/cpu.c +++ b/cpu/mpc86xx/cpu.c @@ -315,5 +315,4 @@ int cpu_eth_init(bd_t *bis) #endif return 0; } -#endif - +#endif /* CONFIG_TSEC_ENET */ -- cgit v1.1