+--- a/drivers/net/cpmac.c
++++ b/drivers/net/cpmac.c
+@@ -668,9 +668,8 @@ static void cpmac_hw_start(struct net_de
+ for (i = 0; i < 8; i++)
+ cpmac_write(priv->regs, CPMAC_MAC_ADDR_LO(i), dev->dev_addr[5]);
+ cpmac_write(priv->regs, CPMAC_MAC_ADDR_MID, dev->dev_addr[4]);
+- cpmac_write(priv->regs, CPMAC_MAC_ADDR_HI, dev->dev_addr[0] |
+- (dev->dev_addr[1] << 8) | (dev->dev_addr[2] << 16) |
+- (dev->dev_addr[3] << 24));
++ cpmac_write(priv->regs, CPMAC_MAC_ADDR_HI, be32_to_cpu(*(u32 *)
++ dev->dev_addr));
+ cpmac_write(priv->regs, CPMAC_MAX_LENGTH, CPMAC_SKB_SIZE);
+ cpmac_write(priv->regs, CPMAC_UNICAST_CLEAR, 0xff);
+ cpmac_write(priv->regs, CPMAC_RX_INT_CLEAR, 0xff);
+@@ -1104,8 +1103,6 @@ static const struct net_device_ops cpmac
+ .ndo_set_mac_address = eth_mac_addr,
+ };
+
+-static int external_switch;
+-
+ static int __devinit cpmac_probe(struct platform_device *pdev)
+ {
+ int rc, phy_id;
+@@ -1117,24 +1114,26 @@ static int __devinit cpmac_probe(struct
+
+ pdata = pdev->dev.platform_data;
+
+- if (external_switch || dumb_switch) {
+- strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */
+- phy_id = pdev->id;
+- } else {
+- for (phy_id = 0; phy_id < PHY_MAX_ADDR; phy_id++) {
+- if (!(pdata->phy_mask & (1 << phy_id)))
+- continue;
+- if (!cpmac_mii->phy_map[phy_id])
+- continue;
+- strncpy(mdio_bus_id, cpmac_mii->id, MII_BUS_ID_SIZE);
+- break;
+- }
++ if (dumb_switch)
++ phy_id = PHY_MAX_ADDR;
++ else for (phy_id = 0; phy_id < PHY_MAX_ADDR; phy_id++) {
++ if (!((pdata->phy_mask | cpmac_mii->phy_mask) &
++ (1 << phy_id)))
++ continue;
++ if (cpmac_mii->phy_map[phy_id])
++ continue;
++ strncpy(mdio_bus_id, cpmac_mii->id, MII_BUS_ID_SIZE);
++ break;
+ }
+
+ if (phy_id == PHY_MAX_ADDR) {
+ dev_err(&pdev->dev, "no PHY present, falling back to switch mode\n");
+ strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */
+ phy_id = pdev->id;
++ } else {
++ /* Now disable EPHY and enable MII */
++ dev_info(&pdev->dev, "trying external MII\n");
++ ar7_device_disable(AR7_RESET_BIT_EPHY);
+ }
+
+ dev = alloc_etherdev_mq(sizeof(*priv), CPMAC_QUEUES);
+@@ -1168,7 +1167,7 @@ static int __devinit cpmac_probe(struct
+ priv->dev = dev;
+ priv->ring_size = 64;
+ priv->msg_enable = netif_msg_init(debug_level, 0xff);
+- memcpy(dev->dev_addr, pdata->dev_addr, sizeof(dev->dev_addr));
++ memcpy(dev->dev_addr, pdata->dev_addr, sizeof(pdata->dev_addr));
+
+ snprintf(priv->phy_name, MII_BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id);
+
+@@ -1244,14 +1243,14 @@ int __devinit cpmac_init(void)
+ ar7_gpio_disable(26);
+ ar7_gpio_disable(27);
+
+- if (!ar7_is_titan()) {
++ if (ar7_is_titan()) {
++ ar7_device_reset(AR7_RESET_BIT_EPHY);
++ ar7_device_reset(TITAN_RESET_BIT_EPHY1);
++ } else {
+ ar7_device_reset(AR7_RESET_BIT_CPMAC_LO);
+ ar7_device_reset(AR7_RESET_BIT_CPMAC_HI);
+- }
+- ar7_device_reset(AR7_RESET_BIT_EPHY);
+
+- if (ar7_is_titan()) {
+- ar7_device_reset(TITAN_RESET_BIT_EPHY1);
++ ar7_device_reset(AR7_RESET_BIT_EPHY);
+ }
+
+ cpmac_mii->reset(cpmac_mii);
+@@ -1262,14 +1261,7 @@ int __devinit cpmac_init(void)
+ else
+ msleep(10);
+
+- mask &= 0x7fffffff;
+- if (mask & (mask - 1)) {
+- external_switch = 1;
+- mask = 0;
+- }
+-
+- cpmac_mii->phy_mask = ar7_is_titan()? ~(mask | 0x80000000 | 0x40000000):
+- ~(mask | 0x80000000);
++ cpmac_mii->phy_mask = ~mask;
+ snprintf(cpmac_mii->id, MII_BUS_ID_SIZE, "1");
+
+ res = mdiobus_register(cpmac_mii);