ar71xx: set GPIO reset line for Ubiquiti NanoStation Loco XW
[openwrt/openwrt.git] / target / linux / ar71xx / files / arch / mips / ath79 / mach-ubnt-xm.c
index bb5b28fc052f502bda2107ba3317306f90a6de79..55cf52d19e5cf5ae535a7922d1163736e98827f0 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/ath9k_platform.h>
 #include <linux/etherdevice.h>
 #include <linux/ar8216_platform.h>
+#include <linux/platform_data/phy-at803x.h>
 
 #include <asm/mach-ath79/ath79.h>
 #include <asm/mach-ath79/irq.h>
@@ -279,6 +280,7 @@ static void __init ubnt_unifi_outdoor_plus_setup(void)
        ath79_register_eth(0);
        ath79_register_eth(1);
 
+       ap9x_pci_get_wmac_data(0)->ubnt_hsr = true;
        ap91_pci_init(ee, NULL);
 
        ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_unifi_outdoor_plus_leds_gpio),
@@ -476,10 +478,26 @@ static void __init ubnt_nano_m_xw_setup(void)
        ath79_register_eth(0);
 }
 
+static struct at803x_platform_data ubnt_loco_m_xw_at803x_data = {
+       .has_reset_gpio = 1,
+       .reset_gpio = 0,
+};
+
+static struct mdio_board_info ubnt_loco_m_xw_mdio_info[] = {
+       {
+               .bus_id = "ag71xx-mdio.0",
+               .phy_addr = 1,
+               .platform_data = &ubnt_loco_m_xw_at803x_data,
+       },
+};
+
 static void __init ubnt_loco_m_xw_setup(void)
 {
        ubnt_xw_init();
 
+       mdiobus_register_board_info(ubnt_loco_m_xw_mdio_info,
+                                   ARRAY_SIZE(ubnt_loco_m_xw_mdio_info));
+
        ath79_register_mdio(0, ~BIT(1));
        ath79_eth0_data.phy_mask = BIT(1);
        ath79_register_eth(0);