Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2096692ybd; Mon, 24 Jun 2019 00:21:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEwAKuSlVoDT/Y7fSl+q8VpSBgbnVUCIseNHfpYMt2WhSjG4SmcfjBdfg/kbR6MiUr1R3z X-Received: by 2002:a17:90a:3210:: with SMTP id k16mr22241515pjb.13.1561360884255; Mon, 24 Jun 2019 00:21:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561360884; cv=none; d=google.com; s=arc-20160816; b=xLMclCSmciAk/8mn72H9I0jhDHjKh3BynuJjCrsSqTX6eKIXEdbLvLJ7Zs82lqOiND rJ0KfownS6rW1jAik5/XTd7uEcLeADRHbZdrz47mvWGWWeTFqeDdobeUC9FyzuFPN4Aj fkXU9PDMfkiWSBV8z47nnXM47tdAciZ9699FR5lFUfxBR5BbgguyipT4O9tavN7MbjyQ bWOFWm+VG4nneoMLcLxXkQI4z88IjDWQ5T5AA4UiMiRSKhGugPSZO8X891qt6R5a+bMc wlGkmQBih7wF3Pw9mWsUYAAjk5RN4sMotX88o7NX236rfi+/j5WACQ/KaXJ6qdREBt0v JNog== 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=TdkFZvb0AtLYwAip+EI2V3QOZDBppRNmIfESos0kY8c=; b=UCCKd0WGwG+Y9DI9ccivILIMSUbXTgtEP6kP/d7RGDEGY0vOKx/6tzPvxMnqiuLnWk PsO+M9iZOtPNRI34ruIHXv7emPfuxAqpuxF2b3mLqefkPRl0Xu3VhPPP/CzvPbCGkxJD GUz3tybIbvOtbwCDILaIZurvAQu+h1iquwPRC1SSg2JzRnZgNi+FyeARHcUW92y4fV5g USfhhqxlxAbpBBX5f+FwvCx8p5eGaEC5CCLx5NC+5FSAGT2vGdQ6aEhvHGHt6OJb1nJ6 6TrUUEvnrTEZYBAgJC6VLCVOf9IzRzdjn1dFdv1TElC2LfttKqIyVq6+MFxXSNof2G/G oyag== 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 i18si10083626pfr.65.2019.06.24.00.21.08; Mon, 24 Jun 2019 00:21:24 -0700 (PDT) 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 S1727802AbfFXHUd (ORCPT + 99 others); Mon, 24 Jun 2019 03:20:33 -0400 Received: from inva021.nxp.com ([92.121.34.21]:44644 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727768AbfFXHUc (ORCPT ); Mon, 24 Jun 2019 03:20:32 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 55D5F20059C; Mon, 24 Jun 2019 09:20:30 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 1038620058D; Mon, 24 Jun 2019 09:20:25 +0200 (CEST) Received: from mega.ap.freescale.net (mega.ap.freescale.net [10.192.208.232]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 5B3B840318; Mon, 24 Jun 2019 15:20:18 +0800 (SGT) From: Yinbo Zhu To: Alan Stern , Greg Kroah-Hartman Cc: yinbo.zhu@nxp.com, xiaobo.xie@nxp.com, jiafei.pan@nxp.com, Ramneek Mehresh , Nikhil Badola , Ran Wang , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v8 4/5] usb: host: Stops USB controller init if PLL fails to lock Date: Mon, 24 Jun 2019 15:22:18 +0800 Message-Id: <20190624072219.15258-4-yinbo.zhu@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190624072219.15258-1-yinbo.zhu@nxp.com> References: <20190624072219.15258-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: Ramneek Mehresh 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 --- Change in v2: replace Yinbo.Zhu with Yinbo Zhu. Change in v5: add the erratum commont replace "/* fall through */". Change in v6: remove "/* fall through */". Change in v7: keep v5 change. Change in v8: Add "/* fall through */" for case FSL_USB2_PHY_UTMIII. drivers/usb/host/ehci-fsl.c | 9 +++++++++ drivers/usb/host/fsl-mph-dr-of.c | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index 8f3bf3efb038..9e9c232e896f 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c @@ -236,6 +236,15 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd, portsc |= PORT_PTS_PTW; /* fall through */ case FSL_USB2_PHY_UTMI: + /* Presence of this node "has_fsl_erratum_a006918" + * in device-tree is used to stop USB controller + * initialization in Linux + */ + if (pdata->has_fsl_erratum_a006918) { + dev_warn(dev, "USB PHY clock invalid\n"); + return -EINVAL; + } + /* fall through */ 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 4f8b8a08c914..762b97600ab0 100644 --- a/drivers/usb/host/fsl-mph-dr-of.c +++ b/drivers/usb/host/fsl-mph-dr-of.c @@ -224,13 +224,14 @@ 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"); + pdata->has_fsl_erratum_a006918 = + of_property_read_bool(np, "fsl,usb_erratum-a006918"); if (of_get_property(np, "fsl,usb_erratum_14", NULL)) pdata->has_fsl_erratum_14 = 1; else pdata->has_fsl_erratum_14 = 0; - /* * Determine whether phy_clk_valid needs to be checked * by reading property in device tree -- 2.17.1