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) From patchwork Fri Aug 9 14:40:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11086547 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 16A9B746 for ; Fri, 9 Aug 2019 14:41:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 017AA1FE84 for ; Fri, 9 Aug 2019 14:41:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E97B11FEBA; Fri, 9 Aug 2019 14:41:49 +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 206F31FE84 for ; Fri, 9 Aug 2019 14:41:48 +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:47 -0700 X-Received: by mail.kernel.org (Postfix) id 2573E21773; Fri, 9 Aug 2019 14:41:47 +0000 (UTC) X-Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) (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 96F1B20820; Fri, 9 Aug 2019 14:41:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 96F1B20820 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1Mvbr4-1iD4VT2f4w-00saWn; Fri, 09 Aug 2019 16:41:37 +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 , Felipe Balbi , Alexandre Belloni , linux-usb@vger.kernel.org Subject: [PATCH v2 02/13] usb: udc: lpc32xx: allow compile-testing Date: Fri, 9 Aug 2019 16:40:28 +0200 Message-Id: <20190809144043.476786-3-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:imKF8CYOdXNLcMsBRk3mkfe2XaXiYZ/dpgIAJ8vRCoyxvlRyj33 AVF5BJ04yO+4T850DaBd0tsnYRR8Kr57cnSNT3OeGpKfcEBIX8M9GQMwT1IUYdprcSqX4vO EeKrYORhADLbzjwUhXrKNiu9yK1kPe1XBmNsZb+rNlS3zJR9ml4+W8sWjKbu1DGbmJqJCp8 TP+LwRSu/+D+dPieDgwZw== X-UI-Out-Filterresults: notjunk:1;V03:K0:o+P30devlyk=:ZOux45NQXABh307CDaffwC eRRPJf8wFJnTFHt8ABbfXpKy4+2KstsbFkVk7tp+8vg4RTNo+M0qNZuHja9WiuljDwDeeHKcR JxyOvwefJYugKbJYpqRg2PBrMHB/XvtsyuqQMKg6MW0mGJk+wUbEB88paGrIS/Z4GIMor3210 qI/jAwzxrydt6db2oU8rWGakd4MF7/PQKoleMWB6eEL683yBW0UqbgyGETizPP/DAsE3BgaaY n1GFH9keXNXLp8Xhf+ZE5mBYr2ExNpKkbKCk5RA9MJQF4T0neuwFC91NWpUMkC4fvpBKNYttN DlXWhYa5RA59/nEeBjcnTVwhV0UVR+x1laNjs+CvutXhcstOZLZ4DLnirepeO2IjaKjkTB68E WPSCJLJS70sOdynJzhit1m7j49KEN77V/Yk0bExKwvI9+6INzhs/cKpqGC8EkE87qhzOfx1Jw VxkvqpnmJjGiEUJVi/fVAv4Izr3dwKSZ+Ahn9ePU0N9HLxPwbFcZoAKs3Ec+3zA5lIuQCzta0 at21vUSECg93O+CzFZY7g0meK28uC1IVZxzI0gQm8lkt0rXQuLIbK+fJekVelMDCWZF8IwghO cu0S6TwolJqo0s/Ne+Zpn138n5DzWwUfAxLpaeBExS5sdoIpkvdiiNDMLIql1FUOR+ONQbviM ICGimsocRL3e9CqZnT7W2tc+ve+MFAKwCFQ00cgCy+DbaPUGMxRxv4WBMRhZ2IJCB8oDAdLQX VyxbDTMn3knDPVcYN44yMWdFlMgOC1wRYKle3g== 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=1565361707; bh=7u/IOSgT+Ce52BFjY9XyfQSSO9+6ALDHae1Qyzr8FN8=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=M+Oof7XRrCJCNdSr5jcac3AOYmMrO42aIMZ+2c5K7wAjkNQ8KaQC1CP915MFBVEKgZl SYBFbNCrPtj4TZ+xtEJOafU+Qj+2jgzW6LmkN2rve3hlkNKpAcBTG5HiSX3h30wKAqa/5 kwnrp0xZNfWlYCeGGsW2FvGV2eDZA5PglQ8= X-Virus-Scanned: ClamAV using ClamSMTP The only thing that prevents building this driver on other platforms is the mach/hardware.h include, which is not actually used here at all, so remove the line and allow CONFIG_COMPILE_TEST. Acked-by: Greg Kroah-Hartman Acked-by: Sylvain Lemieux Signed-off-by: Arnd Bergmann --- drivers/usb/gadget/udc/Kconfig | 3 ++- drivers/usb/gadget/udc/lpc32xx_udc.c | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/udc/Kconfig b/drivers/usb/gadget/udc/Kconfig index ef0259a950ba..d354036ff6c8 100644 --- a/drivers/usb/gadget/udc/Kconfig +++ b/drivers/usb/gadget/udc/Kconfig @@ -45,7 +45,8 @@ config USB_AT91 config USB_LPC32XX tristate "LPC32XX USB Peripheral Controller" - depends on ARCH_LPC32XX && I2C + depends on ARCH_LPC32XX || COMPILE_TEST + depends on I2C select USB_ISP1301 help This option selects the USB device controller in the LPC32xx SoC. diff --git a/drivers/usb/gadget/udc/lpc32xx_udc.c b/drivers/usb/gadget/udc/lpc32xx_udc.c index 5f1b14f3e5a0..defe04d52e6d 100644 --- a/drivers/usb/gadget/udc/lpc32xx_udc.c +++ b/drivers/usb/gadget/udc/lpc32xx_udc.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -35,8 +36,6 @@ #include #endif -#include - /* * USB device configuration structure */ From patchwork Fri Aug 9 14:40:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11086555 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 32AFC14E5 for ; Fri, 9 Aug 2019 14:42:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 199981FE84 for ; Fri, 9 Aug 2019 14:42:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0DC7C1FEBA; Fri, 9 Aug 2019 14:42:38 +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 B05E11FE84 for ; Fri, 9 Aug 2019 14:42:37 +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:42:36 -0700 X-Received: by mail.kernel.org (Postfix) id 5531220820; Fri, 9 Aug 2019 14:42:36 +0000 (UTC) X-Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) (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 C2D97208C4 for ; Fri, 9 Aug 2019 14:42:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2D97208C4 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1N6JtR-1iOPhO3B3h-016fh0; Fri, 09 Aug 2019 16:42:07 +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 , Guenter Roeck , Wim Van Sebroeck , linux-watchdog@vger.kernel.org Subject: [PATCH v2 03/13] watchdog: pnx4008_wdt: allow compile-testing Date: Fri, 9 Aug 2019 16:40:29 +0200 Message-Id: <20190809144043.476786-4-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:2AniHPLvo1jOIHTBA5j2I98sivoZsCAzYNsd3R/3R1uFTaliz4M 3rsrICP/4PwkInaQhxlJ/le7U5DXD8wWkq4JuseLTYnOxVv5i7Pa66SqiXbaguC3oA5FRw8 A3xdnI1Rtez1LzDbs+hgxfPKiJyB71Xm8m9gpg8RdpuYwWaPI7c4IElvW/Zfp2Gv0NrqnrX jNNC2a7YYGqIrQTGKSpMg== X-UI-Out-Filterresults: notjunk:1;V03:K0:Etmti/+xoQU=:l4/pWBsx0O3C1vyi+cIoXU B8/q/x2tPsjhwuwTEusw4xO3v3fsMQQTifM0loxUkh38VhpQRY6hhaYq4T0VxVGIgDRL7k4Fz jZ7BZJjWaG7sWyYIiHLs5LTGW4Sn3dzTN8w+H2ze/4aaLojYSZISir5/crSN/dM7rEGfJ+688 5lfVOkA68CmQdirZenGNKTe9XExQI9XCx3Bc9PI/J/Mhkhw/d0rxvIbRg8VrlGutTxVUa7Ee8 GUGIIM2QpNsQNscwV1Kw9bKmsWzduGGi1t+uRunVn2J7txrxyigBVsDI/Gmklywari3NfJKSH gJHVNI/QjS2jBmpNtXXlgOW5X1oxHK4uU3oyz9KzqIy3I/eqBfwOQh0lhMU4RjQeti5VOR9u+ 28FXhIzaucLv9wNiIKCy3nouTqfLJVXwsuozg9GInw0hjxiGg8jTQI3MivqWIHSf6ICQsP4US VAqYSNd1sQBqtHincI3+5NGUcPiwZxeav4bfdjIVSa60uo825Red6h1hEGt1XZwBdBTfXSaCm ZaYfGakR5giIId/4nDqGSabD0XGEHUqhTaUYwFuHsghmRHYzxm4qqhDZP74Vk8pXeiZlXRcvw r1gSQFieBhcZg1nhipaC/BxG29X59rcn49DjnIeO0Q7pDzw1tcrWETEsHxLq+MWgq3jLHxwhe AhfrHZ5BvPOVUiEgviEvpJB2WVBOnlB2VatyhjVwe+D0LDYrD3oPjGPCcPdHmZi0GOH8fU8gG CO183QaB3b+5OI4Ex4k3snRCyEStnmloMwaR8A== 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=1565361757; bh=faObAONo7FhFBpzqLU6pyH+K2jkfIg3iYXCIuM+/NyM=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=LQuIrPlkObqFFVoGZSn0Q0i8tAP6Agq7KChKtk4n2SLZGWSTona6sb7fuqsth8AvXtZ +s1u2N+/lTJrD40PirXHp8brq30RkCh30bgG5a1HHv8MsAb/zl3ZoQ+m+kBG/NreBF1KN QpMeot8rCvdobuGW6NVWUKwmlpGvUSYYkI8= X-Virus-Scanned: ClamAV using ClamSMTP The only thing that prevents building this driver on other platforms is the mach/hardware.h include, which is not actually used here at all, so remove the line and allow CONFIG_COMPILE_TEST. Acked-by: Sylvain Lemieux Reviewed-by: Guenter Roeck Signed-off-by: Arnd Bergmann --- drivers/watchdog/Kconfig | 2 +- drivers/watchdog/pnx4008_wdt.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 8188963a405b..a45f9e3e442b 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -551,7 +551,7 @@ config OMAP_WATCHDOG config PNX4008_WATCHDOG tristate "LPC32XX Watchdog" - depends on ARCH_LPC32XX + depends on ARCH_LPC32XX || COMPILE_TEST select WATCHDOG_CORE help Say Y here if to include support for the watchdog timer diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c index 7b446b696f2b..e0ea133c1690 100644 --- a/drivers/watchdog/pnx4008_wdt.c +++ b/drivers/watchdog/pnx4008_wdt.c @@ -30,7 +30,6 @@ #include #include #include -#include /* WatchDog Timer - Chapter 23 Page 207 */ From patchwork Fri Aug 9 14:40:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11086561 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 CF50014E5 for ; Fri, 9 Aug 2019 14:42:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7CBC1FE84 for ; Fri, 9 Aug 2019 14:42:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AAF661FEBA; Fri, 9 Aug 2019 14:42:55 +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 522B01FE84 for ; Fri, 9 Aug 2019 14:42:55 +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:42:48 -0700 X-Received: by mail.kernel.org (Postfix) id AC097208C4; Fri, 9 Aug 2019 14:42:48 +0000 (UTC) X-Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) (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 29CD320820 for ; Fri, 9 Aug 2019 14:42:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 29CD320820 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MkW10-1ibFDP1DAM-00m6H3; Fri, 09 Aug 2019 16:42:37 +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 , Jiri Slaby , linux-serial@vger.kernel.org Subject: [PATCH v2 04/13] serial: lpc32xx_hs: allow compile-testing Date: Fri, 9 Aug 2019 16:40:30 +0200 Message-Id: <20190809144043.476786-5-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:SC8nZDGE2BL9UiO9/Fozk5OqQl67V4vDebpaMMEW86kY+4HNvMj YKeoq6THCo5lQcI4cDrmklhCT+LWmfdbFN6lCLqNDdUHBRLIJebF4mmnJGvh7mNxIv3ZCwT VRRC/RLTDmubB2Xi0BWRSw3kyzrdd4XxldtbAohamPuPtyOMkYMk/BGepJUSdUSyZ8xWeQ/ KNc6Ys+WF0CLgaVoQH5wA== X-UI-Out-Filterresults: notjunk:1;V03:K0:4Hc4IEz+FE8=:Bi1ycoD9jmGxicFoUUXqr5 9b/29dRCFDWcYEgVD78D6DLLA8oYjJi1HM1kwFtqAW9rJ0UNlrn1TzbQ9jHY9o3Z2zVS/NOkb JqK8vcIejal4Piu9/08+X/Nw8SCu87wa05jNNtjOqbR/YqHPLSKvJ1S3AsnT5xNke/viiMiM0 FhC2pDBEnDvz2FH+LmvyZLQrjExv9w+hh6KrINZe2YCSIJqPIjz+90LR2WZePDsZVMvvIZVY3 AofLb7Y85aBRVeQ5SqHLtQwmF+Wdrk/6sNqiOUm44Eo6oUmJLJURRmO9KmiNZYeWF8tE1+8Fg 2hU2uS0MJuE6ztejja1tqp7zlMck0fN4puh+1AeDr9/h+JAR8FnRGwBiHfVOKXmZRy+WuZkYd 0WdEdfDDydRMZqM1RM9wkoSx+4l2f6bQsuPe52787AdY6XNEumOIJYB884hCm0zFkxczbXKgh VaJ9be149nYemxn0IGfZcdtR52mA1GE9LaiBcCyLWYI2jewdF+Iulw86wDRAt4sUkOEY3gKrm 2K/0jBKfJ3oDH0hKOJ2W6OKBX6J9NGuhiLgMMf8P79Utgi5f/E2PXnwhO3hAjtrqVVTyh7td9 80eTZhPkz9J6xoMjACEo+WsPBu4mk0neKFetIC7rib1R82Y/41wT86pbHoE1la6xROckMdSNF dZvNS2PHw0GDMRxSFCC5kbRqbD6/wZXPpELBuyE3X0Ot9gCtoP2vjaW1urOioW7W9aaCtQXKy NWMoDJ45quKlhemjbD/l8qhcV2xrgjPMTROlJw== 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=1565361774; bh=E1YKvLQy7voDiav4HLnIC1Errh6Kg3kWismTXRxCnkA=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=r4tv+YDvf0pCAoBysLvVunetV4PIlmhjp5+0M4SGS97VL8GWgDLyrIV2p8xdODDAUko TTLUfYYzuwoniO4rpl0CHAxo+VUkU/s6KhhwsXMFfetQZ5bc7eJT999wtaNueC3/5PgFZ +kgBRiezp1EbLZHiEgqAXkP4s7aJNxA1sAg= X-Virus-Scanned: ClamAV using ClamSMTP The only thing that prevents building this driver on other platforms is the mach/hardware.h include, which is not actually used here at all, so remove the line and allow CONFIG_COMPILE_TEST. Acked-by: Greg Kroah-Hartman Acked-by: Sylvain Lemieux Signed-off-by: Arnd Bergmann --- drivers/tty/serial/Kconfig | 3 ++- drivers/tty/serial/lpc32xx_hs.c | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index 3083dbae35f7..518aac902e4b 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -739,7 +739,8 @@ config SERIAL_PNX8XXX_CONSOLE config SERIAL_HS_LPC32XX tristate "LPC32XX high speed serial port support" - depends on ARCH_LPC32XX && OF + depends on ARCH_LPC32XX || COMPILE_TEST + depends on OF select SERIAL_CORE help Support for the LPC32XX high speed serial ports (up to 900kbps). diff --git a/drivers/tty/serial/lpc32xx_hs.c b/drivers/tty/serial/lpc32xx_hs.c index f4e27d0ad947..7f14cd8fac47 100644 --- a/drivers/tty/serial/lpc32xx_hs.c +++ b/drivers/tty/serial/lpc32xx_hs.c @@ -25,8 +25,6 @@ #include #include #include -#include -#include /* * High Speed UART register offsets From patchwork Fri Aug 9 14:40:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11086565 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 39C8614E5 for ; Fri, 9 Aug 2019 14:43:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 222381FE84 for ; Fri, 9 Aug 2019 14:43:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 15F321FEBA; Fri, 9 Aug 2019 14:43:18 +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 595541FE84 for ; Fri, 9 Aug 2019 14:43:17 +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:43:16 -0700 X-Received: by mail.kernel.org (Postfix) id 410F82171F; Fri, 9 Aug 2019 14:43:16 +0000 (UTC) X-Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) (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 B1B3720820 for ; Fri, 9 Aug 2019 14:43:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B1B3720820 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MsJXG-1iBz611zvG-00tgzd; Fri, 09 Aug 2019 16:43:07 +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 , Linus Walleij , Bartosz Golaszewski , linux-gpio@vger.kernel.org Subject: [PATCH v2 05/13] gpio: lpc32xx: allow building on non-lpc32xx targets Date: Fri, 9 Aug 2019 16:40:31 +0200 Message-Id: <20190809144043.476786-6-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:/mHIHcM4NUVHez/4l0Lm1IgoJwHRA/BTHyJw9ReNM2OTo0m9Aod /O1DdwbpKfucI3Vu/nSW1Mx3r/G6pP4GiPf7xoOOyxb9l8JP2dhlOHvHUFonOgsn9JgbFUI T76EjiBiCN+w5pUXFxPmuA4D41MDrJJmD43NC5aj6dGXMNSx4/AW43hTYxQpDXAQhKvu2XD EPib7hU9b0bM9hbXpermA== X-UI-Out-Filterresults: notjunk:1;V03:K0:e145JppYo8c=:btDTqUjP2xw07aCm+vPUBB gMV48+aRcWyxtdRnkWTZznJ9m1CbvklY9oCI+mcfAUiDqEtIFhueI/dbL4Utv0vtRz949Qa8l bUWwWSZi7x0AdA3Ss0f823OEsBMc2Y4Mw8Ryl7nEpBzVC9EONchO/UEekT5M/at/QhRwApz8x lT+GX7MZLa16AavB5Buju0zx3I17fW6FHxMsvub0k8kTM3vqTO3qonjsEvUtVPOISGMJlSoha 82CXkRVqtDXA9LzTyp62T2cpOl7pEz5ipPzk5CF++C16RqMEcG4uXQ414JE/9V4aa5OF6fPzt SawVmPBSigapi1xY6Wwgw26poYrQTIkem6fMthNUHsFdOxOvi7koB3o5uPwBBhMMpV2AuhBzy sszl3OCfOwijfOe/wXKFl0Gp7pZOn+T2dscCkcT8chKXy2A+kNt7INxSq9YcT5zHX0DSvmRxv RmO7Ul6N2eZ6sHgXWAaM4yyjXQww+tZM3U1UDiT6+JGI8iDu6MKuUYE/Rjl3tVwVHOECvw3af WmFf9uGE9ye5vbO5CkM8i0JZZr2ZS68/kHDHSvCHagr2nmmrvr2U1ZoBbCXJhCf9NVy8Volc1 fEyk9e7GQRg07HjPgfD6l4xv6rKkiV7XACv7VqkjIy47W32Qy6PXtm/tITLLTq4516sJ55CSh blbkDgUtxk12GTfRtZFKnJKk+eAgBVriC/nKEsmXi0DvNlolCcQY/Tgxir1JoLQaaUa7h1X5J QPMa9E+NeJyV4/w3o3MrXFaomiRX8zsg6MYYpg== 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=1565361797; bh=sC0LhjPpGiJmZBksg91ph6Q8iy6ZNFpwW+RRIXNMZJ8=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=oZHZhEHBdWP3N8yviFzDJfiSBCuNbxhK2ceTtZVu812NMo6sw/4XvJlJ3NIGC7Z0Jaf 4+zAfTWLtHGJRQKgSlybShAb0ZGcrIqe/cAtMRugZb3OHE+NC8YTwLDitnDPsluvjpHrK LiRM4egLxRhe2fjGOePoR9uCTwzxUdjOlWU= X-Virus-Scanned: ClamAV using ClamSMTP The driver uses hardwire MMIO addresses instead of the data that is passed in device tree. Change it over to only hardcode the register offset values and allow compile-testing. Acked-by: Sylvain Lemieux Tested-by: Sylvain Lemieux Signed-off-by: Arnd Bergmann --- arch/arm/configs/lpc32xx_defconfig | 1 + drivers/gpio/Kconfig | 7 ++ drivers/gpio/Makefile | 2 +- drivers/gpio/gpio-lpc32xx.c | 118 +++++++++++++++++------------ 4 files changed, 77 insertions(+), 51 deletions(-) diff --git a/arch/arm/configs/lpc32xx_defconfig b/arch/arm/configs/lpc32xx_defconfig index 0cdc6c7974b3..3772d5a8975a 100644 --- a/arch/arm/configs/lpc32xx_defconfig +++ b/arch/arm/configs/lpc32xx_defconfig @@ -93,6 +93,7 @@ CONFIG_SERIAL_HS_LPC32XX_CONSOLE=y # CONFIG_HW_RANDOM is not set CONFIG_I2C_CHARDEV=y CONFIG_I2C_PNX=y +CONFIG_GPIO_LPC32XX=y CONFIG_SPI=y CONFIG_SPI_PL022=y CONFIG_GPIO_SYSFS=y diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index bb13c266c329..8b40a578963c 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -311,6 +311,13 @@ config GPIO_LPC18XX Select this option to enable GPIO driver for NXP LPC18XX/43XX devices. +config GPIO_LPC32XX + tristate "NXP LPC32XX GPIO support" + depends on OF_GPIO && (ARCH_LPC32XX || COMPILE_TEST) + help + Select this option to enable GPIO driver for + NXP LPC32XX devices. + config GPIO_LYNXPOINT tristate "Intel Lynxpoint GPIO support" depends on ACPI && X86 diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index a4e91175c708..87d659ae95eb 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -74,7 +74,7 @@ obj-$(CONFIG_GPIO_LP3943) += gpio-lp3943.o obj-$(CONFIG_GPIO_LP873X) += gpio-lp873x.o obj-$(CONFIG_GPIO_LP87565) += gpio-lp87565.o obj-$(CONFIG_GPIO_LPC18XX) += gpio-lpc18xx.o -obj-$(CONFIG_ARCH_LPC32XX) += gpio-lpc32xx.o +obj-$(CONFIG_GPIO_LPC32XX) += gpio-lpc32xx.o obj-$(CONFIG_GPIO_LYNXPOINT) += gpio-lynxpoint.o obj-$(CONFIG_GPIO_MADERA) += gpio-madera.o obj-$(CONFIG_GPIO_MAX3191X) += gpio-max3191x.o diff --git a/drivers/gpio/gpio-lpc32xx.c b/drivers/gpio/gpio-lpc32xx.c index 24885b3db3d5..4e626c4235c2 100644 --- a/drivers/gpio/gpio-lpc32xx.c +++ b/drivers/gpio/gpio-lpc32xx.c @@ -16,36 +16,33 @@ #include #include -#include -#include - -#define LPC32XX_GPIO_P3_INP_STATE _GPREG(0x000) -#define LPC32XX_GPIO_P3_OUTP_SET _GPREG(0x004) -#define LPC32XX_GPIO_P3_OUTP_CLR _GPREG(0x008) -#define LPC32XX_GPIO_P3_OUTP_STATE _GPREG(0x00C) -#define LPC32XX_GPIO_P2_DIR_SET _GPREG(0x010) -#define LPC32XX_GPIO_P2_DIR_CLR _GPREG(0x014) -#define LPC32XX_GPIO_P2_DIR_STATE _GPREG(0x018) -#define LPC32XX_GPIO_P2_INP_STATE _GPREG(0x01C) -#define LPC32XX_GPIO_P2_OUTP_SET _GPREG(0x020) -#define LPC32XX_GPIO_P2_OUTP_CLR _GPREG(0x024) -#define LPC32XX_GPIO_P2_MUX_SET _GPREG(0x028) -#define LPC32XX_GPIO_P2_MUX_CLR _GPREG(0x02C) -#define LPC32XX_GPIO_P2_MUX_STATE _GPREG(0x030) -#define LPC32XX_GPIO_P0_INP_STATE _GPREG(0x040) -#define LPC32XX_GPIO_P0_OUTP_SET _GPREG(0x044) -#define LPC32XX_GPIO_P0_OUTP_CLR _GPREG(0x048) -#define LPC32XX_GPIO_P0_OUTP_STATE _GPREG(0x04C) -#define LPC32XX_GPIO_P0_DIR_SET _GPREG(0x050) -#define LPC32XX_GPIO_P0_DIR_CLR _GPREG(0x054) -#define LPC32XX_GPIO_P0_DIR_STATE _GPREG(0x058) -#define LPC32XX_GPIO_P1_INP_STATE _GPREG(0x060) -#define LPC32XX_GPIO_P1_OUTP_SET _GPREG(0x064) -#define LPC32XX_GPIO_P1_OUTP_CLR _GPREG(0x068) -#define LPC32XX_GPIO_P1_OUTP_STATE _GPREG(0x06C) -#define LPC32XX_GPIO_P1_DIR_SET _GPREG(0x070) -#define LPC32XX_GPIO_P1_DIR_CLR _GPREG(0x074) -#define LPC32XX_GPIO_P1_DIR_STATE _GPREG(0x078) +#define LPC32XX_GPIO_P3_INP_STATE (0x000) +#define LPC32XX_GPIO_P3_OUTP_SET (0x004) +#define LPC32XX_GPIO_P3_OUTP_CLR (0x008) +#define LPC32XX_GPIO_P3_OUTP_STATE (0x00C) +#define LPC32XX_GPIO_P2_DIR_SET (0x010) +#define LPC32XX_GPIO_P2_DIR_CLR (0x014) +#define LPC32XX_GPIO_P2_DIR_STATE (0x018) +#define LPC32XX_GPIO_P2_INP_STATE (0x01C) +#define LPC32XX_GPIO_P2_OUTP_SET (0x020) +#define LPC32XX_GPIO_P2_OUTP_CLR (0x024) +#define LPC32XX_GPIO_P2_MUX_SET (0x028) +#define LPC32XX_GPIO_P2_MUX_CLR (0x02C) +#define LPC32XX_GPIO_P2_MUX_STATE (0x030) +#define LPC32XX_GPIO_P0_INP_STATE (0x040) +#define LPC32XX_GPIO_P0_OUTP_SET (0x044) +#define LPC32XX_GPIO_P0_OUTP_CLR (0x048) +#define LPC32XX_GPIO_P0_OUTP_STATE (0x04C) +#define LPC32XX_GPIO_P0_DIR_SET (0x050) +#define LPC32XX_GPIO_P0_DIR_CLR (0x054) +#define LPC32XX_GPIO_P0_DIR_STATE (0x058) +#define LPC32XX_GPIO_P1_INP_STATE (0x060) +#define LPC32XX_GPIO_P1_OUTP_SET (0x064) +#define LPC32XX_GPIO_P1_OUTP_CLR (0x068) +#define LPC32XX_GPIO_P1_OUTP_STATE (0x06C) +#define LPC32XX_GPIO_P1_DIR_SET (0x070) +#define LPC32XX_GPIO_P1_DIR_CLR (0x074) +#define LPC32XX_GPIO_P1_DIR_STATE (0x078) #define GPIO012_PIN_TO_BIT(x) (1 << (x)) #define GPIO3_PIN_TO_BIT(x) (1 << ((x) + 25)) @@ -72,12 +69,12 @@ #define LPC32XX_GPO_P3_GRP (LPC32XX_GPI_P3_GRP + LPC32XX_GPI_P3_MAX) struct gpio_regs { - void __iomem *inp_state; - void __iomem *outp_state; - void __iomem *outp_set; - void __iomem *outp_clr; - void __iomem *dir_set; - void __iomem *dir_clr; + unsigned long inp_state; + unsigned long outp_state; + unsigned long outp_set; + unsigned long outp_clr; + unsigned long dir_set; + unsigned long dir_clr; }; /* @@ -165,16 +162,27 @@ static struct gpio_regs gpio_grp_regs_p3 = { struct lpc32xx_gpio_chip { struct gpio_chip chip; struct gpio_regs *gpio_grp; + void __iomem *reg_base; }; +static inline u32 gpreg_read(struct lpc32xx_gpio_chip *group, unsigned long offset) +{ + return __raw_readl(group->reg_base + offset); +} + +static inline void gpreg_write(struct lpc32xx_gpio_chip *group, u32 val, unsigned long offset) +{ + __raw_writel(val, group->reg_base + offset); +} + static void __set_gpio_dir_p012(struct lpc32xx_gpio_chip *group, unsigned pin, int input) { if (input) - __raw_writel(GPIO012_PIN_TO_BIT(pin), + gpreg_write(group, GPIO012_PIN_TO_BIT(pin), group->gpio_grp->dir_clr); else - __raw_writel(GPIO012_PIN_TO_BIT(pin), + gpreg_write(group, GPIO012_PIN_TO_BIT(pin), group->gpio_grp->dir_set); } @@ -184,19 +192,19 @@ static void __set_gpio_dir_p3(struct lpc32xx_gpio_chip *group, u32 u = GPIO3_PIN_TO_BIT(pin); if (input) - __raw_writel(u, group->gpio_grp->dir_clr); + gpreg_write(group, u, group->gpio_grp->dir_clr); else - __raw_writel(u, group->gpio_grp->dir_set); + gpreg_write(group, u, group->gpio_grp->dir_set); } static void __set_gpio_level_p012(struct lpc32xx_gpio_chip *group, unsigned pin, int high) { if (high) - __raw_writel(GPIO012_PIN_TO_BIT(pin), + gpreg_write(group, GPIO012_PIN_TO_BIT(pin), group->gpio_grp->outp_set); else - __raw_writel(GPIO012_PIN_TO_BIT(pin), + gpreg_write(group, GPIO012_PIN_TO_BIT(pin), group->gpio_grp->outp_clr); } @@ -206,31 +214,31 @@ static void __set_gpio_level_p3(struct lpc32xx_gpio_chip *group, u32 u = GPIO3_PIN_TO_BIT(pin); if (high) - __raw_writel(u, group->gpio_grp->outp_set); + gpreg_write(group, u, group->gpio_grp->outp_set); else - __raw_writel(u, group->gpio_grp->outp_clr); + gpreg_write(group, u, group->gpio_grp->outp_clr); } static void __set_gpo_level_p3(struct lpc32xx_gpio_chip *group, unsigned pin, int high) { if (high) - __raw_writel(GPO3_PIN_TO_BIT(pin), group->gpio_grp->outp_set); + gpreg_write(group, GPO3_PIN_TO_BIT(pin), group->gpio_grp->outp_set); else - __raw_writel(GPO3_PIN_TO_BIT(pin), group->gpio_grp->outp_clr); + gpreg_write(group, GPO3_PIN_TO_BIT(pin), group->gpio_grp->outp_clr); } static int __get_gpio_state_p012(struct lpc32xx_gpio_chip *group, unsigned pin) { - return GPIO012_PIN_IN_SEL(__raw_readl(group->gpio_grp->inp_state), + return GPIO012_PIN_IN_SEL(gpreg_read(group, group->gpio_grp->inp_state), pin); } static int __get_gpio_state_p3(struct lpc32xx_gpio_chip *group, unsigned pin) { - int state = __raw_readl(group->gpio_grp->inp_state); + int state = gpreg_read(group, group->gpio_grp->inp_state); /* * P3 GPIO pin input mapping is not contiguous, GPIOP3-0..4 is mapped @@ -242,13 +250,13 @@ static int __get_gpio_state_p3(struct lpc32xx_gpio_chip *group, static int __get_gpi_state_p3(struct lpc32xx_gpio_chip *group, unsigned pin) { - return GPI3_PIN_IN_SEL(__raw_readl(group->gpio_grp->inp_state), pin); + return GPI3_PIN_IN_SEL(gpreg_read(group, group->gpio_grp->inp_state), pin); } static int __get_gpo_state_p3(struct lpc32xx_gpio_chip *group, unsigned pin) { - return GPO3_PIN_IN_SEL(__raw_readl(group->gpio_grp->outp_state), pin); + return GPO3_PIN_IN_SEL(gpreg_read(group, group->gpio_grp->outp_state), pin); } /* @@ -497,12 +505,18 @@ static int lpc32xx_of_xlate(struct gpio_chip *gc, static int lpc32xx_gpio_probe(struct platform_device *pdev) { int i; + void __iomem *reg_base; + + reg_base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(reg_base)) + return PTR_ERR(reg_base); for (i = 0; i < ARRAY_SIZE(lpc32xx_gpiochip); i++) { if (pdev->dev.of_node) { lpc32xx_gpiochip[i].chip.of_xlate = lpc32xx_of_xlate; lpc32xx_gpiochip[i].chip.of_gpio_n_cells = 3; lpc32xx_gpiochip[i].chip.of_node = pdev->dev.of_node; + lpc32xx_gpiochip[i].reg_base = reg_base; } devm_gpiochip_add_data(&pdev->dev, &lpc32xx_gpiochip[i].chip, &lpc32xx_gpiochip[i]); @@ -527,3 +541,7 @@ static struct platform_driver lpc32xx_gpio_driver = { }; module_platform_driver(lpc32xx_gpio_driver); + +MODULE_AUTHOR("Kevin Wells "); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("GPIO driver for LPC32xx SoC"); From patchwork Fri Aug 9 14:40:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11086569 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 055AA14E5 for ; Fri, 9 Aug 2019 14:43:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1CF61FE84 for ; Fri, 9 Aug 2019 14:43:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D62641FEBA; Fri, 9 Aug 2019 14:43:48 +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 57A291FE84 for ; Fri, 9 Aug 2019 14:43:48 +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:43:47 -0700 X-Received: by mail.kernel.org (Postfix) id 6749F208C4; Fri, 9 Aug 2019 14:43:47 +0000 (UTC) X-Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.187]) (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 D136A20820 for ; Fri, 9 Aug 2019 14:43:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D136A20820 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1N0qmr-1iGfMq1dTx-00wjWU; Fri, 09 Aug 2019 16:43:37 +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 , "David S. Miller" , netdev@vger.kernel.org Subject: [PATCH v2 06/13] net: lpc-enet: factor out iram access Date: Fri, 9 Aug 2019 16:40:32 +0200 Message-Id: <20190809144043.476786-7-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:M1AYytHx6XmmunCKlV/TLUdpENpBqLRCGCD3Pn5cu9bj26l7VNZ ppTmd/I+r5hcLU0hmOjH/xyc/sS3WjXelutVyPcQXkf+1fcQuy0SLJgMYzoy3xLp7l3Kh1d 3Ql2Y8T6+WkkXw8dptJK85G1JUkG2GNTdVLR5WJAy5JJwbmIXNJts54TsFkP6dIVozEMZ30 oAx+HJ4EWfL59R8y6IhDw== X-UI-Out-Filterresults: notjunk:1;V03:K0:gYlz00sn4w0=:BqGN/DtzRwRepukBnvS5uD jtT5EKlubutzFsIn9CkuwmcuLmlSQeQonfrz6aRlQaSgiCPYs2v01l58RsrUsg3yrid6VbP/+ OkI19EJmhyt0Kqo7L2/z+4Fsjx8J+d+3MnCxMOjHxY6D25viimEAc8S9TWPa1PlK3k8GU3+lU vgZOe3DJ9z/1kocRjLJXBV7kpB1cRNZCxvkpnkzmklp1OsUj0sCGVyjSyb63RhsmVGVr2++nm PPdv6sSHoTqcSwzE/zleeDippUxx3OiEwpZMEYL5PNrBLauaqqna60c5uRDNi55XNdyJr+ABN Svztmjz1G/7PVk2O3uhNMVr4BHmBAjzdKVEA8c0rQXlP5JiBWm9cQBvEWLBwwU4aRPq2XJoOV vYVgJvxdRnzBbRBzmketRNlXZPS4742xUl1FkEnWibmAzWImR/UwuyJcaNJmChauTOldQ889O xjI/+djH1UHAzBhyEXaJILAKMTdNCSexIymg5cnGWSTLqTnGRvRCMHqZdYu3pQJrAlGDrMllQ +NjL6Y69+YAnXAoZHi00DvYNk1fJcA6vVrwtgySNB9PcK3I3gvpoiPbHmXmH+gfj+jHG5WL+R 93SdLp2QCCm5WRXPtDXksNACmUIpXISEX49NGsYEmdrF0DRp8ecH2ID/JnN//+6OEqmYyDkih tZGCcLBJBEtXih2po/Iy7XvCXe4HrG87vaH2dTegieCZinPcr0o3Z410szVqPXcNtnXsJ12fr EwlOhWlxH2qDnflSWNTk8zgSlxgyCC69ukAXdQ== 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=1565361828; bh=yC9cPc9wRKGH7jND09mIle4R44m3soK3kZ0p3rLPjwY=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=WtOQSJMhnsKDh5MBRlneKIQ9sdY1HwoZZE6OmzCWh8oWhJ0UQ58OsSY11NXg/UPveSf QvNmVti2G78PRoktfYpNnYxUavNcbu1E5fpY5oJK8D9brQ7sOcEJHWhHHXJFv9BN/mr50 /VQlqX6WMcvmx/mzjLc3f7+7H4rrMJiIo10= X-Virus-Scanned: ClamAV using ClamSMTP The lpc_eth driver uses a platform specific method to find the internal sram. This prevents building it on other machines. Rework to only use one function call and keep the other platform internals where they belong. Ideally this would look up the sram location from DT, but as this is a rarely used driver, I want to keep the modifications to a minimum. Signed-off-by: Arnd Bergmann --- arch/arm/mach-lpc32xx/common.c | 9 ++++++-- arch/arm/mach-lpc32xx/common.h | 1 - arch/arm/mach-lpc32xx/include/mach/board.h | 15 -------------- drivers/net/ethernet/nxp/lpc_eth.c | 17 ++++++++------- include/linux/soc/nxp/lpc32xx-misc.h | 24 ++++++++++++++++++++++ 5 files changed, 39 insertions(+), 27 deletions(-) delete mode 100644 arch/arm/mach-lpc32xx/include/mach/board.h create mode 100644 include/linux/soc/nxp/lpc32xx-misc.h diff --git a/arch/arm/mach-lpc32xx/common.c b/arch/arm/mach-lpc32xx/common.c index 5b71b4fab2cd..f648324d5fb4 100644 --- a/arch/arm/mach-lpc32xx/common.c +++ b/arch/arm/mach-lpc32xx/common.c @@ -8,6 +8,7 @@ */ #include +#include #include #include @@ -32,7 +33,7 @@ void lpc32xx_get_uid(u32 devid[4]) */ #define LPC32XX_IRAM_BANK_SIZE SZ_128K static u32 iram_size; -u32 lpc32xx_return_iram_size(void) +u32 lpc32xx_return_iram(void __iomem **mapbase, dma_addr_t *dmaaddr) { if (iram_size == 0) { u32 savedval1, savedval2; @@ -53,10 +54,14 @@ u32 lpc32xx_return_iram_size(void) } else iram_size = LPC32XX_IRAM_BANK_SIZE * 2; } + if (dmaaddr) + *dmaaddr = LPC32XX_IRAM_BASE; + if (mapbase) + *mapbase = io_p2v(LPC32XX_IRAM_BASE); return iram_size; } -EXPORT_SYMBOL_GPL(lpc32xx_return_iram_size); +EXPORT_SYMBOL_GPL(lpc32xx_return_iram); static struct map_desc lpc32xx_io_desc[] __initdata = { { diff --git a/arch/arm/mach-lpc32xx/common.h b/arch/arm/mach-lpc32xx/common.h index 8e597ce48a73..32f0ad217807 100644 --- a/arch/arm/mach-lpc32xx/common.h +++ b/arch/arm/mach-lpc32xx/common.h @@ -23,7 +23,6 @@ extern void __init lpc32xx_serial_init(void); */ extern void lpc32xx_get_uid(u32 devid[4]); -extern u32 lpc32xx_return_iram_size(void); /* * Pointers used for sizing and copying suspend function data */ diff --git a/arch/arm/mach-lpc32xx/include/mach/board.h b/arch/arm/mach-lpc32xx/include/mach/board.h deleted file mode 100644 index 476513d970a4..000000000000 --- a/arch/arm/mach-lpc32xx/include/mach/board.h +++ /dev/null @@ -1,15 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * arm/arch/mach-lpc32xx/include/mach/board.h - * - * Author: Kevin Wells - * - * Copyright (C) 2010 NXP Semiconductors - */ - -#ifndef __ASM_ARCH_BOARD_H -#define __ASM_ARCH_BOARD_H - -extern u32 lpc32xx_return_iram_size(void); - -#endif /* __ASM_ARCH_BOARD_H */ diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c index f7e11f1b0426..bcdd0adcfb0c 100644 --- a/drivers/net/ethernet/nxp/lpc_eth.c +++ b/drivers/net/ethernet/nxp/lpc_eth.c @@ -18,8 +18,8 @@ #include #include #include +#include -#include #include #include @@ -1311,16 +1311,15 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) /* Get size of DMA buffers/descriptors region */ pldat->dma_buff_size = (ENET_TX_DESC + ENET_RX_DESC) * (ENET_MAXF_SIZE + sizeof(struct txrx_desc_t) + sizeof(struct rx_status_t)); - pldat->dma_buff_base_v = 0; if (use_iram_for_net(dev)) { - dma_handle = LPC32XX_IRAM_BASE; - if (pldat->dma_buff_size <= lpc32xx_return_iram_size()) - pldat->dma_buff_base_v = - io_p2v(LPC32XX_IRAM_BASE); - else + if (pldat->dma_buff_size > + lpc32xx_return_iram(&pldat->dma_buff_base_v, &dma_handle)) { + pldat->dma_buff_base_v = NULL; + pldat->dma_buff_size = 0; netdev_err(ndev, "IRAM not big enough for net buffers, using SDRAM instead.\n"); + } } if (pldat->dma_buff_base_v == 0) { @@ -1409,7 +1408,7 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) unregister_netdev(ndev); err_out_dma_unmap: if (!use_iram_for_net(dev) || - pldat->dma_buff_size > lpc32xx_return_iram_size()) + pldat->dma_buff_size > lpc32xx_return_iram(NULL, NULL)) dma_free_coherent(dev, pldat->dma_buff_size, pldat->dma_buff_base_v, pldat->dma_buff_base_p); @@ -1436,7 +1435,7 @@ static int lpc_eth_drv_remove(struct platform_device *pdev) unregister_netdev(ndev); if (!use_iram_for_net(&pldat->pdev->dev) || - pldat->dma_buff_size > lpc32xx_return_iram_size()) + pldat->dma_buff_size > lpc32xx_return_iram(NULL, NULL)) dma_free_coherent(&pldat->pdev->dev, pldat->dma_buff_size, pldat->dma_buff_base_v, pldat->dma_buff_base_p); diff --git a/include/linux/soc/nxp/lpc32xx-misc.h b/include/linux/soc/nxp/lpc32xx-misc.h new file mode 100644 index 000000000000..f232e1a1bcdc --- /dev/null +++ b/include/linux/soc/nxp/lpc32xx-misc.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Author: Kevin Wells + * + * Copyright (C) 2010 NXP Semiconductors + */ + +#ifndef __SOC_LPC32XX_MISC_H +#define __SOC_LPC32XX_MISC_H + +#include + +#ifdef CONFIG_ARCH_LPC32XX +extern u32 lpc32xx_return_iram(void __iomem **mapbase, dma_addr_t *dmaaddr); +#else +static inline u32 lpc32xx_return_iram(void __iomem **mapbase, dma_addr_t *dmaaddr) +{ + *mapbase = NULL; + *dmaaddr = 0; + return 0; +} +#endif + +#endif /* __SOC_LPC32XX_MISC_H */ From patchwork Fri Aug 9 14:40:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11086573 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 18E1C746 for ; Fri, 9 Aug 2019 14:44:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01F631FE8A for ; Fri, 9 Aug 2019 14:44:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E94651FF29; Fri, 9 Aug 2019 14:44:09 +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 81A461FE8A for ; Fri, 9 Aug 2019 14:44:09 +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:44:08 -0700 X-Received: by mail.kernel.org (Postfix) id 6BDC1208C4; Fri, 9 Aug 2019 14:44:08 +0000 (UTC) X-Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) (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 DB16E20820 for ; Fri, 9 Aug 2019 14:44:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DB16E20820 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1Mx0VH-1iG7wk0ZcR-00yNx6; Fri, 09 Aug 2019 16:43:57 +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 , "David S. Miller" , netdev@vger.kernel.org Subject: [PATCH v2 07/13] net: lpc-enet: move phy setup into platform code Date: Fri, 9 Aug 2019 16:40:33 +0200 Message-Id: <20190809144043.476786-8-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:npK/7O3KZV7d5O6NlWG3KNX1AMZFTWjJt5jIZxT/9Cn6I6FKIyo QtmoB26+nkmPETIXDitdSAt3MnVUpAxDnh/1ZLz+8c0KEwvBbqHnSWWDkLtfc/YRekmRqr5 U4rxDZ6QBOwqpsUrp+++R8K7fAN9D0TeE8kfbsHlLe8H0PeB8CZjVjOVT8MXhEld2he1dd2 UkoVJI9R12KVyqTHBifnQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:kLcmpZsLMHg=:LoRu5U8RBYNWBdajrx2Cwj 6uByw9wEYucEAL3bs+1NpQky5IJXsvTOh30GBcLVsNnj5/OwquXE9MpMPWojycLdCkndhwz+z puWsll5zQwgM8JWIVSvq6AWJAbVRm2X4pe5oDaKtxCngVuIIA+axfdXJ0S6FbTUnb8VnSwRIz qq7v+7v038KEMCGZ35mPmHCkXfEU1cSN6ZYwbZ0efnPULIZduEpJC52N64jDVt8VisVK3ssV7 6aZtKKRmULV1uAZhzrlmFP9iq2m/I9znqHOwo0YJr7yMOEeIgUZbJKtSxQV4j+UbcZDmS8HQE LuGQwq1CMlbsrrJJ0CGqN2/mLKJxYmnbfJtnsDdp1pjp20yYDa4qMU8r6bhtgwS3/yG7zDNqK iZxDQHnl4i8x6PnGJz67MzpBbv3vmsym27A3S58cKKn6Md9UDbBI242zZ6rbizo5HJDKXJ6GI UxCWGLvITRVhAspCZCfwt+EBfFguy1dhrC9XrOF4I0VJK3M53cHCw+jPJUdCzLP0oyIMvdtkp Weh4d1hylUIKcVZqernWkqPkZorxBi3+lgfwM6I+ifN2erPkpucf3aFo3oP3Wfr9zIDsiHgRm mo7Zowpf0ldICtz3wHHRygz4UhGCgI7NWy93AvCjci6ORuvc4Ev3IYioUWqjuGJPDuxULpn4A a15PpF5qK7LDO+UcnTtvdG5ORUZbfltTMWziW0OG2VhmkxTExAwXFxEmM7eWriJ1BYH607csq 1aGj26CaWSLC6rzP2Cbj9tPr6g43e+aGnQqJxQ== 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=1565361849; bh=X3PYF5drmkqKnXmL2UR7edJibdjPaBTu3Pe2/JtUieM=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=R3emJc+67T4YPZU7ktUtYyuVlZfVinLkGxnXcLdjHB7xnH62PYPzemWbchA4D9Wbr9k MQb4DE4/3xq+MXd+Gzdnjc5PqiltYFLiPof/dWeGD1Vn1w+9YkKWFy7w7FQrJgGOvjoGi fL9lIB+ib3xa6wHOA5Fgqp/5AvoAQFI7MR4= X-Virus-Scanned: ClamAV using ClamSMTP Setting the phy mode requires touching a platform specific register, which prevents us from building the driver without its header files. Move it into a separate function in arch/arm/mach/lpc32xx to hide the core registers from the network driver. Acked-by: Sylvain Lemieux Signed-off-by: Arnd Bergmann --- arch/arm/mach-lpc32xx/common.c | 12 ++++++++++++ drivers/net/ethernet/nxp/lpc_eth.c | 12 +----------- include/linux/soc/nxp/lpc32xx-misc.h | 5 +++++ 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-lpc32xx/common.c b/arch/arm/mach-lpc32xx/common.c index f648324d5fb4..a475339333c1 100644 --- a/arch/arm/mach-lpc32xx/common.c +++ b/arch/arm/mach-lpc32xx/common.c @@ -63,6 +63,18 @@ u32 lpc32xx_return_iram(void __iomem **mapbase, dma_addr_t *dmaaddr) } EXPORT_SYMBOL_GPL(lpc32xx_return_iram); +void lpc32xx_set_phy_interface_mode(phy_interface_t mode) +{ + u32 tmp = __raw_readl(LPC32XX_CLKPWR_MACCLK_CTRL); + tmp &= ~LPC32XX_CLKPWR_MACCTRL_PINS_MSK; + if (mode == PHY_INTERFACE_MODE_MII) + tmp |= LPC32XX_CLKPWR_MACCTRL_USE_MII_PINS; + else + tmp |= LPC32XX_CLKPWR_MACCTRL_USE_RMII_PINS; + __raw_writel(tmp, LPC32XX_CLKPWR_MACCLK_CTRL); +} +EXPORT_SYMBOL_GPL(lpc32xx_set_phy_interface_mode); + static struct map_desc lpc32xx_io_desc[] __initdata = { { .virtual = (unsigned long)IO_ADDRESS(LPC32XX_AHB0_START), diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c index bcdd0adcfb0c..0893b77c385d 100644 --- a/drivers/net/ethernet/nxp/lpc_eth.c +++ b/drivers/net/ethernet/nxp/lpc_eth.c @@ -20,9 +20,6 @@ #include #include -#include -#include - #define MODNAME "lpc-eth" #define DRV_VERSION "1.00" @@ -1237,16 +1234,9 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) dma_addr_t dma_handle; struct resource *res; int irq, ret; - u32 tmp; /* Setup network interface for RMII or MII mode */ - tmp = __raw_readl(LPC32XX_CLKPWR_MACCLK_CTRL); - tmp &= ~LPC32XX_CLKPWR_MACCTRL_PINS_MSK; - if (lpc_phy_interface_mode(dev) == PHY_INTERFACE_MODE_MII) - tmp |= LPC32XX_CLKPWR_MACCTRL_USE_MII_PINS; - else - tmp |= LPC32XX_CLKPWR_MACCTRL_USE_RMII_PINS; - __raw_writel(tmp, LPC32XX_CLKPWR_MACCLK_CTRL); + lpc32xx_set_phy_interface_mode(lpc_phy_interface_mode(dev)); /* Get platform resources */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); diff --git a/include/linux/soc/nxp/lpc32xx-misc.h b/include/linux/soc/nxp/lpc32xx-misc.h index f232e1a1bcdc..af4f82f6cf3b 100644 --- a/include/linux/soc/nxp/lpc32xx-misc.h +++ b/include/linux/soc/nxp/lpc32xx-misc.h @@ -9,9 +9,11 @@ #define __SOC_LPC32XX_MISC_H #include +#include #ifdef CONFIG_ARCH_LPC32XX extern u32 lpc32xx_return_iram(void __iomem **mapbase, dma_addr_t *dmaaddr); +extern void lpc32xx_set_phy_interface_mode(phy_interface_t mode); #else static inline u32 lpc32xx_return_iram(void __iomem **mapbase, dma_addr_t *dmaaddr) { @@ -19,6 +21,9 @@ static inline u32 lpc32xx_return_iram(void __iomem **mapbase, dma_addr_t *dmaadd *dmaaddr = 0; return 0; } +static inline void lpc32xx_set_phy_interface_mode(phy_interface_t mode) +{ +} #endif #endif /* __SOC_LPC32XX_MISC_H */ From patchwork Fri Aug 9 14:40:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11086577 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 2789614E5 for ; Fri, 9 Aug 2019 14:44:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1260E1FE8A for ; Fri, 9 Aug 2019 14:44:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 066291FF29; Fri, 9 Aug 2019 14:44:31 +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 AE1AD1FE8A for ; Fri, 9 Aug 2019 14:44:30 +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:44:30 -0700 X-Received: by mail.kernel.org (Postfix) id D7161208C4; Fri, 9 Aug 2019 14:44:29 +0000 (UTC) X-Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) (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 546BE20820 for ; Fri, 9 Aug 2019 14:44:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 546BE20820 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MeDYt-1iUKLc3gKV-00bKl6; Fri, 09 Aug 2019 16:44:12 +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, kbuild test robot , Arnd Bergmann , "David S. Miller" , netdev@vger.kernel.org Subject: [PATCH v2 08/13] net: lpc-enet: fix badzero.cocci warnings Date: Fri, 9 Aug 2019 16:40:34 +0200 Message-Id: <20190809144043.476786-9-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:ymJswPYKYUfJcYhkgzxASapbRky55SNMKmN45E1N1FA/lD9wVRt nEkanG7MtJ/Pqveg+h6/6LAG+DrFlq4SuhWOfaZiZETH7gs4em9A42H4Zt4uT3VfWrhsRIe CulwVh+XfSAkba94KTZX+nwNfSPRHjC2+ey++8db5AJWpxOhnI+dyS0vb26UIXRYODolgss ynV1gvQMpkNJsma+aWNww== X-UI-Out-Filterresults: notjunk:1;V03:K0:DJdco6j8rD4=:dQhHBR77IFlKfKZRM8eVPy V4nC2W/CrV/kLoRpyM40abNGXn7N9t/aH3K6fSYmFvDJr7DP0iiwcuYczFi4+CUVeoUIdbnMI arj1+4IXw5yJCeQTYabD611KpdLgrW7/n+Sc3ySzEvRoON9NljdOTWLx1riZgBH8a+wiRXA+L Eq7ZMP3kqlqu1mdz6XZUdwfunBrF7kR81tnf374XRy0wcH9UI9pI1LPhQu4CxyQlr85VMyZbg MhS/+C5PMG7Lyc9niJLsIzIHqazyAa9QgashCgryO59fbkX7/lpkbilsIGUSCuQ/IzaJcH6cV Q0dtBElm1MOZYc7+F4ZRBk/XAnZH40dzJpa3NYDI+N4O/wKzd1jnNyobsVqrxesXszSXszE9a CU6nIAwn9meG1N+GkMf+kB32G+m2gqCI7O0myYNCfDswYe0kxTEI6pCxJIZHoavUtj7pPfAt/ 3ZlaoDE6Od+cEXOij5a2FrcdIj94CHIauGWDuM/3zIsqw7SBVPobAgPkN7iGhLnSCQVB1GvMU 5wUJ8aM5BAQMSMG8/TVMdRjFtlbnsBbq1cVqM5oSyJVzfFfum40hbwvFTL4i2BqXgJBWgzk8E gAvKXfQuhMQL0z7O1bJJyFvZ1oZ8MoFzb8fhiwTteLjiO2a+OB0LVNxbmJTw++1xInAJgDDgO 0G/+Jii877WgDnTQ4DecrPqaIx+F4QDoF2YK8KG7GHUHKoeZqLRr5CHs2p7m1l9QYrih/gVOv BKbi3SN3knrMlI+s1+mASE3vWQVTBTatnNgMew== 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=1565361870; bh=zCf3NKq/LxuQhKoy8wgf9uZfOM4bvKEl4hz5JYEYlt8=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=hud0ifXvN+RpIdERU4r/BRGxRSoLM6s6l6qLzUOPKyCrOWshVDSA9kpPaXuqF/b3/RY b6GB14ML6JbBc8uBdlRRKVMjOBrm5Z0IQ6kQr3/h/VxgQRR4NRMt7p+3urHSye2ApyG5w dbRhSTY1LJr3X10BCQ2yKcHxGvnP9YDq3zQ= X-Virus-Scanned: ClamAV using ClamSMTP From: kbuild test robot drivers/net/ethernet/nxp/lpc_eth.c:1316:31-32: WARNING comparing pointer to 0 Compare pointer-typed values to NULL rather than 0 Semantic patch information: This makes an effort to choose between !x and x == NULL. !x is used if it has previously been used with the function used to initialize x. This relies on type information. More type information can be obtained using the option -all_includes and the option -I to specify an include path. Generated by: scripts/coccinelle/null/badzero.cocci Fixes: e42016eb3844 ("net: lpc-enet: allow compile testing") Signed-off-by: kbuild test robot Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/nxp/lpc_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c index 0893b77c385d..797bdbbcef76 100644 --- a/drivers/net/ethernet/nxp/lpc_eth.c +++ b/drivers/net/ethernet/nxp/lpc_eth.c @@ -1312,7 +1312,7 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) } } - if (pldat->dma_buff_base_v == 0) { + if (pldat->dma_buff_base_v == NULL) { ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32)); if (ret) goto err_out_free_irq; From patchwork Fri Aug 9 14:40:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11086579 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 1676A746 for ; Fri, 9 Aug 2019 14:44:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 010E91FE8A for ; Fri, 9 Aug 2019 14:44:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E91861FF29; Fri, 9 Aug 2019 14:44:40 +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 845331FE8A for ; Fri, 9 Aug 2019 14:44:40 +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:44:40 -0700 X-Received: by mail.kernel.org (Postfix) id ABBA7208C4; Fri, 9 Aug 2019 14:44:39 +0000 (UTC) X-Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) (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 1EA1720820 for ; Fri, 9 Aug 2019 14:44:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1EA1720820 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1Mth79-1iAbbg0rWx-00v4ZM; Fri, 09 Aug 2019 16:44:27 +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 , kbuild test robot , "David S. Miller" , netdev@vger.kernel.org Subject: [PATCH v2 09/13] net: lpc-enet: fix printk format strings Date: Fri, 9 Aug 2019 16:40:35 +0200 Message-Id: <20190809144043.476786-10-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:6Fx2odY0ygf+ZHM70dyaWh2GH0CHTs6YpTvBzkGXRPduV6BL0xl t72e5WbYRZFfSyvNB5wHUAwHLeZrRfgO4HsFF1kwFOkXWXfEfef0oUUQmo9a7s+ITnC2TC+ 83aglvlCCZmL5CEyNOodIIoVqFkema1G7urRVaVoGoYERLaBffBuydHZlG05der7HKlg+8P OTW/9RUwYKzKBmDHb7gtQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:IvXMTkvFbS0=:zCF+fdgg8gxSjM2KXJSPbJ VtwjpBPJBmUSNRZymPnwHy8UAVEH3AY87/wx7kAmDEo7Ulj2EaWiGC+0HiQ+ndiYtZKiyTLxl JAXVJ86moHoU7dHh7NqiGOJ2Y4Hr0CJHSWHTSLtnvX+b+hOeE+I/11Yi4s77Awb0yLy6lryhB tlDFKkKYJw8B19AA8zNr2iy0oVlqeNbck1fB/uiFuBrEiGvBRWOoPAt3pCDicmfFHv8EBM8vw 2XMGotVZeXkuUwizIf9EXHPFDdz4VAl8pn3M5/mWc78z0ybKFzqIgthgmFglQat1OsHelO1QD rXrQhGs5SUXc+uStB+paJsNTPN77kxpbjTV+w1O1yCYC3Amyvmv/bSZmAf1YEOd6KlfBjpDD3 VzNB1aQlAkF1mrKyvzy7ZRgkv9JmAZQ5xz2VRkNSu6mL0bMduELxlE+SIo4n1PkN0U/qfxVWP bzpXA/qiauT/MF13bZEN91IdcPpgpWVjz1G+9dq74SI3PLbTa+dWwGXXqwid4XAHRYbMqVDQi lvGIftyfNw8cJGgSEAyUBkbjfbnav+dp0GVwlM9+1ALdO7BkzPgrWKYSwT6SlUk1jraB2KY2W S9Q4BHZnG38FT0fpiQZsHq8FDrRVjQwz3OVmvGgF0MdVfh0VJyDOAHaG24pv5LIz/3i9bvb2l sj1C+PreIxrQ7mIjxDi988Xvgo8p3tN2V5ylpjAX/3tK8g2/6yAwypL2liN89WbYLGX0HT2tp GnBSi/LdGRTsDTOWzvgCZ0kpO6+9F4WT0WoDNg== 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=1565361880; bh=COUS2twCzjw/2IjeHcP+R3TB94TMKu4QclOWgcLw558=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=QfRh2ZAfxnt1lNpDnx8905cViNeAcIOsbGNyVwNF1QKgspM2TW4vI5v5+P8gH0VHVSx F1w0HRWEt9SkRelcD29c3+eLptynnNIlGqzSgfXDV2swj6qWGOHK6CwP82nEEes7XpmEI TRMdxjcCmwMNMoB84usKuwgYm0od2ylOE8A= X-Virus-Scanned: ClamAV using ClamSMTP compile-testing this driver on other architectures showed multiple warnings: drivers/net/ethernet/nxp/lpc_eth.c: In function 'lpc_eth_drv_probe': drivers/net/ethernet/nxp/lpc_eth.c:1337:19: warning: format '%d' expects argument of type 'int', but argument 4 has type 'resource_size_t {aka long long unsigned int}' [-Wformat=] drivers/net/ethernet/nxp/lpc_eth.c:1342:19: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=] Use format strings that work on all architectures. Reported-by: kbuild test robot Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/nxp/lpc_eth.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c index 797bdbbcef76..96d509c418bf 100644 --- a/drivers/net/ethernet/nxp/lpc_eth.c +++ b/drivers/net/ethernet/nxp/lpc_eth.c @@ -1333,13 +1333,14 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) pldat->dma_buff_base_p = dma_handle; netdev_dbg(ndev, "IO address space :%pR\n", res); - netdev_dbg(ndev, "IO address size :%d\n", resource_size(res)); + netdev_dbg(ndev, "IO address size :%zd\n", + (size_t)resource_size(res)); netdev_dbg(ndev, "IO address (mapped) :0x%p\n", pldat->net_base); netdev_dbg(ndev, "IRQ number :%d\n", ndev->irq); - netdev_dbg(ndev, "DMA buffer size :%d\n", pldat->dma_buff_size); - netdev_dbg(ndev, "DMA buffer P address :0x%08x\n", - pldat->dma_buff_base_p); + netdev_dbg(ndev, "DMA buffer size :%zd\n", pldat->dma_buff_size); + netdev_dbg(ndev, "DMA buffer P address :%pad\n", + &pldat->dma_buff_base_p); netdev_dbg(ndev, "DMA buffer V address :0x%p\n", pldat->dma_buff_base_v); @@ -1386,8 +1387,8 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) if (ret) goto err_out_unregister_netdev; - netdev_info(ndev, "LPC mac at 0x%08x irq %d\n", - res->start, ndev->irq); + netdev_info(ndev, "LPC mac at 0x%08lx irq %d\n", + (unsigned long)res->start, ndev->irq); device_init_wakeup(dev, 1); device_set_wakeup_enable(dev, 0); From patchwork Fri Aug 9 14:40:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11086583 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 AA91D14E5 for ; Fri, 9 Aug 2019 14:44:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95DE01FE8A for ; Fri, 9 Aug 2019 14:44:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 896E71FF29; Fri, 9 Aug 2019 14:44:57 +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 3B1831FE8A for ; Fri, 9 Aug 2019 14:44:57 +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:44:56 -0700 X-Received: by mail.kernel.org (Postfix) id 3BBD42171F; Fri, 9 Aug 2019 14:44:56 +0000 (UTC) X-Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) (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 AF452208C4 for ; Fri, 9 Aug 2019 14:44:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF452208C4 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1M7ehh-1hwwfj3ddd-0084kM; Fri, 09 Aug 2019 16:44:47 +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 , "David S. Miller" , netdev@vger.kernel.org Subject: [PATCH v2 10/13] net: lpc-enet: allow compile testing Date: Fri, 9 Aug 2019 16:40:36 +0200 Message-Id: <20190809144043.476786-11-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:RCFvjeuu0t6f1S3c2jeBwyAit2sEKCe3winoluK8TV6k5NAoOUO 0HaU0UeVh1bfmegCwZ/LxZYBGuVQ+7eXPexo60SZ4/fhiQPq4crzC1qGmIJ/ZR2C10ryy8P +3n+Rbdz54ykoqC2GhA3rvwxeJ73S0gOOpx9LpPn+IDp8M7Qct4l2VjHj5K1QVYXDT4/g+1 gvS4O0eBreeQVVrF4XDYQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:vO1wbEWxD8I=:6+u3R4GfutAihcMR0mmONZ HP7bzqimvfTuINSG21LTieDz2KUv6efnOlbOGeMn/i80QZwho0TC8mAEWfJXPHxbAKDG5Suh4 RknDI+FhEgZXDXw+DJvO73m1TbsaSWq2ADaOzaNwMKz7Yz4pLjKnkyjMsAXyqXqCKvpsnzanG DgCK/RBBm1OyJ4pOqRVtrly4GqCbLNtqtqww+vCW+wF2UVLD8sfjRbflblvU3XjSkdb8lxMjW Od8LUDWA4Q/S4zjmOaM8r+7U6V1V9EUUhMU8ZmL7yMbEansGeMyI01jfvMSd/YY4eJ7Z5j9Mi 4uew4FuY2ITGLxTVi3UPQQVs+qsi8o/GhBVluXyBAkVbRigHeUHG8DvCn2LGcPkWDbBBtAs++ cnGw/LGJ1ElnskF8l3d/+52MiyvPTv7yNgPEPXW0G+JcTKe+NE3ZVT/64VkZrjVXr4w57wx5h v005eDqI5QkSiqRdjwzeJxgfoXeUsRsJrZtQtZyQOphMoQeJKZsR9dHCZBwq/ocx8x8bC7iGf BMS2ffpA+JkheWx0C7rTmkMzyAnIFPMYV/Po522SNNBCx4MlExhIzMw5aWwG5vujNXpeXtrSD 0WeGsWIjjNnImHwadAS1ScB4KbQd0Xcv7VSH83TABwqk/9+M0AiscaQ6OL6rauWRhnvvucmdq hJ4xCU1b0ilijKOsiP6+DOn9UJH6iQOSwn5qWI79J+uZC16GTA08mzqfWm9BYDLFzck/qhkE9 5iCn+1XwlD62XtNtWSIAMC5X1XYrH4ZPc/M73w== 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=1565361897; bh=0NgZh9mtA7zvF4LO3V5AU6gZU/OHT8oTvb6dVjgT4H0=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=Nnaoga0NXiw46FqAh4cJbPxjZc2Hi6jsJBwtlgLRYSWmF5TUI8T9+cIsNWl3N6U2Vvi brH96FaCiCQUA1ACQHP8F0SYwooNAOrFKkB/5TcZxRPIVJlpvsJ+K0QWWtRdjnhBbdHy4 Znt5gNEtrYK2A4JRyGw4hHYAmygjGvFHlTY= X-Virus-Scanned: ClamAV using ClamSMTP The lpc-enet driver can now be built on all platforms, so allow compile testing as well. Add one missing header inclusion that is required in some configurations. Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/nxp/Kconfig | 2 +- drivers/net/ethernet/nxp/lpc_eth.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/nxp/Kconfig b/drivers/net/ethernet/nxp/Kconfig index 261f107e2be0..418afb84c84b 100644 --- a/drivers/net/ethernet/nxp/Kconfig +++ b/drivers/net/ethernet/nxp/Kconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only config LPC_ENET tristate "NXP ethernet MAC on LPC devices" - depends on ARCH_LPC32XX + depends on ARCH_LPC32XX || COMPILE_TEST select PHYLIB help Say Y or M here if you want to use the NXP ethernet MAC included on diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c index 96d509c418bf..141571e2ec11 100644 --- a/drivers/net/ethernet/nxp/lpc_eth.c +++ b/drivers/net/ethernet/nxp/lpc_eth.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include From patchwork Fri Aug 9 14:40:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11086589 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 038961399 for ; Fri, 9 Aug 2019 14:46:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E15951FE84 for ; Fri, 9 Aug 2019 14:46:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D55C21FEBA; Fri, 9 Aug 2019 14:46:04 +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 6172B1FE84 for ; Fri, 9 Aug 2019 14:46:04 +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:46:03 -0700 X-Received: by mail.kernel.org (Postfix) id 08B4B2171F; Fri, 9 Aug 2019 14:46:03 +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 7477D208C4 for ; Fri, 9 Aug 2019 14:46:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7477D208C4 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1N79Ey-1iNaIe1kU8-017V2R; Fri, 09 Aug 2019 16:45:20 +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 , Jiri Slaby , linux-serial@vger.kernel.org Subject: [PATCH v2 11/13] serial: lpc32xx: allow compile testing Date: Fri, 9 Aug 2019 16:40:37 +0200 Message-Id: <20190809144043.476786-12-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:QSyZAIrEK0tisvxeshqXx4Yf121VPR+VVNYcnXCO8jzU+Wj3Ush I/ukpTsjSD50wlu5mlErjvyyjoC7r5ZaE9gO6Bzq5JQB8kvQN/7/3zM8Bih+zpxqpE1wyo4 T5ehI8/mM/L7wAgH4tcbxV4iEiOQijuNX2En16g/UAdInN5IC+HSJHS6z7Tyg1No1B2si8l 19wPbeSZDJ1CNo4wggS2A== X-UI-Out-Filterresults: notjunk:1;V03:K0:VJCyh49joGQ=:hiDrY4RgZVRXKwVAgZwTaF zd/yvwV5BTZewhK51/lohRaZMa4Ns09MbbfjiVlXLr5F+LAzi3ITNBjb79lgUU0Y3zS5zA0Gg 6fMw1KccRDUHKbZ7nR5vc3++tNjZAY8jtUo8K1uTy7g7c8fU29PKEi1rzwGZofnn7OUmhCK9/ +SoDdtlr/BCbvIO8lImCdQ6JUpVEhWW2ZW6skW9CBes3Aud4FKEi2N/AEreZqioOOYxOxVVbC E7ZXajHg0vvQvFwqJKTMEHyssG8oGufrB2rl2mltwc/9AyeWX5gLPnrgwwGKAYieJgrHBKd90 2hdrZOhAt6ju6w3H7zepU+DH3gSl8nopfVfESIfOH708xGNuc9p3bDTiq61nsIza3PM7gCmGs w44mJQY5PlsPIGTFdlzKnJy+xhElyaG3CbTYGUBn0lngXe6pEAah6teBvuIhbhe9z2KbBoVae xL6OnSGYwiKhBS2tq0YmF+AN4Cvv6dq7t68dsK24GOgio4AyGLVg7DLrJhguVowEXjR3qAqSU vyvia2c9x7tzYcRE2DvRfP7km8GnHCORRT34OKCUqNiMD5pwREOpwFiU0AO86WFKuZhxzydlG uheyaIfuS+5sTAUwai+7fYv+NvzQ5wIxwI/1kz6tLkzmBBAQVrvXoHqxhfqmgJAcwNoa3YLnr Ok37nwVz4h+iJIXlt6wzL8C3QHsoOhlH4hXBTMxqosmMvDo5Skz356oB7K+CDQDhQAaVW9Kuu C3BZGQW5BFpJC6DTSfIJQyquZnDaMZQUeE0TuA== 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=1565361964; bh=Y3ITxfo7VubT5yEZqYGw95Ub9a/yi8DLdjYRoVSzlrA=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=nTCFZ4MZVtJjtyM5s2TF3VviIzvCwQWEpwcl4xOczETdaDrmY49vXjZcCAWlDMditD4 mzPxD0MWerHloIwLC/vnCotrh/22tBJH++CFUYF9xeAc8fk/83aQ17RH6zOClFFklSyKg ldcta/oedUKapJ958yz/mKgniGznZswGHws= X-Virus-Scanned: ClamAV using ClamSMTP The lpc32xx_loopback_set() function in hte lpc32xx_hs driver is the one thing that relies on platform header files. Move that into the core platform code so we only need a variable declaration for it, and enable COMPILE_TEST building. Signed-off-by: Arnd Bergmann Acked-by: Greg Kroah-Hartman --- arch/arm/mach-lpc32xx/serial.c | 30 ++++++++++++++++++++++++ drivers/tty/serial/lpc32xx_hs.c | 35 ++++------------------------ include/linux/soc/nxp/lpc32xx-misc.h | 4 ++++ 3 files changed, 38 insertions(+), 31 deletions(-) diff --git a/arch/arm/mach-lpc32xx/serial.c b/arch/arm/mach-lpc32xx/serial.c index 3f9b30df9f0e..cfb35e5691cd 100644 --- a/arch/arm/mach-lpc32xx/serial.c +++ b/arch/arm/mach-lpc32xx/serial.c @@ -60,6 +60,36 @@ static struct uartinit uartinit_data[] __initdata = { }, }; +/* LPC3250 Errata HSUART.1: Hang workaround via loopback mode on inactivity */ +void lpc32xx_loopback_set(resource_size_t mapbase, int state) +{ + int bit; + u32 tmp; + + switch (mapbase) { + case LPC32XX_HS_UART1_BASE: + bit = 0; + break; + case LPC32XX_HS_UART2_BASE: + bit = 1; + break; + case LPC32XX_HS_UART7_BASE: + bit = 6; + break; + default: + WARN(1, "lpc32xx_hs: Warning: Unknown port at %08x\n", mapbase); + return; + } + + tmp = readl(LPC32XX_UARTCTL_CLOOP); + if (state) + tmp |= (1 << bit); + else + tmp &= ~(1 << bit); + writel(tmp, LPC32XX_UARTCTL_CLOOP); +} +EXPORT_SYMBOL_GPL(lpc32xx_loopback_set); + void __init lpc32xx_serial_init(void) { u32 tmp, clkmodes = 0; diff --git a/drivers/tty/serial/lpc32xx_hs.c b/drivers/tty/serial/lpc32xx_hs.c index 7f14cd8fac47..d3843f722182 100644 --- a/drivers/tty/serial/lpc32xx_hs.c +++ b/drivers/tty/serial/lpc32xx_hs.c @@ -25,6 +25,8 @@ #include #include #include +#include +#include /* * High Speed UART register offsets @@ -79,6 +81,8 @@ #define LPC32XX_HSU_TX_TL8B (0x2 << 0) #define LPC32XX_HSU_TX_TL16B (0x3 << 0) +#define LPC32XX_MAIN_OSC_FREQ 13000000 + #define MODNAME "lpc32xx_hsuart" struct lpc32xx_hsuart_port { @@ -149,8 +153,6 @@ static void lpc32xx_hsuart_console_write(struct console *co, const char *s, local_irq_restore(flags); } -static void lpc32xx_loopback_set(resource_size_t mapbase, int state); - static int __init lpc32xx_hsuart_console_setup(struct console *co, char *options) { @@ -437,35 +439,6 @@ static void serial_lpc32xx_break_ctl(struct uart_port *port, spin_unlock_irqrestore(&port->lock, flags); } -/* LPC3250 Errata HSUART.1: Hang workaround via loopback mode on inactivity */ -static void lpc32xx_loopback_set(resource_size_t mapbase, int state) -{ - int bit; - u32 tmp; - - switch (mapbase) { - case LPC32XX_HS_UART1_BASE: - bit = 0; - break; - case LPC32XX_HS_UART2_BASE: - bit = 1; - break; - case LPC32XX_HS_UART7_BASE: - bit = 6; - break; - default: - WARN(1, "lpc32xx_hs: Warning: Unknown port at %08x\n", mapbase); - return; - } - - tmp = readl(LPC32XX_UARTCTL_CLOOP); - if (state) - tmp |= (1 << bit); - else - tmp &= ~(1 << bit); - writel(tmp, LPC32XX_UARTCTL_CLOOP); -} - /* port->lock is not held. */ static int serial_lpc32xx_startup(struct uart_port *port) { diff --git a/include/linux/soc/nxp/lpc32xx-misc.h b/include/linux/soc/nxp/lpc32xx-misc.h index af4f82f6cf3b..699c6f1e3aab 100644 --- a/include/linux/soc/nxp/lpc32xx-misc.h +++ b/include/linux/soc/nxp/lpc32xx-misc.h @@ -14,6 +14,7 @@ #ifdef CONFIG_ARCH_LPC32XX extern u32 lpc32xx_return_iram(void __iomem **mapbase, dma_addr_t *dmaaddr); extern void lpc32xx_set_phy_interface_mode(phy_interface_t mode); +extern void lpc32xx_loopback_set(resource_size_t mapbase, int state); #else static inline u32 lpc32xx_return_iram(void __iomem **mapbase, dma_addr_t *dmaaddr) { @@ -24,6 +25,9 @@ static inline u32 lpc32xx_return_iram(void __iomem **mapbase, dma_addr_t *dmaadd static inline void lpc32xx_set_phy_interface_mode(phy_interface_t mode) { } +static inline void lpc32xx_loopback_set(resource_size_t mapbase, int state) +{ +} #endif #endif /* __SOC_LPC32XX_MISC_H */ From patchwork Fri Aug 9 14:40:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11086591 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 93CF914E5 for ; Fri, 9 Aug 2019 14:46:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A3731FE8A for ; Fri, 9 Aug 2019 14:46:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DB2C1FF29; Fri, 9 Aug 2019 14:46:19 +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 AA5151FE8A for ; Fri, 9 Aug 2019 14:46:12 +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:46:12 -0700 X-Received: by mail.kernel.org (Postfix) id E8CFF208C4; Fri, 9 Aug 2019 14:46:11 +0000 (UTC) X-Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) (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 62C3F20820 for ; Fri, 9 Aug 2019 14:46:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 62C3F20820 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MpTpc-1if78t25mO-00py9b; Fri, 09 Aug 2019 16:45:59 +0200 From: Arnd Bergmann To: Linuxkernel+Patchwork-Soc via Email Integration Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH v2 12/13] ARM: lpc32xx: clean up header files Date: Fri, 9 Aug 2019 16:40:38 +0200 Message-Id: <20190809144043.476786-13-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:gUv5Djd/kUqZty7AwE14hMF4BlO136N+kfe2FDOX9t6V9ZTl3xJ RyDl101DmZmiqt6fWRNui6ntR+M8v6PNq36iqqfyAIEP4TNYQgNva6vtZMNBiqQ5whyMYJl uME5uFSbE50zOjXnMdLR0vuRF67iM6tFcgPcX4lSproSYFO+rw88afqDIy4juJQlXKUZE0t wesLQIQyeBR+lrUPQBxYg== X-UI-Out-Filterresults: notjunk:1;V03:K0:4LZhuL+dm+4=:3OE/ZUQHPHOVTVdznznZXx F2OyfC2OjeZoVmm9lNylI73g6dCm780+Ipwl1Jdi2DPqBHoI8GoIw+bBlr2VltLNH6i0vr1q8 rIF/ySmGXW7tZMB0VllI3+/4vxM8OUyrN6FY6GJ6s+D2Vc8ebnqqAVSRkz6wr0fw7Tw1e6/iV 44ggRUunEJPwvBl7QtfDFC/qMfm0HGOVMYVKS54R4WSUElA+rnXSN1KKFzrT4NSDePDoKCZtS BvCspyedjyK/lMqDDQ9lCcokNNtEJ/pG0dzskxpw/QgrWoQBYsKP8j9FE/oqseoUDJW8t5u7a weT9b0bBW8olKPCKmcqPk5g1u7lvm8WvJqNfegItKNeunq1T6YMzyh3xy5FH0psNAOaKeOkDV zs5wlKCRUSyJtZk3qc+hRSebTZtQXIFXZXywAYiXFoav/E2JBbefh/yDJwBHwGYt0Sj7LNT4m WtWKrDFA4qwAwtjbLZQwCRiATSD95DmAIkB4wwwwZXGAijS9uW3rHvry1L//1C7l9JTIdbAfj 149HFxwj+/+v5cn805YbC9cXL8BL2skeJz4ITkeL0cC+b7tIc3S6LB/lhkoBAaWnuWMmYnMiE QzTXlj+kILJ3jL6TzzPDHVjeV8H4Oxfh4Xm5NS7DmNIRjI7URFYufNbf9yi6WkSEH47AEDN0H s/W7fKBWJQl9WozDUmfJSOo5bIGRbo99oghLJCpkag3UMvXddho/VUu7TRFKEjcvc3TXuQ5SU IVVDb8PCe6GE4A6py4qZkRfx3pWAjSE1AADxWg== 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=1565361972; bh=AP7raA6+jMEoYBEp//VsUT75M93r04dX5Y+GvFaql0M=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=OTuWaQs5DfzfzwZ4S+7FbafuskrX8UrUnrVgJCRWeWytvy3zI0/o7WCRH5hlxTB8Bu5 Bt8zG4T5uVW9r+QSCr3iEU+UkGYC4gjB1Bv0JMsE1PDAENjUP0Vhb6YV6wwTSqTxUOJd4 sjzk4ALSnjALrnGsztld61/QEIc7UbmYvhk= X-Virus-Scanned: ClamAV using ClamSMTP All device drivers have stopped relying on mach/*.h headers, so move the remaining headers into arch/arm/mach-lpc32xx/lpc32xx.h to prepare for multiplatform builds. The mach/entry-macro.S file has been unused for a long time now and can simply get removed. Acked-by: Sylvain Lemieux Signed-off-by: Arnd Bergmann --- arch/arm/mach-lpc32xx/common.c | 3 +- .../mach-lpc32xx/include/mach/entry-macro.S | 28 ------------------- arch/arm/mach-lpc32xx/include/mach/hardware.h | 25 ----------------- .../mach-lpc32xx/include/mach/uncompress.h | 4 +-- .../{include/mach/platform.h => lpc32xx.h} | 18 ++++++++++-- arch/arm/mach-lpc32xx/pm.c | 3 +- arch/arm/mach-lpc32xx/serial.c | 3 +- arch/arm/mach-lpc32xx/suspend.S | 3 +- 8 files changed, 21 insertions(+), 66 deletions(-) delete mode 100644 arch/arm/mach-lpc32xx/include/mach/entry-macro.S delete mode 100644 arch/arm/mach-lpc32xx/include/mach/hardware.h rename arch/arm/mach-lpc32xx/{include/mach/platform.h => lpc32xx.h} (98%) diff --git a/arch/arm/mach-lpc32xx/common.c b/arch/arm/mach-lpc32xx/common.c index a475339333c1..304ea61a0716 100644 --- a/arch/arm/mach-lpc32xx/common.c +++ b/arch/arm/mach-lpc32xx/common.c @@ -13,8 +13,7 @@ #include #include -#include -#include +#include "lpc32xx.h" #include "common.h" /* diff --git a/arch/arm/mach-lpc32xx/include/mach/entry-macro.S b/arch/arm/mach-lpc32xx/include/mach/entry-macro.S deleted file mode 100644 index eec0f5f7e722..000000000000 --- a/arch/arm/mach-lpc32xx/include/mach/entry-macro.S +++ /dev/null @@ -1,28 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * arch/arm/mach-lpc32xx/include/mach/entry-macro.S - * - * Author: Kevin Wells - * - * Copyright (C) 2010 NXP Semiconductors - */ - -#include -#include - -#define LPC32XX_INTC_MASKED_STATUS_OFS 0x8 - - .macro get_irqnr_preamble, base, tmp - ldr \base, =IO_ADDRESS(LPC32XX_MIC_BASE) - .endm - -/* - * Return IRQ number in irqnr. Also return processor Z flag status in CPSR - * as set if an interrupt is pending. - */ - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - ldr \irqstat, [\base, #LPC32XX_INTC_MASKED_STATUS_OFS] - clz \irqnr, \irqstat - rsb \irqnr, \irqnr, #31 - teq \irqstat, #0 - .endm diff --git a/arch/arm/mach-lpc32xx/include/mach/hardware.h b/arch/arm/mach-lpc32xx/include/mach/hardware.h deleted file mode 100644 index 4866f096ffce..000000000000 --- a/arch/arm/mach-lpc32xx/include/mach/hardware.h +++ /dev/null @@ -1,25 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * arch/arm/mach-lpc32xx/include/mach/hardware.h - * - * Copyright (c) 2005 MontaVista Software, Inc. - */ - -#ifndef __ASM_ARCH_HARDWARE_H -#define __ASM_ARCH_HARDWARE_H - -/* - * Start of virtual addresses for IO devices - */ -#define IO_BASE 0xF0000000 - -/* - * This macro relies on fact that for all HW i/o addresses bits 20-23 are 0 - */ -#define IO_ADDRESS(x) IOMEM(((((x) & 0xff000000) >> 4) | ((x) & 0xfffff)) |\ - IO_BASE) - -#define io_p2v(x) ((void __iomem *) (unsigned long) IO_ADDRESS(x)) -#define io_v2p(x) ((((x) & 0x0ff00000) << 4) | ((x) & 0x000fffff)) - -#endif diff --git a/arch/arm/mach-lpc32xx/include/mach/uncompress.h b/arch/arm/mach-lpc32xx/include/mach/uncompress.h index a568812a0b91..74b7aa0da0e4 100644 --- a/arch/arm/mach-lpc32xx/include/mach/uncompress.h +++ b/arch/arm/mach-lpc32xx/include/mach/uncompress.h @@ -12,15 +12,13 @@ #include -#include -#include - /* * Uncompress output is hardcoded to standard UART 5 */ #define UART_FIFO_CTL_TX_RESET (1 << 2) #define UART_STATUS_TX_MT (1 << 6) +#define LPC32XX_UART5_BASE 0x40090000 #define _UARTREG(x) (void __iomem *)(LPC32XX_UART5_BASE + (x)) diff --git a/arch/arm/mach-lpc32xx/include/mach/platform.h b/arch/arm/mach-lpc32xx/lpc32xx.h similarity index 98% rename from arch/arm/mach-lpc32xx/include/mach/platform.h rename to arch/arm/mach-lpc32xx/lpc32xx.h index 1c53790444fc..5eeb884a1993 100644 --- a/arch/arm/mach-lpc32xx/include/mach/platform.h +++ b/arch/arm/mach-lpc32xx/lpc32xx.h @@ -7,8 +7,8 @@ * Copyright (C) 2010 NXP Semiconductors */ -#ifndef __ASM_ARCH_PLATFORM_H -#define __ASM_ARCH_PLATFORM_H +#ifndef __ARM_LPC32XX_H +#define __ARM_LPC32XX_H #define _SBF(f, v) ((v) << (f)) #define _BIT(n) _SBF(n, 1) @@ -700,4 +700,18 @@ #define LPC32XX_USB_OTG_DEV_CLOCK_ON _BIT(1) #define LPC32XX_USB_OTG_HOST_CLOCK_ON _BIT(0) +/* + * Start of virtual addresses for IO devices + */ +#define IO_BASE 0xF0000000 + +/* + * This macro relies on fact that for all HW i/o addresses bits 20-23 are 0 + */ +#define IO_ADDRESS(x) IOMEM(((((x) & 0xff000000) >> 4) | ((x) & 0xfffff)) |\ + IO_BASE) + +#define io_p2v(x) ((void __iomem *) (unsigned long) IO_ADDRESS(x)) +#define io_v2p(x) ((((x) & 0x0ff00000) << 4) | ((x) & 0x000fffff)) + #endif diff --git a/arch/arm/mach-lpc32xx/pm.c b/arch/arm/mach-lpc32xx/pm.c index 32bca351a73b..b27fa1b9f56c 100644 --- a/arch/arm/mach-lpc32xx/pm.c +++ b/arch/arm/mach-lpc32xx/pm.c @@ -70,8 +70,7 @@ #include -#include -#include +#include "lpc32xx.h" #include "common.h" #define TEMP_IRAM_AREA IO_ADDRESS(LPC32XX_IRAM_BASE) diff --git a/arch/arm/mach-lpc32xx/serial.c b/arch/arm/mach-lpc32xx/serial.c index cfb35e5691cd..3e765c4bf986 100644 --- a/arch/arm/mach-lpc32xx/serial.c +++ b/arch/arm/mach-lpc32xx/serial.c @@ -16,8 +16,7 @@ #include #include -#include -#include +#include "lpc32xx.h" #include "common.h" #define LPC32XX_SUART_FIFO_SIZE 64 diff --git a/arch/arm/mach-lpc32xx/suspend.S b/arch/arm/mach-lpc32xx/suspend.S index 374f9f07fe48..3f0a8282ef6f 100644 --- a/arch/arm/mach-lpc32xx/suspend.S +++ b/arch/arm/mach-lpc32xx/suspend.S @@ -11,8 +11,7 @@ */ #include #include -#include -#include +#include "lpc32xx.h" /* Using named register defines makes the code easier to follow */ #define WORK1_REG r0 From patchwork Fri Aug 9 14:40:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11086597 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 EE91514E5 for ; Fri, 9 Aug 2019 14:46:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D392E1FE8A for ; Fri, 9 Aug 2019 14:46:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C71CF1FF29; Fri, 9 Aug 2019 14:46: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=-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 35AFC1FE8A for ; Fri, 9 Aug 2019 14:46:41 +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:46:40 -0700 X-Received: by mail.kernel.org (Postfix) id C1C5B208C4; Fri, 9 Aug 2019 14:46:39 +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 24E6320820 for ; Fri, 9 Aug 2019 14:46:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 24E6320820 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1M91Tq-1hzxWA3eR4-0068fZ; Fri, 09 Aug 2019 16:46:32 +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 Subject: [PATCH v2 13/13] ARM: lpc32xx: allow multiplatform build Date: Fri, 9 Aug 2019 16:40:39 +0200 Message-Id: <20190809144043.476786-14-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:ZpjjCgarnGP5OJJp7WqQXWJgBqErfvsp1pHllIlsTishTCM846M jagMW25mCiPe3qu3M4uGN7g2QnCf34G9GnKrz0TqjJSnZ6Q+XkjB4nyDo8UTs99GPTy1W9+ mVhPZdrw8O3cYMWo/365dZVg+gK46PHAFFZYy5FcyFbaoNKm8JEbKDRWzI+ikSvh3TL8+cg t0242PhtMh68LzzfofLMA== X-UI-Out-Filterresults: notjunk:1;V03:K0:mGfmQMJJPbM=:2+AUq2ZbO8MpEuFsuTDE3V /Wrx2sOiWCbaNdmELUyYovk+spLUFWeBJMcah1lTc/GaQWLv64cDA7p+pJhQU4qDQsG0z0y0I xJ+E2H4bWCF9ELfnBmJXulydXgn40JBRN+5CBpvShd4XY2ctVQdg+qcB9yBrbTMiN4IVpgh/4 f9hlw1NtkFuWgeYybeBQsuy535prRveYOqn2BCIAHxWmNhVj2CnKNv7ySWPomminyBKgZzux/ MEsPCXPyYE/YyiWzyd8yjazfKr2FnKM4swS6YKHb112HOSiNeznqxMN+xHdkxwcpj3sCJ+LlY CPWDK3UjP5TVfjV1LqPv2KZ/na1PR8D8rFVXg+LhqIKob9WbGqbMegl/7RY0V0gvu91gjopSD L6El8+Nw//G9NySUkDuXFpqtz4UENAMjsh/zXKos7xmjywn0OjUZRpg7uCvjF8cVt3YkwTzbl 1yq7KtY2EJ/whp1KqtUdsIx5Lu7LwFECQqD4Q8dtMkbUs4aWzv1RG7Eio+XFkGYXuO0z770u9 kWPktzcKQiO8GyxwAfXLOUckSaY4p9ZRkx4Z/avI+Yj3xjd+5dZfc0vVe6wv/5mDy4gknfzk3 mBjH1tEAGc56m/qRIA0MBCL2aGZRE9jXwZlIOOkyKqIwiFdxReT/NqQx/QYBfZtvHOkegNXIJ UYIb7QJA7jST+yVcIsmS21pomW9dsHq0mU/CkxqloLr9nM9K8+0A1AIvjMxyNOCZVYxPDJvIn c0GsggycoOG0ikntFiudD2ZptPiVcBa4VsmlEA== 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=1565362000; bh=EYqY1YnwTgnV6NRTgdGy5gr4/yIFNOFraAJS25NqTiA=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=evDQu8Zk0+D5yFu+UEzchZD35Ro9ffBL2k066fQp7NaSa6iXEjZMRVoXC6eDPjyH5yS kKmm2d4UTdDHhDSmA4F8M5bF1VrlxiTARlQMfzjBUAelY6PuPaWAKyHN6s+Cd02uwd9pE q2PxFPSbP9NxIOXDnsm04+8WXRHOq4L8I74= X-Virus-Scanned: ClamAV using ClamSMTP All preparation work is done, so the platform can finally be moved into ARCH_MULTIPLATFORM. This requires a small change to the defconfig file to enable the platform. Signed-off-by: Arnd Bergmann --- arch/arm/Kconfig | 17 +------ arch/arm/configs/lpc32xx_defconfig | 1 + arch/arm/mach-lpc32xx/Kconfig | 11 +++++ .../mach-lpc32xx/include/mach/uncompress.h | 48 ------------------- 4 files changed, 14 insertions(+), 63 deletions(-) create mode 100644 arch/arm/mach-lpc32xx/Kconfig delete mode 100644 arch/arm/mach-lpc32xx/include/mach/uncompress.h diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 33b00579beff..65808e17cb3b 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -478,21 +478,6 @@ config ARCH_W90X900 -config ARCH_LPC32XX - bool "NXP LPC32XX" - select ARM_AMBA - select CLKDEV_LOOKUP - select CLKSRC_LPC32XX - select COMMON_CLK - select CPU_ARM926T - select GENERIC_CLOCKEVENTS - select GENERIC_IRQ_MULTI_HANDLER - select GPIOLIB - select SPARSE_IRQ - select USE_OF - help - Support for the NXP LPC32XX family of processors - config ARCH_PXA bool "PXA2xx/PXA3xx-based" depends on MMU @@ -746,6 +731,8 @@ source "arch/arm/mach-keystone/Kconfig" source "arch/arm/mach-ks8695/Kconfig" +source "arch/arm/mach-lpc32xx/Kconfig" + source "arch/arm/mach-mediatek/Kconfig" source "arch/arm/mach-meson/Kconfig" diff --git a/arch/arm/configs/lpc32xx_defconfig b/arch/arm/configs/lpc32xx_defconfig index 3772d5a8975a..09deb57db942 100644 --- a/arch/arm/configs/lpc32xx_defconfig +++ b/arch/arm/configs/lpc32xx_defconfig @@ -12,6 +12,7 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_SYSCTL_SYSCALL=y CONFIG_EMBEDDED=y CONFIG_SLAB=y +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_LPC32XX=y CONFIG_AEABI=y CONFIG_ZBOOT_ROM_TEXT=0x0 diff --git a/arch/arm/mach-lpc32xx/Kconfig b/arch/arm/mach-lpc32xx/Kconfig new file mode 100644 index 000000000000..ec87c65f4536 --- /dev/null +++ b/arch/arm/mach-lpc32xx/Kconfig @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: GPL-2.0-only + +config ARCH_LPC32XX + bool "NXP LPC32XX" + depends on ARCH_MULTI_V5 + select ARM_AMBA + select CLKSRC_LPC32XX + select CPU_ARM926T + select GPIOLIB + help + Support for the NXP LPC32XX family of processors diff --git a/arch/arm/mach-lpc32xx/include/mach/uncompress.h b/arch/arm/mach-lpc32xx/include/mach/uncompress.h deleted file mode 100644 index 74b7aa0da0e4..000000000000 --- a/arch/arm/mach-lpc32xx/include/mach/uncompress.h +++ /dev/null @@ -1,48 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * arch/arm/mach-lpc32xx/include/mach/uncompress.h - * - * Author: Kevin Wells - * - * Copyright (C) 2010 NXP Semiconductors - */ - -#ifndef __ASM_ARM_ARCH_UNCOMPRESS_H -#define __ASM_ARM_ARCH_UNCOMPRESS_H - -#include - -/* - * Uncompress output is hardcoded to standard UART 5 - */ - -#define UART_FIFO_CTL_TX_RESET (1 << 2) -#define UART_STATUS_TX_MT (1 << 6) -#define LPC32XX_UART5_BASE 0x40090000 - -#define _UARTREG(x) (void __iomem *)(LPC32XX_UART5_BASE + (x)) - -#define LPC32XX_UART_DLLFIFO_O 0x00 -#define LPC32XX_UART_IIRFCR_O 0x08 -#define LPC32XX_UART_LSR_O 0x14 - -static inline void putc(int ch) -{ - /* Wait for transmit FIFO to empty */ - while ((__raw_readl(_UARTREG(LPC32XX_UART_LSR_O)) & - UART_STATUS_TX_MT) == 0) - ; - - __raw_writel((u32) ch, _UARTREG(LPC32XX_UART_DLLFIFO_O)); -} - -static inline void flush(void) -{ - __raw_writel(__raw_readl(_UARTREG(LPC32XX_UART_IIRFCR_O)) | - UART_FIFO_CTL_TX_RESET, _UARTREG(LPC32XX_UART_IIRFCR_O)); -} - -/* NULL functions; we don't presently need them */ -#define arch_decomp_setup() - -#endif