Commit 04fddde3 authored by David S. Miller's avatar David S. Miller

Merge branch 'fsl-fixes'

Madalin Bucur says:

====================
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 v3: removed redundant comment, added ack by Scott
Changes from v2: merged fsl/fman changes to avoid a point of failure
Changes from v1: unifying probing on all supported platforms
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents fb3dc5b8 2e3db5a4
...@@ -117,9 +117,6 @@ static const struct of_device_id of_device_ids[] = { ...@@ -117,9 +117,6 @@ static const struct of_device_id of_device_ids[] = {
{ {
.compatible = "fsl,qe", .compatible = "fsl,qe",
}, },
{
.compatible = "fsl,fman",
},
/* The following two are for the Freescale hypervisor */ /* The following two are for the Freescale hypervisor */
{ {
.name = "hypervisor", .name = "hypervisor",
......
config FSL_FMAN config FSL_FMAN
tristate "FMan support" tristate "FMan support"
depends on FSL_SOC || COMPILE_TEST depends on FSL_SOC || ARCH_LAYERSCAPE || COMPILE_TEST
select GENERIC_ALLOCATOR select GENERIC_ALLOCATOR
select PHYLIB select PHYLIB
default n default n
......
...@@ -1890,6 +1890,7 @@ static int fman_reset(struct fman *fman) ...@@ -1890,6 +1890,7 @@ static int fman_reset(struct fman *fman)
goto _return; goto _return;
} else { } else {
#ifdef CONFIG_PPC
struct device_node *guts_node; struct device_node *guts_node;
struct ccsr_guts __iomem *guts_regs; struct ccsr_guts __iomem *guts_regs;
u32 devdisr2, reg; u32 devdisr2, reg;
...@@ -1921,6 +1922,7 @@ static int fman_reset(struct fman *fman) ...@@ -1921,6 +1922,7 @@ static int fman_reset(struct fman *fman)
/* Enable all MACs */ /* Enable all MACs */
iowrite32be(reg, &guts_regs->devdisr2); iowrite32be(reg, &guts_regs->devdisr2);
#endif
/* Perform FMan reset */ /* Perform FMan reset */
iowrite32be(FPM_RSTC_FM_RESET, &fman->fpm_regs->fm_rstc); iowrite32be(FPM_RSTC_FM_RESET, &fman->fpm_regs->fm_rstc);
...@@ -1932,25 +1934,31 @@ static int fman_reset(struct fman *fman) ...@@ -1932,25 +1934,31 @@ static int fman_reset(struct fman *fman)
} while (((ioread32be(&fman->fpm_regs->fm_rstc)) & } while (((ioread32be(&fman->fpm_regs->fm_rstc)) &
FPM_RSTC_FM_RESET) && --count); FPM_RSTC_FM_RESET) && --count);
if (count == 0) { if (count == 0) {
#ifdef CONFIG_PPC
iounmap(guts_regs); iounmap(guts_regs);
of_node_put(guts_node); of_node_put(guts_node);
#endif
err = -EBUSY; err = -EBUSY;
goto _return; goto _return;
} }
#ifdef CONFIG_PPC
/* Restore devdisr2 value */ /* Restore devdisr2 value */
iowrite32be(devdisr2, &guts_regs->devdisr2); iowrite32be(devdisr2, &guts_regs->devdisr2);
iounmap(guts_regs); iounmap(guts_regs);
of_node_put(guts_node); of_node_put(guts_node);
#endif
goto _return; goto _return;
#ifdef CONFIG_PPC
guts_regs: guts_regs:
of_node_put(guts_node); of_node_put(guts_node);
guts_node: guts_node:
dev_dbg(fman->dev, "%s: Didn't perform FManV3 reset due to Errata A007273!\n", dev_dbg(fman->dev, "%s: Didn't perform FManV3 reset due to Errata A007273!\n",
__func__); __func__);
#endif
} }
_return: _return:
return err; return err;
...@@ -2868,6 +2876,13 @@ static struct fman *read_dts_node(struct platform_device *of_dev) ...@@ -2868,6 +2876,13 @@ static struct fman *read_dts_node(struct platform_device *of_dev)
fman->dev = &of_dev->dev; fman->dev = &of_dev->dev;
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; return fman;
fman_node_put: fman_node_put:
......
...@@ -594,6 +594,7 @@ static const u16 phy2speed[] = { ...@@ -594,6 +594,7 @@ static const u16 phy2speed[] = {
[PHY_INTERFACE_MODE_RGMII_RXID] = SPEED_1000, [PHY_INTERFACE_MODE_RGMII_RXID] = SPEED_1000,
[PHY_INTERFACE_MODE_RGMII_TXID] = SPEED_1000, [PHY_INTERFACE_MODE_RGMII_TXID] = SPEED_1000,
[PHY_INTERFACE_MODE_RTBI] = SPEED_1000, [PHY_INTERFACE_MODE_RTBI] = SPEED_1000,
[PHY_INTERFACE_MODE_QSGMII] = SPEED_1000,
[PHY_INTERFACE_MODE_XGMII] = SPEED_10000 [PHY_INTERFACE_MODE_XGMII] = SPEED_10000
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment