net: pcs: pcs-mtk-lynxi: fix bpi-r3 serdes configuration
Subsystems (5)
PATCH v2 1/1 net: pcs: pcs-mtk-lynxi: fix bpi-r3 serdes configuration
From: Frank Wunderlich <[email protected]>
Commit 8871389da151 introduces common pcs dts properties which writes rx=normal,tx=normal polarity to register SGMSYS_QPHY_WRAP_CTRL of switch. This is initialized with tx-bit set and so change inverts polarity compared to before.
It looks like mt7531 has tx polarity inverted in hardware and set tx-bit by default to restore the normal polarity.
The MT7531 datasheet quite clearly states:
Register 000050EC QPHY_WRAP_CTRL -- QPHY wrapper control Reset value: 0x00000501
BIT 1 RX_BIT_POLARITY -- RX bit polarity control
1'b0: normal
1'b1: inverted
BIT 0 TX_BIT_POLARITY -- TX bit polarity control (TX default inversed in MT7531)
1'b0: normal
1'b1: inverted
Till this patch the register write was only called when mediatek,pnswap property was set which cannot be done for switch because the fw-node param was always NULL from switch driver in the mtk_pcs_lynxi_create call.
Do not configure switch side like it's done before.
---
v2:
- send as non-RFC
- add datasheet information from Daniel
--- drivers/net/pcs/pcs-mtk-lynxi.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/pcs/pcs-mtk-lynxi.c +3 -0
@@ -129,6 +129,9 @@ static int mtk_pcs_config_polarity(struct mtk_pcs_lynxi *mpcs,unsigned int val =0 ;int ret; +if (!fwnode) +return 0 ; +if (fwnode_property_read_bool (fwnode,"mediatek,pnswap" )) default_pol =PHY_POL_INVERT ;
Signature · 1 line
2.53.0
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Tue, 26 May 2026 17:32:38 +0200 you wrote:
From: Frank Wunderlich <[email protected]>
Commit
8871389da151introduces common pcs dts properties which writes rx=normal,tx=normal polarity to registerSGMSYS_QPHY_WRAP_CTRLof switch. This is initialized with tx-bit set and so change inverts polarity compared to before.[...]
Here is the summary with links:
- [net,v2] net: pcs: pcs-mtk-lynxi: fix bpi-r3 serdes configuration
https://git.kernel.org/netdev/net/c/422b5233b607
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html