ar71xx: change mac address initialization
[openwrt.git] / target / linux / ar71xx / files / arch / mips / ar71xx / mach-dir-615-c1.c
index d6f1fa7..260397b 100644 (file)
@@ -116,18 +116,23 @@ static struct gpio_button dir_615c1_gpio_buttons[] __initdata = {
        {
                .desc           = "reset",
                .type           = EV_KEY,
-               .code           = BTN_0,
-               .threshold      = 5,
+               .code           = KEY_RESTART,
+               .threshold      = 3,
                .gpio           = DIR_615C1_GPIO_BTN_RESET,
        }, {
                .desc           = "wps",
                .type           = EV_KEY,
-               .code           = BTN_1,
-               .threshold      = 5,
+               .code           = KEY_WPS_BUTTON,
+               .threshold      = 3,
                .gpio           = DIR_615C1_GPIO_BTN_WPS,
        }
 };
 
+#define DIR_615C1_LAN_PHYMASK  BIT(0)
+#define DIR_615C1_WAN_PHYMASK  BIT(4)
+#define DIR_615C1_MDIO_MASK    (~(DIR_615C1_LAN_PHYMASK | \
+                                  DIR_615C1_WAN_PHYMASK))
+
 static void __init dir_615c1_setup(void)
 {
        const char *config = (char *) KSEG1ADDR(DIR_615C1_CONFIG_ADDR);
@@ -137,19 +142,18 @@ static void __init dir_615c1_setup(void)
 
        if (nvram_parse_mac_addr(config, DIR_615C1_CONFIG_SIZE,
                                 "lan_mac=", mac) == 0) {
-               ar71xx_set_mac_base(mac);
+               ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
+               ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);
                wlan_mac = mac;
        }
 
-       ar71xx_add_device_mdio(0x0);
+       ar71xx_add_device_mdio(DIR_615C1_MDIO_MASK);
 
        ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
-       ar71xx_eth0_data.phy_mask = 0xf;
-       ar71xx_eth0_data.speed = SPEED_100;
-       ar71xx_eth0_data.duplex = DUPLEX_FULL;
+       ar71xx_eth0_data.phy_mask = DIR_615C1_LAN_PHYMASK;
 
        ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
-       ar71xx_eth1_data.phy_mask = 0x10;
+       ar71xx_eth1_data.phy_mask = DIR_615C1_WAN_PHYMASK;
 
        ar71xx_add_device_eth(0);
        ar71xx_add_device_eth(1);