[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190123070615.14462-3-yinbo.zhu@nxp.com>
Date: Wed, 23 Jan 2019 07:05:36 +0000
From: Yinbo Zhu <yinbo.zhu@....com>
To: Alan Stern <stern@...land.harvard.edu>
CC: Yinbo Zhu <yinbo.zhu@....com>, Xiaobo Xie <xiaobo.xie@....com>,
Jerry Huang <jerry.huang@....com>,
Ran Wang <ran.wang_1@....com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Ramneek Mehresh <ramneek.mehresh@...escale.com>,
Nikhil Badola <nikhil.badola@...escale.com>,
Suresh Gupta <suresh.gupta@...escale.com>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH v3 3/5] usb: host: Stops USB controller init if PLL fails to
lock
From: Ramneek Mehresh <ramneek.mehresh@...escale.com>
USB erratum-A006918 workaround tries to start internal PHY inside
uboot (when PLL fails to lock). However, if the workaround also
fails, then USB initialization is also stopped inside Linux.
Erratum-A006918 workaround failure creates "fsl,erratum_a006918"
node in device-tree. Presence of this node in device-tree is
used to stop USB controller initialization in Linux
Signed-off-by: Ramneek Mehresh <ramneek.mehresh@...escale.com>
Signed-off-by: Suresh Gupta <suresh.gupta@...escale.com>
Signed-off-by: Yinbo Zhu <yinbo.zhu@....com>
---
drivers/usb/host/ehci-fsl.c | 5 +++++
drivers/usb/host/fsl-mph-dr-of.c | 4 ++++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index 8b0f3ed..e276067 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -236,6 +236,11 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd,
portsc |= PORT_PTS_PTW;
/* fall through */
case FSL_USB2_PHY_UTMI:
+ if (pdata->has_fsl_erratum_a006918) {
+ pr_warn("fsl-ehci: USB PHY clock invalid\n");
+ return -EINVAL;
+ }
+
case FSL_USB2_PHY_UTMI_DUAL:
/* PHY_CLK_VALID bit is de-featured from all controller
* versions below 2.4 and is to be checked only for
diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c
index 4f8b8a0..bdc8812 100644
--- a/drivers/usb/host/fsl-mph-dr-of.c
+++ b/drivers/usb/host/fsl-mph-dr-of.c
@@ -230,6 +230,10 @@ static int fsl_usb2_mph_dr_of_probe(struct platform_device *ofdev)
else
pdata->has_fsl_erratum_14 = 0;
+ if (of_get_property(np, "fsl,erratum_a006918", NULL))
+ pdata->has_fsl_erratum_a006918 = 1;
+ else
+ pdata->has_fsl_erratum_a006918 = 0;
/*
* Determine whether phy_clk_valid needs to be checked
--
1.7.1
Powered by blists - more mailing lists