linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/4] fsl/fman: fixes for ARM
@ 2016-12-15 13:11 Madalin Bucur
  2016-12-15 13:11 ` [PATCH net 1/4] fsl/fman: fix 1G support for QSGMII interfaces Madalin Bucur
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Madalin Bucur @ 2016-12-15 13:11 UTC (permalink / raw)
  To: netdev; +Cc: linuxppc-dev, linux-kernel, davem

The patch set fixes advertised speeds for QSGMII interfaces, disables
A007273 erratum workaround on non-PowerPC platforms where it does not
apply, enables compilation on ARM64 and addresses a probing issue on
ARM64.

Igal Liberman (1):
  fsl/fman: arm: call of_platform_populate() for arm64 platfrom

Madalin Bucur (3):
  fsl/fman: fix 1G support for QSGMII interfaces
  fsl/fman: A007273 only applies to PPC SoCs
  fsl/fman: enable compilation on ARM64

 drivers/net/ethernet/freescale/fman/Kconfig |  2 +-
 drivers/net/ethernet/freescale/fman/fman.c  | 18 ++++++++++++++++++
 drivers/net/ethernet/freescale/fman/mac.c   |  1 +
 3 files changed, 20 insertions(+), 1 deletion(-)

-- 
2.1.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH net 1/4] fsl/fman: fix 1G support for QSGMII interfaces
  2016-12-15 13:11 [PATCH net 0/4] fsl/fman: fixes for ARM Madalin Bucur
@ 2016-12-15 13:11 ` Madalin Bucur
  2016-12-15 13:11 ` [PATCH net 2/4] fsl/fman: arm: call of_platform_populate() for arm64 platfrom Madalin Bucur
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Madalin Bucur @ 2016-12-15 13:11 UTC (permalink / raw)
  To: netdev; +Cc: linuxppc-dev, linux-kernel, davem

QSGMII ports were not advertising 1G speed.

Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
Reviewed-by: Camelia Groza <camelia.groza@nxp.com>
---
 drivers/net/ethernet/freescale/fman/mac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c
index 69ca42c..0b31f85 100644
--- a/drivers/net/ethernet/freescale/fman/mac.c
+++ b/drivers/net/ethernet/freescale/fman/mac.c
@@ -594,6 +594,7 @@ static const u16 phy2speed[] = {
 	[PHY_INTERFACE_MODE_RGMII_RXID]	= SPEED_1000,
 	[PHY_INTERFACE_MODE_RGMII_TXID]	= SPEED_1000,
 	[PHY_INTERFACE_MODE_RTBI]		= SPEED_1000,
+	[PHY_INTERFACE_MODE_QSGMII]		= SPEED_1000,
 	[PHY_INTERFACE_MODE_XGMII]		= SPEED_10000
 };
 
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net 2/4] fsl/fman: arm: call of_platform_populate() for arm64 platfrom
  2016-12-15 13:11 [PATCH net 0/4] fsl/fman: fixes for ARM Madalin Bucur
  2016-12-15 13:11 ` [PATCH net 1/4] fsl/fman: fix 1G support for QSGMII interfaces Madalin Bucur
@ 2016-12-15 13:11 ` Madalin Bucur
  2016-12-15 18:41   ` [upstream-release] " Scott Wood
  2016-12-15 13:11 ` [PATCH net 3/4] fsl/fman: A007273 only applies to PPC SoCs Madalin Bucur
  2016-12-15 13:11 ` [PATCH net 4/4] fsl/fman: enable compilation on ARM64 Madalin Bucur
  3 siblings, 1 reply; 7+ messages in thread
From: Madalin Bucur @ 2016-12-15 13:11 UTC (permalink / raw)
  To: netdev; +Cc: linuxppc-dev, linux-kernel, davem

From: Igal Liberman <igal.liberman@freescale.com>

Signed-off-by: Igal Liberman <igal.liberman@freescale.com>
---
 drivers/net/ethernet/freescale/fman/fman.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/freescale/fman/fman.c b/drivers/net/ethernet/freescale/fman/fman.c
index dafd9e1..f36b4eb 100644
--- a/drivers/net/ethernet/freescale/fman/fman.c
+++ b/drivers/net/ethernet/freescale/fman/fman.c
@@ -2868,6 +2868,16 @@ static struct fman *read_dts_node(struct platform_device *of_dev)
 
 	fman->dev = &of_dev->dev;
 
+#ifdef CONFIG_ARM64
+	/* call of_platform_populate in order to probe sub-nodes on arm64 */
+	err = of_platform_populate(fm_node, NULL, NULL, &of_dev->dev);
+	if (err) {
+		dev_err(&of_dev->dev, "%s: of_platform_populate() failed\n",
+			__func__);
+		goto fman_free;
+	}
+#endif
+
 	return fman;
 
 fman_node_put:
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net 3/4] fsl/fman: A007273 only applies to PPC SoCs
  2016-12-15 13:11 [PATCH net 0/4] fsl/fman: fixes for ARM Madalin Bucur
  2016-12-15 13:11 ` [PATCH net 1/4] fsl/fman: fix 1G support for QSGMII interfaces Madalin Bucur
  2016-12-15 13:11 ` [PATCH net 2/4] fsl/fman: arm: call of_platform_populate() for arm64 platfrom Madalin Bucur
@ 2016-12-15 13:11 ` Madalin Bucur
  2016-12-15 13:11 ` [PATCH net 4/4] fsl/fman: enable compilation on ARM64 Madalin Bucur
  3 siblings, 0 replies; 7+ messages in thread
From: Madalin Bucur @ 2016-12-15 13:11 UTC (permalink / raw)
  To: netdev; +Cc: linuxppc-dev, linux-kernel, davem

Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
Reviewed-by: Camelia Groza <camelia.groza@nxp.com>
---
 drivers/net/ethernet/freescale/fman/fman.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/freescale/fman/fman.c b/drivers/net/ethernet/freescale/fman/fman.c
index f36b4eb..93d6a36 100644
--- a/drivers/net/ethernet/freescale/fman/fman.c
+++ b/drivers/net/ethernet/freescale/fman/fman.c
@@ -1890,6 +1890,7 @@ static int fman_reset(struct fman *fman)
 
 		goto _return;
 	} else {
+#ifdef CONFIG_PPC
 		struct device_node *guts_node;
 		struct ccsr_guts __iomem *guts_regs;
 		u32 devdisr2, reg;
@@ -1921,6 +1922,7 @@ static int fman_reset(struct fman *fman)
 
 		/* Enable all MACs */
 		iowrite32be(reg, &guts_regs->devdisr2);
+#endif
 
 		/* Perform FMan reset */
 		iowrite32be(FPM_RSTC_FM_RESET, &fman->fpm_regs->fm_rstc);
@@ -1932,25 +1934,31 @@ static int fman_reset(struct fman *fman)
 		} while (((ioread32be(&fman->fpm_regs->fm_rstc)) &
 			 FPM_RSTC_FM_RESET) && --count);
 		if (count == 0) {
+#ifdef CONFIG_PPC
 			iounmap(guts_regs);
 			of_node_put(guts_node);
+#endif
 			err = -EBUSY;
 			goto _return;
 		}
+#ifdef CONFIG_PPC
 
 		/* Restore devdisr2 value */
 		iowrite32be(devdisr2, &guts_regs->devdisr2);
 
 		iounmap(guts_regs);
 		of_node_put(guts_node);
+#endif
 
 		goto _return;
 
+#ifdef CONFIG_PPC
 guts_regs:
 		of_node_put(guts_node);
 guts_node:
 		dev_dbg(fman->dev, "%s: Didn't perform FManV3 reset due to Errata A007273!\n",
 			__func__);
+#endif
 	}
 _return:
 	return err;
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net 4/4] fsl/fman: enable compilation on ARM64
  2016-12-15 13:11 [PATCH net 0/4] fsl/fman: fixes for ARM Madalin Bucur
                   ` (2 preceding siblings ...)
  2016-12-15 13:11 ` [PATCH net 3/4] fsl/fman: A007273 only applies to PPC SoCs Madalin Bucur
@ 2016-12-15 13:11 ` Madalin Bucur
  3 siblings, 0 replies; 7+ messages in thread
From: Madalin Bucur @ 2016-12-15 13:11 UTC (permalink / raw)
  To: netdev; +Cc: linuxppc-dev, linux-kernel, davem

Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
---
 drivers/net/ethernet/freescale/fman/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/fman/Kconfig b/drivers/net/ethernet/freescale/fman/Kconfig
index 79b7c84..dc0850b 100644
--- a/drivers/net/ethernet/freescale/fman/Kconfig
+++ b/drivers/net/ethernet/freescale/fman/Kconfig
@@ -1,6 +1,6 @@
 config FSL_FMAN
 	tristate "FMan support"
-	depends on FSL_SOC || COMPILE_TEST
+	depends on FSL_SOC || ARCH_LAYERSCAPE || COMPILE_TEST
 	select GENERIC_ALLOCATOR
 	select PHYLIB
 	default n
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [upstream-release] [PATCH net 2/4] fsl/fman: arm: call of_platform_populate() for arm64 platfrom
  2016-12-15 13:11 ` [PATCH net 2/4] fsl/fman: arm: call of_platform_populate() for arm64 platfrom Madalin Bucur
@ 2016-12-15 18:41   ` Scott Wood
  2016-12-16 17:01     ` Madalin-Cristian Bucur
  0 siblings, 1 reply; 7+ messages in thread
From: Scott Wood @ 2016-12-15 18:41 UTC (permalink / raw)
  To: Madalin-Cristian Bucur, netdev; +Cc: linuxppc-dev, linux-kernel, davem

On 12/15/2016 07:11 AM, Madalin Bucur wrote:
> From: Igal Liberman <igal.liberman@freescale.com>
> 
> Signed-off-by: Igal Liberman <igal.liberman@freescale.com>
> ---
>  drivers/net/ethernet/freescale/fman/fman.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/net/ethernet/freescale/fman/fman.c b/drivers/net/ethernet/freescale/fman/fman.c
> index dafd9e1..f36b4eb 100644
> --- a/drivers/net/ethernet/freescale/fman/fman.c
> +++ b/drivers/net/ethernet/freescale/fman/fman.c
> @@ -2868,6 +2868,16 @@ static struct fman *read_dts_node(struct platform_device *of_dev)
>  
>  	fman->dev = &of_dev->dev;
>  
> +#ifdef CONFIG_ARM64
> +	/* call of_platform_populate in order to probe sub-nodes on arm64 */
> +	err = of_platform_populate(fm_node, NULL, NULL, &of_dev->dev);
> +	if (err) {
> +		dev_err(&of_dev->dev, "%s: of_platform_populate() failed\n",
> +			__func__);
> +		goto fman_free;
> +	}
> +#endif

Should we remove fsl,fman from the PPC of_device_ids[], so this doesn't
need an ifdef?

Why is it #ifdef CONFIG_ARM64 rather than #ifndef CONFIG_PPC?

-Scott

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [upstream-release] [PATCH net 2/4] fsl/fman: arm: call of_platform_populate() for arm64 platfrom
  2016-12-15 18:41   ` [upstream-release] " Scott Wood
@ 2016-12-16 17:01     ` Madalin-Cristian Bucur
  0 siblings, 0 replies; 7+ messages in thread
From: Madalin-Cristian Bucur @ 2016-12-16 17:01 UTC (permalink / raw)
  To: Scott Wood, netdev, mpe; +Cc: linuxppc-dev, linux-kernel, davem

> From: Scott Wood
> Sent: Thursday, December 15, 2016 8:42 PM
> 
> On 12/15/2016 07:11 AM, Madalin Bucur wrote:
> > From: Igal Liberman <igal.liberman@freescale.com>
> >
> > Signed-off-by: Igal Liberman <igal.liberman@freescale.com>
> > ---
> >  drivers/net/ethernet/freescale/fman/fman.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/freescale/fman/fman.c
> b/drivers/net/ethernet/freescale/fman/fman.c
> > index dafd9e1..f36b4eb 100644
> > --- a/drivers/net/ethernet/freescale/fman/fman.c
> > +++ b/drivers/net/ethernet/freescale/fman/fman.c
> > @@ -2868,6 +2868,16 @@ static struct fman *read_dts_node(struct
> platform_device *of_dev)
> >
> >  	fman->dev = &of_dev->dev;
> >
> > +#ifdef CONFIG_ARM64
> > +	/* call of_platform_populate in order to probe sub-nodes on arm64 */
> > +	err = of_platform_populate(fm_node, NULL, NULL, &of_dev->dev);
> > +	if (err) {
> > +		dev_err(&of_dev->dev, "%s: of_platform_populate() failed\n",
> > +			__func__);
> > +		goto fman_free;
> > +	}
> > +#endif
> 
> Should we remove fsl,fman from the PPC of_device_ids[], so this doesn't
> need an ifdef?
> 
> Why is it #ifdef CONFIG_ARM64 rather than #ifndef CONFIG_PPC?
> 
> -Scott

Igal was working on adding ARM64 support when this patch was created, thus the
choice of #ifdef CONFIG_ARM64. Unifying this for PPC and ARM64 by always calling
of_platform_populate() sounds like the best approach. I would need to synchronize
the introduction of this code with the removal of the fsl,fman entry from the
of_device_ids[] array.

Dave, Michael, Scott, is it ok to add to v2 of this patch set the patch that removes
the compatible "fsl,fman" from arch/powerpc/platforms/85xx/corenet_generic.c?

Thanks,
Madalin

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-12-16 19:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-15 13:11 [PATCH net 0/4] fsl/fman: fixes for ARM Madalin Bucur
2016-12-15 13:11 ` [PATCH net 1/4] fsl/fman: fix 1G support for QSGMII interfaces Madalin Bucur
2016-12-15 13:11 ` [PATCH net 2/4] fsl/fman: arm: call of_platform_populate() for arm64 platfrom Madalin Bucur
2016-12-15 18:41   ` [upstream-release] " Scott Wood
2016-12-16 17:01     ` Madalin-Cristian Bucur
2016-12-15 13:11 ` [PATCH net 3/4] fsl/fman: A007273 only applies to PPC SoCs Madalin Bucur
2016-12-15 13:11 ` [PATCH net 4/4] fsl/fman: enable compilation on ARM64 Madalin Bucur

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).