* [PATCH net-next v2 2/5] net: enetc: Enable probing of version 4.4 devices
2026-10-13 17:12 [PATCH net-next v2 0/5] net: enetc: S32N79 pseudo-MAC (PPM) networking support Claudiu Manoil
@ 2026-10-13 17:12 ` Claudiu Manoil
2026-10-15 1:42 ` Wei Fang
0 siblings, 1 reply; 4+ messages in thread
From: Claudiu Manoil @ 2026-10-13 17:12 UTC (permalink / raw)
To: netdev
Cc: s32, linux-kernel, Vladimir Oltean, Wei Fang, Clark Wang,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, imx
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).
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
---
v2:
- Described why there are two ENETC PF IDs in the commit message, as per
review.
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 related [flat|nested] 4+ messages in thread
* RE: [PATCH net-next v2 2/5] net: enetc: Enable probing of version 4.4 devices
2026-10-13 17:12 ` [PATCH net-next v2 2/5] net: enetc: Enable probing of version 4.4 devices Claudiu Manoil
@ 2026-10-15 1:42 ` Wei Fang
2026-10-15 13:31 ` Claudiu Manoil
0 siblings, 1 reply; 4+ messages in thread
From: Wei Fang @ 2026-10-15 1:42 UTC (permalink / raw)
To: Claudiu Manoil
Cc: dl-S32, linux-kernel@vger.kernel.org, Vladimir Oltean, Clark Wang,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, imx@lists.linux.dev, netdev@vger.kernel.org
> + { .revision = ENETC_REV_4_4,
> + .dev_id = NXP_ENETC_PPM_DEV_ID,
> + .data = &enetc4_ppm_data,
> + },
You have reused driver data of the i.MX94, which has a system clock
frequency of 333 MHz. However, for the S32N7, I think its system
clock frequency to be 500 MHz. And the system clock frequency is
used for DIM. Therefore, you'd better to add the new driver data
for S32N7.
> + { .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] 4+ messages in thread
* RE: [PATCH net-next v2 2/5] net: enetc: Enable probing of version 4.4 devices
2026-10-15 1:42 ` Wei Fang
@ 2026-10-15 13:31 ` Claudiu Manoil
0 siblings, 0 replies; 4+ messages in thread
From: Claudiu Manoil @ 2026-10-15 13:31 UTC (permalink / raw)
To: Wei Fang
Cc: dl-S32, linux-kernel@vger.kernel.org, Vladimir Oltean, Clark Wang,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, imx@lists.linux.dev, netdev@vger.kernel.org
NXP Confidential
> From: Wei Fang <wei.fang@nxp.com>
> Sent: Thursday, October 15, 2026 4:42 AM
[...]
> Subject: RE: [PATCH net-next v2 2/5] net: enetc: Enable probing of version 4.4
> devices
>
> > + { .revision = ENETC_REV_4_4,
> > + .dev_id = NXP_ENETC_PPM_DEV_ID,
> > + .data = &enetc4_ppm_data,
> > + },
>
> You have reused driver data of the i.MX94, which has a system clock
> frequency of 333 MHz. However, for the S32N7, I think its system
> clock frequency to be 500 MHz. And the system clock frequency is
> used for DIM. Therefore, you'd better to add the new driver data
> for S32N7.
>
Ok, wanted to deal with the NETC frequency of S32N79 later, but I'll
look into adding this info in v3. This is not a functional issue, the driver
still works with the 'old' frequency, but it may affect indeed the performance
of interrupt coalescing.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next v2 2/5] net: enetc: Enable probing of version 4.4 devices
@ 2026-10-16 8:15 netdev-bot+sashiko
0 siblings, 0 replies; 4+ messages in thread
From: netdev-bot+sashiko @ 2026-10-16 8:15 UTC (permalink / raw)
To: claudiu.manoil; +Cc: netdev, s32, linux-kernel, bhelgaas, linux-pci, kuba
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · 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] The patch enables ENETC v4.4 (S32N79) by adding ENETC_REV_4_4
entries to enetc_info[], including { ENETC_REV_4_4,…
--
net: enetc: Enable probing of version 4.4 devices
This commit adds the ENETC_REV_4_4 revision define. It also adds
enetc_info[] entries for v4.4 devices, as found on S32N79 SoCs. Both PF
device IDs (0xe101 and 0xe110) map to enetc4_ppm_data, and the 0xef00
VF ID maps to enetc4_vf_data.
> diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c
> index c6571b5cc8425..be7795d4e0c66 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[] = {
[ ... ]
> + { .revision = ENETC_REV_4_4,
> + .dev_id = NXP_ENETC_VF_DEV_ID,
> + .data = &enetc4_vf_data,
> + },
> };
[Severity: Medium]
With this entry, v4.4 VFs probe with enetc4_vf_data and get
enetc_vf_ethtool_ops, which sets .get_ts_info = enetc_get_ts_info. Was the
second revision-keyed table in enetc_get_phc_index_by_pdev() in
enetc_ethtool.c meant to be updated as well? It only knows about the older
revisions:
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;
}
...
}
On a v4.4 VF, enetc_vf_get_revision() computes si->revision as
(pdev->revision << 8) | ip_mn, which gives 0x0404. VFs have no OF node,
since the PCI fixup in this series only covers 0xe101/0xe110. So
enetc_get_phc_index() always falls back to the by-pdev lookup:
enetc_get_ts_info()
enetc_get_phc_index()
if (!np) return enetc_get_phc_index_by_pdev(si);
default: return -1;
goto timestamp_tx_sw;
As a result, ethtool -T on a v4.4 VF reports only
SOF_TIMESTAMPING_TX_SOFTWARE and no PHC, even with CONFIG_PTP_NETC_V4_TIMER
enabled.
enetc_hwtstamp_set() is gated only by enetc_ptp_clock_is_enabled():
if (!enetc_ptp_clock_is_enabled(priv->si))
return -EOPNOTSUPP;
So it still enables ENETC_F_TX_TSTAMP / ENETC_F_RX_TSTAMP on the same VF.
That leaves ethtool and the hwtstamp path disagreeing, and PTP userspace
has no PHC to pair with the hardware timestamps.
When REV_4_1 and REV_4_3 were enabled, each got a timer devfn in this
switch. Does the S32N79 NETC timer sit on the same PCI bus as the ENETC
functions?
If it does, should a REV_4_4 case with the right devfn be added here? If
it doesn't, should hardware timestamping be refused for v4.4 VFs, so that
ndo_hwtstamp_set and get_ts_info report the same thing?
The PFs use enetc4_ppm_data and enetc4_ppm_ethtool_ops, which have no
.get_ts_info, so the ethtool half of this does not apply to them.
>
> int enetc_get_driver_data(struct enetc_si *si)
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1791908694.git.claudiu.manoil%40nxp.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-10-16 8:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-16 8:15 [PATCH net-next v2 2/5] net: enetc: Enable probing of version 4.4 devices netdev-bot+sashiko
-- strict thread matches above, loose matches on Subject: below --
2026-10-13 17:12 [PATCH net-next v2 0/5] net: enetc: S32N79 pseudo-MAC (PPM) networking support Claudiu Manoil
2026-10-13 17:12 ` [PATCH net-next v2 2/5] net: enetc: Enable probing of version 4.4 devices Claudiu Manoil
2026-10-15 1:42 ` Wei Fang
2026-10-15 13:31 ` Claudiu Manoil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox