[U-Boot] [PATCH 2/4] arm: pxa: always init ethaddr for LP-8x4x
Marek Vasut
marex at denx.de
Sat Dec 14 13:30:30 CET 2013
On Saturday, December 14, 2013 at 06:41:58 AM, Sergei Ianovich wrote:
> 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 at 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;
Please pass the ethernet address via DT, will that not work for you ?
Best regards,
Marek Vasut
More information about the U-Boot
mailing list