mirror of
https://gitee.com/open-loongarch/linux-6.12.git
synced 2026-10-25 12:37:11 +08:00
net: stmmac: loongson1: use stmmac_get_phy_intf_sel()
Use stmmac_get_phy_intf_sel() to decode the PHY interface mode to the phy_intf_sel value, validate the result and use that to set the control register to select the operating mode for the DWMAC core. Note that this will allow GMII as well as MII as the phy_intf_sel value is the same for both. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Link: https://patch.msgid.link/E1vIjTp-0000000DqtC-2DmI@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: maoxiaochuan <maoxiaochuan@loongson.cn>
This commit is contained in:
committed by
maoxiaochuan
parent
5e7d3b50dd
commit
9182549ca7
@@ -140,14 +140,9 @@ static int ls1c_dwmac_syscon_init(struct platform_device *pdev, void *priv)
|
||||
struct regmap *regmap = dwmac->regmap;
|
||||
int phy_intf_sel;
|
||||
|
||||
switch (plat->phy_interface) {
|
||||
case PHY_INTERFACE_MODE_MII:
|
||||
phy_intf_sel = PHY_INTF_SEL_GMII_MII;
|
||||
break;
|
||||
case PHY_INTERFACE_MODE_RMII:
|
||||
phy_intf_sel = PHY_INTF_SEL_RMII;
|
||||
break;
|
||||
default:
|
||||
phy_intf_sel = stmmac_get_phy_intf_sel(plat->phy_interface);
|
||||
if (phy_intf_sel != PHY_INTF_SEL_GMII_MII &&
|
||||
phy_intf_sel != PHY_INTF_SEL_RMII) {
|
||||
dev_err(&pdev->dev, "Unsupported PHY-mode %u\n",
|
||||
plat->phy_interface);
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
Reference in New Issue
Block a user