diff options
author | Jonas Gorski <jonas.gorski@gmail.com> | 2017-10-12 10:50:08 +0200 |
---|---|---|
committer | Jonas Gorski <jonas.gorski@gmail.com> | 2017-10-29 23:41:00 +0100 |
commit | cf9e0a59aabd84a409a44fd39f6b03a064a82786 (patch) | |
tree | b71834a2483db031f3c0a254ff551faf2beb9e67 /target/linux/ar7/patches-4.9/950-cpmac_titan.patch | |
parent | 1d30869cd2f589b27227428863ebd201099106ce (diff) | |
download | upstream-cf9e0a59aabd84a409a44fd39f6b03a064a82786.tar.gz upstream-cf9e0a59aabd84a409a44fd39f6b03a064a82786.tar.bz2 upstream-cf9e0a59aabd84a409a44fd39f6b03a064a82786.zip |
ar7: add kernel 4.9 support
Compile and run tested on WAG354Gv1.
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Diffstat (limited to 'target/linux/ar7/patches-4.9/950-cpmac_titan.patch')
-rw-r--r-- | target/linux/ar7/patches-4.9/950-cpmac_titan.patch | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/target/linux/ar7/patches-4.9/950-cpmac_titan.patch b/target/linux/ar7/patches-4.9/950-cpmac_titan.patch new file mode 100644 index 0000000000..158b689c98 --- /dev/null +++ b/target/linux/ar7/patches-4.9/950-cpmac_titan.patch @@ -0,0 +1,52 @@ +--- a/drivers/net/ethernet/ti/cpmac.c ++++ b/drivers/net/ethernet/ti/cpmac.c +@@ -1124,6 +1124,8 @@ static int cpmac_probe(struct platform_d + goto fail; + } + ++ ar7_device_reset(pdata->reset_bit); ++ + dev->irq = platform_get_irq_byname(pdev, "irq"); + + dev->netdev_ops = &cpmac_netdev_ops; +@@ -1203,7 +1205,7 @@ int cpmac_init(void) + cpmac_mii->write = cpmac_mdio_write; + cpmac_mii->reset = cpmac_mdio_reset; + +- 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) { + pr_err("Can't ioremap mdio registers\n"); +@@ -1214,10 +1216,16 @@ int cpmac_init(void) + /* 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++) { +@@ -1234,7 +1242,11 @@ int cpmac_init(void) + mask = 0; + } + +- cpmac_mii->phy_mask = ~(mask | 0x80000000); ++ if (ar7_is_titan()) ++ cpmac_mii->phy_mask = ~(mask | 0x80000000 | 0x40000000); ++ else ++ cpmac_mii->phy_mask = ~(mask | 0x80000000); ++ + snprintf(cpmac_mii->id, MII_BUS_ID_SIZE, "cpmac-1"); + + res = mdiobus_register(cpmac_mii); |