ar71xx: enable the ar7240 switch driver on the ubnt nanostation m (fixes #10373)
[openwrt-10.03/.git] / target / linux / ar71xx / files / arch / mips / ar71xx / mach-ubnt.c
index 37151ab02ce981f8fafa222af981b931ec9d90a0..c0cfde0d6947c06919d0c915bd5cba6df184ecc2 100644 (file)
@@ -105,7 +105,7 @@ static struct gpio_button ubnt_gpio_buttons[] __initdata = {
                .desc           = "sw4",
                .type           = EV_KEY,
                .code           = BTN_0,
-               .threshold      = 5,
+               .threshold      = 3,
                .gpio           = UBNT_RS_GPIO_SW4,
                .active_low     = 1,
        }
@@ -116,7 +116,7 @@ static struct gpio_button ubnt_m_gpio_buttons[] __initdata = {
                .desc           = "reset",
                .type           = EV_KEY,
                .code           = BTN_0,
-               .threshold      = 5,
+               .threshold      = 3,
                .gpio           = UBNT_M_GPIO_BTN_RESET,
                .active_low     = 1,
        }
@@ -136,9 +136,6 @@ static void __init ubnt_generic_setup(void)
 #define UBNT_RS_WAN_PHYMASK    (1 << 20)
 #define UBNT_RS_LAN_PHYMASK    ((1 << 16) | (1 << 17) | (1 << 18) | (1 << 19))
 
-#define UBNT_RSPRO_WAN_PHYMASK (1 << 4)
-#define UBNT_RSPRO_LAN_PHYMASK ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3))
-
 static void __init ubnt_rs_setup(void)
 {
        ubnt_generic_setup();
@@ -149,8 +146,6 @@ static void __init ubnt_rs_setup(void)
        ar71xx_eth0_data.phy_mask = UBNT_RS_WAN_PHYMASK;
 
        ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
-       ar71xx_eth1_data.phy_mask = UBNT_RS_LAN_PHYMASK;
-
        ar71xx_eth1_data.speed = SPEED_100;
        ar71xx_eth1_data.duplex = DUPLEX_FULL;
 
@@ -169,6 +164,9 @@ MIPS_MACHINE(AR71XX_MACH_UBNT_RS, "UBNT-RS", "Ubiquiti RouterStation",
 MIPS_MACHINE(AR71XX_MACH_UBNT_AR71XX, "Ubiquiti AR71xx-based board",
             "Ubiquiti RouterStation", ubnt_rs_setup);
 
+#define UBNT_RSPRO_WAN_PHYMASK (1 << 4)
+#define UBNT_RSPRO_LAN_PHYMASK ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3))
+
 static void __init ubnt_rspro_setup(void)
 {
        ubnt_generic_setup();
@@ -180,7 +178,6 @@ static void __init ubnt_rspro_setup(void)
 
        ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
        ar71xx_eth1_data.phy_mask = UBNT_RSPRO_LAN_PHYMASK;
-
        ar71xx_eth1_data.speed = SPEED_1000;
        ar71xx_eth1_data.duplex = DUPLEX_FULL;
 
@@ -235,7 +232,6 @@ static void __init ubnt_m_setup(void)
        ar71xx_add_device_mdio(~0);
 
        ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
-       ar71xx_eth0_data.phy_mask = 0;
        ar71xx_eth0_data.speed = SPEED_100;
        ar71xx_eth0_data.duplex = DUPLEX_FULL;
        ar71xx_eth0_data.fifo_cfg1 = 0x0010ffff;
@@ -272,12 +268,12 @@ static void __init ubnt_nano_m_setup(void)
        ubnt_m_setup();
 
        ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
-       ar71xx_eth1_data.phy_mask = 0;
        ar71xx_eth1_data.speed = SPEED_1000;
        ar71xx_eth1_data.duplex = DUPLEX_FULL;
        ar71xx_eth1_data.fifo_cfg1 = 0x0010ffff;
        ar71xx_eth1_data.fifo_cfg2 = 0x015500aa;
        ar71xx_eth1_data.fifo_cfg3 = 0x01f00140;
+       ar71xx_eth1_data.has_ar7240_switch = 1;
 
        ar71xx_add_device_eth(1);
 }