diff mbox series

[6/6] net: macb: take into account all RGMII interface types

Message ID 1606987556-20217-7-git-send-email-claudiu.beznea@microchip.com
State Superseded
Delegated to: Eugen Hristev
Headers show
Series add support for sama7g5 ethernet interfaces | expand

Commit Message

Claudiu Beznea Dec. 3, 2020, 9:25 a.m. UTC
Take into account all RGMII interface types. Depending on it
the RGMII PHY's timings are setup.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/net/macb.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index e3003cb4a619..127d6e899bad 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -630,7 +630,7 @@  static int macb_phy_init(struct macb_device *macb, const char *name)
 #else
 	/* need to consider other phy interface mode */
 	macb->phydev = phy_connect(macb->bus, macb->phy_addr, &macb->netdev,
-			     PHY_INTERFACE_MODE_RGMII);
+				   macb->phy_interface);
 #endif
 	if (!macb->phydev) {
 		printf("phy_connect failed\n");
@@ -857,7 +857,10 @@  static int _macb_init(struct macb_device *macb, const char *name)
 		 * to select interface between RMII and MII.
 		 */
 #ifdef CONFIG_DM_ETH
-		if (macb->phy_interface == PHY_INTERFACE_MODE_RGMII)
+		if (macb->phy_interface == PHY_INTERFACE_MODE_RGMII ||
+		    macb->phy_interface == PHY_INTERFACE_MODE_RGMII_ID ||
+		    macb->phy_interface == PHY_INTERFACE_MODE_RGMII_RXID ||
+		    macb->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID)
 			val = macb->config->usrio->rgmii;
 		else if (macb->phy_interface == PHY_INTERFACE_MODE_RMII)
 			val = macb->config->usrio->rmii;