Re: [PATCH v2 03/10] phy: rockchip: naneng- combphy: add SGMII MAC selection for RK3568
Coia Prant <[email protected]> Sun, 02 Aug 2026 10:51:37 +0800
| Newsgroups | org.kernel.vger.linux-renesas-soc,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-phy,org.infradead.lists.linux-rockchip,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.netdev |
|---|---|
| Message-ID | <[email protected]> |
On August 2, 2026 4:58:39 AM GMT+08:00, Andrew Lunn <andrew@lunn=2Ech> wrot= e: >On Sat, Aug 01, 2026 at 10:22:27PM +0800, Coia Prant wrote: >> On RK3568, the SGMII interface can be routed to either GMAC0 or >> GMAC1 via the GRF register pipe_sgmii_mac_sel=2E >>=20 >> Add support for this selection by introducing >> the "rockchip,sgmii-mac-sel" DT property=2E >>=20 >> The hardware reset value is GMAC1 (1)=2E If the property is set to 0, >> the driver routes SGMII to GMAC0; if set to 1 (or omitted), it >> remains at GMAC1=2E >>=20 >> This is necessary for boards such as the Ariaboard Photonicat, which >> uses the SGMII interface connected to GMAC0=2E > >If SGMII is not selected, what MII is used? RGMII? > >Can this setting be implied from phy-mode? > > Andrew Hi Andrew, If phy-mode is not "sgmii" (e=2Eg=2E, "rgmii" or "rmii"), the GMAC works i= n the corresponding mode and this register is not touched=2E The reset default (GMAC1) remains, but it has no effect in non-SGMII modes because the register only controls SGMII signal routing=2E Regarding inference from phy-mode: phy-mode =3D "sgmii" only tells the MAC driver that the interface is SGMII=2E It does not specify whether the SGMII signals are physically routed to GMAC0 or GMAC1 on the board=2E That routing is a board-level decision and cannot be derived from any other DT property=2E Also, the PHY (Naneng Combo PHY) is initialized by the XPCS glue driver (pcs-xpcs-rk), not by the GMAC driver=2E The PHY driver has no way to know which GMAC is using it=2E Making the PHY aware of the MAC ID would require significant changes to the PHY layer, which is out of scope for this series=2E Therefore, an explicit DT property is the cleanest and most maintainable way to describe this hardware routing=2E Thanks, Coia