/* WAN port */
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
- ar71xx_eth0_data.phy_mask = 0x0;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_eth0_data.fifo_cfg1 = 0x0fff0000;
/* LAN ports */
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
- ar71xx_eth1_data.phy_mask = 0x0;
ar71xx_eth1_data.speed = SPEED_1000;
ar71xx_eth1_data.duplex = DUPLEX_FULL;
ar71xx_eth1_data.fifo_cfg1 = 0x0fff0000;
ar71xx_add_device_mdio(0x0);
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.has_ar8216 = 1;
ar71xx_add_device_eth(0);
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
- ar71xx_eth1_data.phy_mask = 0x0;
ar71xx_eth1_data.speed = SPEED_1000;
ar71xx_eth1_data.duplex = DUPLEX_FULL;
ar71xx_add_device_mdio(0x0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
- ar71xx_eth0_data.phy_mask = 0xf;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_add_device_mdio(0x0);
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_add_device_mdio(0x0);
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.has_ar8216 = 1;
ar71xx_add_device_mdio(0x0);
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.has_ar8216 = 1;
ar71xx_eth0_data.phy_mask = PB42_WAN_PHYMASK;
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
- ar71xx_eth1_data.phy_mask = PB42_LAN_PHYMASK;
ar71xx_eth1_data.speed = SPEED_100;
ar71xx_eth1_data.duplex = DUPLEX_FULL;
ar71xx_add_device_eth(0);
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
- ar71xx_eth1_data.phy_mask = PB44_LAN_PHYMASK;
ar71xx_eth1_data.speed = SPEED_1000;
ar71xx_eth1_data.duplex = DUPLEX_FULL;
ar71xx_eth1_pll_data.pll_1000 = 0x110000;
rb4xx_generic_setup();
rb4xx_add_device_spi();
- ar71xx_add_device_mdio(0xfffffffe);
+ ar71xx_add_device_mdio(0xfffffffc);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
- ar71xx_eth0_data.phy_mask = 0x00000001;
+ ar71xx_eth0_data.phy_mask = 0x00000003;
ar71xx_add_device_eth(0);
ar71xx_add_device_mdio(0xffffffe9);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
- ar71xx_eth0_data.phy_mask = 0x00000006;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_add_device_mdio(0xffffffe0);
ar71xx_eth0_data.phy_if_mode = (gige) ? PHY_INTERFACE_MODE_RGMII : PHY_INTERFACE_MODE_MII;
- ar71xx_eth0_data.phy_mask = 0x0000000f;
ar71xx_eth0_data.speed = (gige) ? SPEED_1000 : SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_add_device_mdio(0x3fffff00);
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_add_device_mdio(0x0);
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.mii_bus_dev = &tl_wr1043nd_rtl8366rb_device.dev;
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
- ar71xx_eth0_data.phy_mask = 0x0;
ar71xx_eth0_data.speed = SPEED_1000;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_eth0_pll_data.pll_1000 = 0x1a000000;
ar71xx_add_device_mdio(0x0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
- ar71xx_eth0_data.phy_mask = 0x0;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_add_device_mdio(0x0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
- ar71xx_eth0_data.phy_mask = 0x0;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
#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();
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;
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();
ar71xx_eth0_data.phy_mask = UBNT_RSPRO_WAN_PHYMASK;
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;
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;
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_eth0_pll_data.pll_1000 = 0x11110000;
ar71xx_eth0_data.mii_bus_dev = &wndr3700_rtl8366s_device.dev;
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
- ar71xx_eth0_data.phy_mask = 0xf;
ar71xx_eth0_data.speed = SPEED_1000;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_add_device_mdio(0x0);
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.has_ar8216 = 1;
ar71xx_add_device_mdio(0xfffffff7);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
- ar71xx_eth0_data.phy_mask = 0x00000008;
+ ar71xx_eth0_data.phy_mask = 0x08;
ar71xx_eth0_data.reset_bit = RESET_MODULE_GE0_MAC |
RESET_MODULE_GE0_PHY;
ar71xx_add_device_eth(0);
ar71xx_add_device_mdio(0x0);
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.has_ar8216 = 1;
ar71xx_eth0_pll_data.pll_1000 = 0x1e000100;
ar71xx_eth0_data.mii_bus_dev = &wzrhpg300nh_rtl8366s_device.dev;
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
- ar71xx_eth0_data.phy_mask = 0xf;
ar71xx_eth0_data.speed = SPEED_1000;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
#define ETH_FCS_LEN 4
#define AG71XX_DRV_NAME "ag71xx"
-#define AG71XX_DRV_VERSION "0.5.32"
+#define AG71XX_DRV_VERSION "0.5.33"
#define AG71XX_NAPI_WEIGHT 64
#define AG71XX_OOM_REFILL (1 + HZ/10)
if (ag->phy_dev) {
phy_start(ag->phy_dev);
} else {
- struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
-
- ag->duplex = pdata->duplex;
- ag->speed = pdata->speed;
ag->link = 1;
ag71xx_link_adjust(ag);
}
if (ag->phy_dev) {
phy_stop(ag->phy_dev);
} else {
- ag->duplex = -1;
ag->link = 0;
- ag->speed = 0;
ag71xx_link_adjust(ag);
}
}
case SPEED_1000:
break;
default:
- printk(KERN_ERR "%s: invalid speed specified\n",
- dev->name);
+ printk(KERN_ERR "%s: invalid speed specified\n", dev->name);
ret = -EINVAL;
break;
}
+ printk(KERN_DEBUG "%s: using fixed link parameters\n", dev->name);
+
+ ag->duplex = pdata->duplex;
+ ag->speed = pdata->speed;
+
return ret;
}
struct net_device *dev = ag->dev;
struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
struct phy_device *phydev = NULL;
- int phy_count = 0;
int phy_addr;
int ret = 0;
if (phydev == NULL)
phydev = ag->mii_bus->phy_map[phy_addr];
-
- phy_count++;
}
- switch (phy_count) {
- case 0:
+ if (!phydev) {
printk(KERN_ERR "%s: no PHY found with phy_mask=%08x\n",
dev->name, pdata->phy_mask);
- ret = -ENODEV;
- break;
- case 1:
- ag->phy_dev = phy_connect(dev, dev_name(&phydev->dev),
- &ag71xx_phy_link_adjust, 0, pdata->phy_if_mode);
-
- if (IS_ERR(ag->phy_dev)) {
- printk(KERN_ERR "%s: could not connect to PHY at %s\n",
- dev->name, dev_name(&phydev->dev));
- return PTR_ERR(ag->phy_dev);
- }
+ return -ENODEV;
+ }
- /* mask with MAC supported features */
- if (pdata->has_gbit)
- phydev->supported &= PHY_GBIT_FEATURES;
- else
- phydev->supported &= PHY_BASIC_FEATURES;
+ ag->phy_dev = phy_connect(dev, dev_name(&phydev->dev),
+ &ag71xx_phy_link_adjust, 0,
+ pdata->phy_if_mode);
- phydev->advertising = phydev->supported;
+ if (IS_ERR(ag->phy_dev)) {
+ printk(KERN_ERR "%s: could not connect to PHY at %s\n",
+ dev->name, dev_name(&phydev->dev));
+ return PTR_ERR(ag->phy_dev);
+ }
- printk(KERN_DEBUG "%s: connected to PHY at %s "
- "[uid=%08x, driver=%s]\n",
- dev->name, dev_name(&phydev->dev),
- phydev->phy_id, phydev->drv->name);
+ /* mask with MAC supported features */
+ if (pdata->has_gbit)
+ phydev->supported &= PHY_GBIT_FEATURES;
+ else
+ phydev->supported &= PHY_BASIC_FEATURES;
- ag->link = 0;
- ag->speed = 0;
- ag->duplex = -1;
- break;
+ phydev->advertising = phydev->supported;
- default:
- printk(KERN_DEBUG "%s: connected to %d PHYs\n",
- dev->name, phy_count);
- ret = ag71xx_phy_connect_fixed(ag);
- break;
- }
+ printk(KERN_DEBUG "%s: connected to PHY at %s [uid=%08x, driver=%s]\n",
+ dev->name, dev_name(&phydev->dev),
+ phydev->phy_id, phydev->drv->name);
+
+ ag->link = 0;
+ ag->speed = 0;
+ ag->duplex = -1;
return ret;
}