All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Claudiu Manoil <claudiu.manoil@nxp.com>
Cc: netdev@vger.kernel.org, s32@nxp.com,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	Wei Fang <wei.fang@nxp.com>, Clark Wang <xiaoning.wang@nxp.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Rob Herring <robh@kernel.org>,
	Saravana Kannan <saravanak@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	imx@lists.linux.dev, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH net-next v4 1/6] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node
Date: Thu, 19 Nov 2026 13:23:32 +0000	[thread overview]
Message-ID: <20261119132332.GV860048@horms.kernel.org> (raw)
In-Reply-To: <4f51bfd237fa584c7d9187d7b82f36e261853ea3.1794581338.git.claudiu.manoil@nxp.com>

On Fri, Nov 13, 2026 at 05:02:32PM +0200, Claudiu Manoil wrote:
> ENETCv4 has special internal links when connected to the on-chip NETC
> switch via internal switch ports, called pseudo-MAC links. These
> pseudo-MACs are proprietary, they don't implement any standard IEEE
> interface (like MII), and can be modeled as fixed links with the link
> speed determined at boot time by the Port PCR[PSPEED] register
> configuration.
> 
> We also need to be able to probe the ENETCv4 Ports featuring pseudo-MACs
> as pure PCI devices, i.e. without any "ethernet" DT node representation.
> The typical use case for this consists in a board with NETC connected
> via PCI to another host which probes the ENETC. Note that in this
> scenario, the pseudo-MAC ENETCs are connected internally to a NETC
> switch that is not owned by Linux.
> 
> Since such a port has no "ethernet" DT node, its fixed link has to be
> synthesized at probe time. Build the fixed-link subnode directly in C
> with an of_changeset: of_changeset_create_node() adds a "fixed-link"
> node onto the port's own OF node, and of_changeset_add_prop_*() populate
> its "speed" and "full-duplex" properties. The changeset is applied with
> of_changeset_apply(), so the fixed-link node is spliced onto the ENETC
> netdev's fwnode exactly as if it had come from static DT, and phylink
> picks it up through dev_fwnode().
> 
> The operating speed written into the node is read from PCR[PSPEED] at
> probe time and mapped to a phylink-supported value, so the fixed link
> reflects the actual boot-time configuration, as long as it's a phylink
> supported value. Otherwise, PCR[PSPEED] will be updated to the closest
> rounded down supported value.
> 
> The pseudo-MAC path is selected when the port has no OF node, or when it
> only has the empty PCI-synthesized node (OF_DYNAMIC), which carries no
> fixed-link description. Ports described by static DT take the regular
> of_get_phy_mode() path instead.
> 
> Building the fixed-link node requires the of_changeset API, which is only
> available with CONFIG_OF_DYNAMIC, so select it. As OF_DYNAMIC itself
> depends on OF, make NXP_ENETC4 depend on OF as well, rather than force
> OF_DYNAMIC on without the core OF code being built.
> 
> The changeset is reverted and destroyed on teardown and on the probe
> error unwind. The node-less pseudo-MAC path has a runtime dependency on
> CONFIG_PCI_DYNAMIC_OF_NODES: that is what makes the PCI core synthesize
> the per-function OF node (of_pci_make_dev_node()) that the fixed-link
> node is attached onto. This is intentionally not a hard Kconfig
> dependency, since the ENETC4 driver also serves regular ports described
> by static DT; when PCI_DYNAMIC_OF_NODES is absent the PCI function has no
> of_node and the pseudo-MAC probe path fails gracefully with a clear
> -ENODEV error.
> 
> Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>

Reviewed-by: Simon Horman <horms@kernel.org>


  parent reply	other threads:[~2026-11-19 13:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 15:02 [PATCH net-next v4 0/6] net: enetc: S32N79 pseudo-MAC (PPM) networking support Claudiu Manoil
2026-11-13 15:02 ` [PATCH net-next v4 1/6] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node Claudiu Manoil
2026-11-14 15:17   ` sashiko-bot
2026-11-17  9:08     ` Claudiu Manoil
2026-11-17 15:55   ` netdev-bot+sashiko
2026-11-18 16:11     ` Claudiu Manoil
2026-11-19 13:23   ` Simon Horman [this message]
2026-11-13 15:02 ` [PATCH net-next v4 2/6] net: enetc: Allocate int_vector array dynamically Claudiu Manoil
2026-11-19 13:23   ` Simon Horman
2026-11-13 15:02 ` [PATCH net-next v4 3/6] net: enetc: Enable probing of version 4.4 devices Claudiu Manoil
2026-11-17 15:55   ` netdev-bot+sashiko
2026-11-18 15:43     ` Claudiu Manoil
2026-11-19 13:24   ` Simon Horman
2026-11-13 15:02 ` [PATCH net-next v4 4/6] arm64: dts: s32n79: add NETC IEP18 ECAM node for ENETC PPM ports Claudiu Manoil
2026-11-13 15:02 ` [PATCH net-next v4 5/6] arm64: dts: s32n79-rdb: enable NETC IEP18 Claudiu Manoil
2026-11-17 15:55   ` netdev-bot+sashiko
2026-11-18 16:40     ` Claudiu Manoil
2026-11-13 15:02 ` [PATCH net-next v4 6/6] PCI: Create OF node for NXP ENETC pseudo-MAC functions Claudiu Manoil
2026-11-14 15:17   ` sashiko-bot
2026-11-17 15:55   ` netdev-bot+sashiko
2026-11-18 16:49     ` Claudiu Manoil
2026-11-20  3:20 ` [PATCH net-next v4 0/6] net: enetc: S32N79 pseudo-MAC (PPM) networking support patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261119132332.GV860048@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=s32@nxp.com \
    --cc=saravanak@kernel.org \
    --cc=vladimir.oltean@nxp.com \
    --cc=wei.fang@nxp.com \
    --cc=xiaoning.wang@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.