Re: [PATCH v2 03/10] phy: rockchip: naneng-combphy: add SGMII MAC selection for RK3568

Coia Prant coiaprant at gmail.com
Sat Aug 1 19:51:37 PDT 2026


On August 2, 2026 4:58:39 AM GMT+08:00, Andrew Lunn <andrew at lunn.ch> wrote:
>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.
>> 
>> Add support for this selection by introducing
>> the "rockchip,sgmii-mac-sel" DT property.
>> 
>> The hardware reset value is GMAC1 (1). If the property is set to 0,
>> the driver routes SGMII to GMAC0; if set to 1 (or omitted), it
>> remains at GMAC1.
>> 
>> This is necessary for boards such as the Ariaboard Photonicat, which
>> uses the SGMII interface connected to GMAC0.
>
>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.g., "rgmii" or "rmii"), the GMAC works in
the corresponding mode and this register is not touched. The reset
default (GMAC1) remains, but it has no effect in non-SGMII modes because
the register only controls SGMII signal routing.

Regarding inference from phy-mode: phy-mode = "sgmii" only tells the MAC
driver that the interface is SGMII. It does not specify whether the
SGMII signals are physically routed to GMAC0 or GMAC1 on the board.
That routing is a board-level decision and cannot be derived from any
other DT property.

Also, the PHY (Naneng Combo PHY) is initialized by the XPCS glue driver
(pcs-xpcs-rk), not by the GMAC driver. The PHY driver has no way to know
which GMAC is using it. Making the PHY aware of the MAC ID would require
significant changes to the PHY layer, which is out of scope
for this series.

Therefore, an explicit DT property is the cleanest and most maintainable
way to describe this hardware routing.

Thanks,
Coia



More information about the linux-phy mailing list