Pass in tsec_info struct through tsec_initialize
The tsec driver contains a hard-coded array of configuration information
for the tsec ethernet controllers. We create a default function that works
for most tsecs, and allow that to be overridden by board code. It creates
an array of tsec_info structures, which are then parsed by the corresponding
driver instance to determine configuration. Also, add regs, miiregs, and
devname fields to the tsec_info structure, so that we don't need the kludgy
"index" parameter.
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
diff --git a/cpu/mpc83xx/cpu.c b/cpu/mpc83xx/cpu.c
index 52e4476..5862acd 100644
--- a/cpu/mpc83xx/cpu.c
+++ b/cpu/mpc83xx/cpu.c
@@ -32,6 +32,7 @@
#include <mpc83xx.h>
#include <asm/processor.h>
#include <libfdt.h>
+#include <tsec.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -358,22 +359,15 @@
}
#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)
+/*
+ * Initializes on-chip ethernet controllers.
+ * to override, implement board_eth_init()
*/
-
-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);
+#if defined(CONFIG_TSEC_ENET)
+ tsec_standard_init(bis);
#endif
-#if defined(CONFIG_TSEC2)
- tsec_initialize(bis, 1, CONFIG_TSEC2_NAME);
-#endif
+
return 0;
}
-#endif