diff options
author | Florian Fainelli <florian@openwrt.org> | 2010-01-03 20:19:32 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2010-01-03 20:19:32 +0000 |
commit | ea52050d3f4896dea29670a277310f98121ded4c (patch) | |
tree | 6e739e981b45cb846578f905e9916d8472e43dee /target/linux/ar7/patches-2.6.30/940-cpmac-titan.patch | |
parent | af919ae232318bffb9dc7a0f97f9db5d2530344b (diff) | |
download | master-187ad058-ea52050d3f4896dea29670a277310f98121ded4c.tar.gz master-187ad058-ea52050d3f4896dea29670a277310f98121ded4c.tar.bz2 master-187ad058-ea52050d3f4896dea29670a277310f98121ded4c.zip |
[ar7] add support for titan variant (WRTP54G) (#6185)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19022 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar7/patches-2.6.30/940-cpmac-titan.patch')
-rw-r--r-- | target/linux/ar7/patches-2.6.30/940-cpmac-titan.patch | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/target/linux/ar7/patches-2.6.30/940-cpmac-titan.patch b/target/linux/ar7/patches-2.6.30/940-cpmac-titan.patch new file mode 100644 index 0000000000..0e3a8b9ce4 --- /dev/null +++ b/target/linux/ar7/patches-2.6.30/940-cpmac-titan.patch @@ -0,0 +1,66 @@ +--- a/arch/mips/ar7/platform.c 2009-11-18 15:47:42.000000000 +0800 ++++ b/arch/mips/ar7/platform.c 2009-11-19 00:56:05.000000000 +0800 +@@ -677,24 +677,32 @@ + } + + if (ar7_has_high_cpmac()) { +- res = fixed_phy_add(PHY_POLL, cpmac_high.id, &fixed_phy_status); ++ res = fixed_phy_add(PHY_POLL, ar7_is_titan()?cpmac_high_titan.id: cpmac_high.id, &fixed_phy_status); + if (res && res != -ENODEV) + return res; + +- cpmac_get_mac(1, cpmac_high_data.dev_addr); +- res = platform_device_register(&cpmac_high); ++ cpmac_get_mac(1, ar7_is_titan() ? cpmac_high_data_titan.dev_addr: ++ cpmac_high_data.dev_addr); ++ res = platform_device_register(ar7_is_titan() ? &cpmac_high_titan : ++ &cpmac_high); + if (res) + return res; + } else { +- cpmac_low_data.phy_mask = 0xffffffff; +- } ++ if (ar7_is_titan()) ++ cpmac_low_data_titan.phy_mask = 0xffffffff; ++ else ++ cpmac_low_data.phy_mask = 0xffffffff; ++ } + +- res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status); ++ res = fixed_phy_add(PHY_POLL, ar7_is_titan()?cpmac_low_titan.id: ++ cpmac_low.id, &fixed_phy_status); + if (res && res != -ENODEV) + return res; + +- cpmac_get_mac(0, cpmac_low_data.dev_addr); +- res = platform_device_register(&cpmac_low); ++ cpmac_get_mac(0, ar7_is_titan() ? cpmac_low_data_titan.dev_addr : ++ cpmac_low_data.dev_addr); ++ res = platform_device_register(ar7_is_titan() ? &cpmac_low_titan : ++ &cpmac_low); + if (res) + return res; + +--- a/drivers/net/cpmac.c 2009-11-18 15:47:42.000000000 +0800 ++++ b/drivers/net/cpmac.c 2009-11-19 00:58:25.000000000 +0800 +@@ -1236,6 +1236,10 @@ + 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++) +@@ -1250,7 +1254,8 @@ + 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); |