* [PATCH net-next v1 1/5] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a DT overlay
[not found] <cover.1791548316.git.claudiu.manoil@nxp.com>
@ 2026-10-09 12:40 ` Claudiu Manoil
2026-10-10 2:26 ` Frank Li
2026-10-09 12:40 ` [PATCH net-next v1 2/5] net: enetc: Enable probing of version 4.4 devices Claudiu Manoil
` (3 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Claudiu Manoil @ 2026-10-09 12:40 UTC (permalink / raw)
To: netdev
Cc: s32, Vladimir Oltean, Wei Fang, Clark Wang, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Saravana Kannan, Russell King, linux-kernel, imx,
devicetree
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.
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
---
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
diff --git a/drivers/net/ethernet/freescale/enetc/Kconfig b/drivers/net/ethernet/freescale/enetc/Kconfig
index f425f82a6213..a323f4235802 100644
--- a/drivers/net/ethernet/freescale/enetc/Kconfig
+++ b/drivers/net/ethernet/freescale/enetc/Kconfig
@@ -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
diff --git a/drivers/net/ethernet/freescale/enetc/Makefile b/drivers/net/ethernet/freescale/enetc/Makefile
index 10ab6694c314..86aa73de3f84 100644
--- a/drivers/net/ethernet/freescale/enetc/Makefile
+++ b/drivers/net/ethernet/freescale/enetc/Makefile
@@ -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
diff --git a/drivers/net/ethernet/freescale/enetc/enetc.h b/drivers/net/ethernet/freescale/enetc/enetc.h
index d9e91832a9c1..02b44ea53807 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc.h
+++ b/drivers/net/ethernet/freescale/enetc/enetc.h
@@ -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]))
diff --git a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c
index 71c971618388..7999355b5b9f 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
-/* Copyright 2024 NXP */
+/* Copyright 2024, 2026 NXP */
#include <linux/clk.h>
#include <linux/module.h>
@@ -12,6 +12,10 @@
#define ENETC_SI_MAX_RING_NUM 8
+/* embedded overlay blob, created by cmd_wrap_S_dtb in scripts/Makefile.lib */
+extern char __dtbo_enetc4_pseudo_mac_begin[];
+extern char __dtbo_enetc4_pseudo_mac_end[];
+
static void enetc4_get_port_caps(struct enetc_pf *pf)
{
struct enetc_hw *hw = &pf->si->hw;
@@ -932,6 +936,32 @@ static void enetc4_pl_mac_link_down(struct phylink_config *config,
enetc4_mac_tx_graceful_stop(pf);
}
+static void enetc4_get_pcr_speed(struct enetc_hw *hw, int *speed)
+{
+ u32 val = enetc_port_rd(hw, ENETC4_PCR);
+ int pspeed = FIELD_GET(PCR_PSPEED, val);
+
+ *speed = (pspeed + 1) * 10;
+}
+
+/* Pseudo-MAC ports have no real PHY; the link is fixed. The overlay puts
+ * phylink into fixed-link mode, but the operating speed is taken live from
+ * PCR[PSPEED] here rather than from the DT 'speed' cell.
+ */
+static void enetc4_pl_get_fixed_state(struct phylink_config *config,
+ struct phylink_link_state *state)
+{
+ struct enetc_pf *pf = phylink_to_enetc_pf(config);
+ int speed;
+
+ enetc4_get_pcr_speed(&pf->si->hw, &speed);
+
+ state->link = 1;
+ state->an_complete = 1;
+ state->duplex = DUPLEX_FULL;
+ state->speed = enetc_phylink_match_pseudo_mac_speed(speed);
+}
+
static const struct phylink_mac_ops enetc_pl_mac_ops = {
.mac_select_pcs = enetc4_pl_mac_select_pcs,
.mac_config = enetc4_pl_mac_config,
@@ -946,23 +976,76 @@ static void enetc4_pci_remove(void *data)
enetc_pci_remove(pdev);
}
+static void enetc4_put_overlay(struct enetc_ndev_priv *priv)
+{
+ if (!priv->ovcs_id)
+ return;
+
+ of_overlay_remove(&priv->ovcs_id);
+ priv->ovcs_id = 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;
+
+ 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");
+
+ return 0;
+}
+
static int enetc4_link_init(struct enetc_ndev_priv *priv,
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;
- 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 fixed-link overlay
+ * 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.
+ */
+ if (enetc_is_pseudo_mac(priv->si) && (!node || dynamic)) {
+ pf->if_mode = PHY_INTERFACE_MODE_INTERNAL;
+
+ err = enetc4_apply_overlay(priv);
+ if (err)
+ return err;
+
+ /* Source the fixed-link speed live from PCR[PSPEED] instead
+ * of the overlay 'speed' cell.
+ */
+ pf->phylink_config.get_fixed_state = enetc4_pl_get_fixed_state;
+
+ /* The overlay was grafted onto dev's own of_node, so phylink
+ * will find the fixed-link via dev_fwnode(dev). Use that node
+ * for the subsequent MDIO/phylink setup below.
+ */
+ node = dev_of_node(dev);
+ } else {
+ err = of_get_phy_mode(node, &pf->if_mode);
+ if (err) {
+ dev_err(dev, "Failed to get PHY mode\n");
+ return err;
+ }
}
err = enetc_mdiobus_create(pf, node);
if (err) {
dev_err(dev, "Failed to create MDIO bus\n");
- return err;
+ goto err_mdiobus_create;
}
err = enetc_phylink_create(priv, node, &enetc_pl_mac_ops);
@@ -975,6 +1058,8 @@ static int enetc4_link_init(struct enetc_ndev_priv *priv,
err_phylink_create:
enetc_mdiobus_destroy(pf);
+err_mdiobus_create:
+ enetc4_put_overlay(priv);
return err;
}
@@ -985,6 +1070,7 @@ static void enetc4_link_deinit(struct enetc_ndev_priv *priv)
enetc_phylink_destroy(priv);
enetc_mdiobus_destroy(pf);
+ enetc4_put_overlay(priv);
}
static void enetc4_pf_link_status_task(struct work_struct *work)
diff --git a/drivers/net/ethernet/freescale/enetc/enetc4_pseudo_mac.dtso b/drivers/net/ethernet/freescale/enetc/enetc4_pseudo_mac.dtso
new file mode 100644
index 000000000000..e3d3e4259fbd
--- /dev/null
+++ b/drivers/net/ethernet/freescale/enetc/enetc4_pseudo_mac.dtso
@@ -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;
+ };
+ };
+ };
+};
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c b/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c
index 8206884294a4..3ba46c3a7670 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c
@@ -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)
+{
+ 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);
+
int enetc_phylink_create(struct enetc_ndev_priv *priv, struct device_node *node,
const struct phylink_mac_ops *ops)
{
@@ -471,9 +508,7 @@ int enetc_phylink_create(struct enetc_ndev_priv *priv, struct device_node *node,
phy_interface_set_rgmii(pf->phylink_config.supported_interfaces);
} else {
- mac_caps |= MAC_10FD | MAC_100FD | MAC_1000FD | MAC_2500FD |
- MAC_5000FD | MAC_10000FD | MAC_20000FD |
- MAC_25000FD;
+ mac_caps |= enetc_phylink_get_pseudo_mac_caps();
}
pf->phylink_config.mac_capabilities = mac_caps;
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf_common.h b/drivers/net/ethernet/freescale/enetc/enetc_pf_common.h
index c9eed879d5a3..aede1aad6362 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_pf_common.h
+++ b/drivers/net/ethernet/freescale/enetc/enetc_pf_common.h
@@ -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);
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next v1 2/5] net: enetc: Enable probing of version 4.4 devices
[not found] <cover.1791548316.git.claudiu.manoil@nxp.com>
2026-10-09 12:40 ` [PATCH net-next v1 1/5] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a DT overlay Claudiu Manoil
@ 2026-10-09 12:40 ` Claudiu Manoil
2026-10-10 2:01 ` Wei Fang
2026-10-09 12:40 ` [PATCH net-next v1 3/5] arm64: dts: s32n79: add NETC IEP18 ECAM node for ENETC PPM ports Claudiu Manoil
` (2 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Claudiu Manoil @ 2026-10-09 12:40 UTC (permalink / raw)
To: netdev
Cc: s32, Vladimir Oltean, Wei Fang, Clark Wang, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, imx,
linux-kernel
The 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.
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
---
drivers/net/ethernet/freescale/enetc/enetc.c | 12 ++++++++++++
drivers/net/ethernet/freescale/enetc/enetc_hw.h | 1 +
2 files changed, 13 insertions(+)
diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c
index c6571b5cc842..be7795d4e0c6 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc.c
@@ -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)
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_hw.h b/drivers/net/ethernet/freescale/enetc/enetc_hw.h
index 2c9d9042eb0b..64789bd0f33e 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_hw.h
+++ b/drivers/net/ethernet/freescale/enetc/enetc_hw.h
@@ -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))
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next v1 3/5] arm64: dts: s32n79: add NETC IEP18 ECAM node for ENETC PPM ports
[not found] <cover.1791548316.git.claudiu.manoil@nxp.com>
2026-10-09 12:40 ` [PATCH net-next v1 1/5] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a DT overlay Claudiu Manoil
2026-10-09 12:40 ` [PATCH net-next v1 2/5] net: enetc: Enable probing of version 4.4 devices Claudiu Manoil
@ 2026-10-09 12:40 ` Claudiu Manoil
2026-10-09 12:40 ` [PATCH net-next v1 4/5] arm64: dts: s32n79-rdb: enable NETC IEP18 Claudiu Manoil
2026-10-09 12:40 ` [PATCH net-next v1 5/5] PCI: Create OF node for NXP ENETC pseudo-MAC functions Claudiu Manoil
4 siblings, 0 replies; 8+ messages in thread
From: Claudiu Manoil @ 2026-10-09 12:40 UTC (permalink / raw)
To: netdev
Cc: s32, Frank Li, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
imx, linux-arm-kernel, devicetree, linux-kernel
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 and DMA is translated
by the SMMUv3 (iommu-map).
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
---
arch/arm64/boot/dts/freescale/s32n79.dtsi | 24 +++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/s32n79.dtsi b/arch/arm64/boot/dts/freescale/s32n79.dtsi
index 94ab58783fdc..671b807f1c54 100644
--- a/arch/arm64/boot/dts/freescale/s32n79.dtsi
+++ b/arch/arm64/boot/dts/freescale/s32n79.dtsi
@@ -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>;
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next v1 4/5] arm64: dts: s32n79-rdb: enable NETC IEP18
[not found] <cover.1791548316.git.claudiu.manoil@nxp.com>
` (2 preceding siblings ...)
2026-10-09 12:40 ` [PATCH net-next v1 3/5] arm64: dts: s32n79: add NETC IEP18 ECAM node for ENETC PPM ports Claudiu Manoil
@ 2026-10-09 12:40 ` Claudiu Manoil
2026-10-09 12:40 ` [PATCH net-next v1 5/5] PCI: Create OF node for NXP ENETC pseudo-MAC functions Claudiu Manoil
4 siblings, 0 replies; 8+ messages in thread
From: Claudiu Manoil @ 2026-10-09 12:40 UTC (permalink / raw)
To: netdev
Cc: s32, Frank Li, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
imx, linux-arm-kernel, devicetree, linux-kernel
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.
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
---
arch/arm64/boot/dts/freescale/s32n79-rdb.dts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/s32n79-rdb.dts b/arch/arm64/boot/dts/freescale/s32n79-rdb.dts
index 1feccd61258e..897ba24ac03a 100644
--- a/arch/arm64/boot/dts/freescale/s32n79-rdb.dts
+++ b/arch/arm64/boot/dts/freescale/s32n79-rdb.dts
@@ -68,3 +68,7 @@ &usdhc0 {
no-sdio;
status = "okay";
};
+
+&netc_iep18 {
+ status = "okay";
+};
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next v1 5/5] PCI: Create OF node for NXP ENETC pseudo-MAC functions
[not found] <cover.1791548316.git.claudiu.manoil@nxp.com>
` (3 preceding siblings ...)
2026-10-09 12:40 ` [PATCH net-next v1 4/5] arm64: dts: s32n79-rdb: enable NETC IEP18 Claudiu Manoil
@ 2026-10-09 12:40 ` Claudiu Manoil
2026-10-09 15:29 ` Bjorn Helgaas
4 siblings, 1 reply; 8+ messages in thread
From: Claudiu Manoil @ 2026-10-09 12:40 UTC (permalink / raw)
To: netdev; +Cc: s32, Bjorn Helgaas, linux-pci, linux-kernel
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 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.
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
---
drivers/pci/quirks.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index de9bbccda21f..86f0a182224b 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -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
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v1 5/5] PCI: Create OF node for NXP ENETC pseudo-MAC functions
2026-10-09 12:40 ` [PATCH net-next v1 5/5] PCI: Create OF node for NXP ENETC pseudo-MAC functions Claudiu Manoil
@ 2026-10-09 15:29 ` Bjorn Helgaas
0 siblings, 0 replies; 8+ messages in thread
From: Bjorn Helgaas @ 2026-10-09 15:29 UTC (permalink / raw)
To: Claudiu Manoil; +Cc: netdev, s32, Bjorn Helgaas, linux-pci, linux-kernel
On Fri, Oct 09, 2026 at 03:40:34PM +0300, Claudiu Manoil wrote:
> 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 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.
>
> Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> ---
> drivers/pci/quirks.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index de9bbccda21f..86f0a182224b 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -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
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH net-next v1 2/5] net: enetc: Enable probing of version 4.4 devices
2026-10-09 12:40 ` [PATCH net-next v1 2/5] net: enetc: Enable probing of version 4.4 devices Claudiu Manoil
@ 2026-10-10 2:01 ` Wei Fang
0 siblings, 0 replies; 8+ messages in thread
From: Wei Fang @ 2026-10-10 2:01 UTC (permalink / raw)
To: Claudiu Manoil
Cc: dl-S32, Vladimir Oltean, Clark Wang, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, imx,
linux-kernel, netdev
> The ENETC v4.4 devices are present on S32N79 SoCs and feature only
> Pseudo-MAC ENETC ports, whose PFs expose both the 0xe101 and 0xe110
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.
> PCI device IDs, while the VFs answer to the usual device ID of 0xef00.
>
> Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v1 1/5] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a DT overlay
2026-10-09 12:40 ` [PATCH net-next v1 1/5] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a DT overlay Claudiu Manoil
@ 2026-10-10 2:26 ` Frank Li
0 siblings, 0 replies; 8+ messages in thread
From: Frank Li @ 2026-10-10 2:26 UTC (permalink / raw)
To: Claudiu Manoil
Cc: netdev, s32, Vladimir Oltean, Wei Fang, Clark Wang, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Saravana Kannan, Russell King, linux-kernel, imx,
devicetree
On Fri, Oct 09, 2026 at 03:40:30PM +0300, Claudiu Manoil wrote:
> [You don't often get email from claudiu.manoil@nxp.com. 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 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.
>
> Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
> ---
> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-10-10 2:26 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <cover.1791548316.git.claudiu.manoil@nxp.com>
2026-10-09 12:40 ` [PATCH net-next v1 1/5] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a DT overlay Claudiu Manoil
2026-10-10 2:26 ` Frank Li
2026-10-09 12:40 ` [PATCH net-next v1 2/5] net: enetc: Enable probing of version 4.4 devices Claudiu Manoil
2026-10-10 2:01 ` Wei Fang
2026-10-09 12:40 ` [PATCH net-next v1 3/5] arm64: dts: s32n79: add NETC IEP18 ECAM node for ENETC PPM ports Claudiu Manoil
2026-10-09 12:40 ` [PATCH net-next v1 4/5] arm64: dts: s32n79-rdb: enable NETC IEP18 Claudiu Manoil
2026-10-09 12:40 ` [PATCH net-next v1 5/5] PCI: Create OF node for NXP ENETC pseudo-MAC functions Claudiu Manoil
2026-10-09 15:29 ` Bjorn Helgaas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®