ar71xx: use the new ar7240 switch driver on the DIR-600-A1 as well (fixes #7563)
[openwrt/svn-archive/archive.git] / target / linux / ar71xx / files / arch / mips / ar71xx / mach-dir-600-a1.c
index 42146f55c8222f0adfe0df2fb541e46538e6208c..5c36402e34835bd253c13fcfd67fd89547bb64ef 100644 (file)
@@ -96,14 +96,14 @@ static struct gpio_button dir_600_a1_gpio_buttons[] __initdata = {
        {
                .desc           = "reset",
                .type           = EV_KEY,
-               .code           = BTN_0,
+               .code           = KEY_RESTART,
                .threshold      = 3,
                .gpio           = DIR_600_A1_GPIO_BTN_RESET,
                .active_low     = 1,
        }, {
                .desc           = "wps",
                .type           = EV_KEY,
-               .code           = BTN_1,
+               .code           = KEY_WPS_BUTTON,
                .threshold      = 3,
                .gpio           = DIR_600_A1_GPIO_BTN_WPS,
                .active_low     = 1,
@@ -118,8 +118,11 @@ static void __init dir_600_a1_setup(void)
        u8 *mac = NULL;
 
        if (nvram_parse_mac_addr(nvram, DIR_600_A1_NVRAM_SIZE,
-                                "lan_mac=", mac_buff) == 0)
+                                "lan_mac=", mac_buff) == 0) {
+               ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
+               ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);
                mac = mac_buff;
+       }
 
        ar71xx_add_device_m25p80(&dir_600_a1_flash_data);
 
@@ -130,7 +133,24 @@ static void __init dir_600_a1_setup(void)
                                        ARRAY_SIZE(dir_600_a1_gpio_buttons),
                                        dir_600_a1_gpio_buttons);
 
-       ap91_eth_init(mac);
+       ar71xx_eth1_data.has_ar7240_switch = 1;
+       ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
+       ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);
+
+       /* WAN port */
+       ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
+       ar71xx_eth0_data.speed = SPEED_100;
+       ar71xx_eth0_data.duplex = DUPLEX_FULL;
+
+       /* LAN ports */
+       ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
+       ar71xx_eth1_data.speed = SPEED_1000;
+       ar71xx_eth1_data.duplex = DUPLEX_FULL;
+
+       ar71xx_add_device_mdio(0x0);
+       ar71xx_add_device_eth(1);
+       ar71xx_add_device_eth(0);
+
        ap91_pci_init(ee, mac);
 }