aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2011-11-12 12:50:18 +0000
committerGabor Juhos <juhosg@openwrt.org>2011-11-12 12:50:18 +0000
commit368c6605a03b74b749017c73885ca9e7339adad6 (patch)
tree27e90b01202175700e327e8ad7dbd2224224e585 /target/linux
parent21d317b9cc3d866be16897b62ce8c6cbaa90bae2 (diff)
downloadupstream-368c6605a03b74b749017c73885ca9e7339adad6.tar.gz
upstream-368c6605a03b74b749017c73885ca9e7339adad6.tar.bz2
upstream-368c6605a03b74b749017c73885ca9e7339adad6.zip
ar71xx: implement SoC specific phy interface setup
SVN-Revision: 28988
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/devices.c102
1 files changed, 85 insertions, 17 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/devices.c b/target/linux/ar71xx/files/arch/mips/ar71xx/devices.c
index 0091ac276c..e62d1123d6 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/devices.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/devices.c
@@ -590,33 +590,101 @@ static int __init ar71xx_setup_phy_if_mode(unsigned int id,
{
switch (id) {
case 0:
- switch (pdata->phy_if_mode) {
- case PHY_INTERFACE_MODE_MII:
- pdata->mii_if = MII0_CTRL_IF_MII;
- break;
- case PHY_INTERFACE_MODE_GMII:
- pdata->mii_if = MII0_CTRL_IF_GMII;
+ switch (ar71xx_soc) {
+ case AR71XX_SOC_AR7130:
+ case AR71XX_SOC_AR7141:
+ case AR71XX_SOC_AR7161:
+ case AR71XX_SOC_AR9130:
+ case AR71XX_SOC_AR9132:
+ switch (pdata->phy_if_mode) {
+ case PHY_INTERFACE_MODE_MII:
+ pdata->mii_if = MII0_CTRL_IF_MII;
+ break;
+ case PHY_INTERFACE_MODE_GMII:
+ pdata->mii_if = MII0_CTRL_IF_GMII;
+ break;
+ case PHY_INTERFACE_MODE_RGMII:
+ pdata->mii_if = MII0_CTRL_IF_RGMII;
+ break;
+ case PHY_INTERFACE_MODE_RMII:
+ pdata->mii_if = MII0_CTRL_IF_RMII;
+ break;
+ default:
+ return -EINVAL;
+ }
break;
- case PHY_INTERFACE_MODE_RGMII:
- pdata->mii_if = MII0_CTRL_IF_RGMII;
+
+ case AR71XX_SOC_AR7240:
+ case AR71XX_SOC_AR7241:
+ case AR71XX_SOC_AR9330:
+ case AR71XX_SOC_AR9331:
+ pdata->phy_if_mode = PHY_INTERFACE_MODE_MII;
break;
- case PHY_INTERFACE_MODE_RMII:
- pdata->mii_if = MII0_CTRL_IF_RMII;
+
+ case AR71XX_SOC_AR7242:
+ /* FIXME */
+
+ case AR71XX_SOC_AR9341:
+ case AR71XX_SOC_AR9342:
+ case AR71XX_SOC_AR9344:
+ switch (pdata->phy_if_mode) {
+ case PHY_INTERFACE_MODE_MII:
+ case PHY_INTERFACE_MODE_GMII:
+ case PHY_INTERFACE_MODE_RGMII:
+ case PHY_INTERFACE_MODE_RMII:
+ break;
+ default:
+ return -EINVAL;
+ }
break;
+
default:
- return -EINVAL;
+ BUG();
}
break;
case 1:
- switch (pdata->phy_if_mode) {
- case PHY_INTERFACE_MODE_RMII:
- pdata->mii_if = MII1_CTRL_IF_RMII;
+ switch (ar71xx_soc) {
+ case AR71XX_SOC_AR7130:
+ case AR71XX_SOC_AR7141:
+ case AR71XX_SOC_AR7161:
+ case AR71XX_SOC_AR9130:
+ case AR71XX_SOC_AR9132:
+ switch (pdata->phy_if_mode) {
+ case PHY_INTERFACE_MODE_RMII:
+ pdata->mii_if = MII1_CTRL_IF_RMII;
+ break;
+ case PHY_INTERFACE_MODE_RGMII:
+ pdata->mii_if = MII1_CTRL_IF_RGMII;
+ break;
+ default:
+ return -EINVAL;
+ }
+ break;
+
+ case AR71XX_SOC_AR7240:
+ case AR71XX_SOC_AR7241:
+ case AR71XX_SOC_AR9330:
+ case AR71XX_SOC_AR9331:
+ pdata->phy_if_mode = PHY_INTERFACE_MODE_GMII;
break;
- case PHY_INTERFACE_MODE_RGMII:
- pdata->mii_if = MII1_CTRL_IF_RGMII;
+
+ case AR71XX_SOC_AR7242:
+ /* FIXME */
+
+ case AR71XX_SOC_AR9341:
+ case AR71XX_SOC_AR9342:
+ case AR71XX_SOC_AR9344:
+ switch (pdata->phy_if_mode) {
+ case PHY_INTERFACE_MODE_MII:
+ case PHY_INTERFACE_MODE_GMII:
+ break;
+ default:
+ return -EINVAL;
+ }
break;
+
default:
- return -EINVAL;
+ BUG();
}
break;
}