summaryrefslogtreecommitdiff
path: root/target/linux/ar71xx/files/arch
diff options
context:
space:
mode:
authorMatteo Croce <rootkit85@yahoo.it>2011-05-14 23:31:50 +0000
committerMatteo Croce <rootkit85@yahoo.it>2011-05-14 23:31:50 +0000
commit2ea528d1d0cf6cec4e6a61f57cefd84b66f04aba (patch)
tree8424f1d57cdb9c5122edad6b5cdca5dac84366b1 /target/linux/ar71xx/files/arch
parentc0c2e184524fca647742e9327f8df9aa544d9eb2 (diff)
downloadmtk-20170518-2ea528d1d0cf6cec4e6a61f57cefd84b66f04aba.zip
mtk-20170518-2ea528d1d0cf6cec4e6a61f57cefd84b66f04aba.tar.gz
mtk-20170518-2ea528d1d0cf6cec4e6a61f57cefd84b66f04aba.tar.bz2
ar71xx: add link detection on Ubiquiti devices WAN port
SVN-Revision: 26891
Diffstat (limited to 'target/linux/ar71xx/files/arch')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/mach-ubnt.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-ubnt.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-ubnt.c
index f94f472..bc682cb 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-ubnt.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-ubnt.c
@@ -235,6 +235,9 @@ static void __init ubnt_lssr71_setup(void)
MIPS_MACHINE(AR71XX_MACH_UBNT_LSSR71, "UBNT-LS-SR71", "Ubiquiti LS-SR71",
ubnt_lssr71_setup);
+#define UBNT_M_WAN_PHYMASK BIT(4)
+#define UBNT_M_LAN_PHYMASK BIT(0)
+
static void __init ubnt_m_setup(void)
{
u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
@@ -243,13 +246,14 @@ static void __init ubnt_m_setup(void)
ar71xx_add_device_m25p80(NULL);
- ar71xx_add_device_mdio(~0);
+ ar71xx_add_device_mdio(~(UBNT_M_WAN_PHYMASK | UBNT_M_LAN_PHYMASK));
ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac1, 0);
ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac2, 0);
- ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
+ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
+ ar71xx_eth0_data.phy_mask = UBNT_M_WAN_PHYMASK;
ar71xx_add_device_eth(0);
@@ -310,12 +314,13 @@ static void __init ubnt_unifi_setup(void)
ar71xx_add_device_m25p80(NULL);
- ar71xx_add_device_mdio(~0);
+ ar71xx_add_device_mdio(~UBNT_M_WAN_PHYMASK);
ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
- ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
+ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
+ ar71xx_eth0_data.phy_mask = UBNT_M_WAN_PHYMASK;
ar71xx_add_device_eth(0);