2016-12-19 16:13:44

by Madalin-cristian Bucur

[permalink] [raw]
Subject: [PATCH net v3 0/4] fsl/fman: fixes for ARM

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


2016-12-19 16:13:53

by Madalin-cristian Bucur

[permalink] [raw]
Subject: [PATCH net v3 3/4] fsl/fman: A007273 only applies to PPC SoCs

Signed-off-by: Madalin Bucur <[email protected]>
Reviewed-by: Camelia Groza <[email protected]>
---
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

2016-12-19 16:13:48

by Madalin-cristian Bucur

[permalink] [raw]
Subject: [PATCH net v3 1/4] fsl/fman: fix 1G support for QSGMII interfaces

QSGMII ports were not advertising 1G speed.

Signed-off-by: Madalin Bucur <[email protected]>
Reviewed-by: Camelia Groza <[email protected]>
---
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

2016-12-19 16:14:13

by Madalin-cristian Bucur

[permalink] [raw]
Subject: [PATCH net v3 4/4] fsl/fman: enable compilation on ARM64

Signed-off-by: Madalin Bucur <[email protected]>
---
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

2016-12-19 16:14:45

by Madalin-cristian Bucur

[permalink] [raw]
Subject: [PATCH net v3 2/4] powerpc: fsl/fman: remove fsl,fman from of_device_ids[]

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 <[email protected]>
Signed-off-by: Madalin Bucur <[email protected]>
---
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

2016-12-19 19:46:40

by Crystal Wood

[permalink] [raw]
Subject: Re: [upstream-release] [PATCH net v3 2/4] powerpc: fsl/fman: remove fsl, fman from of_device_ids[]

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 <[email protected]>
> Signed-off-by: Madalin Bucur <[email protected]>
> ---
>  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 <[email protected]>

> 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

2016-12-19 23:18:13

by Madalin-cristian Bucur

[permalink] [raw]
Subject: RE: [upstream-release] [PATCH net v3 2/4] powerpc: fsl/fman: remove fsl, fman from of_device_ids[]

> From: Scott Wood [mailto:[email protected]]
> 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 <[email protected]>
> > Signed-off-by: Madalin Bucur <[email protected]>
> > ---
> >  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 <[email protected]>

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.