2019-06-14 10:41:34

by Yangbo Lu

[permalink] [raw]
Subject: [v2, 0/6] Reuse ptp_qoriq driver for dpaa2-ptp

Although dpaa2-ptp.c driver is a fsl_mc_driver which
is using MC APIs for register accessing, it's same IP
block with eTSEC/DPAA/ENETC 1588 timer.
This patch-set is to convert to reuse ptp_qoriq driver by
using register ioremap and dropping related MC APIs.
However the interrupts could only be handled by MC which
fires MSIs to ARM cores. So the interrupt enabling and
handling still rely on MC APIs. MC APIs for interrupt
and PPS event support are also added by this patch-set.

---
Changes for v2:
- Allowed to compile with COMPILE_TEST.

Yangbo Lu (6):
ptp: add QorIQ PTP support for DPAA2
dpaa2-ptp: reuse ptp_qoriq driver
dt-binding: ptp_qoriq: support DPAA2 PTP compatible
arm64: dts: fsl: add ptp timer node for dpaa2 platforms
dpaa2-ptp: add interrupt support
MAINTAINERS: maintain DPAA2 PTP driver in QorIQ PTP entry

.../devicetree/bindings/ptp/ptp-qoriq.txt | 3 +-
MAINTAINERS | 9 +-
arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi | 8 +
arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi | 8 +
arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi | 8 +
drivers/net/ethernet/freescale/dpaa2/Kconfig | 3 +-
drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c | 242 +++++++++++----------
drivers/net/ethernet/freescale/dpaa2/dprtc-cmd.h | 48 +++-
drivers/net/ethernet/freescale/dpaa2/dprtc.c | 191 ++++++++++++----
drivers/net/ethernet/freescale/dpaa2/dprtc.h | 62 ++++--
drivers/ptp/Kconfig | 2 +-
11 files changed, 386 insertions(+), 198 deletions(-)

--
2.7.4


2019-06-14 10:41:48

by Yangbo Lu

[permalink] [raw]
Subject: [v2, 4/6] arm64: dts: fsl: add ptp timer node for dpaa2 platforms

This patch is to add ptp timer device tree node for dpaa2
platforms(ls1088a/ls208xa/lx2160a).

Signed-off-by: Yangbo Lu <[email protected]>
---
Changes for v2:
- None.
---
arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi | 8 ++++++++
arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi | 8 ++++++++
arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi | 8 ++++++++
3 files changed, 24 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
index 661137f..dacd8cf 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
@@ -609,6 +609,14 @@
<GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH>;
};

+ ptp-timer@8b95000 {
+ compatible = "fsl,dpaa2-ptp";
+ reg = <0x0 0x8b95000 0x0 0x100>;
+ clocks = <&clockgen 4 0>;
+ little-endian;
+ fsl,extts-fifo;
+ };
+
cluster1_core0_watchdog: wdt@c000000 {
compatible = "arm,sp805-wdt", "arm,primecell";
reg = <0x0 0xc000000 0x0 0x1000>;
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi
index d7e78dc..3ace919 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi
@@ -321,6 +321,14 @@
};
};

+ ptp-timer@8b95000 {
+ compatible = "fsl,dpaa2-ptp";
+ reg = <0x0 0x8b95000 0x0 0x100>;
+ clocks = <&clockgen 4 1>;
+ little-endian;
+ fsl,extts-fifo;
+ };
+
fsl_mc: fsl-mc@80c000000 {
compatible = "fsl,qoriq-mc";
reg = <0x00000008 0x0c000000 0 0x40>, /* MC portal base */
diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi b/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi
index 125a8cc..e6fdba3 100644
--- a/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi
@@ -848,6 +848,14 @@
dma-coherent;
};

+ ptp-timer@8b95000 {
+ compatible = "fsl,dpaa2-ptp";
+ reg = <0x0 0x8b95000 0x0 0x100>;
+ clocks = <&clockgen 4 1>;
+ little-endian;
+ fsl,extts-fifo;
+ };
+
fsl_mc: fsl-mc@80c000000 {
compatible = "fsl,qoriq-mc";
reg = <0x00000008 0x0c000000 0 0x40>,
--
2.7.4

2019-06-15 20:43:44

by David Miller

[permalink] [raw]
Subject: Re: [v2, 0/6] Reuse ptp_qoriq driver for dpaa2-ptp

From: Yangbo Lu <[email protected]>
Date: Fri, 14 Jun 2019 18:40:49 +0800

> Although dpaa2-ptp.c driver is a fsl_mc_driver which
> is using MC APIs for register accessing, it's same IP
> block with eTSEC/DPAA/ENETC 1588 timer.
> This patch-set is to convert to reuse ptp_qoriq driver by
> using register ioremap and dropping related MC APIs.
> However the interrupts could only be handled by MC which
> fires MSIs to ARM cores. So the interrupt enabling and
> handling still rely on MC APIs. MC APIs for interrupt
> and PPS event support are also added by this patch-set.
>
> ---
> Changes for v2:
> - Allowed to compile with COMPILE_TEST.

Series applied, thanks.