
I always used tftp in my test, so the first dm9000 on LP-8x4x was always properly initialized. However, if the boot doesn't include network related commands, linux will not find a valid MAC and will complain.
No longer.
Signed-off-by: Sergei Ianovich ynvich@gmail.com --- board/icpdas/lp8x4x/lp8x4x.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/board/icpdas/lp8x4x/lp8x4x.c b/board/icpdas/lp8x4x/lp8x4x.c index 1b68ef3..8396caa 100644 --- a/board/icpdas/lp8x4x/lp8x4x.c +++ b/board/icpdas/lp8x4x/lp8x4x.c @@ -112,10 +112,18 @@ void usb_board_stop(void) #ifdef CONFIG_DRIVER_DM9000 void lp8x4x_eth1_mac_init(void) { + u8 ethaddr[8]; u8 eth1addr[8]; int i; u8 reg;
+ eth_getenv_enetaddr_by_index("eth", 0, ethaddr); + if (is_valid_ether_addr(ethaddr)) { + for (i = 0, reg = 0x10; i < 6; i++, reg++) { + writeb(reg, (u8 *)(DM9000_IO)); + writeb(ethaddr[i], (u8 *)(DM9000_DATA)); + } + } eth_getenv_enetaddr_by_index("eth", 1, eth1addr); if (!is_valid_ether_addr(eth1addr)) return;