]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: pcs: pcs-mtk-lynxi: pass SGMIISYS OF node to PCS
authorVladimir Oltean <vladimir.oltean@nxp.com>
Mon, 19 Jan 2026 09:12:19 +0000 (11:12 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 22 Jan 2026 03:46:58 +0000 (19:46 -0800)
commitbde1ae2d52ab3599e1c7ca68a90af8407d20f91d
treeb7ef7f73f52112aaedd851974ab53563f57a14b8
parent9f841922ebd0a34c78fc1984dc9abcb346704c58
net: pcs: pcs-mtk-lynxi: pass SGMIISYS OF node to PCS

The Mediatek LynxI PCS is used from the MT7530 DSA driver (where it does
not have an OF presence) and from mtk_eth_soc, where it does
(Documentation/devicetree/bindings/net/pcs/mediatek,sgmiisys.yaml
informs of a combined clock provider + SGMII PCS "SGMIISYS" syscon
block).

Currently, mtk_eth_soc parses the SGMIISYS OF node for the
"mediatek,pnswap" property and sets a bit in the "flags" argument of
mtk_pcs_lynxi_create() if set.

I'd like to deprecate "mediatek,pnswap" in favour of a property which
takes the current phy-mode into consideration. But this is only known at
mtk_pcs_lynxi_config() time, and not known at mtk_pcs_lynxi_create(),
when the SGMIISYS OF node is parsed.

To achieve that, we must pass the OF node of the PCS, if it exists, to
mtk_pcs_lynxi_create(), and let the PCS take a reference on it and
handle property parsing whenever it wants.

Use the fwnode API which is more general than OF (in case we ever need
to describe the PCS using some other format). This API should be NULL
tolerant, so add no particular tests for the mt7530 case.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20260119091220.1493761-5-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/mt7530-mdio.c
drivers/net/ethernet/mediatek/mtk_eth_soc.c
drivers/net/pcs/pcs-mtk-lynxi.c
include/linux/pcs/pcs-mtk-lynxi.h