2019-06-10 03:21:26

by Yangbo Lu

[permalink] [raw]
Subject: [PATCH 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.

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-10 03:21:31

by Yangbo Lu

[permalink] [raw]
Subject: [PATCH 1/6] ptp: add QorIQ PTP support for DPAA2

This patch is to add QorIQ PTP support for DPAA2.
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. We will
convert to reuse ptp_qoriq driver by using register
ioremap and dropping related MC APIs.

Signed-off-by: Yangbo Lu <[email protected]>
---
drivers/ptp/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ptp/Kconfig b/drivers/ptp/Kconfig
index 9b8fee5..b1b454f 100644
--- a/drivers/ptp/Kconfig
+++ b/drivers/ptp/Kconfig
@@ -44,7 +44,7 @@ config PTP_1588_CLOCK_DTE

config PTP_1588_CLOCK_QORIQ
tristate "Freescale QorIQ 1588 timer as PTP clock"
- depends on GIANFAR || FSL_DPAA_ETH || FSL_ENETC || FSL_ENETC_VF
+ depends on GIANFAR || FSL_DPAA_ETH || FSL_DPAA2_ETH || FSL_ENETC || FSL_ENETC_VF
depends on PTP_1588_CLOCK
default y
help
--
2.7.4

2019-06-10 13:31:41

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH 1/6] ptp: add QorIQ PTP support for DPAA2

On Mon, Jun 10, 2019 at 11:21:03AM +0800, Yangbo Lu wrote:
> This patch is to add QorIQ PTP support for DPAA2.
> 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. We will
> convert to reuse ptp_qoriq driver by using register
> ioremap and dropping related MC APIs.
>
> Signed-off-by: Yangbo Lu <[email protected]>
> ---
> drivers/ptp/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ptp/Kconfig b/drivers/ptp/Kconfig
> index 9b8fee5..b1b454f 100644
> --- a/drivers/ptp/Kconfig
> +++ b/drivers/ptp/Kconfig
> @@ -44,7 +44,7 @@ config PTP_1588_CLOCK_DTE
>
> config PTP_1588_CLOCK_QORIQ
> tristate "Freescale QorIQ 1588 timer as PTP clock"
> - depends on GIANFAR || FSL_DPAA_ETH || FSL_ENETC || FSL_ENETC_VF
> + depends on GIANFAR || FSL_DPAA_ETH || FSL_DPAA2_ETH || FSL_ENETC || FSL_ENETC_VF
> depends on PTP_1588_CLOCK

Hi Yangbo

Could COMPILE_TEST also be added?

Thanks
Andrew

2019-06-12 07:55:05

by Yangbo Lu

[permalink] [raw]
Subject: RE: [PATCH 1/6] ptp: add QorIQ PTP support for DPAA2

Hi Andrew,

> -----Original Message-----
> From: Andrew Lunn <[email protected]>
> Sent: 2019??6??10?? 21:06
> To: Y.b. Lu <[email protected]>
> Cc: [email protected]; David S . Miller <[email protected]>;
> Richard Cochran <[email protected]>; Rob Herring
> <[email protected]>; Shawn Guo <[email protected]>;
> [email protected]; [email protected];
> [email protected]
> Subject: Re: [PATCH 1/6] ptp: add QorIQ PTP support for DPAA2
>
> On Mon, Jun 10, 2019 at 11:21:03AM +0800, Yangbo Lu wrote:
> > This patch is to add QorIQ PTP support for DPAA2.
> > 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. We will convert to reuse ptp_qoriq driver by using register
> > ioremap and dropping related MC APIs.
> >
> > Signed-off-by: Yangbo Lu <[email protected]>
> > ---
> > drivers/ptp/Kconfig | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/ptp/Kconfig b/drivers/ptp/Kconfig index
> > 9b8fee5..b1b454f 100644
> > --- a/drivers/ptp/Kconfig
> > +++ b/drivers/ptp/Kconfig
> > @@ -44,7 +44,7 @@ config PTP_1588_CLOCK_DTE
> >
> > config PTP_1588_CLOCK_QORIQ
> > tristate "Freescale QorIQ 1588 timer as PTP clock"
> > - depends on GIANFAR || FSL_DPAA_ETH || FSL_ENETC || FSL_ENETC_VF
> > + depends on GIANFAR || FSL_DPAA_ETH || FSL_DPAA2_ETH ||
> FSL_ENETC ||
> > +FSL_ENETC_VF
> > depends on PTP_1588_CLOCK
>
> Hi Yangbo
>
> Could COMPILE_TEST also be added?

[Y.b. Lu] COMPILE_TEST is usually for other ARCHs build coverage.
Do you want me to append it after these Ethernet driver dependencies?

Thanks.

>
> Thanks
> Andrew

2019-06-12 17:58:54

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH 1/6] ptp: add QorIQ PTP support for DPAA2

> > > diff --git a/drivers/ptp/Kconfig b/drivers/ptp/Kconfig index
> > > 9b8fee5..b1b454f 100644
> > > --- a/drivers/ptp/Kconfig
> > > +++ b/drivers/ptp/Kconfig
> > > @@ -44,7 +44,7 @@ config PTP_1588_CLOCK_DTE
> > >
> > > config PTP_1588_CLOCK_QORIQ
> > > tristate "Freescale QorIQ 1588 timer as PTP clock"
> > > - depends on GIANFAR || FSL_DPAA_ETH || FSL_ENETC || FSL_ENETC_VF
> > > + depends on GIANFAR || FSL_DPAA_ETH || FSL_DPAA2_ETH ||
> > FSL_ENETC ||
> > > +FSL_ENETC_VF
> > > depends on PTP_1588_CLOCK
> >
> > Hi Yangbo
> >
> > Could COMPILE_TEST also be added?
>
> [Y.b. Lu] COMPILE_TEST is usually for other ARCHs build coverage.
> Do you want me to append it after these Ethernet driver dependencies?

Hii Y.b. Lu

Normally, drivers like this should be able to compile independent of
the MAC driver. So you should be able to add COMPILE_TEST here.

Andrew

2019-06-14 10:41:04

by Yangbo Lu

[permalink] [raw]
Subject: RE: [PATCH 1/6] ptp: add QorIQ PTP support for DPAA2

> -----Original Message-----
> From: Andrew Lunn <[email protected]>
> Sent: 2019??6??12?? 21:11
> To: Y.b. Lu <[email protected]>
> Cc: [email protected]; David S . Miller <[email protected]>;
> Richard Cochran <[email protected]>; Rob Herring
> <[email protected]>; Shawn Guo <[email protected]>;
> [email protected]; [email protected];
> [email protected]
> Subject: Re: [PATCH 1/6] ptp: add QorIQ PTP support for DPAA2
>
> > > > diff --git a/drivers/ptp/Kconfig b/drivers/ptp/Kconfig index
> > > > 9b8fee5..b1b454f 100644
> > > > --- a/drivers/ptp/Kconfig
> > > > +++ b/drivers/ptp/Kconfig
> > > > @@ -44,7 +44,7 @@ config PTP_1588_CLOCK_DTE
> > > >
> > > > config PTP_1588_CLOCK_QORIQ
> > > > tristate "Freescale QorIQ 1588 timer as PTP clock"
> > > > - depends on GIANFAR || FSL_DPAA_ETH || FSL_ENETC ||
> FSL_ENETC_VF
> > > > + depends on GIANFAR || FSL_DPAA_ETH || FSL_DPAA2_ETH ||
> > > FSL_ENETC ||
> > > > +FSL_ENETC_VF
> > > > depends on PTP_1588_CLOCK
> > >
> > > Hi Yangbo
> > >
> > > Could COMPILE_TEST also be added?
> >
> > [Y.b. Lu] COMPILE_TEST is usually for other ARCHs build coverage.
> > Do you want me to append it after these Ethernet driver dependencies?
>
> Hii Y.b. Lu
>
> Normally, drivers like this should be able to compile independent of the MAC
> driver. So you should be able to add COMPILE_TEST here.

[Y.b. Lu] Thanks Andrew. I had sent out v2 with the change.

>
> Andrew