Skip to contentSkip to conversation

net: thunderx: use proper interface type for RGMII

PATCH Applied Tim Harvey 3 participants 5 messages Feb 7, 2020 – Feb 12, 2020

Subsystems (3)
lore
Share & tools
lore

Tim Harvey

author
#0 lore raw

PATCH 1/1 net: thunderx: use proper interface type for RGMII

The configuration of the OCTEONTX XCV_DLL_CTL register via xcv_init_hw() is such that the RGMII RX delay is bypassed leaving the RGMII TX delay enabled in the MAC:

	/* Configure DLL - enable or bypass
	 * TX no bypass, RX bypass
	 */
	cfg = readq_relaxed(xcv->reg_base + XCV_DLL_CTL);
	cfg &= ~0xFF03;
	cfg |= CLKRX_BYP;
	writeq_relaxed(cfg, xcv->reg_base + XCV_DLL_CTL);

This would coorespond to a interface type of PHY_INTERFACE_MODE_RGMII_RXID and not PHY_INTERFACE_MODE_RGMII.

Fixing this allows RGMII PHY drivers to do the right thing (enable RX delay in the PHY) instead of erroneously enabling both delays in the PHY.

---
 drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/cavium/thunder/thunder_bgx.c +1 -1
index c4f6ec0..17a4110 100644
@@ -1039,7 +1039,7 @@ static int phy_interface_mode(u8 lmac_type)
 	if (lmac_type == BGX_MODE_QSGMII)
 		return PHY_INTERFACE_MODE_QSGMII;
 	if (lmac_type == BGX_MODE_RGMII)
-		return PHY_INTERFACE_MODE_RGMII;
+		return PHY_INTERFACE_MODE_RGMII_RXID;
 
 	return PHY_INTERFACE_MODE_SGMII;
 }
Signature · 7 lines
2.7.4


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · Tim Harvey

The configuration of the OCTEONTX XCV_DLL_CTL register via xcv_init_hw() is such that the RGMII RX delay is bypassed leaving the RGMII TX delay enabled in the MAC:

	/* Configure DLL - enable or bypass
	 * TX no bypass, RX bypass
	 */
	cfg = readq_relaxed(xcv->reg_base + XCV_DLL_CTL);
	cfg &= ~0xFF03;
	cfg |= CLKRX_BYP;
	writeq_relaxed(cfg, xcv->reg_base + XCV_DLL_CTL);
Quoted 6 lines

This would coorespond to a interface type of PHY_INTERFACE_MODE_RGMII_RXID and not PHY_INTERFACE_MODE_RGMII.

Fixing this allows RGMII PHY drivers to do the right thing (enable RX delay in the PHY) instead of erroneously enabling both delays in the PHY.

Hi Tim

This seems correct. But how has it worked in the past? Does this suggest there is PHY driver out there which is doing the wrong thing when passed PHY_INTERFACE_MODE_RGMII?

Andrew

author
#2 lore raw
Quoted 21 lines · Andrew Lunn
Quoted 12 lines · Tim Harvey

The configuration of the OCTEONTX XCV_DLL_CTL register via xcv_init_hw() is such that the RGMII RX delay is bypassed leaving the RGMII TX delay enabled in the MAC:

      /* Configure DLL - enable or bypass
       * TX no bypass, RX bypass
       */
      cfg = readq_relaxed(xcv->reg_base + XCV_DLL_CTL);
      cfg &= ~0xFF03;
      cfg |= CLKRX_BYP;
      writeq_relaxed(cfg, xcv->reg_base + XCV_DLL_CTL);
Quoted 6 lines

This would coorespond to a interface type of PHY_INTERFACE_MODE_RGMII_RXID and not PHY_INTERFACE_MODE_RGMII.

Fixing this allows RGMII PHY drivers to do the right thing (enable RX delay in the PHY) instead of erroneously enabling both delays in the PHY.

Quoted 8 lines

Hi Tim

This seems correct. But how has it worked in the past? Does this suggest there is PHY driver out there which is doing the wrong thing when passed PHY_INTERFACE_MODE_RGMII?

Andrew,

Yes, the DP83867 phy driver used on the Gateworks Newport boards would configure the delay in an incompatible way when enabled.

Tim

#3 lore raw
Quoted 28 lines · Tim Harvey
Quoted 27 lines · Andrew Lunn
Quoted 12 lines · Tim Harvey

The configuration of the OCTEONTX XCV_DLL_CTL register via xcv_init_hw() is such that the RGMII RX delay is bypassed leaving the RGMII TX delay enabled in the MAC:

      /* Configure DLL - enable or bypass
       * TX no bypass, RX bypass
       */
      cfg = readq_relaxed(xcv->reg_base + XCV_DLL_CTL);
      cfg &= ~0xFF03;
      cfg |= CLKRX_BYP;
      writeq_relaxed(cfg, xcv->reg_base + XCV_DLL_CTL);
Quoted 6 lines

This would coorespond to a interface type of PHY_INTERFACE_MODE_RGMII_RXID and not PHY_INTERFACE_MODE_RGMII.

Fixing this allows RGMII PHY drivers to do the right thing (enable RX delay in the PHY) instead of erroneously enabling both delays in the PHY.

Hi Tim

This seems correct. But how has it worked in the past? Does this suggest there is PHY driver out there which is doing the wrong thing when passed PHY_INTERFACE_MODE_RGMII?

Quoted 7 lines
Quoted 2 lines

Andrew,

Yes, the DP83867 phy driver used on the Gateworks Newport boards would configure the delay in an incompatible way when enabled.

Hi Tim

So it was broken? Maybe find the appropriate Fixes tag, and have David add it to stable?

Andrew

maintainer Applied
#4 lore raw
In reply to Tim Harvey

From: Tim Harvey <[email protected]>
Date: Fri, 7 Feb 2020 12:40:26 -0800

Quoted 12 lines

The configuration of the OCTEONTX XCV_DLL_CTL register via xcv_init_hw() is such that the RGMII RX delay is bypassed leaving the RGMII TX delay enabled in the MAC:

	/* Configure DLL - enable or bypass
	 * TX no bypass, RX bypass
	 */
	cfg = readq_relaxed(xcv->reg_base + XCV_DLL_CTL);
	cfg &= ~0xFF03;
	cfg |= CLKRX_BYP;
	writeq_relaxed(cfg, xcv->reg_base + XCV_DLL_CTL);
Quoted 8 lines

This would coorespond to a interface type of PHY_INTERFACE_MODE_RGMII_RXID and not PHY_INTERFACE_MODE_RGMII.

Fixing this allows RGMII PHY drivers to do the right thing (enable RX delay in the PHY) instead of erroneously enabling both delays in the PHY.

Applied, thanks.