1 --- a/drivers/net/cpmac.c
2 +++ b/drivers/net/cpmac.c
4 #include <linux/skbuff.h>
7 +#include <linux/phy_fixed.h>
8 #include <linux/platform_device.h>
9 #include <linux/dma-mapping.h>
10 #include <linux/clk.h>
11 @@ -219,6 +220,12 @@ static void cpmac_hw_stop(struct net_dev
12 static int cpmac_stop(struct net_device *dev);
13 static int cpmac_open(struct net_device *dev);
15 +static struct fixed_phy_status fixed_phy_status = {
21 static void cpmac_dump_regs(struct net_device *dev)
24 @@ -1127,11 +1134,38 @@ static int __devinit cpmac_probe(struct
28 - if (phy_id == PHY_MAX_ADDR) {
29 - dev_err(&pdev->dev, "no PHY present\n");
31 + if (phy_id < PHY_MAX_ADDR)
34 + dev_info(&pdev->dev, "trying external MII\n");
35 + /* Now disable EPHY and enable MII */
36 + ar7_device_disable(AR7_RESET_BIT_EPHY);
37 + *(unsigned long*) ioremap(0x08611A08, 4) |= 0x00000001;
39 + for (phy_id = 0; phy_id < PHY_MAX_ADDR; phy_id++) {
40 + if (!(pdata->phy_mask & (1 << phy_id)))
42 + if (!cpmac_mii->phy_map[phy_id])
44 + strncpy(mdio_bus_id, cpmac_mii->id, MII_BUS_ID_SIZE);
48 + if (phy_id < PHY_MAX_ADDR)
51 + /* This still does not work, so now we register a fixed phy */
52 + dev_info(&pdev->dev, "using fixed PHY\n");
53 + rc = fixed_phy_add(PHY_POLL, pdev->id, &fixed_phy_status);
54 + if (rc && rc != -ENODEV) {
55 + dev_err(&pdev->dev, "unable to register fixed PHY\n");
59 + strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */
63 dev = alloc_etherdev_mq(sizeof(*priv), CPMAC_QUEUES);