ar71xx: implement SoC specific phy interface setup

SVN-Revision: 28988
This commit is contained in:
Gabor Juhos 2011-11-12 12:50:18 +00:00
parent 21d317b9cc
commit 368c6605a0

View File

@ -590,6 +590,12 @@ static int __init ar71xx_setup_phy_if_mode(unsigned int id,
{ {
switch (id) { switch (id) {
case 0: case 0:
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) { switch (pdata->phy_if_mode) {
case PHY_INTERFACE_MODE_MII: case PHY_INTERFACE_MODE_MII:
pdata->mii_if = MII0_CTRL_IF_MII; pdata->mii_if = MII0_CTRL_IF_MII;
@ -607,7 +613,42 @@ static int __init ar71xx_setup_phy_if_mode(unsigned int id,
return -EINVAL; return -EINVAL;
} }
break; break;
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 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:
BUG();
}
break;
case 1: case 1:
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) { switch (pdata->phy_if_mode) {
case PHY_INTERFACE_MODE_RMII: case PHY_INTERFACE_MODE_RMII:
pdata->mii_if = MII1_CTRL_IF_RMII; pdata->mii_if = MII1_CTRL_IF_RMII;
@ -619,6 +660,33 @@ static int __init ar71xx_setup_phy_if_mode(unsigned int id,
return -EINVAL; return -EINVAL;
} }
break; 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 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:
BUG();
}
break;
} }
return 0; return 0;