summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorNikhil Badola <nikhil.badola@freescale.com>2014-10-13 12:25:33 (GMT)
committerMatthew Weigel <Matthew.Weigel@freescale.com>2014-12-11 18:38:19 (GMT)
commit44a0d180e3774f999bd74fd101d430231540bf36 (patch)
tree97dc2d9baa83911d49d22395774a4199113d1d83 /drivers/usb
parent36e3f1f1fa166c73c9fe427daebc648d795eab34 (diff)
downloadlinux-fsl-qoriq-44a0d180e3774f999bd74fd101d430231540bf36.tar.xz
drivers: usb :fsl: Remove USB Errata checking code
Remove USB errata checking code from driver. Applicability of erratum is retreived by reading corresponding property in device tree. This property is written during device tree fixup. Signed-off-by: Ramneek Mehresh <ramneek.mehresh@freescale.com> Signed-off-by: Nikhil Badola <nikhil.badola@freescale.com> Change-Id: I78a8b51a4b647d43f942666800bae4d515b15e70 Reviewed-on: http://git.am.freescale.net:8181/21813 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Zhengxiong Jin <Jason.Jin@freescale.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/ehci-fsl.c7
-rw-r--r--drivers/usb/host/fsl-mph-dr-of.c105
2 files changed, 12 insertions, 100 deletions
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index c307ab0..86f2736 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -396,14 +396,9 @@ static int ehci_fsl_usb_setup(struct ehci_hcd *ehci)
return -EINVAL;
if (pdata->operating_mode == FSL_USB2_MPH_HOST) {
- unsigned int chip, rev, svr;
-
- svr = mfspr(SPRN_SVR);
- chip = svr >> 16;
- rev = (svr >> 4) & 0xf;
/* Deal with USB Erratum #14 on MPC834x Rev 1.0 & 1.1 chips */
- if ((rev == 1) && (chip >= 0x8050) && (chip <= 0x8055))
+ if (pdata->has_fsl_erratum_14 == 1)
ehci->has_fsl_port_bug = 1;
if (pdata->port_enables & FSL_USB2_PORT0_ENABLED)
diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c
index 8cb82cc..4ac390a 100644
--- a/drivers/usb/host/fsl-mph-dr-of.c
+++ b/drivers/usb/host/fsl-mph-dr-of.c
@@ -17,7 +17,6 @@
#include <linux/of_platform.h>
#include <linux/clk.h>
#include <linux/module.h>
-#include <asm/mpc85xx.h>
struct fsl_usb2_dev_data {
char *dr_mode; /* controller mode */
@@ -120,92 +119,6 @@ error:
static const struct of_device_id fsl_usb2_mph_dr_of_match[];
-static bool has_erratum_a005275(struct device_node *node)
-{
- unsigned int svr = mfspr(SPRN_SVR);
- bool flag = false;
- /* Deal with USB Erratum USB A-005275
- * Packet corruption in HS mode, default to
- * FS mode for the following
- * P3041 and P2041 rev 1.0 and 1.1
- * P5020 and P5010 rev 1.0 and 2.0
- * P5040 and P1010 rev 1.0
- */
- if ((SVR_SOC_VER(svr) == SVR_P2041) ||
- (SVR_SOC_VER(svr) == SVR_P3041))
- flag = (SVR_REV(svr) == 0x10) || (SVR_REV(svr) == 0x11);
- else if ((SVR_SOC_VER(svr) == SVR_P5010) ||
- (SVR_SOC_VER(svr) == SVR_P5020))
- flag = (SVR_REV(svr) == 0x10) || (SVR_REV(svr) == 0x20);
- else if ((SVR_SOC_VER(svr) == SVR_P5040) ||
- (SVR_SOC_VER(svr) == SVR_P1010))
- flag = (SVR_REV(svr) == 0x10);
-
- return flag;
-}
-
-static bool has_erratum_a005697(void)
-{
- unsigned int svr = mfspr(SPRN_SVR);
- bool flag = false;
-
- switch (SVR_SOC_VER(svr)) {
- case SVR_P1014:
- case SVR_T1040:
- case SVR_T2080:
- case SVR_T2081:
- if (SVR_REV(svr) == 0x10)
- flag = true;
- break;
- case SVR_9132:
- if ((SVR_REV(svr) == 0x10) || (SVR_REV(svr) == 0x11))
- flag = true;
- break;
- case SVR_P5040:
- case SVR_P5021:
- if ((SVR_REV(svr) == 0x10) || (SVR_REV(svr) == 0x20) ||
- (SVR_REV(svr) == 0x21))
- flag = true;
- break;
- case SVR_P1010:
- case SVR_T4240:
- case SVR_T4160:
- case SVR_P5020:
- case SVR_P5010:
- if ((SVR_REV(svr) == 0x10) || (SVR_REV(svr) == 0x20))
- flag = true;
- break;
- case SVR_P2040:
- case SVR_P2041:
- case SVR_P3041:
- if ((SVR_REV(svr) == 0x10) || (SVR_REV(svr) == 0x11) ||
- (SVR_REV(svr) == 0x20))
- flag = true;
- break;
- case SVR_P4080:
- if ((SVR_REV(svr) == 0x10) || (SVR_REV(svr) == 0x20) ||
- (SVR_REV(svr) == 0x30))
- flag = true;
- break;
- case SVR_B4860:
- case SVR_B4420:
- if ((SVR_REV(svr) == 0x10) || (SVR_REV(svr) == 0x20) ||
- (SVR_REV(svr) == 0x21) || (SVR_REV(svr) == 0x22))
- flag = true;
- break;
- }
-
- return flag;
-}
-
-static bool has_erratum_a007792(int controller_ver)
-{
- if (controller_ver == FSL_USB_VER_2_5)
- return true;
- else
- return false;
-}
-
static int usb_get_ver_info(struct device_node *np)
{
int ver = -1;
@@ -299,31 +212,35 @@ static int fsl_usb2_mph_dr_of_probe(struct platform_device *ofdev)
pdata->phy_mode = determine_usb_phy(prop);
pdata->controller_ver = usb_get_ver_info(np);
- /* Activate workaround for USB erratum-A005275 if
- * fsl,no-erratum-a005275 property not defined for
+ /* Activate workaround for USB erratum-A00XXXX if
+ * fsl,erratum-a00XXXX property is defined for
* affected socs
*/
- if (!of_get_property(np, "fsl,no-erratum-a005275", NULL) &&
- has_erratum_a005275(np))
+ if (of_get_property(np, "fsl,usb_erratum-a005275", NULL))
pdata->has_fsl_erratum_a005275 = 1;
else
pdata->has_fsl_erratum_a005275 = 0;
- if (has_erratum_a005697())
+ if (of_get_property(np, "fsl,usb_erratum-a005697", NULL))
pdata->has_fsl_erratum_a005697 = 1;
else
pdata->has_fsl_erratum_a005697 = 0;
- if (has_erratum_a007792(pdata->controller_ver))
+ if (of_get_property(np, "fsl,usb_erratum-a007792", NULL))
pdata->has_fsl_erratum_a007792 = 1;
else
pdata->has_fsl_erratum_a007792 = 0;
- if (of_get_property(np, "fsl,erratum_a006918", NULL))
+ if (of_get_property(np, "fsl,usb_erratum_a006918", NULL))
pdata->has_fsl_erratum_a006918 = 1;
else
pdata->has_fsl_erratum_a006918 = 0;
+ if (of_get_property(np, "fsl,usb_erratum_14", NULL))
+ pdata->has_fsl_erratum_14 = 1;
+ else
+ pdata->has_fsl_erratum_14 = 0;
+
if (pdata->have_sysif_regs) {
if (pdata->controller_ver < 0) {
dev_warn(&ofdev->dev, "Could not get controller version\n");