diff options
author | Biju Das <biju.das.jz@bp.renesas.com> | 2022-09-14 21:26:04 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-09-20 17:39:46 +0200 |
commit | 1089877ada8d2da5f173922f1061ccfe721ebf56 (patch) | |
tree | ae384b5f3c897a1b5b260178a9ea83b22d5e2dad /drivers/net/ethernet/renesas/ravb_main.c | |
parent | net: rtnetlink: Enslave device before bringing it up (diff) | |
download | linux-1089877ada8d2da5f173922f1061ccfe721ebf56.tar.xz linux-1089877ada8d2da5f173922f1061ccfe721ebf56.zip |
ravb: Add RZ/G2L MII interface support
EMAC IP found on RZ/G2L Gb ethernet supports MII interface.
This patch adds support for selecting MII interface mode.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/20220914192604.265859-1-biju.das.jz@bp.renesas.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/ethernet/renesas/ravb_main.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index d013cc1c8a0a..a550ffec9000 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -540,7 +540,13 @@ static void ravb_emac_init_gbeth(struct net_device *ndev) /* E-MAC interrupt enable register */ ravb_write(ndev, ECSIPR_ICDIP, ECSIPR); - ravb_modify(ndev, CXR31, CXR31_SEL_LINK0 | CXR31_SEL_LINK1, CXR31_SEL_LINK0); + if (priv->phy_interface == PHY_INTERFACE_MODE_MII) { + ravb_modify(ndev, CXR31, CXR31_SEL_LINK0 | CXR31_SEL_LINK1, 0); + ravb_write(ndev, (1000 << 16) | CXR35_SEL_XMII_MII, CXR35); + } else { + ravb_modify(ndev, CXR31, CXR31_SEL_LINK0 | CXR31_SEL_LINK1, + CXR31_SEL_LINK0); + } } static void ravb_emac_init_rcar(struct net_device *ndev) |