net: enetc: S32N79 pseudo-MAC (PPM) networking support
Subsystems (6)
Claudiu Manoil
maintainerPATCH 3/5 arm64: dts: s32n79: add NETC IEP18 ECAM node for ENETC PPM ports
In reply to Claudiu ManoilAdd 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 and DMA is translated by the SMMUv3 (iommu-map).
--- arch/arm64/boot/dts/freescale/s32n79.dtsi | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+)
arch/arm64/boot/dts/freescale/s32n79.dtsi +24 -0
@@ -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>; + msi-parent = <&its 0x0>; + iommu-map = <0x0 &smmu 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
Claudiu Manoil
maintainerPATCH 4/5 arm64: dts: s32n79-rdb: enable NETC IEP18
In reply to Claudiu ManoilEnable 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.
--- arch/arm64/boot/dts/freescale/s32n79-rdb.dts | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/freescale/s32n79-rdb.dts +4 -0
@@ -68,3 +68,7 @@ &usdhc0 { no-sdio; status = "okay"; }; + +&netc_iep18 { + status = "okay"; +};
Signature · 1 line
2.34.1
Claudiu Manoil
maintainercover 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.
Rather than hand-building a software node, the driver describes the fixed link with a self-contained DT overlay (following the lan966x PCI approach), applied unmodified via of_overlay_fdt_apply() onto the PCI function's dynamic OF node (CONFIG_PCI_DYNAMIC_OF_NODES). phylink then picks up the fixed-link node through dev_fwnode(); the real operating speed is sourced live from PCR[PSPEED].
The series touches three subsystems:
- net/enetc: pseudo-MAC overlay support + probing of 4.4 devices - 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.
v1: initial submission.
Claudiu Manoil (5):
net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a DT overlay
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 | 1 + drivers/net/ethernet/freescale/enetc/Makefile | 1 + drivers/net/ethernet/freescale/enetc/enetc.c | 12 +++ drivers/net/ethernet/freescale/enetc/enetc.h | 1 + .../net/ethernet/freescale/enetc/enetc4_pf.c | 98 +++++++++++++++++-- .../freescale/enetc/enetc4_pseudo_mac.dtso | 32 ++++++ .../net/ethernet/freescale/enetc/enetc_hw.h | 1 + .../freescale/enetc/enetc_pf_common.c | 41 +++++++- .../freescale/enetc/enetc_pf_common.h | 1 + drivers/pci/quirks.c | 2 + 12 files changed, 209 insertions(+), 9 deletions(-) create mode 100644 drivers/net/ethernet/freescale/enetc/enetc4_pseudo_mac.dtso
base-commit: d8674294aefef02266c4d47ad10131f1bffbe534
Signature · 1 line
2.34.1
Claudiu Manoil
maintainerPATCH 1/5 net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a DT overlay
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. Rather than hand-building a named software node, describe the fixed link with a self-contained device-tree overlay, following the approach used by the Microchip lan966x PCI driver. The overlay is compiled from enetc4_pseudo_mac.dtso into a .dtbo blob and embedded in the driver via the kernel's dtbo wrapping (__dtbo_*_begin/_end symbols).
The overlay fragment uses an empty target-path, so it is grafted onto the base node passed to of_overlay_fdt_apply(), i.e. the PCI function's own dynamic OF node (created by the PCI core when CONFIG_PCI_DYNAMIC_OF_NODES is enabled). The fixed-link node is therefore spliced directly onto the ENETC netdev's fwnode, exactly as if it had come from static DT, and phylink picks it up through dev_fwnode().
The overlay only adds a new fixed-link node; it deliberately does not add a phy-mode property. A device-tree overlay may only add new nodes (which are tracked with the OF_OVERLAY flag and freed cleanly on removal), not new properties onto an already-live node such as the PCI function's dynamic OF node. The phy-mode is instead set programmatically by the driver (pf->if_mode) before the overlay is applied.
The pseudo-MAC overlay 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.
The overlay blob is applied unmodified, it only selects fixed-link mode and carries the duplex setting; its 'speed' cell is a placeholder. The real operating speed is sourced live from PCR[PSPEED] through the phylink get_fixed_state callback, which lets the driver override the fixed-link state at link time. The overlay is removed on teardown and on the probe error unwind.
The driver gains a build dependency on OF_OVERLAY. In addition, 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 overlay is applied 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.
--- drivers/net/ethernet/freescale/enetc/Kconfig | 1 + drivers/net/ethernet/freescale/enetc/Makefile | 1 + drivers/net/ethernet/freescale/enetc/enetc.h | 1 + .../net/ethernet/freescale/enetc/enetc4_pf.c | 98 +++++++++++++++++-- .../freescale/enetc/enetc4_pseudo_mac.dtso | 32 ++++++ .../freescale/enetc/enetc_pf_common.c | 41 +++++++- .../freescale/enetc/enetc_pf_common.h | 1 + 7 files changed, 166 insertions(+), 9 deletions(-) create mode 100644 drivers/net/ethernet/freescale/enetc/enetc4_pseudo_mac.dtso
drivers/net/ethernet/freescale/enetc/Kconfig +1 -0
@@ -49,6 +49,7 @@ config NXP_ENETC4 tristate "ENETC4 PF driver" depends on PTP_1588_CLOCK_OPTIONAL depends on PCI_MSI + depends on OF_OVERLAY select FSL_ENETC_CORE select FSL_ENETC_MDIO select NXP_ENETC_PF_COMMON
drivers/net/ethernet/freescale/enetc/Makefile +1 -0
@@ -16,6 +16,7 @@ fsl-enetc-$(CONFIG_FSL_ENETC_QOS) += enetc_qos.o obj-$(CONFIG_NXP_ENETC4) += nxp-enetc4.o nxp-enetc4-y := enetc4_pf.o +nxp-enetc4-y += enetc4_pseudo_mac.dtbo.o nxp-enetc4-$(CONFIG_DEBUG_FS) += enetc4_debugfs.o obj-$(CONFIG_FSL_ENETC_VF) += fsl-enetc-vf.o
drivers/net/ethernet/freescale/enetc/enetc.h +1 -0
@@ -500,6 +500,7 @@ struct enetc_ndev_priv {struct clk *ref_clk;/* RGMII/RMII reference clock */ u64 sysclk_freq;/* NETC system clock frequency */ +int ovcs_id; };#define ENETC_CBD (R , i) (&(((struct enetc_cbd *)((R).bd_base))[i]))
drivers/net/ethernet/freescale/enetc/enetc4_pf.c +92 -6
144 lines not on this page · raw message
drivers/net/ethernet/freescale/enetc/enetc4_pseudo_mac.dtso new file +32 -0
@@ -0,0 +1,32 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* + * Device-tree overlay for ENETC v4 Pseudo-MAC (PPM) ports. + * + * ENETCv4 pseudo-MACs are proprietary internal links to the on-chip NETC + * switch; they implement no standard MII interface and are modeled as a + * fixed link whose speed is set at boot time from the Port PCR[PSPEED] + * field. + * + * This overlay is applied by the ENETC4 PF driver onto the PCI function's own + * dynamic OF node (created by the PCI core when CONFIG_PCI_DYNAMIC_OF_NODES + * is enabled). The overlay only selects fixed-link mode and carries the duplex + * setting; the 'speed' property is a placeholder. + * + * Copyright 2026 NXP + */ + +/dts-v1/; +/plugin/; + +/ { + fragment@0 { + target-path = ""; + + __overlay__ { + fixed-link { + speed = <2500>; + full-duplex; + }; + }; + }; +};
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
@@ -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
Claudiu Manoil
maintainerPATCH 2/5 net: enetc: Enable probing of version 4.4 devices
In reply to Claudiu ManoilThe ENETC v4.4 devices are present on S32N79 SoCs and feature only Pseudo-MAC ENETC ports, whose PFs expose both the 0xe101 and 0xe110 PCI device IDs, while the VFs answer to the usual device ID of 0xef00.
--- drivers/net/ethernet/freescale/enetc/enetc.c | 12 ++++++++++++ drivers/net/ethernet/freescale/enetc/enetc_hw.h | 1 + 2 files changed, 13 insertions(+)
drivers/net/ethernet/freescale/enetc/enetc.c +12 -0
@@ -3862,6 +3862,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_ppm_data, + }, + { .revision = ENETC_REV_4_4, + .dev_id = NXP_ENETC_PF_DEV_ID, + .data = &enetc4_ppm_data, + }, + { .revision = ENETC_REV_4_4, + .dev_id = NXP_ENETC_VF_DEV_ID, + .data = &enetc4_vf_data, + }, }; int enetc_get_driver_data(struct enetc_si *si)
drivers/net/ethernet/freescale/enetc/enetc_hw.h +1 -0
@@ -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))
Signature · 1 line
2.34.1
Claudiu Manoil
maintainerPATCH 5/5 PCI: Create OF node for NXP ENETC pseudo-MAC functions
In reply to Claudiu ManoilNXP 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 applying a device-tree overlay onto 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.
--- drivers/pci/quirks.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/pci/quirks.c +2 -0
@@ -6391,6 +6391,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_XILINX, 0x5020, of_pci_make_dev_node);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_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
Re: [PATCH net-next v1 5/5] PCI: Create OF node for NXP ENETC pseudo-MAC functions
Quoted 12 lines · 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 applying a device-tree overlay onto 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 whenCONFIG_PCI_DYNAMIC_OF_NODESis enabled.
Quoted 4 lines
Both ENETC4 PCI device IDs are covered (
0xe101and0xe110), since either can be instantiated as a pseudo-MAC port on S32N79.Signed-off-by Claudiu Manoil <[email protected]>
Quoted 20 lines
--- drivers/pci/quirks.c | 2 ++ 1 file changed, 2 insertions(+)drivers/pci/quirks.c +2
-0@@ -6391,6 +6391,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_XILINX, 0x5020, of_pci_make_dev_node);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_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
Wei Fang
maintainerRE: [PATCH net-next v1 2/5] net: enetc: Enable probing of version 4.4 devices
In reply to Claudiu ManoilQuoted 2 lines
The ENETC v4.4 devices are present on S32N79 SoCs and feature only Pseudo-MAC ENETC ports, whose PFs expose both the
0xe101and0xe110
I think the device ID of the ENETC PF with the pseudo MAC should be 0xe110. The device ID 0xe101 should be only used for the standalone ENETCs (without pseudo MAC). Is this a hardware issue? If so, a workaround is to set these PF's device ID to 0xe110 in IERB module. Then the device ID 0xe110 will be present in the PCIe ECAM space.
Quoted 3 lines
PCI device IDs, while the VFs answer to the usual device ID of
0xef00.Signed-off-by Claudiu Manoil <[email protected]>
Re: [PATCH net-next v1 1/5] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a DT overlay
In reply to Claudiu ManoilQuoted 59 lines · Claudiu Manoil
[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
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. Rather than hand-building a named software node, describe the fixed link with a self-contained device-tree overlay, following the approach used by the Microchip lan966x PCI driver. The overlay is compiled from enetc4_pseudo_mac.dtso into a .dtbo blob and embedded in the driver via the kernel's dtbo wrapping (__dtbo_*_begin/_end symbols).
The overlay fragment uses an empty target-path, so it is grafted onto the base node passed to
of_overlay_fdt_apply(), i.e. the PCI function's own dynamic OF node (created by the PCI core whenCONFIG_PCI_DYNAMIC_OF_NODESis enabled). The fixed-link node is therefore spliced directly onto the ENETC netdev's fwnode, exactly as if it had come from static DT, and phylink picks it up throughdev_fwnode().The overlay only adds a new fixed-link node; it deliberately does not add a phy-mode property. A device-tree overlay may only add new nodes (which are tracked with the
OF_OVERLAYflag and freed cleanly on removal), not new properties onto an already-live node such as the PCI function's dynamic OF node. The phy-mode is instead set programmatically by the driver (pf->if_mode) before the overlay is applied.The pseudo-MAC overlay 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 regularof_get_phy_mode()path instead.The overlay blob is applied unmodified, it only selects fixed-link mode and carries the duplex setting; its 'speed' cell is a placeholder. The real operating speed is sourced live from PCR[PSPEED] through the phylink
get_fixed_statecallback, which lets the driver override the fixed-link state at link time. The overlay is removed on teardown and on the probe error unwind.The driver gains a build dependency on
OF_OVERLAY. In addition, the node-less pseudo-MAC path has a runtime dependency onCONFIG_PCI_DYNAMIC_OF_NODES: that is what makes the PCI core synthesize the per-function OF node (of_pci_make_dev_node()) that the overlay is applied onto. This is intentionally not a hardKconfigdependency, since the ENETC4 driver also serves regular ports described by static DT; whenPCI_DYNAMIC_OF_NODESis absent the PCI function has noof_nodeand the pseudo-MAC probe path fails gracefully with a clear-ENODEVerror.
Quoted 7 lines
Signed-off-by Claudiu Manoil <[email protected]>--- drivers/net/ethernet/freescale/enetc/Kconfig | 1 + drivers/net/ethernet/freescale/enetc/Makefile | 1 + drivers/net/ethernet/freescale/enetc/enetc.h | 1 + .../net/ethernet/freescale/enetc/enetc4_pf.c | 98 +++++++++++++++++-- .../freescale/enetc/enetc4_pseudo_mac.dtso | 32 ++++++
Not sure why need dt overlay here, there are already dymatic update dts by of_changeset_* API, like of_changeset_create_node().
Frank
[email protected]
AI reviewRe: [PATCH net-next v1 1/5] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a DT overlay
In reply to Claudiu ManoilThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] net: enetc: memory leak of partially applied overlay on of_overlay_fdt_apply() error --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] net: enetc: memory leak of partially applied overlay on of_overlay_fdt_apply() error --
commit 8ec35cbb99007d6ea94d2243308ce4530bb6180d
Author: Claudiu Manoil <[email protected]>
net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a DT overlay
This commit introduces pseudo-MAC support for ENETCv4 ports by modeling them as fixed links. It uses a compiled device-tree overlay to synthesize the fixed-link node at probe time when the port lacks an ethernet DT node representation.
Quoted 4 lines
drivers/net/ethernet/freescale/enetc/enetc4_pf.c +0
-0
[ ... ]
Quoted 5 lines
drivers/net/ethernet/freescale/enetc/enetc4_pf.c +5
-0+static int enetc4_apply_overlay (struct enetc_ndev_priv *priv) +{ +u32 size = __dtbo_enetc4_pseudo_mac_end - __dtbo_enetc4_pseudo_mac_begin; +struct device_node *np =dev_of_node (priv->dev); +int err;
drivers/net/ethernet/freescale/enetc/enetc4_pf.c static void enetc4_pci_remove(void *data) · line 1002
Quoted 10 lines
drivers/net/ethernet/freescale/enetc/enetc4_pf.c +10
-0+ +if (!np) +return dev_err_probe (priv->dev, -ENODEV , +"Missing of_node for Pseudo-MAC port\n" ); + + err =of_overlay_fdt_apply (__dtbo_enetc4_pseudo_mac_begin, size, + &priv->ovcs_id, np); +if (err) +return dev_err_probe (priv->dev, err, +"Failed to apply fixed-link overlay\n" );
[Severity: Medium]
Can this leak the partially applied overlay changeset?
If of_overlay_fdt_apply() fails during application (for example, from a post-apply notifier returning an error), it can return a negative error code but still populate the changeset ID in priv->ovcs_id. Returning immediately here without calling enetc4_put_overlay() bypasses cleaning up the partially applied state.
Looking at the caller enetc4_link_init():
err = enetc4_apply_overlay(priv); if (err) return err;
The error propagates directly and skips the err_mdiobus_create label which would otherwise invoke enetc4_put_overlay() to handle the cleanup.
Quoted 3 lines
drivers/net/ethernet/freescale/enetc/enetc4_pf.c +3
-0+ +return 0 ; +}
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
[email protected]
AI reviewRe: [PATCH net-next v1 3/5] arm64: dts: s32n79: add NETC IEP18 ECAM node for ENETC PPM ports
In reply to Claudiu ManoilThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] dt-bindings: PCI node netc_iep18 uses msi-parent instead of msi-map breaking MSI routing --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] dt-bindings: PCI node netc_iep18 uses msi-parent instead of msi-map breaking MSI routing --
commit 31419622a4729bd8008cf190e3a0993387a80408
Author: Claudiu Manoil <[email protected]>
arm64: dts: s32n79: add NETC IEP18 ECAM node for ENETC PPM ports
Add the netc_iep18 PCIe ECAM host node describing the NETC integrated endpoint bus allocated to the first Linux cohort on S32N79.
Quoted 5 lines
arch/arm64/boot/dts/freescale/s32n79.dtsi +0
-0@@ -122,6 +122,30 @@ irqsteer_coss: interrupt-controller@4ed00000 {
[ ... ]
arch/arm64/boot/dts/freescale/s32n79.dtsi irqsteer_coss: interrupt-controller@4ed00000 { · line 139
Quoted 8 lines
arch/arm64/boot/dts/freescale/s32n79.dtsi +8
-0+ 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>; + msi-parent = <&its 0x0>;
[Severity: High]
Does this break MSI routing for the PCIe devices on this bus?
The GICv3 ITS requires an MSI specifier (#msi-cells = <1>), and Linux's of_check_msi_parent() explicitly rejects msi-parent on bus nodes if the target MSI controller has #msi-cells > 0. This causes of_msi_xlate() to fail to locate an MSI controller, leaving the PCIe devices entirely without an MSI domain.
Furthermore, PCI buses typically use the msi-map property to map Requester IDs (RIDs) to MSI sideband Device IDs. Using msi-parent with an argument maps all 256 RIDs to the exact same ITS sideband ID (0x0). This breaks MSI isolation and contradicts the iommu-map property which maps them to distinct Stream IDs (0xc0000 to 0xc00FF).
Should this use msi-map instead, for example:
msi-map = <0x0 &its 0xc0000 0x100>?
Quoted 8 lines
arch/arm64/boot/dts/freescale/s32n79.dtsi +8
-0+ iommu-map = <0x0 &smmu 0xc0000 0x100>; + dma-coherent; + status = "disabled"; + + /* All NETC PCIe functions */ + ranges = <0x82000000 0x0 0x48800000 0x0 0x48800000 0x0 0x4b0000>; + }; + };
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
[email protected]
AI reviewRe: [PATCH net-next v1 5/5] PCI: Create OF node for NXP ENETC pseudo-MAC functions
In reply to Claudiu ManoilSashiko has reviewed this patch and found no issues. It looks great!
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 applying a device-tree overlay onto 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 whenCONFIG_PCI_DYNAMIC_OF_NODESis enabled.
Quoted 4 lines
Both ENETC4 PCI device IDs are covered (
0xe101and0xe110), since either can be instantiated as a pseudo-MAC port on S32N79.Signed-off-by Claudiu Manoil <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
Claudiu Manoil
maintainerRE: [PATCH net-next v1 1/5] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a DT overlay
In reply to Frank LiQuoted 2 lines
From: Frank Li (OSS) <[email protected]>
Sent: Saturday, October 10, 2026 5:26 AM
[...]
Quoted 5 lines
Subject: Re: [PATCH net-next v1 1/5] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a DT overlay
Quoted 1 line · Claudiu Manoil
[...]
Quoted 5 lines
Quoted 1 line
.../freescale/enetc/enetc4_pseudo_mac.dtso | 32 ++++++Not sure why need dt overlay here, there are already dymatic update dts by of_changeset_* API, like
of_changeset_create_node().
Ok, of_changeset_create_node() looks better to me too. Probably I missed this option because only one driver to date uses this function and I was focused on the lan966x approach.
The of_changeset_create_node() approach would also address the limitation regarding the advertised/supported speed displayed by phylink (I was aware of) that also Sashiko found as medium severity issue. Likely this approach will address the other Med severity issues found on this patch too.
Thanks.
Claudiu Manoil
maintainerRE: [PATCH net-next v1 2/5] net: enetc: Enable probing of version 4.4 devices
In reply to Wei FangFrom: Wei Fang <[email protected]>
Sent: Saturday, October 10, 2026 5:02 AM
[...]
Quoted 12 lines
Subject: RE: [PATCH net-next v1 2/5] net: enetc: Enable probing of version 4.4 devices
Quoted 2 lines
The ENETC v4.4 devices are present on S32N79 SoCs and feature only Pseudo-MAC ENETC ports, whose PFs expose both the
0xe101and0xe110I think the device ID of the ENETC PF with the pseudo MAC should be
0xe110. The device ID0xe101should be only used for the standalone ENETCs (without pseudo MAC). Is this a hardware issue? If so, a workaround is to set these PF's device ID to0xe110in IERB module. Then the device ID0xe110will be present in the PCIe ECAM space.
Ok, will consider going forward with 0xe110 exclusively, in v2. Thanks.
Wei Fang
maintainerRE: [PATCH net-next v1 2/5] net: enetc: Enable probing of version 4.4 devices
NXP Confidential
Quoted 15 lines
From: Wei Fang <[email protected]>
Sent: Saturday, October 10, 2026 5:02 AM [...]Quoted 12 lines
Subject: RE: [PATCH net-next v1 2/5] net: enetc: Enable probing of version 4.4 devices
Quoted 2 lines
The ENETC v4.4 devices are present on S32N79 SoCs and feature only Pseudo-MAC ENETC ports, whose PFs expose both the
0xe101and0xe110I think the device ID of the ENETC PF with the pseudo MAC should be
0xe110. The device ID0xe101should be only used for the standalone ENETCs (without pseudo MAC). Is this a hardware issue? If so, a workaround is to set these PF's device ID to0xe110in IERB module. Then the device ID0xe110will be present in the PCIe ECAM space.
Quoted 2 lines
Ok, will consider going forward with
0xe110exclusively, in v2. Thanks.
As Alex explained in the internal mail thread, the device ID is not related to pseudo MAC vs physic MAC. The device ID 0xe110 is used for switch management port, and the device ID 0xe101 is used for non-management port. So the current patch is fine, the only thing that needs improvement is to include this in the commit message to avoid causing the same confusion for others as I have.