Skip to content

Commit 5b48f49

Browse files
dangowrtPaolo Abeni
authored andcommitted
net: dsa: mxl-gsw1xx: fix SerDes RX polarity
According to MaxLinear engineer Benny Weng the RX lane of the SerDes port of the GSW1xx switches is inverted in hardware, and the SGMII_PHY_RX0_CFG2_INVERT bit is set by default in order to compensate for that. Hence also set the SGMII_PHY_RX0_CFG2_INVERT bit by default in gsw1xx_pcs_reset(). Fixes: 2233593 ("net: dsa: add driver for MaxLinear GSW1xx switch family") Reported-by: Rasmus Villemoes <ravi@prevas.dk> Signed-off-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Link: https://patch.msgid.link/ca10e9f780c0152ecf9ae8cbac5bf975802e8f99.1764668951.git.daniel@makrotopia.org Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 4f0638b commit 5b48f49

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/net/dsa/lantiq/mxl-gsw1xx.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,16 @@ static int gsw1xx_pcs_reset(struct gsw1xx_priv *priv)
255255
FIELD_PREP(GSW1XX_SGMII_PHY_RX0_CFG2_FILT_CNT,
256256
GSW1XX_SGMII_PHY_RX0_CFG2_FILT_CNT_DEF);
257257

258-
/* TODO: Take care of inverted RX pair once generic property is
258+
/* RX lane seems to be inverted internally, so bit
259+
* GSW1XX_SGMII_PHY_RX0_CFG2_INVERT needs to be set for normal
260+
* (ie. non-inverted) operation.
261+
*
262+
* TODO: Take care of inverted RX pair once generic property is
259263
* available
260264
*/
261265

266+
val |= GSW1XX_SGMII_PHY_RX0_CFG2_INVERT;
267+
262268
ret = regmap_write(priv->sgmii, GSW1XX_SGMII_PHY_RX0_CFG2, val);
263269
if (ret < 0)
264270
return ret;

0 commit comments

Comments
 (0)