summaryrefslogtreecommitdiff
path: root/target/linux/ar71xx
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-11-12 12:09:56 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-11-12 12:09:56 +0000
commit8255c166fd59a9a8cbaeeb86ac774c5f2bd6b879 (patch)
treef89ac7cf0cd27e3f273dce182a5fb4facc723e81 /target/linux/ar71xx
parent79bc01d085050cf626d919974c66cec162012f6e (diff)
ar71xx: add AR934X specific MDIO registration code
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@28985 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/devices.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/devices.c b/target/linux/ar71xx/files/arch/mips/ar71xx/devices.c
index 0759142ec7..86b615ea87 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/devices.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/devices.c
@@ -194,8 +194,16 @@ void __init ar71xx_add_device_mdio(unsigned int id, u32 phy_mask)
{
struct platform_device *mdio_dev;
struct ag71xx_mdio_platform_data *mdio_data;
+ unsigned int max_id;
- if (id > 0) {
+ if (ar71xx_soc == AR71XX_SOC_AR9341 ||
+ ar71xx_soc == AR71XX_SOC_AR9342 ||
+ ar71xx_soc == AR71XX_SOC_AR9344)
+ max_id = 1;
+ else
+ max_id = 0;
+
+ if (id > max_id) {
printk(KERN_ERR "ar71xx: invalid MDIO id %u\n", id);
return;
}
@@ -208,6 +216,18 @@ void __init ar71xx_add_device_mdio(unsigned int id, u32 phy_mask)
mdio_data = &ar71xx_mdio1_data;
break;
+ case AR71XX_SOC_AR9341:
+ case AR71XX_SOC_AR9342:
+ case AR71XX_SOC_AR9344:
+ if (id == 0) {
+ mdio_dev = &ar71xx_mdio0_device;
+ mdio_data = &ar71xx_mdio0_data;
+ } else {
+ mdio_dev = &ar71xx_mdio1_device;
+ mdio_data = &ar71xx_mdio1_data;
+ }
+ break;
+
case AR71XX_SOC_AR7242:
ar71xx_set_pll(AR71XX_PLL_REG_SEC_CONFIG,
AR7242_PLL_REG_ETH0_INT_CLOCK, 0x62000000,
@@ -228,6 +248,14 @@ void __init ar71xx_add_device_mdio(unsigned int id, u32 phy_mask)
case AR71XX_SOC_AR9331:
mdio_data->is_ar7240 = 1;
break;
+
+ case AR71XX_SOC_AR9341:
+ case AR71XX_SOC_AR9342:
+ case AR71XX_SOC_AR9344:
+ if (id == 1)
+ mdio_data->is_ar7240 = 1;
+ break;
+
default:
break;
}
@@ -755,6 +783,15 @@ void __init ar71xx_add_device_eth(unsigned int id)
if (pdata->mii_bus_dev == NULL) {
switch (ar71xx_soc) {
+ case AR71XX_SOC_AR9341:
+ case AR71XX_SOC_AR9342:
+ case AR71XX_SOC_AR9344:
+ if (id == 0)
+ pdata->mii_bus_dev = &ar71xx_mdio0_device.dev;
+ else
+ pdata->mii_bus_dev = &ar71xx_mdio1_device.dev;
+ break;
+
case AR71XX_SOC_AR7241:
case AR71XX_SOC_AR9330:
case AR71XX_SOC_AR9331: