]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: enetc: add pre-boot initialization for i.MX94 switch
authorWei Fang <wei.fang@nxp.com>
Mon, 18 May 2026 08:24:54 +0000 (16:24 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 21 May 2026 11:04:41 +0000 (13:04 +0200)
commitf059d55fd8a0d2657f592045de98f87286031bc6
tree5ac830cb8032f42d40f97943c350524df74ba0ff
parent6d019124be60b4e78a81fd802758c9c18fd52cd9
net: enetc: add pre-boot initialization for i.MX94 switch

Before probing the NETC switch driver, some pre-initialization needs to
be set in NETCMIX and IERB to ensure that the switch can work properly.
For example, i.MX94 NETC switch has three external ports and each port
is bound to a link. And each link needs to be configured so that it can
work properly, such as I/O variant and MII protocol.

In addition, the switch port 2 (MAC 2) and ENETC 0 (MAC 3) share the same
parallel interface, they cannot be used at the same time due to the SoC
constraint. And the MAC selection is controlled by the mac2_mac3_sel bit
of EXT_PIN_CONTROL register. Currently, the interface is set for ENETC 0
by default unless the switch port 2 is enabled in the DT node.

Like ENETC, each external port of the NETC switch can manage its external
PHY through its port MDIO registers. And the port can only access its own
external PHY by setting the PHY address to the LaBCR[MDIO_PHYAD_PRTAD].
If the accessed PHY address is not equal to LaBCR[MDIO_PHYAD_PRTAD], then
the MDIO access initiated by port MDIO will be invalid.

Signed-off-by: Wei Fang <wei.fang@nxp.com>
Link: https://patch.msgid.link/20260518082506.1318236-4-wei.fang@nxp.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c