From patchwork Thu Jan 17 09:10:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ran Wang X-Patchwork-Id: 10767783 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 7CC106C5 for ; Thu, 17 Jan 2019 09:11:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B9842E838 for ; Thu, 17 Jan 2019 09:11:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C74D2E859; Thu, 17 Jan 2019 09:11:30 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI 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 283752E838 for ; Thu, 17 Jan 2019 09:11:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728056AbfAQJK4 (ORCPT ); Thu, 17 Jan 2019 04:10:56 -0500 Received: from mail-eopbgr40085.outbound.protection.outlook.com ([40.107.4.85]:45177 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725894AbfAQJK4 (ORCPT ); Thu, 17 Jan 2019 04:10: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=NDuJVbyFgpv3DviJ6gckzI5GGNDQ1uEcSXcOk/VpdnM=; b=fUxQeKqQi2U/P5Js/tsf4y7qnVUebWHEJJSikNpbYqkrMaXPJFl1+DTk0lhbyFUE/rs6pdBNnuqlnWbHtbxoJk9kqQTaJC7Y/XZIfrZxTgRkzrxwXTNNmdgrrAw64sZC6gF/vfSDthZKgubeAqpj5O251W2qUUYeOrZko/KeAHA= Received: from AM5PR0402MB2865.eurprd04.prod.outlook.com (10.175.41.148) by AM5PR0402MB2900.eurprd04.prod.outlook.com (10.175.42.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1537.24; Thu, 17 Jan 2019 09:10:50 +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.1537.018; Thu, 17 Jan 2019 09:10:50 +0000 From: Ran Wang To: Greg Kroah-Hartman , Alan Stern CC: "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Ran Wang Subject: [PATCH v2 1/3] usb: ehci: fsl: Update register accessing for arm/arm64 platforms Thread-Topic: [PATCH v2 1/3] usb: ehci: fsl: Update register accessing for arm/arm64 platforms Thread-Index: AQHUrkSK5gjXIA2AjUOFpVeBl/CheA== Date: Thu, 17 Jan 2019 09:10:50 +0000 Message-ID: <20190117091135.44209-1-ran.wang_1@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0043.apcprd03.prod.outlook.com (2603:1096:203:2f::31) 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;AM5PR0402MB2900;6:3WRzUqQIwfHrPf2eNiVcUYCgg4c/sVYTC9axSMhvYVUtdIKAO7E3xECxGUl5jRli8/OGYwDCAoa8WYN/DeWk8f65BimiNMD/7/p6G1gLbEsiRU4f5+dqNlXlP+mw4CHZ3+LwDIvhnUVSrzTJdimWbAo/XWdCV/WIv90e8S7fWoWM1mTjHPyCr99x3TQekjQfmxukLHDLbVYt6QwoPeMpLSyZG4Ymqovtg26oxBEJ127DHf8P3AHK/6LXzEExCE9SRtNaf9CZ2Qq/P63cELlMWfDzsXlxNml9mpB+J1W75zQjd9g2aKBvZT1rePlEuXhNsLi5QUYl6dR+iNsrlMgL0LxaWCqzoqxjAaftYAgrysbv09hNHZyAZfTg8Gmz4tKqJWP0GD60NJSZT/WCYx3vfNro1KPzMNqYpBx5QhtEjn4adTOPwQpj5M6AY+T8z2Ad1e6rlPhy48WNOgmtb6n5RQ==;5:UnFwoNgd0ueB+7XFlWx0p2YYar6Kuv14TIISMxDHdIvGzjHBIUHou4BT1BdF+YPs+3AinwC6E9ZMz4ZMN+Ou6IB9dJikZA8hAryohVrDbnjb2WxaX2rgfd++mbLIu0v3BFooADx3QuXHxwE5rDPNRCj1avvOHlcrn4fT9w+VS7mrnc16DeS3Fi2JFogV6IVjeII5mwabAtbe7s4APzSD8g==;7:tOG9tGZ3sGkdDZ27p4rQe88VKaR4wgn5g4fJSpKwmP292hzLszIGhNM+Hk6J2wmzBwUFl4PlPuD9NtCuCdqWM+l+8ytSt8yoE5ahtRIfA9iB0oFkWa462BcJ+3U/zcVIV2dbOf0DMf1rnYeWvjGCzw== x-ms-office365-filtering-correlation-id: 8702782d-a0be-4cef-b8a6-08d67c5bacb7 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:AM5PR0402MB2900; x-ms-traffictypediagnostic: AM5PR0402MB2900: x-microsoft-antispam-prvs: x-forefront-prvs: 0920602B08 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(346002)(39860400002)(136003)(396003)(376002)(189003)(199004)(102836004)(26005)(2616005)(476003)(2906002)(478600001)(14454004)(6506007)(386003)(71200400001)(71190400001)(1076003)(105586002)(6486002)(106356001)(186003)(52116002)(6436002)(86362001)(50226002)(110136005)(68736007)(66066001)(3846002)(6116002)(8936002)(256004)(81156014)(81166006)(8676002)(54906003)(305945005)(316002)(7736002)(5660300001)(97736004)(4326008)(2171002)(25786009)(99286004)(53936002)(6512007)(14444005)(36756003)(486006);DIR:OUT;SFP:1101;SCL:1;SRVR:AM5PR0402MB2900;H:AM5PR0402MB2865.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: N4WXopvRE1aLAZf0zs/Agwmn1OJPo3/k8QDdWrZlUq6I5Y8lUkrprid/DPyssY1jAzYLbZ+HzmwfSujdiLTPKbWJEXAnn9XuvCaXB0k+735ZDN0aFiDsvfG7KEmrYaqUXHh0HVa57e+mycQjDkpNz112dgrAFUsEwZud7DT5kgvRnQ1vRNlK6MA54RbHH6lIInb8Zfj+9ehmC6+OeLz0dLcw0TF6FMM2bypYfBKUhvY1Ow0HuC8Jpz6rXvFMyXRUC391lFX99xtCNhQ3cHU2qFB6hzSoPbH8GaHULX8Ii5WmEuC+nYT2B6ApWq/gpOpU8W/G//pT8NbyLw8JfTKAcWtwZcAYNuUrTJiv/XJMbU+S1TdqPfZ3dZ3hd28pI6bDcaEzr1yZ5KMdvP9aJEpjaishuPUF7kWBF5CQ/TqQZak= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8702782d-a0be-4cef-b8a6-08d67c5bacb7 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jan 2019 09:10:48.1246 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0402MB2900 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 arm/arm64's io.h doesn't define clrbits32() and clrsetbits_be32(), which causing compile failure on some Layerscape Platforms (such as LS1021A and LS2012A which also integrates FSL EHCI controller). So use ioread32be()/iowrite32be() instead to make it workable on both powerpc and arm. Signed-off-by: Ran Wang Acked-by: Alan Stern --- Changes in v2: - Recover writel() calling in code of handling pdata->has_fsl_erratum_a007792 - Remove unnecessary parens - Move this patch to be first one to avoid breaking the build on ARM. drivers/usb/host/ehci-fsl.c | 62 ++++++++++++++++++++++++++++-------------- 1 files changed, 41 insertions(+), 21 deletions(-) diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index 0a9fd20..0a867d9 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "ehci.h" #include "ehci-fsl.h" @@ -50,6 +51,7 @@ static int fsl_ehci_drv_probe(struct platform_device *pdev) struct resource *res; int irq; int retval; + u32 tmp; pr_debug("initializing FSL-SOC USB Controller\n"); @@ -114,17 +116,22 @@ static int fsl_ehci_drv_probe(struct platform_device *pdev) } /* Enable USB controller, 83xx or 8536 */ - if (pdata->have_sysif_regs && pdata->controller_ver < FSL_USB_VER_1_6) - clrsetbits_be32(hcd->regs + FSL_SOC_USB_CTRL, - CONTROL_REGISTER_W1C_MASK, 0x4); - + if (pdata->have_sysif_regs && pdata->controller_ver < FSL_USB_VER_1_6) { + tmp = ioread32be(hcd->regs + FSL_SOC_USB_CTRL); + tmp &= ~CONTROL_REGISTER_W1C_MASK; + tmp |= 0x4; + iowrite32be(tmp, 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 */ if (pdata->has_fsl_erratum_a007792) { - clrsetbits_be32(hcd->regs + FSL_SOC_USB_CTRL, - CONTROL_REGISTER_W1C_MASK, CTRL_UTMI_PHY_EN); + tmp = ioread32be(hcd->regs + FSL_SOC_USB_CTRL); + tmp &= ~CONTROL_REGISTER_W1C_MASK; + tmp |= CTRL_UTMI_PHY_EN; + iowrite32be(tmp, hcd->regs + FSL_SOC_USB_CTRL); + writel(PORT_PTS_UTMI, hcd->regs + FSL_SOC_USB_PORTSC1); } @@ -174,7 +181,7 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd, enum fsl_usb2_phy_modes phy_mode, unsigned int port_offset) { - u32 portsc; + u32 portsc, tmp; struct ehci_hcd *ehci = hcd_to_ehci(hcd); void __iomem *non_ehci = hcd->regs; struct device *dev = hcd->self.controller; @@ -192,11 +199,16 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd, case FSL_USB2_PHY_ULPI: if (pdata->have_sysif_regs && pdata->controller_ver) { /* controller version 1.6 or above */ - clrbits32(non_ehci + FSL_SOC_USB_CTRL, - CONTROL_REGISTER_W1C_MASK | UTMI_PHY_EN); - clrsetbits_be32(non_ehci + FSL_SOC_USB_CTRL, - CONTROL_REGISTER_W1C_MASK, - ULPI_PHY_CLK_SEL | USB_CTRL_USB_EN); + /* turn off UTMI PHY first */ + tmp = ioread32be(non_ehci + FSL_SOC_USB_CTRL); + tmp &= ~(CONTROL_REGISTER_W1C_MASK | UTMI_PHY_EN); + iowrite32be(tmp, non_ehci + FSL_SOC_USB_CTRL); + + /* then turn on ULPI and enable USB controller */ + tmp = ioread32be(non_ehci + FSL_SOC_USB_CTRL); + tmp &= ~CONTROL_REGISTER_W1C_MASK; + tmp |= ULPI_PHY_CLK_SEL | USB_CTRL_USB_EN; + iowrite32be(tmp, non_ehci + FSL_SOC_USB_CTRL); } portsc |= PORT_PTS_ULPI; break; @@ -210,16 +222,21 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd, case FSL_USB2_PHY_UTMI_DUAL: if (pdata->have_sysif_regs && pdata->controller_ver) { /* controller version 1.6 or above */ - clrsetbits_be32(non_ehci + FSL_SOC_USB_CTRL, - CONTROL_REGISTER_W1C_MASK, UTMI_PHY_EN); + tmp = ioread32be(non_ehci + FSL_SOC_USB_CTRL); + tmp &= ~CONTROL_REGISTER_W1C_MASK; + tmp |= UTMI_PHY_EN; + iowrite32be(tmp, non_ehci + FSL_SOC_USB_CTRL); + mdelay(FSL_UTMI_PHY_DLY); /* Delay for UTMI PHY CLK to become stable - 10ms*/ } /* enable UTMI PHY */ - if (pdata->have_sysif_regs) - clrsetbits_be32(non_ehci + FSL_SOC_USB_CTRL, - CONTROL_REGISTER_W1C_MASK, - CTRL_UTMI_PHY_EN); + if (pdata->have_sysif_regs) { + tmp = ioread32be(non_ehci + FSL_SOC_USB_CTRL); + tmp &= ~CONTROL_REGISTER_W1C_MASK; + tmp |= CTRL_UTMI_PHY_EN; + iowrite32be(tmp, non_ehci + FSL_SOC_USB_CTRL); + } portsc |= PORT_PTS_UTMI; break; case FSL_USB2_PHY_NONE: @@ -241,9 +258,12 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd, ehci_writel(ehci, portsc, &ehci->regs->port_status[port_offset]); - if (phy_mode != FSL_USB2_PHY_ULPI && pdata->have_sysif_regs) - clrsetbits_be32(non_ehci + FSL_SOC_USB_CTRL, - CONTROL_REGISTER_W1C_MASK, USB_CTRL_USB_EN); + if (phy_mode != FSL_USB2_PHY_ULPI && pdata->have_sysif_regs) { + tmp = ioread32be(non_ehci + FSL_SOC_USB_CTRL); + tmp &= ~CONTROL_REGISTER_W1C_MASK; + tmp |= USB_CTRL_USB_EN; + iowrite32be(tmp, non_ehci + FSL_SOC_USB_CTRL); + } return 0; } From patchwork Thu Jan 17 09:10:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ran Wang X-Patchwork-Id: 10767781 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 0C42913B4 for ; Thu, 17 Jan 2019 09:11:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F10C92E838 for ; Thu, 17 Jan 2019 09:11:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4AB02E859; Thu, 17 Jan 2019 09:11:12 +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 968292E838 for ; Thu, 17 Jan 2019 09:11:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728306AbfAQJK7 (ORCPT ); Thu, 17 Jan 2019 04:10:59 -0500 Received: from mail-eopbgr40085.outbound.protection.outlook.com ([40.107.4.85]:45177 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728095AbfAQJK6 (ORCPT ); Thu, 17 Jan 2019 04:10:58 -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=fBRP1/K/DcpD36V8RMJacst3n6Ifu6hE+oHxJuKrOBg=; b=f8efW4k7sngiIizWMR0ZEe5YdwHk3Z/F33rJGljor75+Rb/mPAbWLWQPfLezSn1yEpPgJcXODObneSYJhJM0ypbmB6s2lvXc9bA6H2xr6T+Gl9TLDdsjk7/yce0INUsbbwaqPQkttPgMw9zXH0rnXu9Cl37msXk1GEP6zLwuOPE= Received: from AM5PR0402MB2865.eurprd04.prod.outlook.com (10.175.41.148) by AM5PR0402MB2900.eurprd04.prod.outlook.com (10.175.42.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1537.24; Thu, 17 Jan 2019 09:10:53 +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.1537.018; Thu, 17 Jan 2019 09:10:53 +0000 From: Ran Wang To: Greg Kroah-Hartman , Alan Stern CC: "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Ran Wang Subject: [PATCH v2 2/3] usb: kconfig: remove dependency FSL_SOC for ehci fsl driver Thread-Topic: [PATCH v2 2/3] usb: kconfig: remove dependency FSL_SOC for ehci fsl driver Thread-Index: AQHUrkSM0ZRSymVk/E62FypFY3Tsfw== Date: Thu, 17 Jan 2019 09:10:53 +0000 Message-ID: <20190117091135.44209-2-ran.wang_1@nxp.com> References: <20190117091135.44209-1-ran.wang_1@nxp.com> In-Reply-To: <20190117091135.44209-1-ran.wang_1@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0043.apcprd03.prod.outlook.com (2603:1096:203:2f::31) 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;AM5PR0402MB2900;6:hDeKKSXG2E/fpqEuGcz/ZOJT35BikVJFy6O6/+STzxRK0TV7+ICcMJ/MEktqzu1N3tnuQ4qBuHDDMBqawuNehhR2mUSCBTUK5OGS3bzo/gLeGyXBQZU5hV8Fv6QgICcq6rU5tciVRghj4TyPELZYTrZj10P6SeMxvAUezjOzYCqRc4GS5wDK0DrpBn9rA8mlqS7O7lHYdNKbcwTmQM8yzMkpM9yOD6k9q9Sgy8pJ05PF/ejTmp1niHwCy+c4zAlNYqj4vrU47eYNpVQUjyZ8c9BtLB7AqQswJmSLc5DwLVOzg8Ujcg5NCVfyaAf6o8lLOUi9KcgqlNlwlTK1eJy21gSjqSNd9vUnzF8CMvOpatVZHv5q84PLvpDFRtf+csgigPhoX4YnHbICYh09aSbUMi6w58ZIkT71kBTlZ4+uDlov3eNtgQMtluvYExpAQjRkLkqUy7sjB3NdDT5Nb5iSEg==;5:AcLM7XojMcOVcHE0wK023WUgIGb7oYKixzwGeBos65GAtpIb2YoXMX0PfkXhRac93gZV+VULVKpfiqS4vvsOjMN+rTw/edvzX66j6V2R2zT4bjrX91z8vRLwqKXgCxpllUr6rKoaiYoZdN08ap/yKiPvhFV7w5JsKR2YCVNmyLujpDLNK25ZHtbVfaYrfA9exB2+agJJynjuRIzk0YTKAg==;7:PQ5ZuWPY9TxvCCQkGXySl+6aloW6ahRpbCn3nSW14OIpE1hrjfBR2/cBxWleCkTDWsfHI119QsFfCGIdgExLXcSbz8wSs3zythGcOZ9x25DE2TOW1xMjQUfGoFqqE8zRoZqgtbx37e/Lg+hcf4g5CQ== x-ms-office365-filtering-correlation-id: fa502b2e-5bbb-4cf3-8779-08d67c5bae47 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:AM5PR0402MB2900; x-ms-traffictypediagnostic: AM5PR0402MB2900: x-microsoft-antispam-prvs: x-forefront-prvs: 0920602B08 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(346002)(39860400002)(136003)(396003)(376002)(189003)(199004)(446003)(102836004)(26005)(2616005)(476003)(11346002)(2906002)(478600001)(14454004)(6506007)(386003)(76176011)(71200400001)(71190400001)(1076003)(105586002)(6486002)(106356001)(186003)(52116002)(6436002)(86362001)(50226002)(110136005)(68736007)(66066001)(3846002)(6116002)(8936002)(256004)(81156014)(81166006)(8676002)(54906003)(305945005)(316002)(7736002)(5660300001)(97736004)(4326008)(2171002)(25786009)(99286004)(53936002)(6512007)(36756003)(486006);DIR:OUT;SFP:1101;SCL:1;SRVR:AM5PR0402MB2900;H:AM5PR0402MB2865.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: myQJ9bHOSrpmo1uJ0VtxMSc6rOVcJC5S0ru77kke9HOnglLmbU/RNqeLdKAbZpQqtq99XLm+mm5Qrnq9FFWjbuo5obgBLAj+HoXU/8wJPzakrd+Ija2DX67GY7DGcz+Z+H8XbXtDpEsPAWLUFwxzdWegTkx+/8WfhJZgKfCutLgBW2Ei61NsEQQUpP6yydvEPQ6Dm4fBXyDi1POMBw8RIHwWlU8x6A2wX3+xwOUnhF3sHrGWjPU/lghTO/ImcJDxhBcLiUNdP7vKHX8Go0gHaZxdWH/5faAuizlGDRGDJTi7KhkR2rBwKwFBryoIdVbKJVjN7OFoC/sQgDTyGLXpGYv+qZHLmUCn6dc+ekWr5HSLt2z1rZ6u4PIGWzLAfttdyyJcI3v7esnXO3a0FHLgJKyDtVOv3958IvOsgL87sms= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fa502b2e-5bbb-4cf3-8779-08d67c5bae47 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jan 2019 09:10:50.7438 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0402MB2900 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 CONFIG_USB_EHCI_FSL is not dependent on FSL_SOC, it can be built on non-PPC platforms. Signed-off-by: Rajesh Bhagat Signed-off-by: Ran Wang --- Changes in v2: - remove 'depends on USB_EHCI_HCD' - Move this patch to be second one to avoid breaking the build on ARM. drivers/usb/host/Kconfig | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 16758b1..11db5b2 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -179,8 +179,7 @@ config XPS_USB_HCD_XILINX devices only. config USB_EHCI_FSL - tristate "Support for Freescale PPC on-chip EHCI USB controller" - depends on FSL_SOC + tristate "Support for Freescale on-chip EHCI USB controller" select USB_EHCI_ROOT_HUB_TT ---help--- Variation of ARC USB block used in some Freescale chips. From patchwork Thu Jan 17 09:10:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ran Wang X-Patchwork-Id: 10767779 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 0493C6C5 for ; Thu, 17 Jan 2019 09:11:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E805E2E838 for ; Thu, 17 Jan 2019 09:11:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DBDD52E855; Thu, 17 Jan 2019 09:11:11 +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 BC2442E85E for ; Thu, 17 Jan 2019 09:11:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728389AbfAQJLE (ORCPT ); Thu, 17 Jan 2019 04:11:04 -0500 Received: from mail-eopbgr40085.outbound.protection.outlook.com ([40.107.4.85]:45177 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725894AbfAQJLA (ORCPT ); Thu, 17 Jan 2019 04:11:00 -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=HZyPCHjFs2TaAsK44ofIRN5x+XjAgXPjL2gMQBoN9cs=; b=k8cHyPB4Rt1UifOSzRtfNwUI2RgCYg8gRSnlZ2L7Wm6J2goRgvFAKrK60H+PgPDepOmC7q5X/64DGBPL5bDgz4eZwqbEhVm8LB4NZjur/uapmmkSHM5OXDnoqkhG/lIe4lhe96Tf47WiCMWuHS/CRoJOIW5OS7+LkIO1DPahDfM= Received: from AM5PR0402MB2865.eurprd04.prod.outlook.com (10.175.41.148) by AM5PR0402MB2900.eurprd04.prod.outlook.com (10.175.42.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1537.24; Thu, 17 Jan 2019 09:10:56 +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.1537.018; Thu, 17 Jan 2019 09:10:56 +0000 From: Ran Wang To: Greg Kroah-Hartman , Alan Stern CC: "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Ran Wang Subject: [PATCH v2 3/3] drivers: usb :fsl: Remove USB Errata checking code Thread-Topic: [PATCH v2 3/3] drivers: usb :fsl: Remove USB Errata checking code Thread-Index: AQHUrkSNUYxOdWSl/EKOZYXltk4TRg== Date: Thu, 17 Jan 2019 09:10:55 +0000 Message-ID: <20190117091135.44209-3-ran.wang_1@nxp.com> References: <20190117091135.44209-1-ran.wang_1@nxp.com> In-Reply-To: <20190117091135.44209-1-ran.wang_1@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0043.apcprd03.prod.outlook.com (2603:1096:203:2f::31) 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;AM5PR0402MB2900;6:nEpWLx8jsm1I3HlGyF84CC3cgu4WT31JBrM8F/v3TKmmS7tJavpIGXoqP2O3TxYIJ8+fgZVmQeY2H51Qwrn1B/cd7RvA2hNNiuhG6w0wMQEXp5HAlXj74lkvLtztKTQOBSKfNvTsgXmfvzFG9mO63aG1JkJ0P3j82U4VG4HG1qSqKrxbO5wnhHcwjwl8jhP38dZxDkMkIv5o65PIc0lGXumNEIq6856+ofz50avNLZvj+3R0cImH02qzlP/Ygm/EaO465vkxO/ldHdamvc16c2tb7aM6814K98ySXkyiP/qwY23sYrA1deqipAfYppEzP84LOqCmSZ5+R6bKQipaZKUZOoeK25Vgw88ESoaOkuu3tgs5iPXBXMhv4ymm7AHQFv4vfyin3ZGsSBtP7fIQqDKrcw4IB1joiQXLjdo62Mmt7kfi6XZLfPSIstv2YxlJOJs4G4Ghni3HUmGOGnJcew==;5:m+9wMhpA0AHmAX3SUId2FhgQu2CypJXCAmDvv5XGLZf93E7adpdgwruDXoNT5nt1onIPDMdzjsZzWhDvthBrKFGGBkMMF907RzzANRxgRB7Bdp2bawuSte4UM+UhYpfz8Sit75b/Q+SXal3FiMK6lBDbnwOYaWIeeWrvBlrrzujUeRb4FIcmgj2xzD92u+7MD5zUFuKORtCgzi+bgkxVSw==;7:0lphOBf12uMPrlDo8ZHoCBL7RVF/TOuskmvCDTgZ3FdoTi4l0KXT619+FT3567UqSJ8nwWTeDYJCJsZHyspKv/1hS6OdqZExvibgX0sGKVCjnC9/N/0XqHsRjgSKQY2VTJa59SX5/pEUKM7bRp++8g== x-ms-office365-filtering-correlation-id: 83e9554e-2afe-4af9-807f-08d67c5bafff 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:AM5PR0402MB2900; x-ms-traffictypediagnostic: AM5PR0402MB2900: x-microsoft-antispam-prvs: x-forefront-prvs: 0920602B08 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(346002)(39860400002)(136003)(396003)(376002)(189003)(199004)(446003)(102836004)(26005)(2616005)(476003)(11346002)(2906002)(478600001)(14454004)(6506007)(386003)(76176011)(71200400001)(71190400001)(1076003)(105586002)(6486002)(106356001)(186003)(52116002)(6436002)(86362001)(50226002)(110136005)(68736007)(66066001)(3846002)(6116002)(8936002)(256004)(81156014)(81166006)(8676002)(54906003)(305945005)(316002)(7736002)(5660300001)(97736004)(4326008)(2171002)(25786009)(99286004)(53936002)(6512007)(14444005)(36756003)(486006);DIR:OUT;SFP:1101;SCL:1;SRVR:AM5PR0402MB2900;H:AM5PR0402MB2865.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: 1Z3bEuB+HP96MI2lmuAPSrdbmFnCehL6Pnx/TokGBGsYhPunLm682zDogMFyndL83aGfFh4dFCpURfnEp1TB8LLtE5rl9FjjpXXmFu5AXd/wC6s6Gircr2eJGRsTcqvHDgy00WTr0hnTeQH4iPKd1YlJdOPzgw40XuWX4REEU3IiQOHXR/FWIDp1U59VJX9mZx26DPSuYEszYCmI0uQsjHax1LIz/pV6uamKbg3TSpY78hLU9A5zIP9SP9VbEOEjHHuuvMBRh3rQ6g38e8H6ZKRVZEWTjZnwB2xyvkU5VnJW7hCNrY3bfrg6736RZ0BVYBwRNDJHQ33u+fqjVmfyw4XINEPIxqBfRC1rBVlF753c/rcL573DWPbfAZU+Bmc8P1hWjPVkWlhG27QjJksmlPqIiFFyd/Toe+SLe8fyqi4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 83e9554e-2afe-4af9-807f-08d67c5bafff X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jan 2019 09:10:53.5982 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0402MB2900 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 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. Besides, replace spaces with tabs to make code aligned. Signed-off-by: Ramneek Mehresh Signed-off-by: Nikhil Badola Signed-off-by: Yinbo Zhu Signed-off-by: Ran Wang --- Changes in v2: - Correct signed-off name. - Use tabs rather than spaces to make code aligned. 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 0a867d9..e3d0c1c 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..5da56a6 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;