[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <41651550-4e63-4699-b10f-ba2e8cfbc0a3@linux.dev>
Date: Tue, 19 Aug 2025 16:48:19 +0100
From: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
To: Wei Fang <wei.fang@....com>, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, richardcochran@...il.com, claudiu.manoil@....com,
vladimir.oltean@....com, xiaoning.wang@....com, andrew+netdev@...n.ch,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, Frank.Li@....com, shawnguo@...nel.org,
s.hauer@...gutronix.de, festevam@...il.com
Cc: fushi.peng@....com, devicetree@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, imx@...ts.linux.dev, kernel@...gutronix.de
Subject: Re: [PATCH v4 net-next 04/15] ptp: netc: add NETC V4 Timer PTP driver
support
On 19/08/2025 13:36, Wei Fang wrote:
> NETC V4 Timer provides current time with nanosecond resolution, precise
> periodic pulse, pulse on timeout (alarm), and time capture on external
> pulse support. And it supports time synchronization as required for
> IEEE 1588 and IEEE 802.1AS-2020.
>
> Inside NETC, ENETC can capture the timestamp of the sent/received packet
> through the PHC provided by the Timer and record it on the Tx/Rx BD. And
> through the relevant PHC interfaces provided by the driver, the enetc V4
> driver can support PTP time synchronization.
>
> In addition, NETC V4 Timer is similar to the QorIQ 1588 timer, but it is
> not exactly the same. The current ptp-qoriq driver is not compatible with
> NETC V4 Timer, most of the code cannot be reused, see below reasons.
>
> 1. The architecture of ptp-qoriq driver makes the register offset fixed,
> however, the offsets of all the high registers and low registers of V4
> are swapped, and V4 also adds some new registers. so extending ptp-qoriq
> to make it compatible with V4 Timer is tantamount to completely rewriting
> ptp-qoriq driver.
>
> 2. The usage of some functions is somewhat different from QorIQ timer,
> such as the setting of TCLK_PERIOD and TMR_ADD, the logic of configuring
> PPS, etc., so making the driver compatible with V4 Timer will undoubtedly
> increase the complexity of the code and reduce readability.
>
> 3. QorIQ is an expired brand. It is difficult for us to verify whether
> it works stably on the QorIQ platforms if we refactor the driver, and
> this will make maintenance difficult, so refactoring the driver obviously
> does not bring any benefits.
>
> Therefore, add this new driver for NETC V4 Timer. Note that the missing
> features like PEROUT, PPS and EXTTS will be added in subsequent patches.
>
> Signed-off-by: Wei Fang <wei.fang@....com>
>
[...]
> drivers/ptp/Kconfig | 11 +
> drivers/ptp/Makefile | 1 +
> drivers/ptp/ptp_netc.c | 416 ++++++++++++++++++++++++++++++++
> include/linux/fsl/netc_global.h | 3 +-
> 4 files changed, 430 insertions(+), 1 deletion(-)
> create mode 100644 drivers/ptp/ptp_netc.c
[...]
> diff --git a/include/linux/fsl/netc_global.h b/include/linux/fsl/netc_global.h
> index fdecca8c90f0..763b38e05d7d 100644
> --- a/include/linux/fsl/netc_global.h
> +++ b/include/linux/fsl/netc_global.h
> @@ -1,10 +1,11 @@
> /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
> -/* Copyright 2024 NXP
> +/* Copyright 2024-2025 NXP
> */
> #ifndef __NETC_GLOBAL_H
> #define __NETC_GLOBAL_H
>
> #include <linux/io.h>
> +#include <linux/pci.h>
What is the reason to include it header file? You need PCI functions
only in ptp_netc.c, but this header is also included in a couple of
other files (netc_blk_ctrl.c, ntmp.c).
>
> static inline u32 netc_read(void __iomem *reg)
> {
Powered by blists - more mailing lists