diff options
author | Florian Fainelli <florian@openwrt.org> | 2011-02-18 12:52:04 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2011-02-18 12:52:04 +0000 |
commit | 590cb083bcfd4b236e9ec4657787b90e1ea3d7d4 (patch) | |
tree | 4901bc1686e8906bdec1ccbec4100a3ee792e7d8 /target/linux/ar7/patches-2.6.37/950-cpmac_titan.patch | |
parent | 090c04208901d09b7d87960d5531c5c0e318c956 (diff) | |
download | mtk-20170518-590cb083bcfd4b236e9ec4657787b90e1ea3d7d4.zip mtk-20170518-590cb083bcfd4b236e9ec4657787b90e1ea3d7d4.tar.gz mtk-20170518-590cb083bcfd4b236e9ec4657787b90e1ea3d7d4.tar.bz2 |
add support for 2.6.37, thanks Wipster!
SVN-Revision: 25569
Diffstat (limited to 'target/linux/ar7/patches-2.6.37/950-cpmac_titan.patch')
-rw-r--r-- | target/linux/ar7/patches-2.6.37/950-cpmac_titan.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/target/linux/ar7/patches-2.6.37/950-cpmac_titan.patch b/target/linux/ar7/patches-2.6.37/950-cpmac_titan.patch new file mode 100644 index 0000000..65a5b70 --- /dev/null +++ b/target/linux/ar7/patches-2.6.37/950-cpmac_titan.patch @@ -0,0 +1,49 @@ +--- a/drivers/net/cpmac.c ++++ b/drivers/net/cpmac.c +@@ -1155,6 +1155,8 @@ static int __devinit cpmac_probe(struct + goto fail; + } + ++ ar7_device_reset(pdata->reset_bit); ++ + dev->irq = platform_get_irq_byname(pdev, "irq"); + + dev->netdev_ops = &cpmac_netdev_ops; +@@ -1231,7 +1233,7 @@ int __devinit cpmac_init(void) + cpmac_mii->reset = cpmac_mdio_reset; + cpmac_mii->irq = mii_irqs; + +- cpmac_mii->priv = ioremap(AR7_REGS_MDIO, 256); ++ cpmac_mii->priv = ioremap(ar7_is_titan() ? TITAN_REGS_MDIO : AR7_REGS_MDIO, 256); + + if (!cpmac_mii->priv) { + printk(KERN_ERR "Can't ioremap mdio registers\n"); +@@ -1242,10 +1244,16 @@ int __devinit cpmac_init(void) + #warning FIXME: unhardcode gpio&reset bits + ar7_gpio_disable(26); + ar7_gpio_disable(27); +- ar7_device_reset(AR7_RESET_BIT_CPMAC_LO); +- ar7_device_reset(AR7_RESET_BIT_CPMAC_HI); ++ ++ if (!ar7_is_titan()) { ++ 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); ++ + cpmac_mii->reset(cpmac_mii); + + for (i = 0; i < 300; i++) +@@ -1260,7 +1268,8 @@ int __devinit cpmac_init(void) + mask = 0; + } + +- cpmac_mii->phy_mask = ~(mask | 0x80000000); ++ cpmac_mii->phy_mask = ar7_is_titan()? ~(mask | 0x80000000 | 0x40000000) : ++ ~(mask | 0x80000000); + snprintf(cpmac_mii->id, MII_BUS_ID_SIZE, "1"); + + res = mdiobus_register(cpmac_mii); |