From patchwork Fri Jan 25 06:02:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinbo Zhu X-Patchwork-Id: 10780589 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 25ADC746 for ; Fri, 25 Jan 2019 06:03:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EF762F32D for ; Fri, 25 Jan 2019 06:03:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F1F672F327; Fri, 25 Jan 2019 06:03:03 +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 5C73A2F327 for ; Fri, 25 Jan 2019 06:03:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726273AbfAYGC5 (ORCPT ); Fri, 25 Jan 2019 01:02:57 -0500 Received: from mail-eopbgr00040.outbound.protection.outlook.com ([40.107.0.40]:38033 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726097AbfAYGC4 (ORCPT ); Fri, 25 Jan 2019 01:02:56 -0500 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=KkK6eG+ALZtENd0Eh0aeePYod4dZLLCjk0Z6SR/ezvY=; b=BbMUbkWi0wAT/3WEbU82XfvYxhbjLuKfl6pOyVt5Eq4o1uoAHKRys+0V93priN08gW/4WrqIa/DhrJDaNvdHNiBuWn1lc8y7SFqg5MwE3vOhLRhwlJuZOfe/zd6Kvk+ROl4CdFzyRLhSsRRDsv4boQE75+ZIuWphGU6phUyaeI4= Received: from VI1PR04MB4158.eurprd04.prod.outlook.com (52.133.15.33) by VI1PR04MB5455.eurprd04.prod.outlook.com (20.178.121.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.18; Fri, 25 Jan 2019 06:02:51 +0000 Received: from VI1PR04MB4158.eurprd04.prod.outlook.com ([fe80::257e:f28a:1a8c:c9c4]) by VI1PR04MB4158.eurprd04.prod.outlook.com ([fe80::257e:f28a:1a8c:c9c4%2]) with mapi id 15.20.1537.031; Fri, 25 Jan 2019 06:02:51 +0000 From: Yinbo Zhu To: Alan Stern CC: Yinbo Zhu , Xiaobo Xie , Jerry Huang , Ran Wang , Greg Kroah-Hartman , Ramneek Mehresh , Nikhil Badola , Suresh Gupta , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH v4 1/5] usb: fsl: Set USB_EN bit to select ULPI phy Thread-Topic: [PATCH v4 1/5] usb: fsl: Set USB_EN bit to select ULPI phy Thread-Index: AQHUtHOaww2wJ1zabEWo49kUjNOKxA== Date: Fri, 25 Jan 2019 06:02:51 +0000 Message-ID: <20190125060356.14294-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: HK2PR02CA0145.apcprd02.prod.outlook.com (2603:1096:202:16::29) 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-microsoft-exchange-diagnostics: 1;VI1PR04MB5455;6:XkN++E+SpTaMMqexvBF1BfUlYFixQ1jvkuvEQzxuCNaGt/kAT2CrYaGh+NVQFLtwwVRJoNwo293f0ChjWN7+nCyz+9UqWKN5rwhn180787DPru5dMko5YrQlCmtHp9bnBbZWR1PxoEcq7x8+hoZ1nGgDCVoWuWd/h2m29P+lCsOP/oREnWWdyY0vUsohWdaF79v0MjQBih8Tb3HVVpxOnvKoJygJRiM7e/o/45aw90PYv/Mmbltq5utfLwFX6Da1g6wPaHAsLQdZAkp1jVu8toRhlARKzXWbjSmpkqQYQ/74G0YPGIOMZJ1dynjO4ifmge2ATKV5U/HJRX1iq0mpfBMGKNA3oZKxbG110qe+kbMexIONnDU5YtWGD5E8HfFYlMwwXh0gU0LKw8kLjRvSPxoZMuF1a7NzILmrqrJE5N333aTt7mnLmOv1nfztcf3H4wn31v9jvAajYL/OY6JHkQ==;5:k5+/fpPz5aXjdzPSdmmZvWKWTQ9kYtaT9jW2VyoVlu3KAbLMsOHAZi5ebqq5vIPTCZ2M59SWViHewCntUqFqrIRdksJzJTAGlS3LfbcETuPVMVodqIZWTy/KyN/O8M1SBTZzUuCGBshCwz4/JfWcHjAwTbi5gs0MSNChRDVwmLegIDFP6j/DMoVxu9UjQEPhgYNIScBxCgbPkQbS+NlGAg==;7:VA9mlqMCNPyBlfMIPPx7wnk7WicjUarspCR0fr+tlbdeX73RP2excGH37ejiovOutmgIs7s99Yl/XrtI8hLIthQ1H+KxM0d+YAw5LGrQDQgy0iR2rmuhcG7NUBJyhA1AOx006EaAG1DTQEuw2abm5w== x-ms-office365-filtering-correlation-id: 11fab9ed-862d-46f4-2232-08d6828abcdf x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020);SRVR:VI1PR04MB5455; x-ms-traffictypediagnostic: VI1PR04MB5455: x-microsoft-antispam-prvs: x-forefront-prvs: 0928072091 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(396003)(39860400002)(136003)(366004)(346002)(189003)(199004)(4744005)(6916009)(486006)(4326008)(105586002)(106356001)(52116002)(1076003)(14454004)(2616005)(6486002)(44832011)(6436002)(476003)(316002)(478600001)(25786009)(3846002)(6116002)(2171002)(50226002)(305945005)(7736002)(8936002)(26005)(186003)(256004)(86362001)(54906003)(71190400001)(71200400001)(99286004)(102836004)(36756003)(2906002)(386003)(6512007)(97736004)(8676002)(81156014)(81166006)(66066001)(68736007)(6506007)(53936002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB5455;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: xRGVpL8S4kY+1jyizqtdQLu6JVyk8ntjYwgdPqZJR67NbWjvJeNpuKsepXuxbf9hjyQt+r123WWLjw+sS2j2PXOpYBDORihwMVAeiRP4PFw9XQae9RRHnlVfgx6snZfHyKHevIK1BQL2qlgV45RZpc6E8IghF0GgkcU+sVBA3V8KOaJHBhc4sG1Tx3xd8XeZJbIDmsVX4Dzpq36q0hBS15RvWYhBd2X7LknB3FgGJ5CjPOSaae88TUY+5MlncGt6Cwu3/uSDCp31mgB0jWWSFKDd+nTp0BJfSxwtTP19aVlkGTVtJZiQJm4p7n1vuDpa0COGGt4dUejMx/qWL8Y7xxUcWbeRDbuJocAIq/HQrXYtuVF9bIHqVMj4RTLqFsVxag7UFjWAx9oLtIxR1SU4DgfMrMY3C1NxPZeodhMPGMs= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11fab9ed-862d-46f4-2232-08d6828abcdf X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jan 2019 06:02:46.6903 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5455 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: Nikhil Badola Set USB_EN bit to select ULPI phy for USB controller version 2.5 Signed-off-by: Nikhil Badola Signed-off-by: Yinbo Zhu Acked-by: Alan Stern --- Change in v4: Incorrect indentation of the continuation line drivers/usb/host/ehci-fsl.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index e3d0c1c..38674b7 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c @@ -122,6 +122,12 @@ static int fsl_ehci_drv_probe(struct platform_device *pdev) tmp |= 0x4; iowrite32be(tmp, hcd->regs + FSL_SOC_USB_CTRL); } + + /* Set USB_EN bit to select ULPI phy for USB controller version 2.5 */ + if (pdata->controller_ver == FSL_USB_VER_2_5 && + pdata->phy_mode == FSL_USB2_PHY_ULPI) + iowrite32be(USB_CTRL_USB_EN, hcd->regs + FSL_SOC_USB_CTRL); + /* * Enable UTMI phy and program PTS field in UTMI mode before asserting * controller reset for USB Controller version 2.5 From patchwork Fri Jan 25 06:02:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinbo Zhu X-Patchwork-Id: 10780595 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 53296746 for ; Fri, 25 Jan 2019 06:03:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E04F212DA for ; Fri, 25 Jan 2019 06:03:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EED029A72; Fri, 25 Jan 2019 06:03:59 +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 9DA47212DA for ; Fri, 25 Jan 2019 06:03:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727028AbfAYGDo (ORCPT ); Fri, 25 Jan 2019 01:03:44 -0500 Received: from mail-eopbgr00079.outbound.protection.outlook.com ([40.107.0.79]:49753 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726097AbfAYGDl (ORCPT ); Fri, 25 Jan 2019 01:03:41 -0500 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=NrIrxG/4vatlyji+mL63j0o3lNCoAPqVETdonTkdUWs=; b=ljRLu5HOpiY3J4iew7ERc7ez2sv1u8w87mV96w7Hzqz/ZUEJyWhjzivoPIUt8WeLSW/Bq2RZiB230y2sqwORfoP9Bw7zzuAQK0yp8O1PWcgiL6jTK6acdXpCfSARZnELxh1z0nVZH2az688Q5U0VlA1CB/kwHZvO4jpq5gh5GaQ= Received: from VI1PR04MB4158.eurprd04.prod.outlook.com (52.133.15.33) by VI1PR04MB5455.eurprd04.prod.outlook.com (20.178.121.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.18; Fri, 25 Jan 2019 06:02:57 +0000 Received: from VI1PR04MB4158.eurprd04.prod.outlook.com ([fe80::257e:f28a:1a8c:c9c4]) by VI1PR04MB4158.eurprd04.prod.outlook.com ([fe80::257e:f28a:1a8c:c9c4%2]) with mapi id 15.20.1537.031; Fri, 25 Jan 2019 06:02:57 +0000 From: Yinbo Zhu To: Alan Stern CC: Yinbo Zhu , Xiaobo Xie , Jerry Huang , Ran Wang , Greg Kroah-Hartman , Ramneek Mehresh , Nikhil Badola , Suresh Gupta , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Suresh Gupta Subject: [PATCH v4 2/5] usb: phy: Workaround for USB erratum-A005728 Thread-Topic: [PATCH v4 2/5] usb: phy: Workaround for USB erratum-A005728 Thread-Index: AQHUtHOesohGAmkVu06RgZ2b3quwfA== Date: Fri, 25 Jan 2019 06:02:57 +0000 Message-ID: <20190125060356.14294-2-yinbo.zhu@nxp.com> References: <20190125060356.14294-1-yinbo.zhu@nxp.com> In-Reply-To: <20190125060356.14294-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: HK2PR02CA0145.apcprd02.prod.outlook.com (2603:1096:202:16::29) 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-microsoft-exchange-diagnostics: 1;VI1PR04MB5455;6:bxcl8qTKuf936wjOaEpC5lA1nNYQzGfn5AcvgwHNjNT8t3G0bYb1CZ1UlsjN7lRBqHS2fcABefTnHC0FiOnDdv7n/RR6+vZX28RBlJAVXJeH5c3ztYQIyM/bshZq2jlcsV2Tuyv+zeZstVZBmGUofuJdtfxiefnFgxYyakZG/3TYTpazdEJ/Gpum7Z765ql6MTXUb6NPODuOI+jhMnS8AJ0SRghXatU4/uJWnAmRu3s+7twdiLG9B6FuUoWBq3sXupsiXhwy/M3SEEHB/ner1Ed1rCvZX4dvOZgbyyprDhFKHmJJRFMx9IcATnlOkJqSw++SSUR/5hnJMiRCB8QLWgPRUwvaOSU8WQ1gsVAi1LYBgE6d/FU7bKvKR3OQfQ/c1pzjswQzBrBA88miJ4In7r7NsKj9c/wFC/R1Oh369KBP4jllViAQwC22KllCMqP6D/HgKhm1AJztETQ9DRvACg==;5:VbchI1j6TN4T4q3ghSBOU31cFuau8+2ZxL7X+4d9C7YWt5+OXaBVo/hMsUFJPyrx4vowhrpRHuFHpbjsDX0amRxGECttI0KsOnYvvRUSuh7OxIaYI8Gw8eTZIYBg5FEpZjggVuJJMH+RXf0nJsAry+hbTcviMt+1EmvPfQWadecwY8XyWA6V7pnKJ3LHKwDs8oVJbh5BJruCuMmnFWz8rQ==;7:rO23CQABg4Zss+VOQarehnDFjqhWYJXNKnOcwew9GMLtK6ei4rC+goFZUFuRRaUPiCa1Snnz/0vFkcFWoCgeXZAoyH2uTElvEtVPo8DbAMs2TA0z3h9n8pUhtEu32cfPaIbl71sHdKDjhsLbe14rkA== x-ms-office365-filtering-correlation-id: 33078a64-21b0-441b-5a0d-08d6828ac0a2 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020);SRVR:VI1PR04MB5455; x-ms-traffictypediagnostic: VI1PR04MB5455: x-microsoft-antispam-prvs: x-forefront-prvs: 0928072091 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(396003)(39860400002)(136003)(366004)(346002)(189003)(199004)(6916009)(486006)(4326008)(105586002)(106356001)(52116002)(1076003)(14454004)(2616005)(6486002)(446003)(44832011)(76176011)(11346002)(6436002)(476003)(316002)(478600001)(25786009)(3846002)(107886003)(6116002)(2171002)(50226002)(305945005)(7736002)(8936002)(26005)(186003)(256004)(86362001)(54906003)(71190400001)(71200400001)(99286004)(102836004)(36756003)(2906002)(386003)(6512007)(97736004)(8676002)(81156014)(81166006)(66066001)(68736007)(6506007)(53936002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB5455;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: i7CR+Ud2yl3NqH5wL/XNy7OU0pUAluBs8NrM+IzW4UqMrH3Lw/ikRxm14L8hX6uLGYgCzNbjMNC7oJO0qdihsqBFd4mKpUEACrsKoj4Sm1j8nV3T9I5eZofK9+7aVuGT0xLerQk7AKKTWIx8Sf5+T+SLHebuORBEdhhrisFy9XaPYJszYhFjH0gcQmi/oawHYcRIPWiBO7qdLcfoGM3OvFrwyoFn1uIDNEPUglS8eJLm/nfdu0enGl6dm8J7lApsUosDBH+2mh4e5z5sME6aYxEwCWh11mW9XydqR3qDNfJx6fw9+I2sU/geRDHlSzKis03U85Uisjws0u/jaOvVEPMM36hv1IAqw5pJyXBW3c4EpolzwB4dnJUmgIB8wiz29nrvTDoyOSR7p7iRSOJ4TslVtzTr4/wjSWx/9noEXRk= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 33078a64-21b0-441b-5a0d-08d6828ac0a2 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jan 2019 06:02:51.7685 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5455 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: Suresh Gupta PHY_CLK_VALID bit for UTMI PHY in USBDR does not set even if PHY is providing valid clock. Workaround for this involves resetting of PHY and check PHY_CLK_VALID bit multiple times. If PHY_CLK_VALID bit is still not set even after 5 retries, it would be safe to deaclare that PHY clock is not available. This erratum is applicable for USBDR less then ver 2.4. Signed-off-by: Suresh Gupta Signed-off-by: Yinbo Zhu --- Change in v4: Incorrect indentation of the continuation line. replace pr_err with dev_err. drivers/usb/host/ehci-fsl.c | 38 +++++++++++++++++++++++++++----------- drivers/usb/host/ehci-fsl.h | 3 +++ 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index 38674b7..373a816 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c @@ -183,6 +183,17 @@ static int fsl_ehci_drv_probe(struct platform_device *pdev) return retval; } +static bool usb_phy_clk_valid(struct usb_hcd *hcd) +{ + void __iomem *non_ehci = hcd->regs; + bool ret = true; + + if (!(ioread32be(non_ehci + FSL_SOC_USB_CTRL) & PHY_CLK_VALID)) + ret = false; + + return ret; +} + static int ehci_fsl_setup_phy(struct usb_hcd *hcd, enum fsl_usb2_phy_modes phy_mode, unsigned int port_offset) @@ -226,6 +237,17 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd, /* fall through */ case FSL_USB2_PHY_UTMI: 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 + * internal UTMI phy + */ + if (pdata->controller_ver > FSL_USB_VER_2_4 && + pdata->have_sysif_regs && !usb_phy_clk_valid(hcd)) { + dev_err(dev, + "%s: USB PHY clock invalid\n", dev_name(dev)); + return -EINVAL; + } + if (pdata->have_sysif_regs && pdata->controller_ver) { /* controller version 1.6 or above */ tmp = ioread32be(non_ehci + FSL_SOC_USB_CTRL); @@ -249,17 +271,11 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd, break; } - /* - * check PHY_CLK_VALID to determine phy clock presence before writing - * to portsc - */ - if (pdata->check_phy_clk_valid) { - if (!(ioread32be(non_ehci + FSL_SOC_USB_CTRL) & - PHY_CLK_VALID)) { - dev_warn(hcd->self.controller, - "USB PHY clock invalid\n"); - return -EINVAL; - } + if (pdata->have_sysif_regs && + pdata->controller_ver > FSL_USB_VER_1_6 && + !usb_phy_clk_valid(hcd)) { + dev_warn(hcd->self.controller, "USB PHY clock invalid\n"); + return -EINVAL; } ehci_writel(ehci, portsc, &ehci->regs->port_status[port_offset]); diff --git a/drivers/usb/host/ehci-fsl.h b/drivers/usb/host/ehci-fsl.h index cbc4220..9d18c6e 100644 --- a/drivers/usb/host/ehci-fsl.h +++ b/drivers/usb/host/ehci-fsl.h @@ -50,4 +50,7 @@ #define UTMI_PHY_EN (1<<9) #define ULPI_PHY_CLK_SEL (1<<10) #define PHY_CLK_VALID (1<<17) + +/* Retry count for checking UTMI PHY CLK validity */ +#define UTMI_PHY_CLK_VALID_CHK_RETRY 5 #endif /* _EHCI_FSL_H */ From patchwork Fri Jan 25 06:03:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinbo Zhu X-Patchwork-Id: 10780597 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 DE6E3746 for ; Fri, 25 Jan 2019 06:04:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA39E212DA for ; Fri, 25 Jan 2019 06:04:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BDEE729A72; Fri, 25 Jan 2019 06:04:01 +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 6989E212DA for ; Fri, 25 Jan 2019 06:04:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726802AbfAYGDk (ORCPT ); Fri, 25 Jan 2019 01:03:40 -0500 Received: from mail-eopbgr00076.outbound.protection.outlook.com ([40.107.0.76]:34823 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726762AbfAYGDj (ORCPT ); Fri, 25 Jan 2019 01:03:39 -0500 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=5YWWhoInCsJh4SQFgZgXENVYHvb7fYb+VJa++Q5qwBY=; b=pi611JESlN2BZSscdJxtAlxtF5vSkmITOoXSTp3yiNB7Y6kd1S4z/EAUW0KW1PQNzDZ3sc6fzkKq77jZpRsNwMca+MrVLyxNABp8yVwcHbPgreaXh4glnxRX5PX2892Q4hd0dYy4BdDJMf3EA6VhxHaB5Ggw6yEhqzD/yajNlCw= Received: from VI1PR04MB4158.eurprd04.prod.outlook.com (52.133.15.33) by VI1PR04MB5455.eurprd04.prod.outlook.com (20.178.121.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.18; Fri, 25 Jan 2019 06:03:01 +0000 Received: from VI1PR04MB4158.eurprd04.prod.outlook.com ([fe80::257e:f28a:1a8c:c9c4]) by VI1PR04MB4158.eurprd04.prod.outlook.com ([fe80::257e:f28a:1a8c:c9c4%2]) with mapi id 15.20.1537.031; Fri, 25 Jan 2019 06:03:01 +0000 From: Yinbo Zhu To: Alan Stern CC: Yinbo Zhu , Xiaobo Xie , Jerry Huang , Ran Wang , Greg Kroah-Hartman , Ramneek Mehresh , Nikhil Badola , Suresh Gupta , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH v4 3/5] usb: linux/fsl_device: Add platform member has_fsl_erratum_a006918 Thread-Topic: [PATCH v4 3/5] usb: linux/fsl_device: Add platform member has_fsl_erratum_a006918 Thread-Index: AQHUtHOhli28NA5iwEy8ppr9lv9SVg== Date: Fri, 25 Jan 2019 06:03:01 +0000 Message-ID: <20190125060356.14294-3-yinbo.zhu@nxp.com> References: <20190125060356.14294-1-yinbo.zhu@nxp.com> In-Reply-To: <20190125060356.14294-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: HK2PR02CA0145.apcprd02.prod.outlook.com (2603:1096:202:16::29) 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-microsoft-exchange-diagnostics: 1;VI1PR04MB5455;6:CfwWxea90jR42APyWQU5eNoPfrWf8RkH3AoytHn4SQjmc0cfVNS6LnTlbJNcBFuiccbVzRcGLu0WKrT1DXOP6M+PPYLpYX6MVUEZtFfxAZJ+qu65fGYnQDF+VZ0epmX8nNEvoZTB8jbVZD9LiuOJNBiL/jCb9v6XcxIaaaXUjnzjWiLIhVRsPT9RqEsQrSbxhLFGDa5Znn/EgF8OzPJ7mR1LN/IM0WvmUtKC5YxBt5jYhjXCmL5wGpydM22h7mKqmIy18oRuKPXlIfgQB3VRCkkUXhbZELX5ouB8p8x4k0Qix0ZcZHN2Diq+ZqsZ+U2pEPE9bIqiWna7Su4P6SREILMLAOdowExBj/2ovs2wpHmrFotX2v7b5BUpZ1SKHzc21hBR4y3rGzspW2ZFSSaoxHAyzEFWBLKM+223Eo5powIOXT8HhsgmyYkty+3I2plOemK0WNyb2Bmw6cMupnE4mA==;5:wp96dVOG3P9LKBEBOT8qPLqHh+WNJ722+S3yFI5JbWTz4sb34l6LgcsZR86/yFBh6biZJ7RvI7QoFRME9uRAAfql9AYnD7tbvmCFCXDx27RhxhVKH/mHO031bdcBe4yFb9mbX0xEtztHB+EZmJvvPzZlY0XIpHi9QyBh5if2CLs4zLNk+g/jpwHu+vq5BVIo7UOFOOTUMAiHmiJ7YDf7IA==;7:pB9eeAlhbF8tWEx7bH8m+JR7UMq9tWxdlpFq/oDXVnvYSmvIwhAADffYicOOY0cRQI4tOHN10PP+eqjmE+MyuSo2OIYmm+9mj+H+ttovqJJJ9eXd26c97FZnnx4fWXUH/iMJviY44A4GL6ich/bFxA== x-ms-office365-filtering-correlation-id: 6bd075db-8ef4-4154-9e44-08d6828ac34e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020);SRVR:VI1PR04MB5455; x-ms-traffictypediagnostic: VI1PR04MB5455: x-microsoft-antispam-prvs: x-forefront-prvs: 0928072091 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(979002)(376002)(396003)(39860400002)(136003)(366004)(346002)(189003)(199004)(4744005)(6916009)(486006)(4326008)(105586002)(106356001)(52116002)(1076003)(14454004)(2616005)(6486002)(446003)(44832011)(76176011)(11346002)(6436002)(476003)(316002)(478600001)(25786009)(3846002)(6116002)(2171002)(50226002)(305945005)(7736002)(8936002)(26005)(186003)(256004)(14444005)(86362001)(54906003)(71190400001)(71200400001)(99286004)(102836004)(36756003)(2906002)(386003)(6512007)(97736004)(8676002)(81156014)(81166006)(66066001)(68736007)(6506007)(53936002)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB5455;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: ONHnf9RYSeFeMylT6Ez2aElp/8VvfnFpc/UOWJrDqPYBprDSNLLeDoqcFOjsvVqu1kztQeb63Vu7iz3/PwG4cFZlKsI1ftQ+b7b6kFUc+zHcuLSPBXLspAMDNsufhUOpHgkiS3GgctKcCv7nntBjl0ZrAX+g6TESsnnQ+DiwjdWkhhxYSsIpZiy2ayI6J31dHYvniVHIh49JgX/hg216AbsctRjWWFNG0za5HUqBI8omw2Ial4KKupBkgvIC0mIVTyv+zkRK0tsUJN1GMxlaSkyO9sDP6f/353k+MK0O3DnFhHz5iCvuJnWiDtLOBQuxQDtsxERCqHDj/xNOVsCk9UKuiI7O1y1qALcd7RFbhiojrA5uQmzlgqMYZvuylb08w7DLzLK7rKK3zaa0TosqA7f+Ex5gHGYa5pJdGu8t5cs= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6bd075db-8ef4-4154-9e44-08d6828ac34e X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jan 2019 06:02:57.4560 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5455 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: Yinbo Zhu This patch is to add member has_fsl_erratum_a006918 in platform data Signed-off-by: Yinbo Zhu --- include/linux/fsl_devices.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index 5da56a6..4c613da 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h @@ -102,6 +102,7 @@ struct fsl_usb2_platform_data { unsigned has_fsl_erratum_14:1; unsigned has_fsl_erratum_a005275:1; unsigned has_fsl_erratum_a005697:1; + unsigned has_fsl_erratum_a006918:1; unsigned check_phy_clk_valid:1; /* register save area for suspend/resume */ From patchwork Fri Jan 25 06:03:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinbo Zhu X-Patchwork-Id: 10780591 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 EF7DC13B5 for ; Fri, 25 Jan 2019 06:03:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCA3D2F327 for ; Fri, 25 Jan 2019 06:03:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF6AD2F32E; Fri, 25 Jan 2019 06:03:45 +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 67C792F327 for ; Fri, 25 Jan 2019 06:03:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726937AbfAYGDn (ORCPT ); Fri, 25 Jan 2019 01:03:43 -0500 Received: from mail-eopbgr00076.outbound.protection.outlook.com ([40.107.0.76]:34823 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726897AbfAYGDn (ORCPT ); Fri, 25 Jan 2019 01:03:43 -0500 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=stMSGU4D2zxXCPDnQBenMF7UzvJa1CpNkFi2MyOpy/4=; b=L2G+c9upj/FL/OE3D3fCcurT91dvgw31n5flYNfUDN2Onu24TkgIW7U2MssLa5lgXMKXKePjVlm/AKMDLCVl+DHnfAriBXk6oyepGtDrGVtPm9oQczGChv3Muf5HWx69M/WdZyMjKUPgEbV7pOtIsMGJTowo9BAD51dARNd7rsg= Received: from VI1PR04MB4158.eurprd04.prod.outlook.com (52.133.15.33) by VI1PR04MB5455.eurprd04.prod.outlook.com (20.178.121.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.18; Fri, 25 Jan 2019 06:03:06 +0000 Received: from VI1PR04MB4158.eurprd04.prod.outlook.com ([fe80::257e:f28a:1a8c:c9c4]) by VI1PR04MB4158.eurprd04.prod.outlook.com ([fe80::257e:f28a:1a8c:c9c4%2]) with mapi id 15.20.1537.031; Fri, 25 Jan 2019 06:03:06 +0000 From: Yinbo Zhu To: Alan Stern CC: Yinbo Zhu , Xiaobo Xie , Jerry Huang , Ran Wang , Greg Kroah-Hartman , Ramneek Mehresh , Nikhil Badola , Suresh Gupta , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH v4 4/5] usb: host: Stops USB controller init if PLL fails to lock Thread-Topic: [PATCH v4 4/5] usb: host: Stops USB controller init if PLL fails to lock Thread-Index: AQHUtHOjEng1K+NiYU6bfiLuvdUQdg== Date: Fri, 25 Jan 2019 06:03:06 +0000 Message-ID: <20190125060356.14294-4-yinbo.zhu@nxp.com> References: <20190125060356.14294-1-yinbo.zhu@nxp.com> In-Reply-To: <20190125060356.14294-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: HK2PR02CA0145.apcprd02.prod.outlook.com (2603:1096:202:16::29) 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-microsoft-exchange-diagnostics: 1;VI1PR04MB5455;6:6ygwJO/VXBeK1WM7usK3mehqyBtq0OnmeEwPid21qZrQrC0J0ZOnEoA4AkhoMAvTcwvRXDQQJ9wQ9HYp5rqtf1Haz2xPVQhh966rgs2G2GzOVyjH5rOG/g5JVstn8lC9/TtKKdtJMgr3gtK5UiQ4dG2pgPv/WLwWA1HBBMSUEUD7DudVp7jspQJy0jcMqYm6pGklxc9qxsKmFgidf4DnhjpW3AguaVeurw/UlUEKG7Dq+aHKspoM2tq6tATDkK4cRk9qQwryhzvMCSKnissx623bl7VgE55JWRnag1SMi3uoN+sV8T50eZCHNNtTlIpQanthzVJEN0NBjEGZfgVESGfrh8vJ32RRUeo7AhTndasQyUVkvzkbi8fxUMIO0FOVNSTIBgGEaVp7QHWUPPkg38GQqvISCyIDZ5QONenM2LrbWzRJRZdpWgYdy95lp5lJ92vBdnq2HmE8DZ0PSWw+hA==;5:EkO23krb6GT9n8eBnYcqyCwJW0eFOh6MMJjsclQx9GoQBakgvjSGYJqAp86SenKFI8uXb5aJAwZolNamo8liVsE9hQL3W+pKQ+XUEm5nFnuqSnoNHbW0k8qDiTXOLWwg1dLzlL2Z+I0g01cUzkU6FNnRX7lrl52ZPXz0OuW4BEG0GgdzwFLt/+vYOdT86/uthvjfdwRdHy1gUH5bfHdjLA==;7:Wt7rUUKsR9t2nXWWpEGt9pxaTA3aBGYngevZGlZ3aPWSZj08W7viibAdbCsj6PyYxvFrA1zy9J3dtORRZuWdOz73ERkxmkuA7nqiDP4HI5Ru4wUlwMU9kpNNjE/YlCeSB0nwAkruQvlJ9Kbm5UOfcA== x-ms-office365-filtering-correlation-id: 10137209-9421-4df7-57b8-08d6828ac610 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020);SRVR:VI1PR04MB5455; x-ms-traffictypediagnostic: VI1PR04MB5455: x-microsoft-antispam-prvs: x-forefront-prvs: 0928072091 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(396003)(39860400002)(136003)(366004)(346002)(189003)(199004)(6916009)(486006)(4326008)(105586002)(106356001)(52116002)(1076003)(14454004)(2616005)(6486002)(446003)(44832011)(76176011)(11346002)(6436002)(476003)(316002)(478600001)(25786009)(3846002)(6116002)(2171002)(50226002)(305945005)(7736002)(8936002)(26005)(186003)(256004)(14444005)(86362001)(54906003)(71190400001)(71200400001)(99286004)(102836004)(36756003)(2906002)(386003)(6512007)(97736004)(8676002)(81156014)(81166006)(66066001)(68736007)(6506007)(53936002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB5455;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: a2bB3sJ504OnSnFkm/lIXAyXBwOezMpUCDwEf3HIFbxF+a/mL5KtJn/H+WCFMSMJl/lUXdX4aCyKv02ugd9NypznROFiQ1B5V9EVd1lQLcBb0nHzFEsZZ8Fwu6jWKksU8es+zov4EssnhYk3a00TuKJNXwYZo7RS1g4zNgx1xPVOgkm3255VCL98KYW/KrjpungfLzToqTQB0c/AuHD9KEymmUyWrxYHxxCyMsrMMlTmAWsrp0yUCaZokvBbSKwCkg0P1TT/fDThKoNRTULXEJksGsS0HR6UDZ0D1Er2T/FpUhzwFs4tyhMNjbkfwPNUnM5bX/qhO8MyVBQss9IojfvW7vdgtuT8/kQ19mxfG6WB33EMJxKol0eJs5bYdWBWS5oO4qw307ji28h4D8lZI5kQ/IcmpWF1Z7ts3JfYkgI= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 10137209-9421-4df7-57b8-08d6828ac610 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jan 2019 06:03:02.0967 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5455 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 --- 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 373a816..8b47277 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..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 From patchwork Fri Jan 25 06:03:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinbo Zhu X-Patchwork-Id: 10780593 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 1FCE9746 for ; Fri, 25 Jan 2019 06:03:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0975F212DA for ; Fri, 25 Jan 2019 06:03:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB68B29A72; Fri, 25 Jan 2019 06:03:53 +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 7A884212DA for ; Fri, 25 Jan 2019 06:03:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727500AbfAYGDt (ORCPT ); Fri, 25 Jan 2019 01:03:49 -0500 Received: from mail-eopbgr00076.outbound.protection.outlook.com ([40.107.0.76]:34823 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726954AbfAYGDp (ORCPT ); Fri, 25 Jan 2019 01:03:45 -0500 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=G0IKRecnFAAU0wtY0kl/7PEcI9Y+xCrg3ypS1gwNzSA=; b=N3SgetWDWOuI07dC+4DoAALU0SWda0dv1+PIZQlu6bDA7wh4sTR4krQypoPHAv1lw/PdWS+/JwtuFgGYUw2FTwljRwsWhBkTdRdr21adQSV/ueHnYa4TgvAVrjMXqQkjwn0P43PCjbKC1aoRWfauABjjK87hBLhSMBm1YEAiFtM= Received: from VI1PR04MB4158.eurprd04.prod.outlook.com (52.133.15.33) by VI1PR04MB5455.eurprd04.prod.outlook.com (20.178.121.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.18; Fri, 25 Jan 2019 06:03:11 +0000 Received: from VI1PR04MB4158.eurprd04.prod.outlook.com ([fe80::257e:f28a:1a8c:c9c4]) by VI1PR04MB4158.eurprd04.prod.outlook.com ([fe80::257e:f28a:1a8c:c9c4%2]) with mapi id 15.20.1537.031; Fri, 25 Jan 2019 06:03:11 +0000 From: Yinbo Zhu To: Alan Stern CC: Yinbo Zhu , Xiaobo Xie , Jerry Huang , Ran Wang , Greg Kroah-Hartman , Ramneek Mehresh , Nikhil Badola , Suresh Gupta , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH v4 5/5] usb :fsl: Change string format for errata property Thread-Topic: [PATCH v4 5/5] usb :fsl: Change string format for errata property Thread-Index: AQHUtHOmPG3RGfu/2069HGSKVx2OYw== Date: Fri, 25 Jan 2019 06:03:11 +0000 Message-ID: <20190125060356.14294-5-yinbo.zhu@nxp.com> References: <20190125060356.14294-1-yinbo.zhu@nxp.com> In-Reply-To: <20190125060356.14294-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: HK2PR02CA0145.apcprd02.prod.outlook.com (2603:1096:202:16::29) 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-microsoft-exchange-diagnostics: 1;VI1PR04MB5455;6:q79+oDYQUNZsWANHZwd++M2e9L2JVsegJV1UPVAuDk2x869EXIIq7pxqndnXWhR+qaA70NZb9ft/DLMlXbCkwXyI5iC+QUhzBQJhKzjEszRouROPLafOlvTB/r/hx5+XGPNTmCMQTnTpEingqp/tuGWcNjWvAUiLxTG8WQmMjfRm2r+NfaTmIbMFNzrHwZrAY5rqi9QMo7awFY5wOC0LHZYL3fgL54Aokz2H72y6T4Zj2eJnnqK6WNfZAtPngprEmDEUlUWbwKBrSdZ2P33xwLNTaFlueJRhoA8Hg1dgw54PZlKJmkOjO2Z7bU1O0QnzV56+4cJX8575rAD/AqGSU6PxoVWscgar1J+LNWB0B9uV5iGSjn0ItWcdRNXLTKTxsUc7DJHynEH2vjpTWWTND9zCJEBvvzUbHgMmCwnV5+kr7/MhDi0AE2/KzFXspHfiDPU6ppmZmC4UpdrlbdWy0A==;5:yXkiSz0eIAAwZYg7Ri6lOowI+g9n8AnykFSJpIg8vSZCNmYzjDO3l8EJe5k/4UCWGJz4eWvk1mZd0zE9mk5ualGJlLsbMlHXy+yj8urz9mI4pwBusZ5XYlzgzhw/FTTqldVyASXDngxWDaW7SWCqYN6w8ToSmBfwVKxb4jPYivavI+AXjiFMDwcePiRHPiC/h6B90aoJzzeonPfIoBy49A==;7:RyaV2eVmDfzcaRcNo+00Gjye2/rZ4sxW229/QAa24Dkf3VNccmBVCAN3waKUbiz+u7f5m7pDzq3/7zdBWoCi/57unpER47P7YtMSpPKZHPiJDOH6gI05R/By95C8WyzftHKJc36DuTpiP25KjEZYRQ== x-ms-office365-filtering-correlation-id: 17b4ad8c-2100-475f-5f3d-08d6828ac8e0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020);SRVR:VI1PR04MB5455; x-ms-traffictypediagnostic: VI1PR04MB5455: x-microsoft-antispam-prvs: x-forefront-prvs: 0928072091 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(396003)(39860400002)(136003)(366004)(346002)(189003)(199004)(6916009)(486006)(4326008)(105586002)(106356001)(52116002)(1076003)(14454004)(2616005)(6486002)(446003)(44832011)(76176011)(11346002)(6436002)(476003)(316002)(478600001)(25786009)(3846002)(6116002)(2171002)(50226002)(305945005)(7736002)(8936002)(26005)(186003)(256004)(86362001)(54906003)(71190400001)(71200400001)(99286004)(102836004)(36756003)(2906002)(386003)(6512007)(97736004)(8676002)(81156014)(81166006)(66066001)(68736007)(6506007)(53936002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB5455;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: cu38dJMtrUmsy4ar8Br5SAWmnMsPI860130nN1YlhoNs1j1NBR7AJVEcjkNy28iNGu3/uFB1SqxFV8Kn0zjOW7flK/flrV0E4TVWluJbbKOkdHAuy8H+He7ccRDpYhlgqxtmpwQqnIMBYdtLUwlRvR+4a2ZE7L54CLgxwJZv645rCzucDB1THVRbpwDgNml7cL9Tzw4YXmp1fNlxxnaasydswmpRhr/HaBQkFFYeblcEJTiIT7/0T+zLe+jKhaUSpmWVFU4wAGqQaQ0IfmodlCeO9X7Qv6cJzJXcNzFy9uK3NYNyZPNaUDZ47C8IiqYd+YX2AlMW0lpjfoL7hq71Gj0UpI4BIelxgltyRrQC6YCGUA5xZQ3XImwzdWrh4tMWzOyOGAWDR7O7MpJvnxEUS5d115nuiMfxxZXGuwF3Qs0= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 17b4ad8c-2100-475f-5f3d-08d6828ac8e0 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jan 2019 06:03:06.5186 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5455 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: Nikhil Badola Remove USB errata checking code from driver. Applicability of erratum is retrieved by reading corresponding property in device tree. This property is written during device tree fixup. Signed-off-by: Ramneek Mehresh Signed-off-by: Nikhil Badola Signed-off-by: Yinbo Zhu --- drivers/usb/host/fsl-mph-dr-of.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c index 762b976..ae8f60f 100644 --- a/drivers/usb/host/fsl-mph-dr-of.c +++ b/drivers/usb/host/fsl-mph-dr-of.c @@ -226,11 +226,8 @@ static int fsl_usb2_mph_dr_of_probe(struct platform_device *ofdev) 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; + pdata->has_fsl_erratum_14 = + of_property_read_bool(np, "fsl,usb_erratum-14"); /* * Determine whether phy_clk_valid needs to be checked