From patchwork Tue Jan 8 06:04:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ran Wang X-Patchwork-Id: 10751465 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 8C82213B4 for ; Tue, 8 Jan 2019 06:04:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B4B128B18 for ; Tue, 8 Jan 2019 06:04:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FA3728B26; Tue, 8 Jan 2019 06:04:41 +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 EE67228B18 for ; Tue, 8 Jan 2019 06:04:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727878AbfAHGEf (ORCPT ); Tue, 8 Jan 2019 01:04:35 -0500 Received: from mail-eopbgr10049.outbound.protection.outlook.com ([40.107.1.49]:38188 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727831AbfAHGEe (ORCPT ); Tue, 8 Jan 2019 01:04:34 -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=dFQEZhckWRmIWiBApFW50QSsHMlZ8CUuEZuECppRnuA=; b=SpL0QW1hGVRRcjsYiyTVEVtzy8dlSK7l5/K3RK0QVDxggI8MXYCxINn2l/LawBDdDX9DzbDE0U71pVMT2SwuB1Yrd1MrTIyJ5cSCO62xDR57YeK92c+2TC7ylSoV+gmPslgT7V5QkztjLjNsIndMXpY/mSjq//uuraXZu0klfrU= Received: from AM5PR0402MB2865.eurprd04.prod.outlook.com (10.175.41.148) by AM5PR0402MB2915.eurprd04.prod.outlook.com (10.175.42.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1516.13; Tue, 8 Jan 2019 06:04:29 +0000 Received: from AM5PR0402MB2865.eurprd04.prod.outlook.com ([fe80::1c0c:51da:f585:5626]) by AM5PR0402MB2865.eurprd04.prod.outlook.com ([fe80::1c0c:51da:f585:5626%2]) with mapi id 15.20.1495.011; Tue, 8 Jan 2019 06:04:29 +0000 From: Ran Wang To: Greg Kroah-Hartman , Alan Stern CC: "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Yinbo Zhu , Ran Wang Subject: [PATCH 3/3] drivers: usb :fsl: Remove USB Errata checking code Thread-Topic: [PATCH 3/3] drivers: usb :fsl: Remove USB Errata checking code Thread-Index: AQHUpxgE3SCqMwWaSU2qZS5l4UGPMA== Date: Tue, 8 Jan 2019 06:04:29 +0000 Message-ID: <20190108060426.11581-3-ran.wang_1@nxp.com> References: <20190108060426.11581-1-ran.wang_1@nxp.com> In-Reply-To: <20190108060426.11581-1-ran.wang_1@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR01CA0014.apcprd01.prod.exchangelabs.com (2603:1096:203:92::26) To AM5PR0402MB2865.eurprd04.prod.outlook.com (2603:10a6:203:99::20) authentication-results: spf=none (sender IP is ) smtp.mailfrom=ran.wang_1@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;AM5PR0402MB2915;6:kXcS879goJAnoTMa/evy+f/2Y1ARU++/kpZzZAC8YBj2OLdqyn+t2zVhpsA3UZkNguEe5/bfhsgdt7Q5M7yIBToTZXZ5AvFl5k8+mgpTYPVzX35FIfeUVSM9wPHuDFmqoKzxvUla7xTqv3HTHgV4/t7/wMxs9O2Lz4T5qLHeROdwyVjcWXlb8IHN5WC+bO5mSdPK09TXtLVcOL3Wz0m/hvdAO7MljZHX+7k9fjfWzjvYLpDFUbRtx5v0E0BleG32YhHI3MeuSze6x0ujmB7Dpj5zdnoih4DL3hhDDqbPPSdeYIH9x7KSWsqOv/12GOEDOjrfkG08jmjNsPPCj6zAZVxpDVRDUKnc7Y8JQ91QZ5fKw+MLoTPj5zVFrCT/3iy1TuQfCPGNWWQMOHcDF4bDjL2Dh/7ZDz5EDTfT7Lot8wCWZjZdDdgpiO+xEmKnZ/B/3sjHipESkrQTHb3WbIe4ew==;5:aLmcwValxqs5sQeiV/wA+RCykGV13eX+r6clOwR2bSBjxdw9OTDJ5BQdq5pTQ1eYbp/M5vA0xvDT52Jmtbj5tE4rDBttM2/c3KoqE9fSRISDbQqL1LgbUcLsF50FwdmeIpc9Xx6R14DDzM4o/qNdyu4f7WvAf7ot1IAg92eOaDu0UNQAqd4tGxmZC/qmlUOaZoIdLkd9cdpxqemL4cueOg==;7:OqXGtVBSlzP26iogidGn8eBTutnTqWHtscuQXpI8vsTzUMcn9DP5QuLGxtVZbTOWkm57B5Gqxo1bj3V6v2rpUacZHl/YOrfT3WIonP9sHMHFFczFxdC52OPlJUk/ETqNSa9Cdf5BR/wFjTWn01Z7bg== x-ms-office365-filtering-correlation-id: e2e168d0-36d8-4769-56bd-08d6752f26a3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM5PR0402MB2915; x-ms-traffictypediagnostic: AM5PR0402MB2915: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(10201501046)(3002001)(3231475)(944501520)(52105112)(93006095)(93001095)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201708071742011)(7699051)(76991095);SRVR:AM5PR0402MB2915;BCL:0;PCL:0;RULEID:;SRVR:AM5PR0402MB2915; x-forefront-prvs: 0911D5CE78 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(396003)(346002)(376002)(366004)(136003)(199004)(189003)(68736007)(97736004)(36756003)(478600001)(66066001)(476003)(81156014)(81166006)(25786009)(6436002)(8676002)(2616005)(446003)(11346002)(54906003)(6486002)(110136005)(186003)(1076003)(14444005)(106356001)(256004)(105586002)(2906002)(3846002)(71200400001)(6116002)(486006)(7736002)(71190400001)(14454004)(2171002)(50226002)(4326008)(5660300001)(99286004)(305945005)(102836004)(76176011)(53936002)(52116002)(386003)(6506007)(26005)(8936002)(316002)(86362001)(6512007);DIR:OUT;SFP:1101;SCL:1;SRVR:AM5PR0402MB2915;H:AM5PR0402MB2865.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX: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: t8fbkTOzBhaD6cvvMCD5lmCUFWOeqfNBsWVUdRzXTMBDm89I8ONR4fz/zn8pxZTiUmXOmP/9JgGtHzWYK4nlttLasjMzVEdt5WsXyNmeCVgYZK+5dm7vcEHSLFcdZK6oo4LvJrl80j0C4b0r9FjJfkU+xauUVGUL+YbOZLGS3CUEY83cuAjbuAt0F8t1D88YApYyG2vUXnTk795zKmfnGN0qS9N97XTHjqu81EDj3bqjBmk5ymoZfNVwbBH6ZnA1GWhPsAZ9UB+19LpBP6FUuwu0ZvUupFfAdWH77GZ2UU6j+6QJUcUNmue6TpDG2KXA spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e2e168d0-36d8-4769-56bd-08d6752f26a3 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2019 06:04:26.8830 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0402MB2915 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 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 Signed-off-by: Ran Wang --- drivers/usb/host/ehci-fsl.c | 7 +------ drivers/usb/host/fsl-mph-dr-of.c | 6 ++++++ include/linux/fsl_devices.h | 7 ++++--- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index 59ebe1b..2aa408a 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c @@ -304,14 +304,9 @@ static int ehci_fsl_usb_setup(struct ehci_hcd *ehci) return -EINVAL; if (pdata->operating_mode == FSL_USB2_MPH_HOST) { - unsigned int chip, rev, svr; - - svr = mfspr(SPRN_SVR); - chip = svr >> 16; - rev = (svr >> 4) & 0xf; /* Deal with USB Erratum #14 on MPC834x Rev 1.0 & 1.1 chips */ - if ((rev == 1) && (chip >= 0x8050) && (chip <= 0x8055)) + if (pdata->has_fsl_erratum_14 == 1) ehci->has_fsl_port_bug = 1; if (pdata->port_enables & FSL_USB2_PORT0_ENABLED) diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c index 677f9d5..4f8b8a0 100644 --- a/drivers/usb/host/fsl-mph-dr-of.c +++ b/drivers/usb/host/fsl-mph-dr-of.c @@ -225,6 +225,12 @@ 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,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 diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index 60cef82..7aa51bc 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h @@ -98,10 +98,11 @@ struct fsl_usb2_platform_data { unsigned suspended:1; unsigned already_suspended:1; - unsigned has_fsl_erratum_a007792:1; - unsigned has_fsl_erratum_a005275:1; + unsigned has_fsl_erratum_a007792:1; + unsigned has_fsl_erratum_14:1; + unsigned has_fsl_erratum_a005275:1; unsigned has_fsl_erratum_a005697:1; - unsigned check_phy_clk_valid:1; + unsigned check_phy_clk_valid:1; /* register save area for suspend/resume */ u32 pm_command;