Re: [PATCH v3] ptp: add ToD device driver for Intel FPGA cards

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 28 Mar 2023, Tianfei Zhang wrote:

> Adding a DFL (Device Feature List) device driver of ToD device for
> Intel FPGA cards.
> 
> The Intel FPGA Time of Day(ToD) IP within the FPGA DFL bus is exposed
> as PTP Hardware clock(PHC) device to the Linux PTP stack to synchronize
> the system clock to its ToD information using phc2sys utility of the
> Linux PTP stack. The DFL is a hardware List within FPGA, which defines
> a linked list of feature headers within the device MMIO space to provide
> an extensible way of adding subdevice features.
> 
> Signed-off-by: Raghavendra Khadatare <raghavendrax.anand.khadatare@xxxxxxxxx>
> Signed-off-by: Tianfei Zhang <tianfei.zhang@xxxxxxxxx>
> 
> ---
> v3:
> - add PTP_1588_CLOCK dependency for PTP_DFL_TOD in Kconfig file.
> - don't need handle NULL case for ptp_clock_register() after adding
>   PTP_1588_CLOCK dependency.
> - wrap the code at 80 characters.
> 
> v2:
> - handle NULL for ptp_clock_register().
> - use readl_poll_timeout_atomic() instead of readl_poll_timeout(), and
>   change the interval timeout to 10us.
> - fix the uninitialized variable.
> ---

> diff --git a/drivers/ptp/ptp_dfl_tod.c b/drivers/ptp/ptp_dfl_tod.c
> new file mode 100644
> index 000000000000..f699d541b360
> --- /dev/null
> +++ b/drivers/ptp/ptp_dfl_tod.c
> @@ -0,0 +1,332 @@
> +#include <linux/bitfield.h>
> +#include <linux/delay.h>
> +#include <linux/dfl.h>
> +#include <linux/gcd.h>
> +#include <linux/iopoll.h>
> +#include <linux/module.h>
> +#include <linux/ptp_clock_kernel.h>
> +#include <linux/spinlock.h>
> +#include <linux/units.h>

> +static int dfl_tod_probe(struct dfl_device *ddev)
> +{
> +	struct device *dev = &ddev->dev;
> +	struct dfl_tod *dt;
> +
> +	dt = devm_kzalloc(dev, sizeof(*dt), GFP_KERNEL);

+ #include <linux/device.h>

Other than that,

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>

-- 
 i.

[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux