Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5948500imu; Mon, 21 Jan 2019 00:05:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN7nWIodOCH5vrJAdsMF8d1skhK+UlxTHQCJJZ230oe2fLab2/3sM4pHH+UJKbvilje22qeD X-Received: by 2002:a17:902:ba8b:: with SMTP id k11mr29130435pls.177.1548057956965; Mon, 21 Jan 2019 00:05:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548057956; cv=none; d=google.com; s=arc-20160816; b=W1MHaVaxBRC1juchK+Dgk1y1Lt/0WLizLY44G9ISNvvv5NcnvX1rzslIylLoYzTtEy 4P5wp3m3Yub5UjW/eBljSopDCZZGIyMZM0CjpNVaFlYFc7aHqBeQC7TC4el1IWpBrA9i 4W4mk7UgCsf7tdeRGtAQAVczEh6loGYKB1sekqVMlcWPVHw+Jy3VyfeDs/vQP2V4oe8m imj1fs1hJQh8uZjD4b4LIG7cf/T/0FSGjc+uOAFz/nu9bdEi6oCFQazAGr3IUQ2ajp2q kkpkxdiJxpw93A81cvJ5hzdo7QoPSLdTkcJaZZeRN3a7JiYroZM/HHUPzFqgWR85TqpM J1Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=q5m4z3K2xWmaa47IDRchOo1YyH+mw39DoCyW55RxwEk=; b=J8az6PxIcPdFB6nxwdBReH3uRpx2y8K7YQIgNd6VPcevBnkU9JjaQQZmPvqJ5gH6Pm R+GkOKaFh9yAds13v1p1SLkEKIhTh2+f0mHqWTOle6sbIe1vJcV4iM7DLPqKEh8YrP0Y KzmmJMTRDWSrZ3PIAaR/7v0J6j3/S9rX7Rj6PfVpdeVmEq7P7Q+a5UqAqNcsSTT5ZXp0 xIf1KwMvr0Io9ZdeikWuBDDQ+o0bOl10HpUouGDFiJhwkcRs2fL/uOpMeVaC7NrQsZxq PUZl/HfbGJnPDvFrf6fCpCuuyqcH+nXGFkXvneBhZ26Uti9RjkqOLfOvWnTMbZ210M/i xuKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z8si12115611pgk.183.2019.01.21.00.05.41; Mon, 21 Jan 2019 00:05:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729146AbfAUIER (ORCPT + 99 others); Mon, 21 Jan 2019 03:04:17 -0500 Received: from inva020.nxp.com ([92.121.34.13]:42440 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728683AbfAUID7 (ORCPT ); Mon, 21 Jan 2019 03:03:59 -0500 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 533BC1A03A0; Mon, 21 Jan 2019 04:18:39 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 3801A1A0394; Mon, 21 Jan 2019 04:18:34 +0100 (CET) Received: from titan.ap.freescale.net (TITAN.ap.freescale.net [10.192.208.233]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id AFB78402B5; Mon, 21 Jan 2019 11:18:27 +0800 (SGT) From: Yinbo Zhu To: Alan Stern Cc: yinbo.zhu@nxp.com, xiaobo.xie@nxp.com, jerry.huang@nxp.com, ran.wang_1@nxp.com, Greg Kroah-Hartman , Ramneek Mehresh , Nikhil Badola , Suresh Gupta , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 3/6] usb: host: Stops USB controller init if PLL fails to lock Date: Mon, 21 Jan 2019 11:13:01 +0800 Message-Id: <20190121031304.31161-3-yinbo.zhu@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190121031304.31161-1-yinbo.zhu@nxp.com> References: <20190121031304.31161-1-yinbo.zhu@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: yinbo.zhu 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 Signed-off-by: Suresh Gupta Signed-off-by: yinbo.zhu --- drivers/usb/host/ehci-fsl.c | 5 +++++ drivers/usb/host/fsl-mph-dr-of.c | 5 +++++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index a28ec1e..6884130 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c @@ -224,6 +224,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 677f9d5..7e07701 100644 --- a/drivers/usb/host/fsl-mph-dr-of.c +++ b/drivers/usb/host/fsl-mph-dr-of.c @@ -225,6 +225,11 @@ static int fsl_usb2_mph_dr_of_probe(struct platform_device *ofdev) 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; + /* * Determine whether phy_clk_valid needs to be checked * by reading property in device tree -- 1.7.1