From patchwork Fri Aug 9 14:40:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11086537 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 3FE78746 for ; Fri, 9 Aug 2019 14:41:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 261561FE8A for ; Fri, 9 Aug 2019 14:41:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17E831FF2D; Fri, 9 Aug 2019 14:41: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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from web01.groups.io (web01.groups.io [66.175.222.12]) (using TLSv1.2 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B1A6C1FE8A for ; Fri, 9 Aug 2019 14:41:35 +0000 (UTC) X-Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by groups.io with SMTP; Fri, 09 Aug 2019 07:41:35 -0700 X-Received: by mail.kernel.org (Postfix) id C1C04208C4; Fri, 9 Aug 2019 14:41:34 +0000 (UTC) X-Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3E45E20820 for ; Fri, 9 Aug 2019 14:41:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E45E20820 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MV2Sk-1hmqRB0T3u-00S5Pl; Fri, 09 Aug 2019 16:41:23 +0200 From: Arnd Bergmann To: Linuxkernel+Patchwork-Soc via Email Integration Cc: Vladimir Zapolskiy , Sylvain Lemieux , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Greg Kroah-Hartman , Alan Stern , Felipe Balbi , linux-usb@vger.kernel.org Subject: [PATCH v2 01/13] usb: ohci-nxp: enable compile-testing Date: Fri, 9 Aug 2019 16:40:27 +0200 Message-Id: <20190809144043.476786-2-arnd@arndb.de> In-Reply-To: <20190809144043.476786-1-arnd@arndb.de> References: <20190809144043.476786-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:AxvKy6jf+t9d21xZPdfYBHuuoe857kj7IZxWzWdJ5LgVwyC0plW N6v6x9Z00yOXwvoWPiV5buUcxhC7491l21ZEe9ZhO/frzZGRWBRGEtxAgjyECNA0rqmcq9k qAkEMP1R6koIhhI7cMjIF86JqouP/hAVmc3zysqtAlmNOiYXxl3nl9Ohf3PxuG4WFdO4T6V yZnJxYGQpu+NzxMGEWryA== X-UI-Out-Filterresults: notjunk:1;V03:K0:vnpa/i6Pl7A=:Z8kSVbOHBcIByVsErk7lNg Wy/jyu6PzaL2faqwyCBwVD4rWeBx+r/t+GSSyMt/Fa/c6ESek2LtBW2K6fPkBtsNoM2c5lH6w Xe/Y0bLHLxUyhoTjzGjm8pIXTuAGKe8r1Shcr0AofFlt2GR9Gcxs/WjrU1ukmH4T+rq9UNxXJ yWvAzju0cr0EJk/sz/XnFL+0bX75TktvnIoGnNDu4Rtqk/fgj8YFggpH9+04/n5Ri5P3Wq+fv uYLmrn+hHD7QQa6VIh5SvhqRNkQaoagTJHV6QjTJ3C0KHYXjn7+Gykj1rJvUY8AWJid3N3d80 iEAzVt2i/UhXyj84HPEgA+EapGcSXAf9v4tPZALZaUzjK0m3hpw0mvFpkSV/I+CCzQo0XWJ5t zwg67JeZFvVJuliDkaBW7dAeNkZN4/pRZCUpWtYH7i1gp/KMtE+PIbwwp0DI1qQJkCzYYWrsG v3k2P2DXqD7PP9liCvOxA5n20zC2BmudSavUt/uo1xYtKmC6u6pWsCcclLRsyxu62+Jq/z+C3 rB5eyLzGmteCDmGPRo/Gn7a+iHO/ZqqQgtlmNhBk+b4x2y/kPLEyQ8bvI0TdL83LJceYg3VnD SM+d6RnIDLkimjhIVYA7H4OUQQUtH2BRFL3lcoq5x7xxau3rgbKYFgc3X5iUiRJog50xL04U/ Jqy6JmOaWtM+3PfJmjNtWKmy+IEnztgLAEMgU4yHAGCpmYfBDdlEvfUrz7fW9lnbatFdeOjGH pPc0iQtZ8VZNHbm5ycRuzPfWoQxIeANRCiWZyw== Precedence: Bulk List-Unsubscribe: Sender: patchwork-soc@linux.kernel.org List-Id: Mailing-List: list patchwork-soc@linux.kernel.org; contact patchwork-soc+owner@linux.kernel.org Delivered-To: mailing list patchwork-soc@linux.kernel.org Reply-To: patchwork-soc+owner@linux.kernel.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux.kernel.org; q=dns/txt; s=20140610; t=1565361695; bh=bq/dirg7JIYFrO8PWrOtu9yWA+v567njES9HLQHEl30=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=HjO/m9zNkC4xrsaIB0nEV9shpU6iYmfT+sRWJmcPo2lTztbzkrVem5wW1HaaU1RIcRI 67rmSLTN7GCrVJA1qJCl5zysqbglEexYTkgEZWnzi2vImNj8oeAfhfyn/HC2ICDGh6h84 JxPd6FrGHlDmXWBAF+aPMd4X6WYP9oxCoAs= X-Virus-Scanned: ClamAV using ClamSMTP The driver hardcodes a hardware I/O address the way one should generally not do, and this prevents both compile-testing, and moving the platform to CONFIG_ARCH_MULTIPLATFORM. Change the code to be independent of the machine headers to allow those two. Removing the hardcoded address would be hard and is not necessary, so leave that in place for now. Signed-off-by: Arnd Bergmann Reviewed-by: Greg Kroah-Hartman --- drivers/usb/host/Kconfig | 3 ++- drivers/usb/host/ohci-nxp.c | 25 ++++++++++++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 40b5de597112..73d233d3bf4d 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -441,7 +441,8 @@ config USB_OHCI_HCD_S3C2410 config USB_OHCI_HCD_LPC32XX tristate "Support for LPC on-chip OHCI USB controller" - depends on USB_OHCI_HCD && ARCH_LPC32XX + depends on USB_OHCI_HCD + depends on ARCH_LPC32XX || COMPILE_TEST depends on USB_ISP1301 default y ---help--- diff --git a/drivers/usb/host/ohci-nxp.c b/drivers/usb/host/ohci-nxp.c index f5f532601092..c561881d0e79 100644 --- a/drivers/usb/host/ohci-nxp.c +++ b/drivers/usb/host/ohci-nxp.c @@ -29,10 +29,7 @@ #include "ohci.h" -#include - #define USB_CONFIG_BASE 0x31020000 -#define USB_OTG_STAT_CONTROL IO_ADDRESS(USB_CONFIG_BASE + 0x110) /* USB_OTG_STAT_CONTROL bit defines */ #define TRANSPARENT_I2C_EN (1 << 7) @@ -122,19 +119,33 @@ static inline void isp1301_vbus_off(void) static void ohci_nxp_start_hc(void) { - unsigned long tmp = __raw_readl(USB_OTG_STAT_CONTROL) | HOST_EN; + void __iomem *usb_otg_stat_control = ioremap(USB_CONFIG_BASE + 0x110, 4); + unsigned long tmp; + + if (WARN_ON(!usb_otg_stat_control)) + return; + + tmp = __raw_readl(usb_otg_stat_control) | HOST_EN; - __raw_writel(tmp, USB_OTG_STAT_CONTROL); + __raw_writel(tmp, usb_otg_stat_control); isp1301_vbus_on(); + + iounmap(usb_otg_stat_control); } static void ohci_nxp_stop_hc(void) { + void __iomem *usb_otg_stat_control = ioremap(USB_CONFIG_BASE + 0x110, 4); unsigned long tmp; + if (WARN_ON(!usb_otg_stat_control)) + return; + isp1301_vbus_off(); - tmp = __raw_readl(USB_OTG_STAT_CONTROL) & ~HOST_EN; - __raw_writel(tmp, USB_OTG_STAT_CONTROL); + tmp = __raw_readl(usb_otg_stat_control) & ~HOST_EN; + __raw_writel(tmp, usb_otg_stat_control); + + iounmap(usb_otg_stat_control); } static int ohci_hcd_nxp_probe(struct platform_device *pdev)