@@ -75,10 +75,22 @@ int board_late_init (void)
return 0;
}
+#ifdef CONFIG_DRIVER_KS8695ETH
int board_eth_init(bd_t *bis)
{
+ uchar enetaddr[6];
+ const uchar * const fp=CONFIG_SYS_FLASH_BASE+0x1c000;
+
+ /* read MAC address from flash */
+ if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
+ memcpy(&enetaddr[0], fp, 6);
+ if (is_valid_ether_addr(enetaddr))
+ eth_setenv_enetaddr("ethaddr", enetaddr);
+ }
+
return ks8695_eth_initialize();
}
+#endif
int board_init (void)
{
@@ -75,10 +75,22 @@ int board_late_init (void)
return 0;
}
+#ifdef CONFIG_DRIVER_KS8695ETH
int board_eth_init(bd_t *bis)
{
+ uchar enetaddr[6];
+ const uchar * const fp=CONFIG_SYS_FLASH_BASE+0x1c000;
+
+ /* read MAC address from flash */
+ if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
+ memcpy(&enetaddr[0], fp, 6);
+ if (is_valid_ether_addr(enetaddr))
+ eth_setenv_enetaddr("ethaddr", enetaddr);
+ }
+
return ks8695_eth_initialize();
}
+#endif
int board_init (void)
{
Previously code to do this was in the Ethernet driver itself. Since it is board specific, moved it here, and altered it to support preset MAC from environment. Signed-off-by: Yann Vernier <yann.vernier@orsoc.se> --- board/cm4008/cm4008.c | 12 ++++++++++++ board/cm41xx/cm41xx.c | 12 ++++++++++++ 2 files changed, 24 insertions(+)