diff options
Diffstat (limited to 'drivers/net/ethernet/freescale')
| -rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 2 | ||||
| -rw-r--r-- | drivers/net/ethernet/freescale/gianfar.c | 38 | ||||
| -rw-r--r-- | drivers/net/ethernet/freescale/gianfar_ptp.c | 4 |
3 files changed, 32 insertions, 12 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index f9aacf5d8523..b2793b91cc55 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c | |||
| @@ -2199,7 +2199,7 @@ fec_probe(struct platform_device *pdev) | |||
| 2199 | goto failed_irq; | 2199 | goto failed_irq; |
| 2200 | } | 2200 | } |
| 2201 | ret = devm_request_irq(&pdev->dev, irq, fec_enet_interrupt, | 2201 | ret = devm_request_irq(&pdev->dev, irq, fec_enet_interrupt, |
| 2202 | IRQF_DISABLED, pdev->name, ndev); | 2202 | 0, pdev->name, ndev); |
| 2203 | if (ret) | 2203 | if (ret) |
| 2204 | goto failed_irq; | 2204 | goto failed_irq; |
| 2205 | } | 2205 | } |
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index c4eaadeb572f..9fbe4dda7a0e 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c | |||
| @@ -88,6 +88,7 @@ | |||
| 88 | 88 | ||
| 89 | #include <asm/io.h> | 89 | #include <asm/io.h> |
| 90 | #include <asm/reg.h> | 90 | #include <asm/reg.h> |
| 91 | #include <asm/mpc85xx.h> | ||
| 91 | #include <asm/irq.h> | 92 | #include <asm/irq.h> |
| 92 | #include <asm/uaccess.h> | 93 | #include <asm/uaccess.h> |
| 93 | #include <linux/module.h> | 94 | #include <linux/module.h> |
| @@ -939,9 +940,8 @@ static void gfar_init_filer_table(struct gfar_private *priv) | |||
| 939 | } | 940 | } |
| 940 | } | 941 | } |
| 941 | 942 | ||
| 942 | static void gfar_detect_errata(struct gfar_private *priv) | 943 | static void __gfar_detect_errata_83xx(struct gfar_private *priv) |
| 943 | { | 944 | { |
| 944 | struct device *dev = &priv->ofdev->dev; | ||
| 945 | unsigned int pvr = mfspr(SPRN_PVR); | 945 | unsigned int pvr = mfspr(SPRN_PVR); |
| 946 | unsigned int svr = mfspr(SPRN_SVR); | 946 | unsigned int svr = mfspr(SPRN_SVR); |
| 947 | unsigned int mod = (svr >> 16) & 0xfff6; /* w/o E suffix */ | 947 | unsigned int mod = (svr >> 16) & 0xfff6; /* w/o E suffix */ |
| @@ -957,15 +957,33 @@ static void gfar_detect_errata(struct gfar_private *priv) | |||
| 957 | (pvr == 0x80861010 && (mod & 0xfff9) == 0x80c0)) | 957 | (pvr == 0x80861010 && (mod & 0xfff9) == 0x80c0)) |
| 958 | priv->errata |= GFAR_ERRATA_76; | 958 | priv->errata |= GFAR_ERRATA_76; |
| 959 | 959 | ||
| 960 | /* MPC8313 and MPC837x all rev */ | 960 | /* MPC8313 Rev < 2.0 */ |
| 961 | if ((pvr == 0x80850010 && mod == 0x80b0) || | 961 | if (pvr == 0x80850010 && mod == 0x80b0 && rev < 0x0020) |
| 962 | (pvr == 0x80861010 && (mod & 0xfff9) == 0x80c0)) | 962 | priv->errata |= GFAR_ERRATA_12; |
| 963 | priv->errata |= GFAR_ERRATA_A002; | 963 | } |
| 964 | 964 | ||
| 965 | /* MPC8313 Rev < 2.0, MPC8548 rev 2.0 */ | 965 | static void __gfar_detect_errata_85xx(struct gfar_private *priv) |
| 966 | if ((pvr == 0x80850010 && mod == 0x80b0 && rev < 0x0020) || | 966 | { |
| 967 | (pvr == 0x80210020 && mod == 0x8030 && rev == 0x0020)) | 967 | unsigned int svr = mfspr(SPRN_SVR); |
| 968 | |||
| 969 | if ((SVR_SOC_VER(svr) == SVR_8548) && (SVR_REV(svr) == 0x20)) | ||
| 968 | priv->errata |= GFAR_ERRATA_12; | 970 | priv->errata |= GFAR_ERRATA_12; |
| 971 | if (((SVR_SOC_VER(svr) == SVR_P2020) && (SVR_REV(svr) < 0x20)) || | ||
| 972 | ((SVR_SOC_VER(svr) == SVR_P2010) && (SVR_REV(svr) < 0x20))) | ||
| 973 | priv->errata |= GFAR_ERRATA_76; /* aka eTSEC 20 */ | ||
| 974 | } | ||
| 975 | |||
| 976 | static void gfar_detect_errata(struct gfar_private *priv) | ||
| 977 | { | ||
| 978 | struct device *dev = &priv->ofdev->dev; | ||
| 979 | |||
| 980 | /* no plans to fix */ | ||
| 981 | priv->errata |= GFAR_ERRATA_A002; | ||
| 982 | |||
| 983 | if (pvr_version_is(PVR_VER_E500V1) || pvr_version_is(PVR_VER_E500V2)) | ||
| 984 | __gfar_detect_errata_85xx(priv); | ||
| 985 | else /* non-mpc85xx parts, i.e. e300 core based */ | ||
| 986 | __gfar_detect_errata_83xx(priv); | ||
| 969 | 987 | ||
| 970 | if (priv->errata) | 988 | if (priv->errata) |
| 971 | dev_info(dev, "enabled errata workarounds, flags: 0x%x\n", | 989 | dev_info(dev, "enabled errata workarounds, flags: 0x%x\n", |
| @@ -1599,7 +1617,7 @@ static int __gfar_is_rx_idle(struct gfar_private *priv) | |||
| 1599 | /* Normaly TSEC should not hang on GRS commands, so we should | 1617 | /* Normaly TSEC should not hang on GRS commands, so we should |
| 1600 | * actually wait for IEVENT_GRSC flag. | 1618 | * actually wait for IEVENT_GRSC flag. |
| 1601 | */ | 1619 | */ |
| 1602 | if (likely(!gfar_has_errata(priv, GFAR_ERRATA_A002))) | 1620 | if (!gfar_has_errata(priv, GFAR_ERRATA_A002)) |
| 1603 | return 0; | 1621 | return 0; |
| 1604 | 1622 | ||
| 1605 | /* Read the eTSEC register at offset 0xD1C. If bits 7-14 are | 1623 | /* Read the eTSEC register at offset 0xD1C. If bits 7-14 are |
diff --git a/drivers/net/ethernet/freescale/gianfar_ptp.c b/drivers/net/ethernet/freescale/gianfar_ptp.c index 098f133908ae..e006a09ba899 100644 --- a/drivers/net/ethernet/freescale/gianfar_ptp.c +++ b/drivers/net/ethernet/freescale/gianfar_ptp.c | |||
| @@ -452,7 +452,9 @@ static int gianfar_ptp_probe(struct platform_device *dev) | |||
| 452 | err = -ENODEV; | 452 | err = -ENODEV; |
| 453 | 453 | ||
| 454 | etsects->caps = ptp_gianfar_caps; | 454 | etsects->caps = ptp_gianfar_caps; |
| 455 | etsects->cksel = DEFAULT_CKSEL; | 455 | |
| 456 | if (get_of_u32(node, "fsl,cksel", &etsects->cksel)) | ||
| 457 | etsects->cksel = DEFAULT_CKSEL; | ||
| 456 | 458 | ||
| 457 | if (get_of_u32(node, "fsl,tclk-period", &etsects->tclk_period) || | 459 | if (get_of_u32(node, "fsl,tclk-period", &etsects->tclk_period) || |
| 458 | get_of_u32(node, "fsl,tmr-prsc", &etsects->tmr_prsc) || | 460 | get_of_u32(node, "fsl,tmr-prsc", &etsects->tmr_prsc) || |
