+ detect_leds();
+ res = platform_device_register(&ar7_gpio_leds);
+ if (res)
+@@ -771,8 +791,10 @@
+ ar7_wdt_res.end = ar7_wdt_res.start + 0x20;
+
+ bootcr = (u32 *)ioremap_nocache(AR7_REGS_DCL, 4);
+- val = *bootcr;
+- iounmap(bootcr);
++ if (bootcr) {
++ val = *bootcr;
++ iounmap(bootcr);
++ }
+
+ /* Register watchdog only if enabled in hardware */
+ if (val & AR7_WDT_HW_ENA)
+Index: linux-2.6.32.26/arch/mips/include/asm/mach-ar7/ar7.h
+===================================================================
+--- linux-2.6.32.26.orig/arch/mips/include/asm/mach-ar7/ar7.h 2010-11-28 03:22:24.522383766 -0800
++++ linux-2.6.32.26/arch/mips/include/asm/mach-ar7/ar7.h 2010-11-28 03:22:25.012385426 -0800
+@@ -41,6 +41,7 @@
+ #define AR7_REGS_RESET (AR7_REGS_BASE + 0x1600)
+ #define AR7_REGS_VLYNQ0 (AR7_REGS_BASE + 0x1800)
+ #define AR7_REGS_DCL (AR7_REGS_BASE + 0x1a00)
++#define AR7_REGS_MII (AR7_REGS_BASE + 0x1a08)
+ #define AR7_REGS_VLYNQ1 (AR7_REGS_BASE + 0x1c00)
+ #define AR7_REGS_MDIO (AR7_REGS_BASE + 0x1e00)
+ #define AR7_REGS_IRQ (AR7_REGS_BASE + 0x2400)
+Index: linux-2.6.32.26/drivers/net/cpmac.c
+===================================================================
+--- linux-2.6.32.26.orig/drivers/net/cpmac.c 2010-11-28 03:22:24.982383427 -0800
++++ linux-2.6.32.26/drivers/net/cpmac.c 2010-11-28 05:23:59.482390691 -0800
+@@ -668,9 +668,8 @@
+ 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 @@
+ .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 @@
+
+ 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)))