Skip to content

Commit 9c47fe9

Browse files
yijiyangayaan-anwar
authored andcommitted
FROMLIST: net: stmmac: Inverse the phy-mode definition
In the initial device tree submission, the definitions of rgmii and rgmii-id in the phy-mode property were inverted compared to the conventions used by the upstream Linux kernel community. Only QCS-EVB-400 and SA8155-ADP platforms are affected due to the incorrect PHY mode configuration: 'rgmii' was used instead of the correct 'rgmii-id'. This change results in an ABI compatibility break, but it is acceptable as these platforms are not actively used by any customers, based on current observations. Qualcomm expects the MAC, not the PHY, to introduce the timing delay, and the driver is designed accordingly. This is due to specific SoC hardware that handles delay and sampling internally. Link: https://lore.kernel.org/netdev/20250819-qcs615_eth-v4-2-5050ed3402cb@oss.qualcomm.com/ Signed-off-by: Yijie Yang <yijie.yang@oss.qualcomm.com> Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
1 parent 1307064 commit 9c47fe9

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -387,14 +387,11 @@ static int ethqos_dll_configure(struct qcom_ethqos *ethqos)
387387
static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos, int speed)
388388
{
389389
struct device *dev = &ethqos->pdev->dev;
390-
int phase_shift;
390+
int phase_shift = 0;
391391
int loopback;
392392

393393
/* Determine if the PHY adds a 2 ns TX delay or the MAC handles it */
394-
if (ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII_ID ||
395-
ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII_TXID)
396-
phase_shift = 0;
397-
else
394+
if (ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII_ID)
398395
phase_shift = RGMII_CONFIG2_TX_CLK_PHASE_SHIFT_EN;
399396

400397
/* Disable loopback mode */
@@ -789,7 +786,14 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
789786
if (!ethqos)
790787
return -ENOMEM;
791788

789+
/* Qualcomm configures the MAC to introduce delay; instruct the
790+
* PHY not to add additional delay.
791+
*/
792+
if (plat_dat->phy_interface == PHY_INTERFACE_MODE_RGMII_ID)
793+
plat_dat->phy_interface = PHY_INTERFACE_MODE_RGMII;
794+
792795
ethqos->phy_mode = plat_dat->phy_interface;
796+
793797
switch (ethqos->phy_mode) {
794798
case PHY_INTERFACE_MODE_RGMII:
795799
case PHY_INTERFACE_MODE_RGMII_ID:

0 commit comments

Comments
 (0)