linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yinbo Zhu <yinbo.zhu@nxp.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: yinbo.zhu@nxp.com, xiaobo.xie@nxp.com, jerry.huang@nxp.com,
	ran.wang_1@nxp.com,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ramneek Mehresh <ramneek.mehresh@freescale.com>,
	Nikhil Badola <nikhil.badola@freescale.com>,
	Suresh Gupta <suresh.gupta@freescale.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v1 6/6] usb :fsl: Change string format for errata property
Date: Mon, 21 Jan 2019 11:13:04 +0800	[thread overview]
Message-ID: <20190121031304.31161-6-yinbo.zhu@nxp.com> (raw)
In-Reply-To: <20190121031304.31161-1-yinbo.zhu@nxp.com>

From: Nikhil Badola <nikhil.badola@freescale.com>

Remove USB errata checking code from driver. Applicability of erratum
is retrieved 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>
Signed-off-by: yinbo.zhu <yinbo.zhu@nxp.com>
---
 drivers/usb/host/ehci-fsl.c      |    7 +------
 drivers/usb/host/fsl-mph-dr-of.c |    9 ++++-----
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index 6884130..c71680e 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -310,14 +310,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 7e07701..ae8f60f 100644
--- a/drivers/usb/host/fsl-mph-dr-of.c
+++ b/drivers/usb/host/fsl-mph-dr-of.c
@@ -224,11 +224,10 @@ static int fsl_usb2_mph_dr_of_probe(struct platform_device *ofdev)
 		of_property_read_bool(np, "fsl,usb-erratum-a005275");
 	pdata->has_fsl_erratum_a005697 =
 		of_property_read_bool(np, "fsl,usb_erratum-a005697");
-
-	if (of_get_property(np, "fsl,erratum_a006918", NULL))
-		pdata->has_fsl_erratum_a006918 = 1;
-	else
-		pdata->has_fsl_erratum_a006918 = 0;
+	pdata->has_fsl_erratum_a006918 =
+		of_property_read_bool(np, "fsl,usb_erratum-a006918");
+	pdata->has_fsl_erratum_14 =
+		of_property_read_bool(np, "fsl,usb_erratum-14");
 
 	/*
 	 * Determine whether phy_clk_valid needs to be checked
-- 
1.7.1


      parent reply	other threads:[~2019-01-21  8:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-21  3:12 [PATCH v1 1/6] usb: fsl: Set USB_EN bit to select ULPI phy Yinbo Zhu
2019-01-21  3:13 ` [PATCH v1 2/6] usb: phy: Workaround for USB erratum-A005728 Yinbo Zhu
2019-01-21  7:46   ` Greg Kroah-Hartman
2019-01-21  3:13 ` [PATCH v1 3/6] usb: host: Stops USB controller init if PLL fails to lock Yinbo Zhu
2019-01-21  7:46   ` Greg Kroah-Hartman
2019-01-21  8:16   ` Sergei Shtylyov
2019-01-21 10:08     ` Yinbo Zhu
2019-01-21  3:13 ` [PATCH v1 4/6] usb: linux/fsl_device: Add platform member has_fsl_erratum_a006918 Yinbo Zhu
2019-01-21  3:13 ` [PATCH v1 5/6] usb: linux/fsl_device: Add platform member has_fsl_erratum_14 Yinbo Zhu
2019-01-21  3:13 ` Yinbo Zhu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190121031304.31161-6-yinbo.zhu@nxp.com \
    --to=yinbo.zhu@nxp.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jerry.huang@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=nikhil.badola@freescale.com \
    --cc=ramneek.mehresh@freescale.com \
    --cc=ran.wang_1@nxp.com \
    --cc=stern@rowland.harvard.edu \
    --cc=suresh.gupta@freescale.com \
    --cc=xiaobo.xie@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).