Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp705540ybi; Fri, 14 Jun 2019 01:55:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqwndyQ5HTh3hwdRf0zFkWRw09FSGlBoDcYmWVbwN9IPIzSc0iRnAQvmdF2ZASU++381JFRj X-Received: by 2002:a17:90a:8c87:: with SMTP id b7mr9697835pjo.139.1560502504828; Fri, 14 Jun 2019 01:55:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560502504; cv=none; d=google.com; s=arc-20160816; b=lWjY4e8IOoHxxuPuA7AUEify75x5REqVJD0/HRNPtOG0FS0D7MDYuOI3+oeZBrhOMI dwOQd4xOGA7HM4N/C/ae6M1gPVuK0L3ndYK5E2IdzMd7corcjacw/yCpMnkH+MncIQ5U ykwyw17Py39xehNsAlLR0OAacN7rYTTS72u9aP5GL2n8aTPm4vq1zRuv4iOxvjGcN1ji j6iWW+k/ZYZQ98Yig7YGGNx3oHbWb3uule0QTeJnOAztisD1JCBYRndknO91+iho/Mok aBDc4cv/3ZcwHlDos6rpewZwe3IKSK94sF0JMLN9WPFgHYy0OEwyGiTsz+cc1s+DQX1k R+6Q== 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=az4s4HHf0gwgZLwXFyRb04Qp+4AXhlKZAtHHw/ke+wk=; b=soZig/ogWVNEhQpUlxUO9zz/DxjKttNp7GuY11A858lOeizFbZOfYGq/hZ2MLxKfYx fFRjSZX5mG2t/z74jtq4pag01VTJ5AKS7Ee44L+/SHUyA1n/0x9vcgvV8B31OvGw3Sug qZu2ED3ThUP16pxyPiSVeyf+yS6TliHLr9xMHhoa95pGj28eFdSCPCzltGlrVRfMoZ2L SLg+TQqNAihrW/KwHnsgo9Rme5854KwSsi77BwmlTW4QjmiwyDEAF3Mfe92D3OJ8V3NG kBmLGXQykrvjyIKcVaEFv3VYjAXprYzUpBGAjNNkQwkJ+HULLLBslD6Kz8mPM4fXHitz 9vTA== 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 f11si1969005pgh.530.2019.06.14.01.54.48; Fri, 14 Jun 2019 01:55:04 -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 S1726893AbfFNIxA (ORCPT + 99 others); Fri, 14 Jun 2019 04:53:00 -0400 Received: from inva021.nxp.com ([92.121.34.21]:59136 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726404AbfFNIw5 (ORCPT ); Fri, 14 Jun 2019 04:52:57 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 30C44200077; Fri, 14 Jun 2019 10:52:56 +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 A4FB82005F1; Fri, 14 Jun 2019 10:52:51 +0200 (CEST) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 9C1FE40310; Fri, 14 Jun 2019 16:52:45 +0800 (SGT) From: Yinbo Zhu To: Alan Stern Cc: yinbo.zhu@nxp.com, xiaobo.xie@nxp.com, jiafei.pan@nxp.com, Greg Kroah-Hartman , Ramneek Mehresh , Nikhil Badola , Ran Wang , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 4/5] usb: host: Stops USB controller init if PLL fails to lock Date: Fri, 14 Jun 2019 16:54:32 +0800 Message-Id: <20190614085433.22344-4-yinbo.zhu@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190614085433.22344-1-yinbo.zhu@nxp.com> References: <20190614085433.22344-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 v7: keep v5 version "fall through" 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..ef3dfd33a62e 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; + } + 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