1 --- a/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
2 +++ b/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
5 * Board setup for the Linksys WRT300N v2
7 + * Copyright (C) 2010 Alexandros C. Couloumbis <alex@ozo.com>
8 * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
10 * based on coyote-setup.c:
12 #include <linux/tty.h>
13 #include <linux/serial_8250.h>
14 #include <linux/slab.h>
15 +#include <linux/etherdevice.h>
17 #include <asm/types.h>
18 #include <asm/setup.h>
19 @@ -79,7 +81,8 @@ static struct platform_device wrt300nv2_
20 /* Built-in 10/100 Ethernet MAC interfaces */
21 static struct eth_plat_info wrt300nv2_plat_eth[] = {
24 + .phy = IXP4XX_ETH_PHY_MAX_ADDR,
25 + .phy_mask = 0x0F0000,
29 @@ -110,6 +113,10 @@ static struct platform_device *wrt300nv2
31 static void __init wrt300nv2_init(void)
39 wrt300nv2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
40 @@ -119,6 +126,32 @@ static void __init wrt300nv2_init(void)
41 *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
43 platform_add_devices(wrt300nv2_devices, ARRAY_SIZE(wrt300nv2_devices));
45 + f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x60000);
48 + for (i = 0; i < 6; i++) {
50 + wrt300nv2_plat_eth[0].hwaddr[i] = readb(f + 0x5FFA0 + i);
53 + wrt300nv2_plat_eth[1].hwaddr[i] = (wrt300nv2_plat_eth[0].hwaddr[i] + offset);
55 + wrt300nv2_plat_eth[0].hwaddr[i] = readb(f + 0x5FFA0 + (i^3));
58 + wrt300nv2_plat_eth[1].hwaddr[i] = (wrt300nv2_plat_eth[0].hwaddr[i] + offset);
64 + if (!(is_valid_ether_addr(wrt300nv2_plat_eth[0].hwaddr)))
65 + random_ether_addr(wrt300nv2_plat_eth[0].hwaddr);
66 + if (!(is_valid_ether_addr(wrt300nv2_plat_eth[1].hwaddr))) {
67 + memcpy(wrt300nv2_plat_eth[1].hwaddr, wrt300nv2_plat_eth[0].hwaddr, ETH_ALEN);
68 + wrt300nv2_plat_eth[1].hwaddr[5] = (wrt300nv2_plat_eth[0].hwaddr[5] + 1);
72 #ifdef CONFIG_MACH_WRT300NV2