From patchwork Wed May 8 06:04:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinbo Zhu X-Patchwork-Id: 10934215 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 81E5A912 for ; Wed, 8 May 2019 06:05:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 720A5287CD for ; Wed, 8 May 2019 06:05:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6663028827; Wed, 8 May 2019 06:05:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F403D287CD for ; Wed, 8 May 2019 06:05:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727055AbfEHGFV (ORCPT ); Wed, 8 May 2019 02:05:21 -0400 Received: from mail-eopbgr60080.outbound.protection.outlook.com ([40.107.6.80]:3088 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727025AbfEHGFU (ORCPT ); Wed, 8 May 2019 02:05:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rpeZCp1ZplV19AO3dEl5NELaJLD6by4v5QQpk1RDHlU=; b=Ato9ysgZv5fWfIXvOgm98ITczXgacPSCMQAjxbD9UcjwKTnlROwNQ5S2eFlbTOj8kleH7mf7nanVC/5KYAI55fGydKFSp06k8FtnWPPmRzt/ofnjtl87hmwyK5I1umUjqzcGYXxSxI1htukRVwyANzXdKU/Kmi+hzxVJ3fW0A0A= Received: from VI1PR04MB4158.eurprd04.prod.outlook.com (52.133.15.33) by VI1PR04MB4141.eurprd04.prod.outlook.com (52.133.14.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.12; Wed, 8 May 2019 06:04:47 +0000 Received: from VI1PR04MB4158.eurprd04.prod.outlook.com ([fe80::8015:ec84:d721:b566]) by VI1PR04MB4158.eurprd04.prod.outlook.com ([fe80::8015:ec84:d721:b566%5]) with mapi id 15.20.1856.012; Wed, 8 May 2019 06:04:47 +0000 From: Yinbo Zhu To: Alan Stern CC: Yinbo Zhu , Xiaobo Xie , Greg Kroah-Hartman , Ramneek Mehresh , Nikhil Badola , Ran Wang , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Jiafei Pan , Suresh Gupta Subject: [PATCH v5 4/5] usb: host: Stops USB controller init if PLL fails to lock Thread-Topic: [PATCH v5 4/5] usb: host: Stops USB controller init if PLL fails to lock Thread-Index: AQHVBWPwtPsu0fLjhE+qRODS4vtH+w== Date: Wed, 8 May 2019 06:04:47 +0000 Message-ID: <20190508060608.33882-4-yinbo.zhu@nxp.com> References: <20190508060608.33882-1-yinbo.zhu@nxp.com> In-Reply-To: <20190508060608.33882-1-yinbo.zhu@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK2PR06CA0023.apcprd06.prod.outlook.com (2603:1096:202:2e::35) To VI1PR04MB4158.eurprd04.prod.outlook.com (2603:10a6:803:46::33) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yinbo.zhu@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 131968bf-08a6-417b-edea-08d6d37b12e0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020);SRVR:VI1PR04MB4141; x-ms-traffictypediagnostic: VI1PR04MB4141: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-forefront-prvs: 0031A0FFAF x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(39860400002)(346002)(376002)(396003)(136003)(189003)(199004)(68736007)(446003)(54906003)(2906002)(6116002)(81156014)(11346002)(486006)(476003)(6506007)(2616005)(66066001)(81166006)(8676002)(76176011)(7736002)(305945005)(44832011)(6916009)(36756003)(2171002)(50226002)(107886003)(53936002)(4326008)(25786009)(86362001)(1076003)(8936002)(186003)(5660300002)(3846002)(52116002)(99286004)(102836004)(316002)(386003)(478600001)(256004)(71190400001)(71200400001)(14444005)(14454004)(6512007)(6486002)(6436002)(66446008)(73956011)(66946007)(26005)(66476007)(66556008)(64756008);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB4141;H:VI1PR04MB4158.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: S3BvBkG5ABbCkZIzG6isQi9G4ER8x/hNghmhMrY0wVd+dlvW/Ol1T2r3hK7oytVLc0WI92XGWxGJYC5KntyAIrLecNDzJrm1/2r+EVaBXYuz5xdUDJrxkSzFZVQXQSV3K8D+qxuSK2t1LWDAYsO7kCN0D7kWndmxn7wymvvHtvTMSXWVJP3lzBg/kQFioINdsIXC0GPUud3XF78skoRJiviZKpBCJDHiqTmgRO2aibq8+f0ouHCvhbh/pHQI1kUi8PC+afXQWmfA70bP61I3jpClpRsSO4JLB8Q3Axab0iqPFaKr0zew5HnFo5YHQXWi+wf7ZxCUMSAa0dP5Vx9pt0zi3ELxYBkahSnFmd6mzFRoKGEZJvrf3fWGQ6jow9ymEccmGIpxSBE1kF7/RptpKk+v65VAqa2jJIueksFluMY= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 131968bf-08a6-417b-edea-08d6d37b12e0 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 May 2019 06:04:47.3334 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4141 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 v5: use dev_warn() instead of pr_warn() drivers/usb/host/ehci-fsl.c | 5 +++++ drivers/usb/host/fsl-mph-dr-of.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index 1634ac8..90550a6 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) { + 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 4f8b8a0..762b976 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