From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Ianovich Date: Sat, 14 Dec 2013 09:41:58 +0400 Subject: [U-Boot] [PATCH 2/4] arm: pxa: always init ethaddr for LP-8x4x In-Reply-To: <1386999720-23460-1-git-send-email-ynvich@gmail.com> References: <1386999720-23460-1-git-send-email-ynvich@gmail.com> Message-ID: <1386999720-23460-3-git-send-email-ynvich@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- 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; -- 1.8.4.2