Skip to contentSkip to conversation

net: enetc: S32N79 pseudo-MAC (PPM) networking support

PATCH Applied Claudiu Manoil 5 participants 22 messages Nov 13 – Nov 20

Subsystems (6)
lore
Share & tools
lore

Claudiu Manoil

author maintainer
#0 lore raw

v4 cover net: enetc: S32N79 pseudo-MAC (PPM) networking support

This series adds networking support for the ENETCv4.4 pseudo-MAC (PPM) ports found on the NXP S32N79 SoC. On S32N79, the ENETCv4 ports are not wired to any external PHY/MII; instead they are internal "pseudo-MAC" links into the on-chip NETC switch. These links are proprietary, expose no standard IEEE interface, and run at a speed fixed at boot time by the Port PCR[PSPEED] register.

A key use case is a port that has no "ethernet" DT node at all: NETC is reached over PCI from a host that probes the ENETC, while the internal NETC switch it connects to is not owned by Linux. Such a port must have its fixed link synthesized at probe time.

The driver synthesizes the fixed link directly in C using an of_changeset:
of_changeset_create_node() adds a "fixed-link" subnode onto the PCI function's dynamic OF node (CONFIG_PCI_DYNAMIC_OF_NODES), with the "speed" property read from PCR[PSPEED] at probe time and "full-duplex" set. phylink then picks up the fixed-link node through dev_fwnode().

The series touches three subsystems:
- net/enetc: pseudo-MAC fixed-link support, probing of 4.4 devices and a fix for more than 6 ring interrupt vectors
- arm64 dts: NETC IEP18 ECAM node on S32N79 and its RDB board enable
- PCI: a quirk creating the OF node for the ENETC PMAC functions

Because this is primarily a networking feature and the pieces are interdependent at runtime, it would be most convenient to merge the whole series through the netdev tree.

Patch 1 has a runtime (not Kconfig) dependency on CONFIG_PCI_DYNAMIC_OF_NODES; absent that, the pseudo-MAC probe path fails gracefully with -ENODEV.

v4:
- Patch 1: made NXP_ENETC4 depend on OF, as OF_DYNAMIC is only available with OF; improved the commit message.
- Patch 2: new, allocates the int_vector array dynamically to prevent an out-of-bounds access on S32N79.
- Patch 3: clarified the commit message.
- Patches 4-6: no changes.
v3:
- Patch 1: fixed the CONFIG_OF_DYNAMIC dependency, refactored enetc4_add_ppm_fixed_link() as per Wei's feedback, and improved the commit message.
- Patch 3: added sysclk_freq info for the v4.4 ENETC devices.
- Patches 4-6: no changes.
v2:
- Switched the fixed-link patch from a DT overlay blob (of_overlay_fdt_apply() + a .dtso compiled to .dtbo) to of_changeset_create_node(), per review feedback. This drops the embedded overlay externs, the Makefile .dtbo wrapping, and the OF_OVERLAY Kconfig dependency. The operating speed is now baked directly into the changeset-created fixed-link node (read once from PCR[PSPEED] at probe time); the phylink get_fixed_state callback is no longer needed and was removed.
- Described why there are two ENETC PF IDs in the commit message, as per review.
- Replaced the 'msi-parent' stub property with 'msi-map', as per H/W spec.
- Reworded the PCI patch commit message to match the fixed-link approach (no functional change); added Bjorn's Acked-by.
v1: initial submission.

Claudiu Manoil (6):
net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link
node
net: enetc: Allocate int_vector array dynamically
net: enetc: Enable probing of version 4.4 devices
arm64: dts: s32n79: add NETC IEP18 ECAM node for ENETC PPM ports
arm64: dts: s32n79-rdb: enable NETC IEP18
PCI: Create OF node for NXP ENETC pseudo-MAC functions

 arch/arm64/boot/dts/freescale/s32n79-rdb.dts  |   4 +
 arch/arm64/boot/dts/freescale/s32n79.dtsi     |  24 ++++
 drivers/net/ethernet/freescale/enetc/Kconfig  |   2 +
 drivers/net/ethernet/freescale/enetc/enetc.c  |  34 ++++++
 drivers/net/ethernet/freescale/enetc/enetc.h  |   3 +-
 .../net/ethernet/freescale/enetc/enetc4_pf.c  | 109 +++++++++++++++++-
 .../net/ethernet/freescale/enetc/enetc_hw.h   |   4 +-
 .../net/ethernet/freescale/enetc/enetc_pf.h   |   2 +
 .../freescale/enetc/enetc_pf_common.c         |  41 ++++++-
 .../freescale/enetc/enetc_pf_common.h         |   1 +
 drivers/pci/quirks.c                          |   2 +
 11 files changed, 214 insertions(+), 12 deletions(-)
Signature · 1 line
2.34.1
author maintainer
#1 lore raw

PATCH v4 1/6 net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node

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.

---
v4:
- Made NXP_ENETC4 depend on OF, since OF_DYNAMIC (selected for the of_changeset API) is only available with OF; added to the commit message. Reported by the kernel test robot on v2 and in review.

v3:
- Fixed the CONFIG_OF_DYNAMIC dependency.
- Refactored enetc4_add_ppm_fixed_link(), as per Wei's feedback.
- Improved the commit message.

v2:
- Switched from a DT overlay blob (of_overlay_fdt_apply() + a .dtso compiled to .dtbo) to of_changeset_create_node(), per review feedback. Drops the embedded overlay externs, the Makefile .dtbo wrapping, and the OF_OVERLAY Kconfig dependency.
- Baked the operating speed directly into the changeset-created fixed-link node (read once from PCR[PSPEED] at probe time); the phylink get_fixed_state callback is no longer needed and was removed.

 drivers/net/ethernet/freescale/enetc/Kconfig  |   2 +
 .../net/ethernet/freescale/enetc/enetc4_pf.c  | 109 +++++++++++++++++-
 .../net/ethernet/freescale/enetc/enetc_pf.h   |   2 +
 .../freescale/enetc/enetc_pf_common.c         |  41 ++++++-
 .../freescale/enetc/enetc_pf_common.h         |   1 +
 5 files changed, 146 insertions(+), 9 deletions(-)
drivers/net/ethernet/freescale/enetc/Kconfig +2 -0
index f425f82a6213..465c913683c8 100644
@@ -49,12 +49,14 @@ config NXP_ENETC4
 	tristate "ENETC4 PF driver"
 	depends on PTP_1588_CLOCK_OPTIONAL
 	depends on PCI_MSI
+	depends on OF
 	select FSL_ENETC_CORE
 	select FSL_ENETC_MDIO
 	select NXP_ENETC_PF_COMMON
 	select NXP_NTMP
 	select PHYLINK
 	select DIMLIB
+	select OF_DYNAMIC
 	help
 	  This driver supports NXP ENETC devices with major revision 4. ENETC is
 	  as the NIC functionality in NETC, it supports virtualization/isolation
drivers/net/ethernet/freescale/enetc/enetc4_pf.c +103 -6

152 lines not on this page · raw message

drivers/net/ethernet/freescale/enetc/enetc_pf.h +2 -0
index 1f92d16d8ca8..ab11e40cfdbb 100644
@@ -67,6 +67,8 @@ struct enetc_pf {
 	bool sriov_enabled;
 	bool link_up;
 	u16 link_status_ms_mask;
+
+	struct of_changeset *ppm_ocs; /* pseudo-MAC fixed-link changeset */
 };
 
 #define phylink_to_enetc_pf(config) \
drivers/net/ethernet/freescale/enetc/enetc_pf_common.c +38 -3

53 lines not on this page · raw message

drivers/net/ethernet/freescale/enetc/enetc_pf_common.h +1 -0
index c9eed879d5a3..aede1aad6362 100644
@@ -13,6 +13,7 @@ void enetc_mdiobus_destroy(struct enetc_pf *pf);
 int enetc_phylink_create(struct enetc_ndev_priv *priv, struct device_node *node,
 			 const struct phylink_mac_ops *ops);
 void enetc_phylink_destroy(struct enetc_ndev_priv *priv);
+int enetc_phylink_match_pseudo_mac_speed(int speed);
 void enetc_set_default_rss_key(struct enetc_pf *pf);
 int enetc_vlan_rx_add_vid(struct net_device *ndev, __be16 prot, u16 vid);
 int enetc_vlan_rx_del_vid(struct net_device *ndev, __be16 prot, u16 vid);
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH net-next v4 1/6] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] net: enetc: enetc_phylink_match_pseudo_mac_speed() returns

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Medium] net: enetc: enetc_phylink_match_pseudo_mac_speed() returns

Quoted 1 line

10G fixed-link

--

commit 15e36db0338302292004a6cbf3727d8f9d63565f
Author: Claudiu Manoil <[email protected]>

net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node

This commit adds pseudo-MAC support for ENETCv4 ports lacking static DT nodes by synthesizing a fixed-link DT subnode at probe time with the speed derived from PCR[PSPEED].

Quoted 34 lines
drivers/net/ethernet/freescale/enetc/enetc_pf_common.c +26 -0
index 8facc8bf8693a..b032b586f07b4 100644
@@ -436,6 +436,43 @@ void enetc_mdiobus_destroy(struct enetc_pf *pf)
 }
 EXPORT_SYMBOL_GPL(enetc_mdiobus_destroy);
 
+static struct {
+	unsigned long mac_cap;
+	int speed; /* descending order sorted  */
+} enetc_phylink_pseudo_mac_caps[] = {
+	{ MAC_25000FD,  SPEED_25000 },
+	{ MAC_20000FD,  SPEED_20000 },
+	{ MAC_10000FD,  SPEED_10000 },
+	{ MAC_5000FD,   SPEED_5000  },
+	{ MAC_2500FD,   SPEED_2500  },
+	{ MAC_1000FD,   SPEED_1000  },
+	{ MAC_100FD,    SPEED_100   },
+	{ MAC_10FD,     SPEED_10    },
+};
+
+static unsigned long enetc_phylink_get_pseudo_mac_caps(void)
+{
+	unsigned long mac_caps = 0;
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(enetc_phylink_pseudo_mac_caps); i++)
+		mac_caps |= enetc_phylink_pseudo_mac_caps[i].mac_cap;
+
+	return mac_caps;
+}
+
+int enetc_phylink_match_pseudo_mac_speed(int speed)

drivers/net/ethernet/freescale/enetc/enetc_pf_common.c void enetc_mdiobus_destroy(struct enetc_pf *pf) · line 474

Quoted 10 lines
drivers/net/ethernet/freescale/enetc/enetc_pf_common.c +10 -0
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(enetc_phylink_pseudo_mac_caps); i++)
+		if (enetc_phylink_pseudo_mac_caps[i].speed <= speed)
+			return enetc_phylink_pseudo_mac_caps[i].speed;
+
+	return SPEED_UNKNOWN;
+}
+EXPORT_SYMBOL_GPL(enetc_phylink_match_pseudo_mac_speed);

[Severity: Medium]
Can phylink_parse_fixedlink() handle SPEED_20000 or SPEED_25000 when enetc4_add_ppm_fixed_link() writes the result of enetc_phylink_match_pseudo_mac_speed() into the fixed-link DT node?

When PCR[PSPEED] is configured for 20 Gbps or 25 Gbps at boot, enetc_phylink_match_pseudo_mac_speed() returns 20000 or 25000, but phylink_fill_fixedlink_supported() only populates linkmodes up to 10000baseT_Full:

drivers/net/phy/phylink.c:phylink_fill_fixedlink_supported() {
    ...
	linkmode_set_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, supported);
	linkmode_set_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT, supported);
	linkmode_set_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT, supported);
}

As a result, phy_caps_lookup() in phylink_parse_fixedlink() returns NULL, triggering a phylink warning ("fixed link full duplex 20000Mbps not recognised") and leaving pl->supported, pl->link_config.advertising, and pl->link_config.lp_advertising with no speed linkmode bits set.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
author maintainer
#3 lore raw

RE: [PATCH net-next v4 1/6] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node

From: [email protected] <[email protected]>
Sent: Saturday, November 14, 2026 5:17 PM

Quoted 27 lines

To: Claudiu Manoil <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH net-next v4 1/6] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Medium] net: enetc: enetc_phylink_match_pseudo_mac_speed() returns

Quoted 1 line

10G fixed-link

--

commit 15e36db0338302292004a6cbf3727d8f9d63565f
Author: Claudiu Manoil <[email protected]>

net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node

This commit adds pseudo-MAC support for ENETCv4 ports lacking static DT nodes by synthesizing a fixed-link DT subnode at probe time with the speed derived from PCR[PSPEED].

Review

Quoted 1 line
(quoted diff) +0 -0

b/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c

Quoted 3 lines

index 8facc8bf8693a..b032b586f07b4 100644

drivers/net/ethernet/freescale/enetc/enetc_pf_common.c +0 -0

[...]

Quoted 20 lines

[Severity: Medium]
Can phylink_parse_fixedlink() handle SPEED_20000 or SPEED_25000 when enetc4_add_ppm_fixed_link() writes the result of enetc_phylink_match_pseudo_mac_speed() into the fixed-link DT node?

When PCR[PSPEED] is configured for 20 Gbps or 25 Gbps at boot, enetc_phylink_match_pseudo_mac_speed() returns 20000 or 25000, but phylink_fill_fixedlink_supported() only populates linkmodes up to 10000baseT_Full:

drivers/net/phy/phylink.c:phylink_fill_fixedlink_supported() {
    ...
	linkmode_set_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT,
supported);
	linkmode_set_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT,
supported);
	linkmode_set_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT,

supported);
}

Quoted 6 lines

As a result, phy_caps_lookup() in phylink_parse_fixedlink() returns NULL, triggering a phylink warning ("fixed link full duplex 20000Mbps not recognised") and leaving pl->supported, pl->link_config.advertising, and pl->link_config.lp_advertising with no speed linkmode bits set.

--

Hello,

This remains the only outstanding issue for this series introducing S32N79 support [1], and I would prefer not to address this in this series, for two reasons:

1. It is not specific to the ENETC pseudo-MAC support. The ENETC driver already advertises MAC_20000FD and MAC_25000FD for pseudo-MAC ports (see 7c9a6ae0edb2 "net: enetc: differentiate phylink capabilities for pseudo-MAC and standalone MAC"), so this series does not introduce the situation. It only makes it reachable through a fixed-link node, which is the same mechanism any other fixed-link MAC would use for these speeds.

2. The limit sits in generic code and in the binding, not in this driver. Besides phylink's supported mask, the "speed" property of fixed-link in Documentation/devicetree/bindings/net/ethernet-controller.yaml is also restricted to 10, 100, 1000, 2500, 5000 and 10000. Limiting fixed links to 10G looks arbitrary to me given that 20G and 25G are standard speeds and are already handled by phylink's capability and phy_caps tables for non-fixed-link MACs.

Extending fixed-link to 20G and 25G therefore touches phylink and the DT binding. I think it deserves its own series, where it can be reviewed on its own merits by the phylink and DT maintainers, rather than being bundled with S32N79 enablement.

This is the only outstanding issue I am aware of for this series. I'm open to send the phylink and binding change as a separate follow-up once we agree on the approach, if no one else wants to do it.

Does that approach work for you?

Regards
Claudiu

[1] https://lore.kernel.org/netdev/[email protected]

#4 lore raw

Re: [PATCH net-next v4 1/6] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node

In reply to Claudiu Manoil
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider.

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 2

If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough).

- [Medium] In enetc4_link_init() (drivers/net/ethernet/freescale/enetc/enetc4_pf.c:1025-1047), the…
- [Low] In drivers/net/ethernet/freescale/enetc/enetc4_pf.c, enetc4_link_init() (lines 1035-1047) only builds the pseudo-MAC fixed-…
- [Low] enetc4_add_ppm_fixed_link() (drivers/net/ethernet/freescale/enetc/enetc4_pf.c:996) writes a…

--

net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node

This lets ENETCv4 pseudo-MAC ports probe without a static DT "ethernet" node. At probe time an of_changeset adds a "fixed-link" child node whose speed is read from PCR[PSPEED]. The pseudo-MAC path runs when the port has no OF node or only an OF_DYNAMIC node, and the changeset is reverted on teardown and on the probe error unwind.

Quoted 4 lines
drivers/net/ethernet/freescale/enetc/enetc4_pf.c +0 -0
index 71c971618388b..b7e7201e6a71a 100644

[ ... ]

Quoted 10 lines
drivers/net/ethernet/freescale/enetc/enetc4_pf.c +10 -0
+static int enetc4_add_ppm_fixed_link(struct enetc_pf *pf,
+				     struct device_node *np)
+{
+	struct device_node *fixed_link;
+	struct of_changeset *ocs;
+	int speed, err;
+
+	enetc4_get_pcr_speed(&pf->si->hw, &speed);
+	speed = enetc_phylink_match_pseudo_mac_speed(speed);
+

[ ... ]

drivers/net/ethernet/freescale/enetc/enetc4_pf.c static void enetc4_pci_remove(void *data) · line 996

Quoted 7 lines
drivers/net/ethernet/freescale/enetc/enetc4_pf.c +7 -0
+	fixed_link = of_changeset_create_node(ocs, np, "fixed-link");
+	if (!fixed_link) {
+		err = -ENOMEM;
+		goto err_destroy;
+	}
+
+	err = of_changeset_add_prop_u32(ocs, fixed_link, "speed", speed);

[Severity: Low]
This isn't a bug, but can this write a speed value that the fixed-link binding doesn't allow?

enetc_phylink_pseudo_mac_caps[] in enetc_pf_common.c includes SPEED_25000 and SPEED_20000. When PCR[PSPEED] maps to 20000 Mbps or more, enetc_phylink_match_pseudo_mac_speed() returns 20000 or 25000.

In Documentation/devicetree/bindings/net/ethernet-controller.yaml, the fixed-link speed property only allows:

    enum: [10, 100, 1000, 2500, 5000, 10000]

phylink still accepts these values. But the node is built at runtime, so dt-schema never checks it.

Should the binding be extended (as was done for 5000)? Or should the driver stick to the speeds the binding lists?

Quoted 2 lines
drivers/net/ethernet/freescale/enetc/enetc4_pf.c +2 -0
+	if (err)
+		goto err_put_node;

[ ... ]

Quoted 7 lines

static int enetc4_link_init(struct enetc_ndev_priv *priv,

drivers/net/ethernet/freescale/enetc/enetc4_pf.c +1 -0
 			    struct device_node *node)
 {
+	bool dynamic = node && of_node_check_flag(node, OF_DYNAMIC);
 	struct enetc_pf *pf = enetc_si_priv(priv->si);
 	struct device *dev = priv->dev;
 	int err;

drivers/net/ethernet/freescale/enetc/enetc4_pf.c static void enetc4_pci_remove(void *data) · line 1034

Quoted 10 lines
drivers/net/ethernet/freescale/enetc/enetc4_pf.c +5 -4
 
-	err = of_get_phy_mode(node, &pf->if_mode);
-	if (err) {
-		dev_err(dev, "Failed to get PHY mode\n");
-		return err;
+	/* Pseudo-MAC ENETCs are described by a runtime-synthesized fixed-link
+	 * node rather than static DT. This covers both a missing OF node and a
+	 * PCI-synthesized (OF_DYNAMIC) node, which is an empty node created
+	 * by the PCI core and thus carries no fixed-link description.
+	 */

[Severity: Low]
Is this comment accurate?

The PCI-synthesized node isn't empty. of_pci_make_dev_node() fills it in through of_pci_add_properties() (compatible, reg, ...) before it applies the changeset. The only accurate part is that it has no fixed-link child.

The branch also doesn't really cover a missing OF node. That case just returns -ENODEV below.

Related to this: at this commit, the PCI core doesn't create a node for an ENETC endpoint function. pci_bus_add_device() only does it for bridges:

    if (pci_is_bridge(dev))
        of_pci_make_dev_node(dev);

drivers/pci/quirks.c has no ENETC entries either. So a pseudo-MAC port without a node always hits the "Missing of_node for Pseudo-MAC port" error here.

A later patch in the series, "PCI: Create OF node for NXP ENETC pseudo-MAC functions", fixes that. It adds DECLARE_PCI_FIXUP_FINAL() entries for PCI_VENDOR_ID_PHILIPS device IDs 0xe101 and 0xe110 that call of_pci_make_dev_node(). With the whole series applied, only the comment wording is left.

drivers/net/ethernet/freescale/enetc/enetc4_pf.c static void enetc4_pci_remove(void *data) · line 1036

Quoted 2 lines
drivers/net/ethernet/freescale/enetc/enetc4_pf.c +2 -0
+	if (enetc_is_pseudo_mac(priv->si) && (!node || dynamic)) {
+		pf->if_mode = PHY_INTERFACE_MODE_INTERNAL;

[Severity: Medium]
Is the OF_DYNAMIC flag enough to show that the node has no link description?

__of_node_dup() sets OF_DYNAMIC, and DT overlays create their nodes with it in add_changeset_node(). An overlay can also be applied on top of the node from of_pci_make_dev_node() to add phy-mode or fixed-link.

In either case, this branch:

- skips of_get_phy_mode()
- forces PHY_INTERFACE_MODE_INTERNAL
- calls enetc4_add_ppm_fixed_link(), which calls of_changeset_create_node(ocs, np, "fixed-link") without checking for an existing fixed-link child

__of_attach_node() puts the new node at the head of the child list:

    np->sibling = np->parent->child;
    np->parent->child = np;

phylink_parse_fixedlink() looks the node up with fwnode_get_named_child_node(), so it would find the driver-synthesized fixed-link before the DT one.

Would that leave two fixed-link children and replace the DT-provided speed with the PCR[PSPEED] value?

The commit message says:

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.

Nothing in the code checks that, though. Would a check such as of_get_child_by_name(node, "fixed-link") or of_property_present(node, "phy-mode") make the code match the description?

Quoted 5 lines
drivers/net/ethernet/freescale/enetc/enetc4_pf.c +5 -0
+
+		if (!node) {
+			dev_err(dev, "Missing of_node for Pseudo-MAC port\n");
+			return -ENODEV;
+		}

[ ... ]

Signature · 1 line
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1794581338.git.claudiu.manoil%40nxp.com
author maintainer
#5 lore raw

RE: [PATCH net-next v4 1/6] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node

From: [email protected] <[email protected]>
Sent: Tuesday, November 17, 2026 5:55 PM

Quoted 41 lines

To: Claudiu Manoil <[email protected]>
Cc: [email protected]; dl-S32 <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH net-next v4 1/6] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider.

Critical: 0 * High: 0 * Medium: 1 * Low: 2

If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough).

- [Medium] In enetc4_link_init() (drivers/net/ethernet/freescale/enetc/enetc4_pf.c:1025-1047), the...
- [Low] In drivers/net/ethernet/freescale/enetc/enetc4_pf.c, enetc4_link_init() (lines 1035-1047) only builds the pseudo-MAC fixed-...
- [Low] enetc4_add_ppm_fixed_link() (drivers/net/ethernet/freescale/enetc/enetc4_pf.c:996) writes a...

--

net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node

This lets ENETCv4 pseudo-MAC ports probe without a static DT "ethernet" node. At probe time an of_changeset adds a "fixed-link" child node whose speed is read from PCR[PSPEED]. The pseudo-MAC path runs when the port has
no OF node or only an OF_DYNAMIC node, and the changeset is reverted on teardown and on the probe error unwind.

Review

Quoted 1 line
(quoted diff) +0 -0

b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c

Quoted 3 lines

index 71c971618388b..b7e7201e6a71a 100644

drivers/net/ethernet/freescale/enetc/enetc4_pf.c +0 -0

[ ... ]

Quoted 30 lines

[Severity: Medium]
Is the OF_DYNAMIC flag enough to show that the node has no link description?

__of_node_dup() sets OF_DYNAMIC, and DT overlays create their nodes with it in add_changeset_node(). An overlay can also be applied on top of the node from of_pci_make_dev_node() to add phy-mode or fixed-link.

In either case, this branch:

- skips of_get_phy_mode()
- forces PHY_INTERFACE_MODE_INTERNAL
- calls enetc4_add_ppm_fixed_link(), which calls of_changeset_create_node(ocs, np, "fixed-link") without checking for an existing fixed-link child

__of_attach_node() puts the new node at the head of the child list:

    np->sibling = np->parent->child;
    np->parent->child = np;

phylink_parse_fixedlink() looks the node up with fwnode_get_named_child_node(), so it would find the driver-synthesized fixed-link before the DT one.

Would that leave two fixed-link children and replace the DT-provided speed with the PCR[PSPEED] value?

The commit message says:

Quoted 9 lines

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.

Nothing in the code checks that, though. Would a check such as of_get_child_by_name(node, "fixed-link") or of_property_present(node, "phy-mode") make the code match the description?

Same point was made on v2, and the reply is the same [1].

This is a theoretical case, the Pseudo-MAC ports will not have overlays on top. It's either static DT node (fully specified), or a clean PCI-synthetized node. Any other configuration for the Pseudo-MAC node (like the one implied above) is not valid.

[1] https://lore.kernel.org/all/GV2PR04MB1174015C406D353895C57476696692@GV2PR04MB11740.eurprd04.prod.outlook.com/

reviewer Reviewed-by on v4 1/6
#6 lore raw

Re: [PATCH net-next v4 1/6] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node

In reply to Claudiu Manoil
Quoted 49 lines · Claudiu Manoil

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.

Quoted 1 line
author maintainer
#7 lore raw

PATCH v4 2/6 net: enetc: Allocate int_vector array dynamically

In reply to Claudiu Manoil

The number of Rx/Tx ring interrupt vectors, priv->bdr_int_num, is set in enetc_init_si_rings_params() to the lesser of the number of online CPUs and the number of Rx rings of the station interface. The int_vector[] array in struct enetc_ndev_priv, however, has a fixed size of ENETC_MAX_BDR_INT (6), a limit that dates back to the maximum CPU count of the SoCs integrating ENETC at the time.

That assumption does not hold for S32N79, which has 8 CPUs and gives the ENETC PF up to 8 Rx rings. There, bdr_int_num can reach 8, and enetc_alloc_msix() writes priv->int_vector[i] past the end of the array, corrupting the adjacent fields of the netdev private area. No SoC currently supported upstream exceeds 6 vectors, so this is not reachable today; it must be fixed before S32N79 devices can be enabled by a following patch.

Allocate int_vector[] with devm_kcalloc() in enetc_alloc_msix(), once bdr_int_num is known. The memory is released together with the PCI device, so no explicit free is needed on the error or teardown paths. This is common code, so the PF and VF drivers benefit alike. Drop the ENETC_MAX_BDR_INT define, which only existed to size this array.

---
v4:
- New patch. Prevents an out-of-bounds access to priv->int_vector[] when bdr_int_num exceeds 6, as is the case on S32N79, as requested in review.

 drivers/net/ethernet/freescale/enetc/enetc.c | 8 ++++++++
 drivers/net/ethernet/freescale/enetc/enetc.h | 3 +--
 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/net/ethernet/freescale/enetc/enetc.c +8 -0
index c6571b5cc842..855b2d3b8718 100644
@@ -3641,6 +3641,13 @@ int enetc_alloc_msix(struct enetc_ndev_priv *priv)
 	if (n != nvec)
 		return -EPERM;
 
+	priv->int_vector = devm_kcalloc(&pdev->dev, priv->bdr_int_num,
+					sizeof(*priv->int_vector), GFP_KERNEL);
+	if (!priv->int_vector) {
+		err = -ENOMEM;
+		goto fail_int_vector;
+	}
+
 	/* # of tx rings per int vector */
 	v_tx_rings = priv->num_tx_rings / priv->bdr_int_num;
 	v_remainder = priv->num_tx_rings % priv->bdr_int_num;
@@ -3676,6 +3683,7 @@ int enetc_alloc_msix(struct enetc_ndev_priv *priv)
 	while (i--)
 		enetc_int_vector_destroy(priv, i);
 
+fail_int_vector:
 	pci_free_irq_vectors(pdev);
 
 	return err;
drivers/net/ethernet/freescale/enetc/enetc.h +1 -2
index d9e91832a9c1..689ad82b2949 100644
@@ -407,7 +407,6 @@ struct enetc_cls_rule {
 	int used;
 };
 
-#define ENETC_MAX_BDR_INT	6 /* fixed to max # of available cpus */
 struct psfp_cap {
 	u32 max_streamid;
 	u32 max_psfp_filter;
@@ -456,7 +455,7 @@ struct enetc_ndev_priv {
 	struct enetc_si *si;
 
 	int bdr_int_num; /* number of Rx/Tx ring interrupts */
-	struct enetc_int_vector *int_vector[ENETC_MAX_BDR_INT];
+	struct enetc_int_vector **int_vector;
 	u16 num_rx_rings, num_tx_rings;
 	u16 rx_bd_count, tx_bd_count;
 
Signature · 1 line
2.34.1
reviewer Reviewed-by on v4 2/6
#8 lore raw

Re: [PATCH net-next v4 2/6] net: enetc: Allocate int_vector array dynamically

Quoted 15 lines · Claudiu Manoil

The number of Rx/Tx ring interrupt vectors, priv->bdr_int_num, is set in enetc_init_si_rings_params() to the lesser of the number of online CPUs and the number of Rx rings of the station interface. The int_vector[] array in struct enetc_ndev_priv, however, has a fixed size of ENETC_MAX_BDR_INT (6), a limit that dates back to the maximum CPU count of the SoCs integrating ENETC at the time.

That assumption does not hold for S32N79, which has 8 CPUs and gives the ENETC PF up to 8 Rx rings. There, bdr_int_num can reach 8, and enetc_alloc_msix() writes priv->int_vector[i] past the end of the array, corrupting the adjacent fields of the netdev private area. No SoC currently supported upstream exceeds 6 vectors, so this is not reachable today; it must be fixed before S32N79 devices can be enabled by a following patch.

Quoted 7 lines

Allocate int_vector[] with devm_kcalloc() in enetc_alloc_msix(), once bdr_int_num is known. The memory is released together with the PCI device, so no explicit free is needed on the error or teardown paths. This is common code, so the PF and VF drivers benefit alike. Drop the ENETC_MAX_BDR_INT define, which only existed to size this array.

author maintainer
#9 lore raw

PATCH v4 3/6 net: enetc: Enable probing of version 4.4 devices

In reply to Claudiu Manoil

This commit adds driver data and platform info entries for ENETC v4.4 PF and VF devices on S32N79 SoCs with a 500 MHz system clock frequency.

The ENETC v4.4 devices are present on S32N79 SoCs and feature only Pseudo-MAC ENETC ports, whose PFs use either the 0xe101 or the 0xe110 PCI device ID, and the VFs answer to the usual device ID of 0xef00.

While the ENETC PF instances are usually designated by the 0xe101 ID, in newer IP versions the 0xe110 ID was introduced to indicate the power-on reset default NETC switch management interface. These IDs do not indicate any functional difference between the designated ENETC instances, and can be interchanged and re-assigned at boot time (i.e. from firmware).

---
v4:
- Added a leading sentence to the commit message, stating that the patch adds driver data and platform info entries for ENETC v4.4 devices with a 500 MHz system clock frequency.

v3:
- Added sysclk_freq info for the v4.4 ENETC devices.

v2:
- Described why there are two ENETC PF IDs in the commit message, as per review.

 drivers/net/ethernet/freescale/enetc/enetc.c  | 26 +++++++++++++++++++
 .../net/ethernet/freescale/enetc/enetc_hw.h   |  4 ++-
 2 files changed, 29 insertions(+), 1 deletion(-)
drivers/net/ethernet/freescale/enetc/enetc.c +26 -0
index 855b2d3b8718..e3aa117d323d 100644
@@ -3840,6 +3840,20 @@ static const struct enetc_drvdata enetc4_vf_data = {
 	.eth_ops = &enetc_vf_ethtool_ops,
 };
 
+static const struct enetc_drvdata enetc4_s32n79_ppm_data = {
+	.sysclk_freq = ENETC_CLK_500M,
+	.tx_csum = true,
+	.max_frags = ENETC4_MAX_SKB_FRAGS,
+	.eth_ops = &enetc4_ppm_ethtool_ops,
+};
+
+static const struct enetc_drvdata enetc4_s32n79_vf_data = {
+	.sysclk_freq = ENETC_CLK_500M,
+	.tx_csum = true,
+	.max_frags = ENETC4_MAX_SKB_FRAGS,
+	.eth_ops = &enetc_vf_ethtool_ops,
+};
+
 static const struct enetc_platform_info enetc_info[] = {
 	{ .revision = ENETC_REV_1_0,
 	  .dev_id = ENETC_DEV_ID_PF,
@@ -3870,6 +3884,18 @@ static const struct enetc_platform_info enetc_info[] = {
 	  .dev_id = NXP_ENETC_VF_DEV_ID,
 	  .data = &enetc4_vf_data,
 	},
+	{ .revision = ENETC_REV_4_4,
+	  .dev_id = NXP_ENETC_PPM_DEV_ID,
+	  .data = &enetc4_s32n79_ppm_data,
+	},
+	{ .revision = ENETC_REV_4_4,
+	  .dev_id = NXP_ENETC_PF_DEV_ID,
+	  .data = &enetc4_s32n79_ppm_data,
+	},
+	{ .revision = ENETC_REV_4_4,
+	  .dev_id = NXP_ENETC_VF_DEV_ID,
+	  .data = &enetc4_s32n79_vf_data,
+	},
 };
 
 int enetc_get_driver_data(struct enetc_si *si)
drivers/net/ethernet/freescale/enetc/enetc_hw.h +3 -1
index 2c9d9042eb0b..8e6a9d366d40 100644
@@ -414,6 +414,7 @@ enum enetc_bdr_type {TX, RX};
 #define ENETC_REV_1_0		0x0100
 #define ENETC_REV_4_1		0X0401
 #define ENETC_REV_4_3		0x0403
+#define ENETC_REV_4_4		0x0404
 
 #define ENETC_G_EIPBRR1		0x0bfc
 #define ENETC_G_EPFBLPR(n)	(0xd00 + 4 * (n))
@@ -1048,8 +1049,9 @@ struct enetc_cbd {
 	u8 status_flags;
 };
 
-#define ENETC_CLK_400M		400000000ULL
 #define ENETC_CLK_333M		333000000ULL
+#define ENETC_CLK_400M		400000000ULL
+#define ENETC_CLK_500M		500000000ULL
 
 static inline u32 enetc_cycles_to_usecs(u32 cycles, u64 clk_freq)
 {
Signature · 1 line
2.34.1
#10 lore raw

Re: [PATCH net-next v4 3/6] net: enetc: Enable probing of version 4.4 devices

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider.

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider.

Critical: 0 · High: 0 · Medium: 2 · Low: 0

If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough).

- [Medium] This patch adds ENETC_REV_4_4 entries to enetc_info[] so that S32N79 PFs (0xe101/0xe110) and VFs (0xef00) now probe.
- [Medium] When an ENETC v4 VF cannot get the IP minor revision from its PF over the VSI-PSI mailbox, enetc_vf_get_revision()…

--

net: enetc: Enable probing of version 4.4 devices

This commit adds driver data and platform info entries for the ENETC v4.4 PF and VF devices on S32N79 SoCs. These run with a 500 MHz system clock. The PFs use the 0xe101 or 0xe110 device ID and the VFs use 0xef00.

Quoted 5 lines
drivers/net/ethernet/freescale/enetc/enetc.c +0 -0
index 855b2d3b87182..e3aa117d323d5 100644
@@ -3840,6 +3840,20 @@ static const struct enetc_drvdata enetc4_vf_data = {

[ ... ]

drivers/net/ethernet/freescale/enetc/enetc.c static const struct enetc_drvdata enetc4_vf_data = { · line 3855

Quoted 6 lines
drivers/net/ethernet/freescale/enetc/enetc.c +6 -0
+static const struct enetc_drvdata enetc4_s32n79_vf_data = {
+	.sysclk_freq = ENETC_CLK_500M,
+	.tx_csum = true,
+	.max_frags = ENETC4_MAX_SKB_FRAGS,
+	.eth_ops = &enetc_vf_ethtool_ops,
+};

[Severity: Medium]
Can an S32N79 VF end up with the 333 MHz drvdata instead of this one?

The VF gets its minor revision from the PF over the VSI-PSI mailbox. If that query fails, enetc_vf_get_revision() falls back to 4.1:

drivers/net/ethernet/freescale/enetc/enetc_vf.c:enetc_vf_get_revision() {
    ...
	ip_mn = enetc_vf_get_ip_minor_revision(si);
	if (ip_mn >= 0) {
		si->revision = (si->pdev->revision << 8) | ip_mn;
		return;
	}

	si->revision = ENETC_REV_4_1;
    ...
}

The query can fail in several ways:

- -EIO when the mailbox is busy
- -ETIMEDOUT after the 200 ms poll
- an error status returned by the PSI
- -ENOMEM from dma_alloc_coherent()

S32N79 VFs use the same 0xef00 device ID. So in that case enetc_get_driver_data() matches {ENETC_REV_4_1, NXP_ENETC_VF_DEV_ID} and selects enetc4_vf_data, which uses ENETC_CLK_333M. enetc_vf_netdev_setup() then copies that value into priv->sysclk_freq.

Before this patch every v4 platform ran at 333 MHz, so the fallback made no difference. On a 500 MHz platform, wouldn't enetc_usecs_to_cycles() program the default 600 us tx_ictt, the DIM rx_ictt and the set_coalesce values at roughly 0.67x the requested timeout?

enetc_get_coalesce() converts back with the same clock. So ethtool -c would still show the requested values while the hardware fires about 1.5x sooner.

Should the fallback change now that v4 platforms don't all use the same clock frequency?

Quoted 6 lines
drivers/net/ethernet/freescale/enetc/enetc.c +2 -0
@@ -3870,6 +3884,18 @@ static const struct enetc_platform_info enetc_info[] = {
 	  .dev_id = NXP_ENETC_VF_DEV_ID,
 	  .data = &enetc4_vf_data,
 	},
+	{ .revision = ENETC_REV_4_4,
+	  .dev_id = NXP_ENETC_PPM_DEV_ID,

drivers/net/ethernet/freescale/enetc/enetc.c static const struct enetc_platform_info enetc_info[] = { · line 3898

Quoted 10 lines
drivers/net/ethernet/freescale/enetc/enetc.c +10 -0
+	  .data = &enetc4_s32n79_ppm_data,
+	},
+	{ .revision = ENETC_REV_4_4,
+	  .dev_id = NXP_ENETC_PF_DEV_ID,
+	  .data = &enetc4_s32n79_ppm_data,
+	},
+	{ .revision = ENETC_REV_4_4,
+	  .dev_id = NXP_ENETC_VF_DEV_ID,
+	  .data = &enetc4_s32n79_vf_data,
+	},

[Severity: Medium]
Does enetc_get_phc_index_by_pdev() in enetc_ethtool.c also need an ENETC_REV_4_4 case? It has its own per-revision table for the timer devfn:

drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:enetc_get_phc_index_by_pdev() {
    ...
	switch (si->revision) {
	case ENETC_REV_1_0:
		devfn = PCI_DEVFN(0, 4);
		break;
	case ENETC_REV_4_1:
		devfn = PCI_DEVFN(24, 0);
		break;
	case ENETC_REV_4_3:
		devfn = PCI_DEVFN(0, 1);
		break;
	default:
		return -1;
	}
    ...
}

enetc4_s32n79_vf_data uses enetc_vf_ethtool_ops, which provides enetc_get_ts_info(). SR-IOV VFs have no OF node, so enetc_get_phc_index() always takes the per-pdev path. For a v4.4 VF the call chain is:

enetc_get_ts_info()
enetc_get_phc_index()
enetc_get_phc_index_by_pdev()
default: return -1

enetc_get_ts_info() then jumps to timestamp_tx_sw. It reports no PHC and only SOF_TIMESTAMPING_TX_SOFTWARE.

enetc_hwtstamp_set() and enetc_hwtstamp_get() still accept hardware timestamping configs, because they only check enetc_ptp_clock_is_enabled().

Would ptp4l and similar tools then fail to find a PHC on S32N79 VFs?

The v4.4 PF uses enetc4_ppm_ethtool_ops, which has no get_ts_info, so this seems to affect only the VFs.

The code doesn't show whether a NETC timer is reachable on the VF's PCI bus on S32N79. If PTP is intentionally left unsupported on v4.4, could the commit message say so?

Signature · 1 line
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1794581338.git.claudiu.manoil%40nxp.com
author maintainer
#11 lore raw

RE: [PATCH net-next v4 3/6] net: enetc: Enable probing of version 4.4 devices

From: [email protected] <[email protected]>
Sent: Tuesday, November 17, 2026 5:55 PM

Quoted 50 lines

To: Claudiu Manoil <[email protected]>
Cc: [email protected]; dl-S32 <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH net-next v4 3/6] net: enetc: Enable probing of version 4.4 devices

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider.

Critical: 0 * High: 0 * Medium: 2 * Low: 0

If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough).

- [Medium] This patch adds ENETC_REV_4_4 entries to enetc_info[] so that S32N79 PFs (0xe101/0xe110) and VFs (0xef00) now probe.
- [Medium] When an ENETC v4 VF cannot get the IP minor revision from its PF over the VSI-PSI mailbox, enetc_vf_get_revision()...

--

net: enetc: Enable probing of version 4.4 devices

This commit adds driver data and platform info entries for the ENETC v4.4 PF and VF devices on S32N79 SoCs. These run with a 500 MHz system clock. The PFs use the 0xe101 or 0xe110 device ID and the VFs use 0xef00.

Review

Quoted 1 line
(quoted diff) +0 -0

b/drivers/net/ethernet/freescale/enetc/enetc.c

drivers/net/ethernet/freescale/enetc/enetc.c static const struct enetc_drvdata

Quoted 4 lines

index 855b2d3b87182..e3aa117d323d5 100644

drivers/net/ethernet/freescale/enetc/enetc.c +0 -0
@@ -3840,6 +3840,20 @@ static const struct enetc_drvdata

enetc4_vf_data = {

[ ... ]

drivers/net/ethernet/freescale/enetc/enetc.c static const struct enetc_drvdata enetc4_vf_data = { · line 3855

Quoted 6 lines
drivers/net/ethernet/freescale/enetc/enetc.c +6 -0
+static const struct enetc_drvdata enetc4_s32n79_vf_data = {
+	.sysclk_freq = ENETC_CLK_500M,
+	.tx_csum = true,
+	.max_frags = ENETC4_MAX_SKB_FRAGS,
+	.eth_ops = &enetc_vf_ethtool_ops,
+};

[Severity: Medium]
Can an S32N79 VF end up with the 333 MHz drvdata instead of this one?

Quoted 2 lines

The VF gets its minor revision from the PF over the VSI-PSI mailbox. If that query fails, enetc_vf_get_revision() falls back to 4.1:

If the enetc_vf_get_revision() query fails we have bigger concerns than the VF coalescing operating on a 333 MHz reference. There's no fix for this fail, and it's outside the scope of this patch set.

Quoted 49 lines
drivers/net/ethernet/freescale/enetc/enetc_vf.c:enetc_vf_get_revision() {
    ...
	ip_mn = enetc_vf_get_ip_minor_revision(si);
	if (ip_mn >= 0) {
		si->revision = (si->pdev->revision << 8) | ip_mn;
		return;
	}

	si->revision = ENETC_REV_4_1;
    ...
}

The query can fail in several ways:

- -EIO when the mailbox is busy
- -ETIMEDOUT after the 200 ms poll
- an error status returned by the PSI
- -ENOMEM from dma_alloc_coherent()

S32N79 VFs use the same 0xef00 device ID. So in that case enetc_get_driver_data() matches {ENETC_REV_4_1, NXP_ENETC_VF_DEV_ID} and selects enetc4_vf_data, which uses ENETC_CLK_333M. enetc_vf_netdev_setup() then copies that value into priv->sysclk_freq.

Before this patch every v4 platform ran at 333 MHz, so the fallback made no difference. On a 500 MHz platform, wouldn't enetc_usecs_to_cycles() program the default 600 us tx_ictt, the DIM rx_ictt and the set_coalesce values at roughly 0.67x the requested timeout?

enetc_get_coalesce() converts back with the same clock. So ethtool -c would still show the requested values while the hardware fires about 1.5x sooner.

Should the fallback change now that v4 platforms don't all use the same clock frequency?

drivers/net/ethernet/freescale/enetc/enetc.c static const struct enetc_platform_info

Quoted 1 line
drivers/net/ethernet/freescale/enetc/enetc.c +0 -0
@@ -3870,6 +3884,18 @@ static const struct enetc_platform_info

enetc_info[] = {

Quoted 11 lines
drivers/net/ethernet/freescale/enetc/enetc.c +8 -0
 	  .dev_id = NXP_ENETC_VF_DEV_ID,
 	  .data = &enetc4_vf_data,
 	},
+	{ .revision = ENETC_REV_4_4,
+	  .dev_id = NXP_ENETC_PPM_DEV_ID,
+	  .data = &enetc4_s32n79_ppm_data,
+	},
+	{ .revision = ENETC_REV_4_4,
+	  .dev_id = NXP_ENETC_PF_DEV_ID,
+	  .data = &enetc4_s32n79_ppm_data,
+	},
Quoted 9 lines

drivers/net/ethernet/freescale/enetc/enetc.c static const struct enetc_platform_info enetc_info[] = { · line 3898

Quoted 4 lines
drivers/net/ethernet/freescale/enetc/enetc.c +4 -0
+	{ .revision = ENETC_REV_4_4,
+	  .dev_id = NXP_ENETC_VF_DEV_ID,
+	  .data = &enetc4_s32n79_vf_data,
+	},

[Severity: Medium]
Does enetc_get_phc_index_by_pdev() in enetc_ethtool.c also need an ENETC_REV_4_4 case? It has its own per-revision table for the timer devfn:

In short, no. PTP support for ENETC 4.4 is not available at this point. The explanation is the same as replied here, for v2:
https://patchwork.kernel.org/project/netdevbpf/patch/537a977b10b3d76c30b1f879f423bde4fd6f42f8.1791908694.git.claudiu.manoil@nxp.com/#27330675

The VF for v4.4 does not support the existing timestamping scheme.
On platforms with NETC v4.4, CONFIG_PTP_NETC_V4_TIMER will not be 'enabled' since the v4 timer is a separate device on a different bus that is not owned by Linux, on v4.4 SoCs. No need to modify ndo_hwtstamp_set() in this case, and it's outside the scope of this patch set anyway.

Quoted 35 lines

drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:enetc_get_phc_index_b

y_pdev() {
    ...
	switch (si->revision) {
	case ENETC_REV_1_0:
		devfn = PCI_DEVFN(0, 4);
		break;
	case ENETC_REV_4_1:
		devfn = PCI_DEVFN(24, 0);
		break;
	case ENETC_REV_4_3:
		devfn = PCI_DEVFN(0, 1);
		break;
	default:
		return -1;
	}
    ...
}

enetc4_s32n79_vf_data uses enetc_vf_ethtool_ops, which provides enetc_get_ts_info(). SR-IOV VFs have no OF node, so enetc_get_phc_index() always takes the per-pdev path. For a v4.4 VF the call chain is:

enetc_get_ts_info()
enetc_get_phc_index()
enetc_get_phc_index_by_pdev()
default: return -1

enetc_get_ts_info() then jumps to timestamp_tx_sw. It reports no PHC and only SOF_TIMESTAMPING_TX_SOFTWARE.

enetc_hwtstamp_set() and enetc_hwtstamp_get() still accept hardware timestamping configs, because they only check enetc_ptp_clock_is_enabled().

Quoted 9 lines

Would ptp4l and similar tools then fail to find a PHC on S32N79 VFs?

The v4.4 PF uses enetc4_ppm_ethtool_ops, which has no get_ts_info, so this seems to affect only the VFs.

The code doesn't show whether a NETC timer is reachable on the VF's PCI bus on S32N79. If PTP is intentionally left unsupported on v4.4, could the commit message say so?

https://patchwork.kernel.org/project/netdevbpf/patch/537a977b10b3d76c30b1f879f423bde4fd6f42f8.1791908694.git.claudiu.manoil@nxp.com/#27330675

reviewer Reviewed-by on v4 3/6
#12 lore raw

Re: [PATCH net-next v4 3/6] net: enetc: Enable probing of version 4.4 devices

In reply to Claudiu Manoil
Quoted 7 lines · Claudiu Manoil

This commit adds driver data and platform info entries for ENETC v4.4 PF and VF devices on S32N79 SoCs with a 500 MHz system clock frequency.

The ENETC v4.4 devices are present on S32N79 SoCs and feature only Pseudo-MAC ENETC ports, whose PFs use either the 0xe101 or the 0xe110 PCI device ID, and the VFs answer to the usual device ID of 0xef00.

Quoted 8 lines

While the ENETC PF instances are usually designated by the 0xe101 ID, in newer IP versions the 0xe110 ID was introduced to indicate the power-on reset default NETC switch management interface. These IDs do not indicate any functional difference between the designated ENETC instances, and can be interchanged and re-assigned at boot time (i.e. from firmware).

author maintainer
#13 lore raw

PATCH v4 4/6 arm64: dts: s32n79: add NETC IEP18 ECAM node for ENETC PPM ports

In reply to Claudiu Manoil

Add the netc_iep18 PCIe ECAM host node describing the NETC integrated endpoint bus allocated to the first Linux cohort on S32N79. The bus is enumerated via the generic pci-host-ecam-generic driver and hosts the ENETC v4 Pseudo-MAC (PPM) PF and its VFs, which connect internally to the on-chip NETC switch (not owned by Linux).

The node is kept disabled at the SoC level; boards that wire up NETC enable it. MSIs are routed through the GIC-v3 ITS (msi-map) and DMA is translated by the SMMUv3 (iommu-map).

---
v4: none
v3: none

v2:
- Replaced the 'msi-parent' stub property with 'msi-map', as per H/W spec.

 arch/arm64/boot/dts/freescale/s32n79.dtsi | 24 +++++++++++++++++++++++
 1 file changed, 24 insertions(+)
arch/arm64/boot/dts/freescale/s32n79.dtsi +24 -0
index 94ab58783fdc..65cf65e82832 100644
@@ -122,6 +122,30 @@ irqsteer_coss: interrupt-controller@4ed00000 {
 		};
 	};
 
+	nwss-bus {
+		compatible = "simple-bus";
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges = <0x0 0x48800000 0x0 0x48800000 0x0 0x4b0000>,
+			 <0x2 0x40000000 0x2 0x40000000 0x0 0x20000000>;
+
+		netc_iep18: pcie@241200000 {
+			compatible = "pci-host-ecam-generic";
+			reg = <0x2 0x41200000 0x0 0x100000>;
+			#address-cells = <3>;
+			#size-cells = <2>;
+			device_type = "pci";
+			bus-range = <0x0 0x0>;
+			iommu-map = <0x0 &smmu 0xc0000 0x100>;
+			msi-map = <0x0 &its 0xc0000 0x100>;
+			dma-coherent;
+			status = "disabled";
+
+			/* All NETC PCIe functions */
+			ranges = <0x82000000 0x0 0x48800000 0x0 0x48800000 0x0 0x4b0000>;
+		};
+	};
+
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
Signature · 1 line
2.34.1
author maintainer
#14 lore raw

PATCH v4 5/6 arm64: dts: s32n79-rdb: enable NETC IEP18

In reply to Claudiu Manoil

Enable the NETC v4 ECAM bus #18 on the S32N79-RDB board so that the ENETC v4 Pseudo-MAC port (PPM) PF and VF instances are probed.

---
v4: none
v3: none
v2: none

 arch/arm64/boot/dts/freescale/s32n79-rdb.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/freescale/s32n79-rdb.dts +4 -0
index 1feccd61258e..897ba24ac03a 100644
@@ -68,3 +68,7 @@ &usdhc0 {
 	no-sdio;
 	status = "okay";
 };
+
+&netc_iep18 {
+	status = "okay";
+};
Signature · 1 line
2.34.1
#15 lore raw

Re: [PATCH net-next v4 5/6] arm64: dts: s32n79-rdb: enable NETC IEP18

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider.

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider.

Critical: 0 · High: 0 · Medium: 2 · Low: 1

If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough).

- [Medium] This patch turns on &netc_iep18 in arch/arm64/boot/dts/freescale/s32n79-rdb.dts so that, per the commit…
- [Medium] Setting &netc_iep18 to okay makes the ENETC v4 PPM PF and VFs live DMA masters.
- [Low] The new &netc_iep18 override in arch/arm64/boot/dts/freescale/s32n79-rdb.dts is added after &usdhc0.

--

arm64: dts: s32n79-rdb: enable NETC IEP18

This commit enables the NETC v4 ECAM bus #18 on the S32N79-RDB board. The goal is for the ENETC v4 Pseudo-MAC port (PPM) PF and VF instances to be probed.

arch/arm64/boot/dts/freescale/s32n79-rdb.dts &usdhc0 { · line 72

Quoted 10 lines
arch/arm64/boot/dts/freescale/s32n79-rdb.dts +2 -0
index 1feccd61258ef..897ba24ac03ae 100644
@@ -68,3 +68,7 @@ &usdhc0 {
 	no-sdio;
 	status = "okay";
 };
+
+&netc_iep18 {

[Severity: Low]
This isn't a bug, but Documentation/devicetree/bindings/dts-coding-style.rst says:

When extending nodes in the board DTS via &label, the entries shall be ordered either alpha-numerically or by keeping the order from DTSI,

The existing overrides in this file are in alphabetical order (irqsteer_coss, uart0, uart5, uart6, uart7, usdhc0). Should &netc_iep18 go between &irqsteer_coss and &uart0? Keeping the DTSI order would also put it before &usdhc0.

arch/arm64/boot/dts/freescale/s32n79-rdb.dts &usdhc0 { · line 74

Quoted 2 lines
arch/arm64/boot/dts/freescale/s32n79-rdb.dts +2 -0
+	status = "okay";
+};

[Severity: Medium]
The commit message says the bus is enabled "so that the ENETC v4 Pseudo-MAC port (PPM) PF and VF instances are probed". Does the PF actually probe when the kernel is built from the in-tree arm64 defconfig?

The netc_iep18 host bridge node in s32n79.dtsi has no child nodes, so the ENETC PF function does not get a static of_node. For a pseudo-MAC port, enetc4_link_init() in drivers/net/ethernet/freescale/enetc/enetc4_pf.c then fails here:

	if (!node) {
		dev_err(dev, "Missing of_node for Pseudo-MAC port\n");
		return -ENODEV;
	}

The only other way to get an of_node is of_pci_make_dev_node(). The last patch in the series, "PCI: Create OF node for NXP ENETC pseudo-MAC functions", adds it as a final fixup for 0xe101/0xe110:

	DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PHILIPS, 0xe101, of_pci_make_dev_node);

However, of_pci_make_dev_node() is only built with CONFIG_PCI_DYNAMIC_OF_NODES. Without it, drivers/pci/pci.h provides an empty inline stub.

PCI_DYNAMIC_OF_NODES is a plain bool with no default, and NXP_ENETC4 only selects OF_DYNAMIC. arch/arm64/configs/defconfig sets CONFIG_PCI_HOST_GENERIC=y, CONFIG_NXP_ENETC4=m and CONFIG_FSL_ENETC_VF=m, but it does not set CONFIG_PCI_DYNAMIC_OF_NODES.

So on a default arm64 build, won't the only device behind the newly enabled bus fail with -ENODEV? The PF creates the VFs through SR-IOV, so the VFs would not appear either. This is still the case at the end of the series.

Would one of these work: giving the PF a static child node in DT, adding CONFIG_PCI_DYNAMIC_OF_NODES=y to the arm64 defconfig, or having NXP_ENETC4 imply or select it?

[Severity: Medium]
With this bus enabled, the PPM PF and VFs become live DMA masters. The netc_iep18 node in s32n79.dtsi has:

	iommu-map = <0x0 &smmu 0xc0000 0x100>;
	msi-map = <0x0 &its 0xc0000 0x100>;
	dma-coherent;

The smmu node it points to is disabled at the SoC level:

	smmu: iommu@4fc00000 {
		compatible = "arm,smmu-v3";
		...
		status = "disabled";

No board DTS under arch/arm64/boot/dts/freescale/ enables it. of_iommu_xlate() in drivers/iommu/of_iommu.c then ignores the mapping without any message:

	if (!of_device_is_available(iommu_spec->np))
		return -ENODEV;

As a result, the PF and VFs fall back to dma-direct and use raw physical addresses for the BD rings and buffers.

The SoC dtsi commit in this series says "DMA is translated by the SMMUv3 (iommu-map)". That does not seem to hold on this board.

Doesn't DMA now depend entirely on the SMMU state left by boot firmware? Suppose firmware left the SMMU enabled with its own stream table, or set it to abort unmatched streams. NETC DMA would then fault or be blocked, even though the netdev probes.

The dma-coherent property makes Linux skip cache maintenance. That too relies on stream attributes configured outside of Linux.

Should &smmu be enabled along with this bus? Alternatively, could the firmware requirement be documented (SMMU in bypass with coherent attributes for StreamIDs 0xc0000 and up) and the dtsi commit message corrected?

Signature · 1 line
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1794581338.git.claudiu.manoil%40nxp.com
author maintainer
#16 lore raw

RE: [PATCH net-next v4 5/6] arm64: dts: s32n79-rdb: enable NETC IEP18

From: [email protected] <[email protected]>
Sent: Tuesday, November 17, 2026 5:55 PM

Quoted 45 lines

To: Claudiu Manoil <[email protected]>
Cc: [email protected]; dl-S32 <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH net-next v4 5/6] arm64: dts: s32n79-rdb: enable NETC IEP18

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider.

Critical: 0 * High: 0 * Medium: 2 * Low: 1

If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough).

- [Medium] This patch turns on &netc_iep18 in arch/arm64/boot/dts/freescale/s32n79-rdb.dts so that, per the commit...
- [Medium] Setting &netc_iep18 to okay makes the ENETC v4 PPM PF and VFs live DMA masters.
- [Low] The new &netc_iep18 override in arch/arm64/boot/dts/freescale/s32n79-rdb.dts is added after &usdhc0.

--

arm64: dts: s32n79-rdb: enable NETC IEP18

This commit enables the NETC v4 ECAM bus #18 on the S32N79-RDB board. The
goal is for the ENETC v4 Pseudo-MAC port (PPM) PF and VF instances to be probed.

Review

Quoted 1 line
(quoted diff) +0 -0

b/arch/arm64/boot/dts/freescale/s32n79-rdb.dts

Quoted 9 lines

index 1feccd61258ef..897ba24ac03ae 100644

arch/arm64/boot/dts/freescale/s32n79-rdb.dts +2 -0
@@ -68,3 +68,7 @@ &usdhc0 {
 	no-sdio;
 	status = "okay";
 };
+
+&netc_iep18 {

[...]

Quoted 15 lines

[Severity: Medium]
The commit message says the bus is enabled "so that the ENETC v4 Pseudo- MAC port (PPM) PF and VF instances are probed". Does the PF actually probe when the kernel is built from the in-tree arm64 defconfig?

The netc_iep18 host bridge node in s32n79.dtsi has no child nodes, so the ENETC PF function does not get a static of_node. For a pseudo-MAC port, enetc4_link_init() in drivers/net/ethernet/freescale/enetc/enetc4_pf.c then fails here:

	if (!node) {
		dev_err(dev, "Missing of_node for Pseudo-MAC port\n");
		return -ENODEV;
	}
Quoted 7 lines

The only other way to get an of_node is of_pci_make_dev_node(). The last patch in the series, "PCI: Create OF node for NXP ENETC pseudo-MAC functions", adds it as a final fixup for 0xe101/0xe110:

	DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PHILIPS, 0xe101,

of_pci_make_dev_node);

Chicken and egg problem, both the PCI patch and the pci-host-ecam DT node for IEP 18 (netc_iep18) are needed for probing. The decision was to keep the PCI patch as the last in the series.

Quoted 11 lines

However, of_pci_make_dev_node() is only built with CONFIG_PCI_DYNAMIC_OF_NODES. Without it, drivers/pci/pci.h provides an empty inline stub.

PCI_DYNAMIC_OF_NODES is a plain bool with no default, and NXP_ENETC4 only
selects OF_DYNAMIC. arch/arm64/configs/defconfig sets CONFIG_PCI_HOST_GENERIC=y, CONFIG_NXP_ENETC4=m and CONFIG_FSL_ENETC_VF=m, but
it does not set CONFIG_PCI_DYNAMIC_OF_NODES.

Quoted 7 lines

So on a default arm64 build, won't the only device behind the newly enabled bus fail with -ENODEV? The PF creates the VFs through SR-IOV, so the VFs would not appear either. This is still the case at the end of the series.

Would one of these work: giving the PF a static child node in DT, adding CONFIG_PCI_DYNAMIC_OF_NODES=y to the arm64 defconfig, or having NXP_ENETC4 imply or select it?

CONFIG_PCI_DYNAMIC_OF_NODES is not a hard Kconfig dependency because only the newly introduced S32N79 chip makes use of this feature currently. This is intentional. So, this config will be enabled for S32N79 platforms only, for now.

Provided same reply for v2:
https://lore.kernel.org/all/GV2PR04MB117408067A4647C476FAD617596692@GV2PR04MB11740.eurprd04.prod.outlook.com/

Quoted 35 lines

[Severity: Medium]
With this bus enabled, the PPM PF and VFs become live DMA masters. The netc_iep18 node in s32n79.dtsi has:

	iommu-map = <0x0 &smmu 0xc0000 0x100>;
	msi-map = <0x0 &its 0xc0000 0x100>;
	dma-coherent;

The smmu node it points to is disabled at the SoC level:

	smmu: iommu@4fc00000 {
		compatible = "arm,smmu-v3";
		...
		status = "disabled";

No board DTS under arch/arm64/boot/dts/freescale/ enables it. of_iommu_xlate() in drivers/iommu/of_iommu.c then ignores the mapping without
any message:

	if (!of_device_is_available(iommu_spec->np))
		return -ENODEV;

As a result, the PF and VFs fall back to dma-direct and use raw physical addresses for the BD rings and buffers.

The SoC dtsi commit in this series says "DMA is translated by the SMMUv3 (iommu-map)". That does not seem to hold on this board.

Doesn't DMA now depend entirely on the SMMU state left by boot firmware? Suppose firmware left the SMMU enabled with its own stream table, or set it to abort unmatched streams. NETC DMA would then fault or be blocked, even though the netdev probes.

Quoted 7 lines

The dma-coherent property makes Linux skip cache maintenance. That too relies on stream attributes configured outside of Linux.

Should &smmu be enabled along with this bus? Alternatively, could the firmware requirement be documented (SMMU in bypass with coherent attributes for StreamIDs 0xc0000 and up) and the dtsi commit message corrected?

As already explained for v2, enabling SMMU is outside the scope of this patch set:
https://lore.kernel.org/all/GV2PR04MB11740BC1C66529A8E2B672CF096692@GV2PR04MB11740.eurprd04.prod.outlook.com/

ENETC sits behind SMMU, however the SMMU node is not ready to be enabled yet, and this is not in the scope of current patch set.
SMMU on S32N79 needs some support patches (SoC level workarounds) before enabling it, since SMMU is a system wide config that affects other devices too. ENETC4 is functional with the SMMU node disabled, and I checked it with traffic tests.

author maintainer
#17 lore raw

PATCH v4 6/6 PCI: Create OF node for NXP ENETC pseudo-MAC functions

In reply to Claudiu Manoil

NXP ENETCv4 pseudo-MAC (PPM) ports can be probed as pure PCI endpoints, without any "ethernet" node in the static device tree. The ENETC4 driver describes their fixed link by attaching a fixed-link node to the PCI function's own OF node, which requires that node to exist.

Request the PCI core to synthesize a per-function OF node for these devices by registering of_pci_make_dev_node() as a final fixup, following the existing precedent for the Xilinx, Red Hat and EFAR devices. The helper is a no-op when the function already has a static OF node, so this has no effect on platforms that describe ENETC via static DT. It only takes effect when CONFIG_PCI_DYNAMIC_OF_NODES is enabled.

Both ENETC4 PCI device IDs are covered (0xe101 and 0xe110), since either can be instantiated as a pseudo-MAC port on S32N79.

---
v4: none
v3: none
v2: none (reworded the overlay reference to match patch 1's fixed-link
approach; no functional change)

 drivers/pci/quirks.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/pci/quirks.c +2 -0
index 7f1f47ea2ee4..71f272d8a296 100644
@@ -6563,6 +6563,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_XILINX, 0x5021, of_pci_make_dev_node);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_REDHAT, 0x0005, of_pci_make_dev_node);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_EFAR, 0x9660, of_pci_make_dev_node);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_TOSHIBA, 0x0220, of_pci_make_dev_node);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PHILIPS, 0xe101, of_pci_make_dev_node);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PHILIPS, 0xe110, of_pci_make_dev_node);
 
 /*
  * Devices known to require a longer delay before first config space access
Signature · 1 line
2.34.1
#18 lore raw

Re: [PATCH net-next v4 6/6] PCI: Create OF node for NXP ENETC pseudo-MAC functions

Sashiko has reviewed this patch and found no issues.
Quoted 12 lines

NXP ENETCv4 pseudo-MAC (PPM) ports can be probed as pure PCI endpoints, without any "ethernet" node in the static device tree. The ENETC4 driver describes their fixed link by attaching a fixed-link node to the PCI function's own OF node, which requires that node to exist.

Request the PCI core to synthesize a per-function OF node for these devices by registering of_pci_make_dev_node() as a final fixup, following the existing precedent for the Xilinx, Red Hat and EFAR devices. The helper is a no-op when the function already has a static OF node, so this has no effect on platforms that describe ENETC via static DT. It only takes effect when CONFIG_PCI_DYNAMIC_OF_NODES is enabled.

Quoted 4 lines

Both ENETC4 PCI device IDs are covered (0xe101 and 0xe110), since either can be instantiated as a pseudo-MAC port on S32N79.

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
#19 lore raw

Re: [PATCH net-next v4 6/6] PCI: Create OF node for NXP ENETC pseudo-MAC functions

In reply to Claudiu Manoil
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider.

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 1

If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough).

- [Medium] The two new fixups for 0xe101 and 0xe110 in drivers/pci/quirks.c only do something when…
- [Low] The comment above the of_pci_make_dev_node() fixup block in drivers/pci/quirks.c (lines 6553-6560) gives one reason for the…

--

PCI: Create OF node for NXP ENETC pseudo-MAC functions

This commit registers of_pci_make_dev_node() as a final fixup for the NXP ENETC4 PCI device IDs 0xe101 and 0xe110. The new per-function OF node lets the ENETC4 driver attach a fixed-link child to pseudo-MAC ports that have no static DT node. The fixup only does anything when CONFIG_PCI_DYNAMIC_OF_NODES is enabled.

drivers/pci/quirks.c DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_XILINX, 0x5021, of_pci_make_dev_node); · line 6567

Quoted 10 lines
drivers/pci/quirks.c +2 -0
index 7f1f47ea2ee41..71f272d8a2965 100644
@@ -6563,6 +6563,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_XILINX, 0x5021, of_pci_make_dev_node);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_REDHAT, 0x0005, of_pci_make_dev_node);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_EFAR, 0x9660, of_pci_make_dev_node);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_TOSHIBA, 0x0220, of_pci_make_dev_node);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PHILIPS, 0xe101, of_pci_make_dev_node);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PHILIPS, 0xe110, of_pci_make_dev_node);

[Severity: Medium]
With the default arm64 config, will these fixups do anything on the S32N79 platform this series targets?

If CONFIG_PCI_DYNAMIC_OF_NODES is not set, of_pci_make_dev_node() is an empty stub:

drivers/pci/pci.h:
#else
static inline void of_pci_make_dev_node(struct pci_dev *pdev) { }

PCI_DYNAMIC_OF_NODES is a user-visible bool, and nothing in the tree selects it. NXP_ENETC4 selects OF_DYNAMIC, so there is no build problem. However, it does not select or imply PCI_DYNAMIC_OF_NODES.

arch/arm64/configs/defconfig sets CONFIG_ARCH_S32=y and CONFIG_NXP_ENETC4=m, but it does not set PCI_DYNAMIC_OF_NODES.

The s32n79.dtsi change in this series adds netc_iep18 without child nodes for the PCI functions. So dev->of_node stays NULL for the pseudo-MAC PF, and enetc4_link_init() fails the probe:

drivers/net/ethernet/freescale/enetc/enetc4_pf.c:enetc4_link_init() {
    ...
		if (!node) {
			dev_err(dev, "Missing of_node for Pseudo-MAC port\n");
			return -ENODEV;
		}
    ...
}

This error message does not mention the missing config option.

So with the default arm64 config, "arm64: dts: s32n79-rdb: enable NETC IEP18" does not get the PPM PF/VF instances probed, which is what it sets out to do.

The commit messages say this dependency is intentional, because the driver also handles ports described by static DT. That is a reason not to add a hard "depends on". Would an "imply PCI_DYNAMIC_OF_NODES" on NXP_ENETC4, or a defconfig update, work instead? The Kconfig help text notes that turning the option on also creates OF nodes for all PCI bridges.

[Severity: Low]
This isn't a bug, but the comment above this block of fixups no longer covers every entry:

/*
* For a PCI device with multiple downstream devices, its driver may use
* a flattened device tree to describe the downstream devices.
* To overlay the flattened device tree, the PCI device and all its ancestor
* devices need to have device tree nodes on system base device tree. Thus,
* before driver probing, it might need to add a device tree node as the final
* fixup.
*/

An ENETC4 pseudo-MAC function has no downstream devices and loads no FDT overlay. enetc4_add_ppm_fixed_link() only applies an of_changeset that adds a fixed-link child to the function's own node.

The PCI_DYNAMIC_OF_NODES help text in drivers/pci/Kconfig also describes only the overlay use case.

Could the comment, and perhaps the help text, be updated to cover this use?

Signature · 1 line
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1794581338.git.claudiu.manoil%40nxp.com
author maintainer
#20 lore raw

RE: [PATCH net-next v4 6/6] PCI: Create OF node for NXP ENETC pseudo-MAC functions

From: [email protected] <[email protected]>
Sent: Tuesday, November 17, 2026 5:55 PM

Quoted 89 lines

To: Claudiu Manoil <[email protected]>
Cc: [email protected]; dl-S32 <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH net-next v4 6/6] PCI: Create OF node for NXP ENETC pseudo-MAC functions

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider.

Critical: 0 * High: 0 * Medium: 1 * Low: 1

If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough).

- [Medium] The two new fixups for 0xe101 and 0xe110 in drivers/pci/quirks.c only do something when...
- [Low] The comment above the of_pci_make_dev_node() fixup block in drivers/pci/quirks.c (lines 6553-6560) gives one reason for the...

--

PCI: Create OF node for NXP ENETC pseudo-MAC functions

This commit registers of_pci_make_dev_node() as a final fixup for the NXP ENETC4 PCI device IDs 0xe101 and 0xe110. The new per-function OF node lets the ENETC4 driver attach a fixed-link child to pseudo-MAC ports that have no static DT node. The fixup only does anything when CONFIG_PCI_DYNAMIC_OF_NODES is enabled.

drivers/pci/quirks.c

Quoted 5 lines
drivers/pci/quirks.c +0 -0
index 7f1f47ea2ee41..71f272d8a2965 100644
@@ -6563,6 +6563,8 @@

DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_XILINX, 0x5021, of_pci_make_dev_node);

drivers/pci/quirks.c line 6563

Quoted 1 line
drivers/pci/quirks.c +0 -0
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_REDHAT, 0x0005,

of_pci_make_dev_node);

drivers/pci/quirks.c line 6564

Quoted 1 line
drivers/pci/quirks.c +0 -0
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_EFAR, 0x9660,

of_pci_make_dev_node);

drivers/pci/quirks.c line 6565

Quoted 1 line
drivers/pci/quirks.c +0 -0
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_TOSHIBA, 0x0220,

of_pci_make_dev_node);

drivers/pci/quirks.c line 6566

Quoted 1 line
drivers/pci/quirks.c +1 -0
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PHILIPS, 0xe101,

of_pci_make_dev_node);

drivers/pci/quirks.c line 6567

Quoted 1 line
drivers/pci/quirks.c +1 -0
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PHILIPS, 0xe110,

of_pci_make_dev_node);

[Severity: Medium]
With the default arm64 config, will these fixups do anything on the S32N79 platform this series targets?

If CONFIG_PCI_DYNAMIC_OF_NODES is not set, of_pci_make_dev_node() is an
empty stub:

drivers/pci/pci.h:
#else
static inline void of_pci_make_dev_node(struct pci_dev *pdev) { }

PCI_DYNAMIC_OF_NODES is a user-visible bool, and nothing in the tree selects it. NXP_ENETC4 selects OF_DYNAMIC, so there is no build problem. However, it does not select or imply PCI_DYNAMIC_OF_NODES.

arch/arm64/configs/defconfig sets CONFIG_ARCH_S32=y and CONFIG_NXP_ENETC4=m, but it does not set PCI_DYNAMIC_OF_NODES.

The s32n79.dtsi change in this series adds netc_iep18 without child nodes for the PCI functions. So dev->of_node stays NULL for the pseudo-MAC PF, and enetc4_link_init() fails the probe:

drivers/net/ethernet/freescale/enetc/enetc4_pf.c:enetc4_link_init() {
    ...
		if (!node) {
			dev_err(dev, "Missing of_node for Pseudo-MAC
port\n");
			return -ENODEV;
		}
    ...
}

This error message does not mention the missing config option.

So with the default arm64 config, "arm64: dts: s32n79-rdb: enable NETC IEP18" does not get the PPM PF/VF instances probed, which is what it sets out to do.

Quoted 6 lines

The commit messages say this dependency is intentional, because the driver also handles ports described by static DT. That is a reason not to add a hard "depends on". Would an "imply PCI_DYNAMIC_OF_NODES" on NXP_ENETC4, or a defconfig update, work instead? The Kconfig help text notes that turning the option on also creates OF nodes for all PCI bridges.

Same reply as here, for v2:
https://lore.kernel.org/all/GV2PR04MB117408067A4647C476FAD617596692@GV2PR04MB11740.eurprd04.prod.outlook.com/

CONFIG_PCI_DYNAMIC_OF_NODES is not a hard Kconfig dependency because only the newly introduced S32N79 chip makes use of this feature currently. This is intentional. So, this config will be enabled only for S32N79 platforms, for now, separately.

#21 lore raw
In reply to Claudiu Manoil
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Fri, 13 Nov 2026 17:02:31 +0200 you wrote:

This series adds networking support for the ENETCv4.4 pseudo-MAC (PPM) ports found on the NXP S32N79 SoC. On S32N79, the ENETCv4 ports are not wired to any external PHY/MII; instead they are internal "pseudo-MAC" links into the on-chip NETC switch. These links are proprietary, expose no standard IEEE interface, and run at a speed fixed at boot time by the Port PCR[PSPEED] register.

[...]

Here is the summary with links:
- [net-next,v4,1/6] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node

    https://git.kernel.org/netdev/net-next/c/683068cdb9cf
  - [net-next,v4,2/6] net: enetc: Allocate int_vector array dynamically
    https://git.kernel.org/netdev/net-next/c/3e68d8cee653
  - [net-next,v4,3/6] net: enetc: Enable probing of version 4.4 devices
    https://git.kernel.org/netdev/net-next/c/24579bb24660
  - [net-next,v4,4/6] arm64: dts: s32n79: add NETC IEP18 ECAM node for ENETC PPM ports
    https://git.kernel.org/netdev/net-next/c/821b90b0e9cb
  - [net-next,v4,5/6] arm64: dts: s32n79-rdb: enable NETC IEP18
    https://git.kernel.org/netdev/net-next/c/8fa58d0f821f
  - [net-next,v4,6/6] PCI: Create OF node for NXP ENETC pseudo-MAC functions
    https://git.kernel.org/netdev/net-next/c/d2f68f74723d

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html