linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v3 0/4] fsl/fman: fixes for ARM
@ 2016-12-19 16:13 Madalin Bucur
  2016-12-19 16:13 ` [PATCH net v3 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-19 16:13 UTC (permalink / raw)
  To: netdev; +Cc: linuxppc-dev, linux-kernel, davem, scott.wood, mpe

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
non PPC platforms.

Changes from v2: merged fsl/fman changes to avoid a point of failure
Changes from v1: unifying probing on all supported platforms

Madalin Bucur (4):
  fsl/fman: fix 1G support for QSGMII interfaces
  powerpc: fsl/fman: remove fsl,fman from of_device_ids[]
  fsl/fman: A007273 only applies to PPC SoCs
  fsl/fman: enable compilation on ARM64

 arch/powerpc/platforms/85xx/corenet_generic.c |  3 ---
 drivers/net/ethernet/freescale/fman/Kconfig   |  2 +-
 drivers/net/ethernet/freescale/fman/fman.c    | 16 ++++++++++++++++
 drivers/net/ethernet/freescale/fman/mac.c     |  1 +
 4 files changed, 18 insertions(+), 4 deletions(-)

-- 
2.1.0

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

* [PATCH net v3 1/4] fsl/fman: fix 1G support for QSGMII interfaces
  2016-12-19 16:13 [PATCH net v3 0/4] fsl/fman: fixes for ARM Madalin Bucur
@ 2016-12-19 16:13 ` Madalin Bucur
  2016-12-19 16:13 ` [PATCH net v3 2/4] powerpc: fsl/fman: remove fsl,fman from of_device_ids[] Madalin Bucur
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Madalin Bucur @ 2016-12-19 16:13 UTC (permalink / raw)
  To: netdev; +Cc: linuxppc-dev, linux-kernel, davem, scott.wood, mpe

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 v3 2/4] powerpc: fsl/fman: remove fsl,fman from of_device_ids[]
  2016-12-19 16:13 [PATCH net v3 0/4] fsl/fman: fixes for ARM Madalin Bucur
  2016-12-19 16:13 ` [PATCH net v3 1/4] fsl/fman: fix 1G support for QSGMII interfaces Madalin Bucur
@ 2016-12-19 16:13 ` Madalin Bucur
  2016-12-19 19:46   ` [upstream-release] [PATCH net v3 2/4] powerpc: fsl/fman: remove fsl, fman " Scott Wood
  2016-12-19 16:13 ` [PATCH net v3 3/4] fsl/fman: A007273 only applies to PPC SoCs Madalin Bucur
  2016-12-19 16:13 ` [PATCH net v3 4/4] fsl/fman: enable compilation on ARM64 Madalin Bucur
  3 siblings, 1 reply; 7+ messages in thread
From: Madalin Bucur @ 2016-12-19 16:13 UTC (permalink / raw)
  To: netdev; +Cc: linuxppc-dev, linux-kernel, davem, scott.wood, mpe

The fsl/fman drivers will use of_platform_populate() on all
supported platforms. Call of_platform_populate() to probe the
FMan sub-nodes.

Signed-off-by: Igal Liberman <igal.liberman@freescale.com>
Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
---
 arch/powerpc/platforms/85xx/corenet_generic.c | 3 ---
 drivers/net/ethernet/freescale/fman/fman.c    | 8 ++++++++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c b/arch/powerpc/platforms/85xx/corenet_generic.c
index 1179115..824b7f1 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -117,9 +117,6 @@ static const struct of_device_id of_device_ids[] = {
 	{
 		.compatible	= "fsl,qe",
 	},
-	{
-		.compatible    = "fsl,fman",
-	},
 	/* The following two are for the Freescale hypervisor */
 	{
 		.name		= "hypervisor",
diff --git a/drivers/net/ethernet/freescale/fman/fman.c b/drivers/net/ethernet/freescale/fman/fman.c
index dafd9e1..0b7f711 100644
--- a/drivers/net/ethernet/freescale/fman/fman.c
+++ b/drivers/net/ethernet/freescale/fman/fman.c
@@ -2868,6 +2868,14 @@ static struct fman *read_dts_node(struct platform_device *of_dev)
 
 	fman->dev = &of_dev->dev;
 
+	/* 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;
+	}
+
 	return fman;
 
 fman_node_put:
-- 
2.1.0

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

* [PATCH net v3 3/4] fsl/fman: A007273 only applies to PPC SoCs
  2016-12-19 16:13 [PATCH net v3 0/4] fsl/fman: fixes for ARM Madalin Bucur
  2016-12-19 16:13 ` [PATCH net v3 1/4] fsl/fman: fix 1G support for QSGMII interfaces Madalin Bucur
  2016-12-19 16:13 ` [PATCH net v3 2/4] powerpc: fsl/fman: remove fsl,fman from of_device_ids[] Madalin Bucur
@ 2016-12-19 16:13 ` Madalin Bucur
  2016-12-19 16:13 ` [PATCH net v3 4/4] fsl/fman: enable compilation on ARM64 Madalin Bucur
  3 siblings, 0 replies; 7+ messages in thread
From: Madalin Bucur @ 2016-12-19 16:13 UTC (permalink / raw)
  To: netdev; +Cc: linuxppc-dev, linux-kernel, davem, scott.wood, mpe

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 0b7f711..003b86d 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 v3 4/4] fsl/fman: enable compilation on ARM64
  2016-12-19 16:13 [PATCH net v3 0/4] fsl/fman: fixes for ARM Madalin Bucur
                   ` (2 preceding siblings ...)
  2016-12-19 16:13 ` [PATCH net v3 3/4] fsl/fman: A007273 only applies to PPC SoCs Madalin Bucur
@ 2016-12-19 16:13 ` Madalin Bucur
  3 siblings, 0 replies; 7+ messages in thread
From: Madalin Bucur @ 2016-12-19 16:13 UTC (permalink / raw)
  To: netdev; +Cc: linuxppc-dev, linux-kernel, davem, scott.wood, mpe

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 v3 2/4] powerpc: fsl/fman: remove fsl, fman from of_device_ids[]
  2016-12-19 16:13 ` [PATCH net v3 2/4] powerpc: fsl/fman: remove fsl,fman from of_device_ids[] Madalin Bucur
@ 2016-12-19 19:46   ` Scott Wood
  2016-12-19 20:43     ` Madalin-Cristian Bucur
  0 siblings, 1 reply; 7+ messages in thread
From: Scott Wood @ 2016-12-19 19:46 UTC (permalink / raw)
  To: madalin.bucur, netdev; +Cc: mpe, linuxppc-dev, linux-kernel, davem

On Mon, 2016-12-19 at 18:13 +0200, Madalin Bucur wrote:
> The fsl/fman drivers will use of_platform_populate() on all
> supported platforms. Call of_platform_populate() to probe the
> FMan sub-nodes.
> 
> Signed-off-by: Igal Liberman <igal.liberman@freescale.com>
> Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
> ---
>  arch/powerpc/platforms/85xx/corenet_generic.c | 3 ---
>  drivers/net/ethernet/freescale/fman/fman.c    | 8 ++++++++
>  2 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c
> b/arch/powerpc/platforms/85xx/corenet_generic.c
> index 1179115..824b7f1 100644
> --- a/arch/powerpc/platforms/85xx/corenet_generic.c
> +++ b/arch/powerpc/platforms/85xx/corenet_generic.c
> @@ -117,9 +117,6 @@ static const struct of_device_id of_device_ids[] = {
>  	{
>  		.compatible	= "fsl,qe",
>  	},
> -	{
> -		.compatible    = "fsl,fman",
> -	},
>  	/* The following two are for the Freescale hypervisor */
>  	{
>  		.name		= "hypervisor",

For this part:

Acked-by: Scott Wood <oss@buserror.net>

> diff --git a/drivers/net/ethernet/freescale/fman/fman.c
> b/drivers/net/ethernet/freescale/fman/fman.c
> index dafd9e1..0b7f711 100644
> --- a/drivers/net/ethernet/freescale/fman/fman.c
> +++ b/drivers/net/ethernet/freescale/fman/fman.c
> @@ -2868,6 +2868,14 @@ static struct fman *read_dts_node(struct
> platform_device *of_dev)
>  
>  	fman->dev = &of_dev->dev;
>  
> +	/* 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;
> +	}

The "on arm64" comment is no longer accurate (and the rest of the comment
seems unnecessary).

-Scott

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

* RE: [upstream-release] [PATCH net v3 2/4] powerpc: fsl/fman: remove fsl, fman from of_device_ids[]
  2016-12-19 19:46   ` [upstream-release] [PATCH net v3 2/4] powerpc: fsl/fman: remove fsl, fman " Scott Wood
@ 2016-12-19 20:43     ` Madalin-Cristian Bucur
  0 siblings, 0 replies; 7+ messages in thread
From: Madalin-Cristian Bucur @ 2016-12-19 20:43 UTC (permalink / raw)
  To: Scott Wood, netdev; +Cc: mpe, linuxppc-dev, linux-kernel, davem

> From: Scott Wood [mailto:oss@buserror.net]
> Sent: Monday, December 19, 2016 9:46 PM
> 
> On Mon, 2016-12-19 at 18:13 +0200, Madalin Bucur wrote:
> > The fsl/fman drivers will use of_platform_populate() on all
> > supported platforms. Call of_platform_populate() to probe the
> > FMan sub-nodes.
> >
> > Signed-off-by: Igal Liberman <igal.liberman@freescale.com>
> > Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
> > ---
> >  arch/powerpc/platforms/85xx/corenet_generic.c | 3 ---
> >  drivers/net/ethernet/freescale/fman/fman.c    | 8 ++++++++
> >  2 files changed, 8 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c
> > b/arch/powerpc/platforms/85xx/corenet_generic.c
> > index 1179115..824b7f1 100644
> > --- a/arch/powerpc/platforms/85xx/corenet_generic.c
> > +++ b/arch/powerpc/platforms/85xx/corenet_generic.c
> > @@ -117,9 +117,6 @@ static const struct of_device_id of_device_ids[] = {
> >  	{
> >  		.compatible	= "fsl,qe",
> >  	},
> > -	{
> > -		.compatible    = "fsl,fman",
> > -	},
> >  	/* The following two are for the Freescale hypervisor */
> >  	{
> >  		.name		= "hypervisor",
> 
> For this part:
> 
> Acked-by: Scott Wood <oss@buserror.net>

Thank you, added to v4.

> > diff --git a/drivers/net/ethernet/freescale/fman/fman.c
> > b/drivers/net/ethernet/freescale/fman/fman.c
> > index dafd9e1..0b7f711 100644
> > --- a/drivers/net/ethernet/freescale/fman/fman.c
> > +++ b/drivers/net/ethernet/freescale/fman/fman.c
> > @@ -2868,6 +2868,14 @@ static struct fman *read_dts_node(struct
> > platform_device *of_dev)
> >
> >  	fman->dev = &of_dev->dev;
> >
> > +	/* 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;
> > +	}
> 
> The "on arm64" comment is no longer accurate (and the rest of the comment
> seems unnecessary).
> 
> -Scott

Removed in v4.

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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-19 16:13 [PATCH net v3 0/4] fsl/fman: fixes for ARM Madalin Bucur
2016-12-19 16:13 ` [PATCH net v3 1/4] fsl/fman: fix 1G support for QSGMII interfaces Madalin Bucur
2016-12-19 16:13 ` [PATCH net v3 2/4] powerpc: fsl/fman: remove fsl,fman from of_device_ids[] Madalin Bucur
2016-12-19 19:46   ` [upstream-release] [PATCH net v3 2/4] powerpc: fsl/fman: remove fsl, fman " Scott Wood
2016-12-19 20:43     ` Madalin-Cristian Bucur
2016-12-19 16:13 ` [PATCH net v3 3/4] fsl/fman: A007273 only applies to PPC SoCs Madalin Bucur
2016-12-19 16:13 ` [PATCH net v3 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).