From patchwork Wed Jul 31 19:56:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11069151 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 EBA351398 for ; Wed, 31 Jul 2019 19:58:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8C8727CF3 for ; Wed, 31 Jul 2019 19:58:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC90327F3E; Wed, 31 Jul 2019 19:58:27 +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 4734827DCD for ; Wed, 31 Jul 2019 19:58:27 +0000 (UTC) X-Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by groups.io with SMTP; Wed, 31 Jul 2019 12:58:26 -0700 X-Received: by mail.kernel.org (Postfix) id AADD7214DA; Wed, 31 Jul 2019 19:58:25 +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 13A98206A3 for ; Wed, 31 Jul 2019 19:58:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 13A98206A3 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MREqy-1hgjWs14cO-00N7VN; Wed, 31 Jul 2019 21:57:50 +0200 From: Arnd Bergmann To: Linuxkernel+Patchwork-Soc via Email Integration Cc: Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , "David S. Miller" , Guenter Roeck , linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 01/14] usb: ohci-nxp: enable compile-testing Date: Wed, 31 Jul 2019 21:56:43 +0200 Message-Id: <20190731195713.3150463-2-arnd@arndb.de> In-Reply-To: <20190731195713.3150463-1-arnd@arndb.de> References: <20190731195713.3150463-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:Y9P2ZZ0tUv+u7UP+ySO48Qnisfdw/BPCHBVVrPVOhMR0se6XHtZ /rVucQltL2fuAeI04etj2w+UKbl8qnEoBbumQEN4+999lkM3I2ap2LhDhPPYCU+sPUiSn9C MHqmRZQQCJodcJVkIaRsJz/aHzlJ2qbDtR9NKGZoXdpYt9iNJyi2kjLzGDf3w4RZjG9+E0D 3y12ssqwzFQKPPcwF8qWQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:Xo1stquwtQs=:bl7JhWbnrGGzdDgrJPO8Kj DFy2wWP0ZHZ9IanjfpKj7idAUI1oh8dwC6+KdJvb4LHeY1JtZMKcx63mjHAi686NYHgQ8VVTE qpvSBbWGUYS5+bYWsQ/4laOaF1bNS8KywD6IBggqWVu/qHZqfq9eI1VEV6NpVr5g5MyaMj1IH P1wdZBUDAvXz+mDSgg7cQloD/0mVegg6up9JQIRaNzmyYHPSzsKpv8GSHgQBiMwAmeah7yIaO cZfZOQzu/09Y4lqBFz/YeeiIARk7oD3Pa0WQbjRh+AZOmhCQaBCG4OrJn3aq3qPwJeOM0Hv1K KKSuKJKjGXmywjGRQ29Orr90FifnUh8cq1ttCAtvmbagDR63yrU64szUpPnzWtecaWIRp6s5b vTO1+amooJrMidahTJqQKSHM2fx4r9Sr5EmLoCZv+/c9BPTs+f02+pADSmTAUS22Fgv+0jaGt 4HQm2+tHlytUCew5ukF92am1YnKG10BWAYbLXeG2MH8pUFBmgRRVR7ilL7WeTx2Gedk/V79ct uGd8u0N8BHw/0ZucXrPbX+CiYkje/6ZXb3B2XMt6A0XjEX+fg0JP5yhXoUELaqnft5n+Wvivf b1eeZZbdGV+ibHimys+Ct4FUkEzW13+8qoPTMA6tfQrU+zhiUJvNpnzkTBP7V31ZHaVtkPotD 0n8Ep6f3eWAW9zElHMZFjMZoVXqmIZUOH9/ZHQqRINOgvWQfv5Zqa7S52aDmMcB7cQFIxgl+w blDIwv7/7PJz7UoT+quSvgJ675iI9iAKHP+p6g== 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=1564603106; bh=jv3LbSrJ4KAv05m+lM94wu7uGcCEcq9tHuNRInfRQus=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=o2SQAbWMyNjSwYYDko6cjWP4+qge/cHKL1Aq1/Qrh3/tMe+00nY6LqfIC1RqTJ7Awgd +dCO0M8RzKVoDiQAbCFWsBRO/N1wNsyZYFt9Mx1/1vMYcHVNl4pgoNDWc6RHergM2QB+l PmWbiU7hmAb2FqlKOl4xeTFfN2L4FMsW+mI= 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 Acked-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 Wed Jul 31 19:56:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11069161 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 0409A1398 for ; Wed, 31 Jul 2019 19:58:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5AA322B39 for ; Wed, 31 Jul 2019 19:58:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8C6F26CFC; Wed, 31 Jul 2019 19:58:58 +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 889B022B39 for ; Wed, 31 Jul 2019 19:58:58 +0000 (UTC) X-Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by groups.io with SMTP; Wed, 31 Jul 2019 12:58:57 -0700 X-Received: by mail.kernel.org (Postfix) id 7154C214DA; Wed, 31 Jul 2019 19:58:57 +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 E3C5F206A3; Wed, 31 Jul 2019 19:58:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E3C5F206A3 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1N1u2b-1iL0Pk2PAf-012FfM; Wed, 31 Jul 2019 21:58:21 +0200 From: Arnd Bergmann To: Linuxkernel+Patchwork-Soc via Email Integration Cc: Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , "David S. Miller" , Alan Stern , Guenter Roeck , linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org, Arnd Bergmann , Alexandre Belloni , linux-kernel@vger.kernel.org Subject: [PATCH 02/14] usb: udc: lpc32xx: allow compile-testing Date: Wed, 31 Jul 2019 21:56:44 +0200 Message-Id: <20190731195713.3150463-3-arnd@arndb.de> In-Reply-To: <20190731195713.3150463-1-arnd@arndb.de> References: <20190731195713.3150463-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:owqhEQqZQOrw+U7JIsdudcOU30aZRR/RpfOBJiDYVq8lo61ITu6 OTJHhNMtclaN1XkeL+A2wFbBwyqNYCidX1WsSXk3+KA/6veguARtCTAz1ZYlhjxOmuApKns AuZqlZnGwsNqxk5F3v4MWhYGZB7bO18wtIZMCv99c9HjUdYOkCKOZGk9CoJxCPqMFHPItHh renz7Xxq+4kx8oJTEj0rA== X-UI-Out-Filterresults: notjunk:1;V03:K0:Eh8z57l/pNI=:mdadUktRLMFk1jL652Ne7P zFXuP4XrT3hRm8cGQ1BHQgD8pF33SdZrY2CeyvfCTaJL3XiMrWJlhYVR9/OPlDkIHqDaLQf05 YSL6GiZFkj/XCDvN06vXcqVRCng/jk83sJH3teo1qmVc0vrX9/pUnEIvkcXPERea0ha3RFktU UXb17rrjEwJs6NR9YDO3zMVFN6WZUE6Yo5UbLZ3qBCvu1yCt5hhjyPSDahn8s4TtOGm9KlGwG wlrAaenzh59sLnunl4zylxv8iV/B0MiIbQ5dj01i02AIT16MbNf1YsMQkhry0/AlaIiNQUxZA EehYeeC7x2JEIwuvzAB3KSbmKSnraGIelW2iIXDvqU+yObF3KJa0xH/z6CXbo8SN10kL31zZ7 WUMoKPzLtgIpVrPtErO5npwMdgV1FM8rHxmFbF7Qa/v2h8l/gwi6hGSQXzgnTEt/GQ0yMyycC /odZo/ga1mREGA/9yc8PcSanC4lE8ERC/kepk7fFsc0kOpzh9v5NBE0Qcw1u51XNGbNomOUAl pjdXdQFD2yHEFm83pb9MAfq1ms9NrQouZnUVDXhB/oCpuktZrQwAzH2OoaKx5btmN8OSqmpV+ XALoHKf2pQ8OLObelggBk1g7puywQFXIHlO+yPoYaPI1KdqIy+1g1kDW2Uan5E/Lf5Z9dKB+h m+Y1f8dt6M2err8NjDHsx6rDyCKDMCN3Sz4QOl3JV9qVnrkQNdmjE1szvgBdAD/rFtX2m4p3o 3tNgu7MGtzFonhmt/Qe34m648mNxk6UJQabXqA== 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=1564603138; bh=SJ+NSnA5oE/TqyAThQJzlTWqH6/RTnNAePB+Ph9ZwoQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=g6elM3eYXeg7/9JgVX6BqajNYDO+JelCho8CrntbvHQmKv8TeCnmjBqnGA6/ZSbjecF RoCgxmUf8SlW81/JBE6yIua36FI2/H+WNgEVzh3EO2p+cqKZJZSZNuzyaaUxtLmH5mP6G Owk01UCnYItYGfp402dC2Y9ZP0p2M/JM7Vc= 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. Signed-off-by: Arnd Bergmann Acked-by: Greg Kroah-Hartman Acked-by: Sylvain Lemieux --- drivers/usb/gadget/udc/Kconfig | 3 ++- drivers/usb/gadget/udc/lpc32xx_udc.c | 2 -- 2 files changed, 2 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..4d8847988a50 100644 --- a/drivers/usb/gadget/udc/lpc32xx_udc.c +++ b/drivers/usb/gadget/udc/lpc32xx_udc.c @@ -35,8 +35,6 @@ #include #endif -#include - /* * USB device configuration structure */ From patchwork Wed Jul 31 19:56:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11069167 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 A311F112C for ; Wed, 31 Jul 2019 19:59:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D35326CFC for ; Wed, 31 Jul 2019 19:59:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7FB1526E7B; Wed, 31 Jul 2019 19:59:24 +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 2DD4726CFC for ; Wed, 31 Jul 2019 19:59:24 +0000 (UTC) X-Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by groups.io with SMTP; Wed, 31 Jul 2019 12:59:23 -0700 X-Received: by mail.kernel.org (Postfix) id 2AA16216C8; Wed, 31 Jul 2019 19:59:23 +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 9B8A8214DA for ; Wed, 31 Jul 2019 19:59:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B8A8214DA X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1M60HD-1hzmMa1S2t-007WQU; Wed, 31 Jul 2019 21:58:51 +0200 From: Arnd Bergmann To: Linuxkernel+Patchwork-Soc via Email Integration Cc: Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , "David S. Miller" , Greg Kroah-Hartman , Alan Stern , linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 03/14] watchdog: pnx4008_wdt: allow compile-testing Date: Wed, 31 Jul 2019 21:56:45 +0200 Message-Id: <20190731195713.3150463-4-arnd@arndb.de> In-Reply-To: <20190731195713.3150463-1-arnd@arndb.de> References: <20190731195713.3150463-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:9yUamtnf2TIEri8xToHi2HP0bNeq2o/bMYTbPMW/vg0ZGIzRlVZ urODGWophHwj2kamStrDk3IZ7zSpCTCX5t4sMnfLpIcxs9wmaHvSSDo+bNqZzwGdy5UYYR9 e0Y4xZ9D2FHcXdSkv/oCMKk2yUHxFcbeBUTKPhHw7pX66dppRRr1TufSUvH+5QEVggfcs8Z 6oMvoTmm1FtZK8+0oW/wg== X-UI-Out-Filterresults: notjunk:1;V03:K0:klU/jRvYVso=:PV42qGK6cAWld/OjjZOFZ1 zGMpHnObvYTQrIpVxVh6vZz9g4QDbJfZyHjqGV0KF05shbnRpDiouYuKEl+7RdTrLXQfq6OUE 3iGxoYpQ3HBCtxT3DWbqWWLjzoj7ATK7zwEPmUzqzrqjdRYzJszfhNAkX2yI5YVG3GmeBz7yz 9RDZV4vuOZy22/0qG81uXna7kipOrx0kN2s5FikkKplOevEqJ5tLa4h47HbmthkC8KXX7zbgY pV8i3+EJvVZRSaDGhptWUul3T1jBR2b7BO9BWPZmbjlxSVhOASs7lsyj+eHcuceoXxIJkpoby 7jns4DopRRhHvLL9wlR9ZhyFDkRbdO10LDreatLj5aTesK9vI3kXEjSfxlHluovG3Sm6QKYRF SsmRaoxRh7iE87EyMCkT62zLke0BDT/e7RQv10/x5qVYHLOpOHtZfMVaeh4dcS60FyguGq1Fd 3ZzSA/0jVKSDYqdV5txFh/RZ4uwjHFxMsqS451Oz7732M9uDtqR/CDUNN+MlQKcXzJwbAGxMp dN/OymhwlkaxUFRN1E+sGRFvkVQ9MSPkAOc6KurE8C1j+ohNT7WqJgapbfcUiNpDiXpiDxUyg OGFd2tSeUG/ZzHAGSoQjoTxD08FMp+mpwJN3uF+xl+fiNsAqYJ3JEC4ZzIkQYYCsZHSoOrZhj +/i+eKY1tw950RZ1mXRqF+97hNuHJvmGGLacoaAjuOdNIxSHQXg065UQavatOfy/ovlux6y0Y LxMR5+Bjw4qB9h6YFWvXSUmP198oby4rMT3eBg== 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=1564603163; bh=6SEMsO+WCyJmDjOMFP25xZbzRuKkWEu9jPJ/tk51gHs=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=nTF1HSknt5UwAVlR21zy53xWJBqGmDKJ8iXy9cXDJ4pnKwR9sF6caInL+GPF/oU36ij Dip2IBb7aYxk71mmPvqn3Q0YRGaARK93XfEeV92I2FT188ZwKzO8KNgWQ2nOjvuM3IRM7 wXd5tYhJmmC8DCe1TM61a6M2cjECD0FTtqc= 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. Signed-off-by: Arnd Bergmann Reviewed-by: Guenter Roeck Acked-by: Sylvain Lemieux --- 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 Wed Jul 31 19:56:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11069177 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 D94861398 for ; Wed, 31 Jul 2019 20:00:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFCED26E3D for ; Wed, 31 Jul 2019 20:00:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B3D5B27528; Wed, 31 Jul 2019 20:00:07 +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 592ED26E3D for ; Wed, 31 Jul 2019 20:00:07 +0000 (UTC) X-Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by groups.io with SMTP; Wed, 31 Jul 2019 13:00:06 -0700 X-Received: by mail.kernel.org (Postfix) id 47621214DA; Wed, 31 Jul 2019 20:00:06 +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 BB0E3206A3 for ; Wed, 31 Jul 2019 20:00:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB0E3206A3 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1Mo6WJ-1ihbS32Skt-00pgri; Wed, 31 Jul 2019 21:59:24 +0200 From: Arnd Bergmann To: Linuxkernel+Patchwork-Soc via Email Integration Cc: Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , "David S. Miller" , Alan Stern , Guenter Roeck , linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 04/14] serial: lpc32xx_hs: allow compile-testing Date: Wed, 31 Jul 2019 21:56:46 +0200 Message-Id: <20190731195713.3150463-5-arnd@arndb.de> In-Reply-To: <20190731195713.3150463-1-arnd@arndb.de> References: <20190731195713.3150463-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:FgQXWHBg8JwiLqFUWJflxqSabbAP8JCw6bQWgIJ0su4bbGS+nRK 0kUqcrfqJfWTc10p+TkInneDvk18LhtSmF5HyllYlbCgM6NIe2ax1LYFHpLJUPtftTqVfHY LT8kDYequkxI5Lbi1wDejhDPoHyerdsb7xvK8eoFciT5n0YokYA8TO/pNPuR18xFg1KR67C ohO68gbXz9QjaHkKemAWQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:9zXs2NceyDg=:N9NkeMAe628aOvT2TIb/xb PWR1SJ+Jn/xnW7MzNM80nxT0HFhj0IH9hRJO7YpP3nO1nzkVmMIuBW8MfuEjzvna4yYuw/NrN Xdgphu9Ry1EE8S2qqTWWjhUDz545qonpnL1oJEOm/Hr5xdROH7H2WeLZJpQCtnxVxQ8Wh5hqY nU5h7ie3lhbyDKd1IWAhOejvlfNepdIKHF1pDyXuAnlgQUVMople/U1mBLmt0NoxdvF/6Mcer 8tH++YghoErbfk2yDkMI2HYS3ZeTBZRbPO2ZX3iDLbDarWtrQvzDqEVMyG8Y6EUmP0b4qyFjN PwLeOGDMs4lB0+cFHs97ILEblNeqmOzk14Ox/7D0BPmUuVaxPFJuCwl6Uh4bTDBi8TlEtcnsF qKLNzlhsV4qv+KM3IKY+XI8kOnePo6K95sFf+QHEEqVuX8oAp63/X9aVVWFpNTIHW6Va2GEm5 rWdpIHl6eOJoB+r3wgOJizmqDyGRWK5+D7E47X3Bac211kWk2upDTiYsqftygCXSHNH6sKjd1 AQJoQbtKh20u9ADOyh9GW2ko1Az6jrllCmcnPqt1XDs9uHtH/ygJG0Gn7GWFngWKjOpGMOcj0 CGy7SaTzt3GuiyKDn9gHxUEXhOjsb4aCnEX5bWyLhHzocWJcLWujmLb48VzchIKZJgwZWu7lf UkS5FB881G9+x8p0cLogi/HR4km/FxXNvseAnDybpGdJN33PMpOBWTcW0/y9Clg0W5ImRhw22 ktX8KghGubpyC+mg1c2YtkHDcs3NhemMbCnviw== 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=1564603206; bh=3ziMt8H52RyjqR+hKrAIn1pSlJ2APxQSfHSjnt6+lRQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=nqk9cc1NZHdOuF1zHkg03dWmSjYKFVU+qtDTUDoemTFDUZY6BPulHINUfXZMoBG+Isf ZS4DQQFEzRwPPR2niI3cxktAf52lH0+8BKJzfaS2aTJ1sVl+v2Vwnsze0MwOasvqT4pYe 1gDMTWsETNqbgRHos7p9HKpcc6CDXKlIpHI= 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. Signed-off-by: Arnd Bergmann Acked-by: Greg Kroah-Hartman Acked-by: Sylvain Lemieux --- 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 Wed Jul 31 19:56:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11069185 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 357511398 for ; Wed, 31 Jul 2019 20:00:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D13E204C4 for ; Wed, 31 Jul 2019 20:00:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0CCE522B27; Wed, 31 Jul 2019 20:00: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 75CDE204C4 for ; Wed, 31 Jul 2019 20:00:39 +0000 (UTC) X-Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by groups.io with SMTP; Wed, 31 Jul 2019 13:00:39 -0700 X-Received: by mail.kernel.org (Postfix) id ABB6B214DA; Wed, 31 Jul 2019 20:00:38 +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 29D96206A3 for ; Wed, 31 Jul 2019 20:00:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 29D96206A3 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MCGag-1i2EAl44sU-009SDz; Wed, 31 Jul 2019 22:00:02 +0200 From: Arnd Bergmann To: Linuxkernel+Patchwork-Soc via Email Integration Cc: Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , "David S. Miller" , Greg Kroah-Hartman , Alan Stern , Guenter Roeck , linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org, Arnd Bergmann , Lee Jones , linux-kernel@vger.kernel.org Subject: [PATCH 05/14] gpio: lpc32xx: allow building on non-lpc32xx targets Date: Wed, 31 Jul 2019 21:56:47 +0200 Message-Id: <20190731195713.3150463-6-arnd@arndb.de> In-Reply-To: <20190731195713.3150463-1-arnd@arndb.de> References: <20190731195713.3150463-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:nPvPw9YMOaGoeG2QbL6aN8onQhuRLs7PBsNyvS/8jeZPiB2gXYm WBvj7CT/LrcyNxXCQEKzNhWdVnnmj3/03xr+BhLaTsTY+gJMV1XVz9qEE2q+1RAjiL848GO 3ROgAwuwkP7DloHoG9cMXG3IMfqi20QeI7miijXlSompfK6pMA5NdVHjCuVTSMVNKQMHBQv ET5ttUT9J8Urs8rYK1wFQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:gPysoRTXsu8=:ez7tYz6ZrTKnZ1oPtqCtmg oO0Hqyg8T38hQ03POAmT8MiW64FttY5KCjqVWGK/r1ekR8Rv2ynx4MzliMVdJrRHNI4KWyMjH 58M9y1TxWf6YLBq8BEahuS1+AkO6hBPCyNXc8UUYb1+rqmqr9YSDzkLPUESlyK7lBpcurBh9J hHqMfUfNzY3hFNZ5ch0KJxZP9fCAO3t/qtfY3fSt4OtHgvJY//yWKPe7O3yOXVaY2Rs7EQ26u Fjk26HKsrY9t20yCK9YW5SsiD807oDapqJmc8NzKN+q0oth4f2DriZ3zugda8R+T/Vm5ysFnW vAJiq6zL8PP6UtQWYCx7Vnsj0gJlh7nfUEi4d8Rq+5r6Diub/Y7LGV3W9woilHpbn1hlKMW7l M8UF/nbKRI5SdgwesfA1zlEfFHs5HoiCymGjNLxG0Qp2rFAy++lwaCGliUTNKa2QO3DQbUDkQ M5xZDxk/BIxWh1fADMHgsaWeMWW3nYEezVOtSfOS2h+skjoAkAO7HKrTop4tseWsyBY72IW7c KaE7LeRGXpW9BNTQkLAYmE9wgJmvz67/+9Kl5OfEGpNKsgaDPc6szjLnyGhW6jht3FTUTEMID X/kj42BN3RY/hzSlfv73raCU2Xq0vCJs7YCWr6mYHwiX2jYchEN5NJfoStqIqAx+PVxTyqAW+ 5AJcLpb1KfXvWO8455Tl3pH9h4gTVhLpZBF22a28PG6WIZLG06/Bc8r4f+7hEx/d3Nsb+93ma QUIcMpyzg34VAK/EUMiXn3T8xZlYH1Yfx8URtQ== 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=1564603239; bh=2vKUCaTVG1Kp8KscVh1JAe86bneFu/T4tzppPo+sxo0=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=DGoIF75PaGF69rC6J0SLr1kkau8IGijl7DkIQL80q668D2WJiYjwgdUNkBxn8E7hs6O w/Xe0LJqMBwW5Kbt2Wc5gvu5691Hn+53Eai3uOwGmN8ahK+3NJUnSNdxZFuxFTZyfxZLv pCLluHp+XOkv6CfvT53CkgUZb3Jjy8egeDM= 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. Signed-off-by: Arnd Bergmann Acked-by: Sylvain Lemieux Tested-by: Sylvain Lemieux --- drivers/gpio/Kconfig | 8 +++++ drivers/gpio/Makefile | 2 +- drivers/gpio/gpio-lpc32xx.c | 63 ++++++++++++++++++++++++------------- 3 files changed, 50 insertions(+), 23 deletions(-) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index bb13c266c329..ae86ee963eae 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -311,6 +311,14 @@ config GPIO_LPC18XX Select this option to enable GPIO driver for NXP LPC18XX/43XX devices. +config GPIO_LPC32XX + tristate "NXP LPC32XX GPIO support" + default ARCH_LPC32XX + 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..548f7cb69386 100644 --- a/drivers/gpio/gpio-lpc32xx.c +++ b/drivers/gpio/gpio-lpc32xx.c @@ -16,8 +16,7 @@ #include #include -#include -#include +#define _GPREG(x) (x) #define LPC32XX_GPIO_P3_INP_STATE _GPREG(0x000) #define LPC32XX_GPIO_P3_OUTP_SET _GPREG(0x004) @@ -72,12 +71,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; }; /* @@ -167,14 +166,26 @@ struct lpc32xx_gpio_chip { struct gpio_regs *gpio_grp; }; +void __iomem *gpio_reg_base; + +static inline u32 gpreg_read(unsigned long offset) +{ + return __raw_readl(gpio_reg_base + offset); +} + +static inline void gpreg_write(u32 val, unsigned long offset) +{ + __raw_writel(val, gpio_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(GPIO012_PIN_TO_BIT(pin), group->gpio_grp->dir_clr); else - __raw_writel(GPIO012_PIN_TO_BIT(pin), + gpreg_write(GPIO012_PIN_TO_BIT(pin), group->gpio_grp->dir_set); } @@ -184,19 +195,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(u, group->gpio_grp->dir_clr); else - __raw_writel(u, group->gpio_grp->dir_set); + gpreg_write(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(GPIO012_PIN_TO_BIT(pin), group->gpio_grp->outp_set); else - __raw_writel(GPIO012_PIN_TO_BIT(pin), + gpreg_write(GPIO012_PIN_TO_BIT(pin), group->gpio_grp->outp_clr); } @@ -206,31 +217,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(u, group->gpio_grp->outp_set); else - __raw_writel(u, group->gpio_grp->outp_clr); + gpreg_write(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(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(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->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->gpio_grp->inp_state); /* * P3 GPIO pin input mapping is not contiguous, GPIOP3-0..4 is mapped @@ -242,13 +253,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->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->gpio_grp->outp_state), pin); } /* @@ -498,6 +509,10 @@ static int lpc32xx_gpio_probe(struct platform_device *pdev) { int i; + gpio_reg_base = devm_platform_ioremap_resource(pdev, 0); + if (gpio_reg_base) + return -ENXIO; + for (i = 0; i < ARRAY_SIZE(lpc32xx_gpiochip); i++) { if (pdev->dev.of_node) { lpc32xx_gpiochip[i].chip.of_xlate = lpc32xx_of_xlate; @@ -527,3 +542,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 Wed Jul 31 19:56:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11069279 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 3D733746 for ; Wed, 31 Jul 2019 20:07:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AED527DA4 for ; Wed, 31 Jul 2019 20:07:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AE5B22B39; Wed, 31 Jul 2019 20:07:00 +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 7FCCD22B39 for ; Wed, 31 Jul 2019 20:06:59 +0000 (UTC) X-Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by groups.io with SMTP; Wed, 31 Jul 2019 13:06:58 -0700 X-Received: by mail.kernel.org (Postfix) id 739A2206A3; Wed, 31 Jul 2019 20:06:58 +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 E6AD020659 for ; Wed, 31 Jul 2019 20:06:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6AD020659 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MElhb-1i8Xgp2Pet-00GM78; Wed, 31 Jul 2019 22:00:56 +0200 From: Arnd Bergmann To: Linuxkernel+Patchwork-Soc via Email Integration Cc: Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , "David S. Miller" , Greg Kroah-Hartman , Alan Stern , Guenter Roeck , linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 06/14] net: lpc-enet: factor out iram access Date: Wed, 31 Jul 2019 21:56:48 +0200 Message-Id: <20190731195713.3150463-7-arnd@arndb.de> In-Reply-To: <20190731195713.3150463-1-arnd@arndb.de> References: <20190731195713.3150463-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:SIR+StTg1yfrJOk+RcwJDCCTVUYEqRYGtvhttUvKUj31xjabS6n 0LjT+qb3UAb0wMRK253nbzu3yZ3hPz+pIxmA9ovy6x6yoAvgMjctqBTKYeNdbeO3ryTQq28 p/9wr3WFSy9q6FjN5nQAi3ktBtB0uKTJHmeIssaTO4h7KjjpJ9grdl8muSebBIPnDH93laV 3vxDTuWhUy1AUE1bdegow== X-UI-Out-Filterresults: notjunk:1;V03:K0:FPWspoP5H+s=:1vYCFzNX/YMnE0iKrwsf6n DuHG80brVtHP2IigcbQ40ipeU9mgaWvRSxX4aKlJLeQ2cvm5SXIa0s0MKNUa1CtuSrAnxLgtI mfGI5eslSNc+d6/XEDa27RAXMLB2Y1paKgMadybor8ufWYrKADY5/WIkZA1d0Yom/WZ7glJBG Xbnsyu8OGPIK6yAr6j/VCgn/gPpIxuRXDEsOXsfMmq/EoDSF9rVeau1MlfEC73Jas93PAyNdf ePVtG3lGgTUp607pCxC8Vz35rox4wOgNzMpj66kiF068415xIdDDWs6KOZBcUoPByIKm2klCQ 7C4ZsTug4v8ZH7G/McGkD9lNmm8jKDrfRRqg/lTUbNkcLPGFMFsAobECZm6EyYgm3ZXUov+Vq M4ktAjUcZ8xCIHCtRKIIhv55P3jPMKcaOM8n/40uP9+QnAaMlruaLVl2xo6Y9ietcPEtK96ZX cuA5r7pDRSnLTbyXRYMwzUKC5/mJHoHzCroDhf9MIwPTJnjT2bkm05Suhgr8XmOSFT/PNlA6B UQf53Pe8R0Am4a8ja+CFC2BgKEoc+QSVVw8MupDstjUT8HOUyk8sWapyZeVEbDNle7bxGB6Sj ihueSnJBrY0alKGeb/4X0qpYlv5Fvry2dDAOKATY+agU1XxGvHaf0jthj/SohFyKp3RRwu9Nm Qz4rNq6c3I9swJS3Cq6Sn/AItFZNKFgBigr0cUhPOmh9pQWi5VO1Ur4Atq9ALcLIFfu98GHRe YPZtqTdhawvKDsggFR3HBYbjbxFuId6M8OTa2g== 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=1564603619; bh=r629NMSXHxCHtiEpkELXkz8lixtiFh/ArhJY1d8PjOM=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=lc/Y3nAl/icdjPoIr5ueb4RMUVDBeV3MFaJmmhVx/jMXeMI3P4Qwx1ALf8aKwVRVHB5 1nWBoPm4waYTOT/Cn7416qcaWFSppkQBx9YGyb0gOuWIWFifkWCHgb86up1kdpy/K2gTa 3JA/5UZaHAeOnTWXa9QeNhWVNu0Cwtp/J30= 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 Wed Jul 31 19:56:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11069201 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 1B7A8746 for ; Wed, 31 Jul 2019 20:01:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0783420243 for ; Wed, 31 Jul 2019 20:01:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF05C27861; Wed, 31 Jul 2019 20:01:58 +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 8B93520243 for ; Wed, 31 Jul 2019 20:01:58 +0000 (UTC) X-Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by groups.io with SMTP; Wed, 31 Jul 2019 13:01:57 -0700 X-Received: by mail.kernel.org (Postfix) id 26FE3214DA; Wed, 31 Jul 2019 20:01:57 +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 9ADFE206A3 for ; Wed, 31 Jul 2019 20:01:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9ADFE206A3 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MhWx1-1iWd3A2AUt-00eeFu; Wed, 31 Jul 2019 22:01:23 +0200 From: Arnd Bergmann To: Linuxkernel+Patchwork-Soc via Email Integration Cc: Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , "David S. Miller" , Greg Kroah-Hartman , Alan Stern , Guenter Roeck , linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 07/14] net: lpc-enet: move phy setup into platform code Date: Wed, 31 Jul 2019 21:56:49 +0200 Message-Id: <20190731195713.3150463-8-arnd@arndb.de> In-Reply-To: <20190731195713.3150463-1-arnd@arndb.de> References: <20190731195713.3150463-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:DV0nUYbe0M7LEh69rBwpnzpxoNTB5NYut5sl+C1tAwRs+femstR Rb6T5pxzGUFSlJsJr98GJFWfI00qzelp0DSmJSBm+Ss1XOrjdPC5tHy4ZIHY7Q6wBFxXTCi jscc3Pqo7B3jvlmH+w27lTB9SaeK/1nbLjChGfLrc4ixR1DkgFO4ps4co9wrutnuhPxqLiW y2YJJujXV4RZ7aFFguoGQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:4vEuAYs9ZXo=:GFoO+dSjJ1TDEX2+SUxnDx yqMghV4hxbjcUD6ijCuXiSaE3N3EEyyYw7YM+VDvmzD4V4clIdZVgbBBszYBg79h8zPiA/fi7 PuHfqfZqc+YQKoLOz+Y05GtP1lQAKrt0dQunuwjuYVj565TjXwI0ZcNaWQmSzMHSO3AYGkO1t tM3cMJRzZpJKtFWZEmnaKy2bbsC3s+GFBnbjaRLVTA3VFHzURqYoRYLLOL2ilIvgCyHhVjFj4 yeLFKXWVDO0GIQIdPorev9o1bd/H1DmbfTrvz7zfVCHzkq4s5r+z73cccXlotHP6nf7wedmXt iPeCk8sfxTrDcKlUg284A0JtFkg4URHi/sTKtsaLbno3CgnL5KdsqZXsDM8UpvjhA8905I7CI YJbJU2SP9RecnuZH+CvrVjWpjabuD6r8lfTHGhuF362RgQmSzRPuBf1Kk9yYGbKBqqQLCHZuO U0jagpJqBuZImzDYWYdne+7T8b1DpFvxzqpHXDX2P4AB4M/M7j1LBS3ZfDnXvKMFEfyyQF26w pBe2X3fJhusESwtQQuWiLhw/KlycsLnS6O5uZ20SL2VWN07a0meZDYTp15FQYWB7celFqw2cd WHnOcLv5jLsOgzWmcibU+4717eTSAv+Kn4hBKPs3pxhAP2mhxdtAlvmScDxXB/xPZ8hWJEhxJ /4n8Cmy85oczi2XHhkWw/t3JGfi2JLAtRqIK5N6g53zMPo3AaRWATfQamQ91y8XyQR8WublTd vvhb/nkpfBwQtPx27wK+aKf9DM4T9mjgAEcATg== 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=1564603318; bh=Tp27yqPJMD8pcTtrG8GRHKV9MyGsqLa9Blb4tqsmQiQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=NzKDBhWZVkMvds7S3WoEj+c5W1C0ML56ZOl9TgQKcgUpg8SzH+uukid0SHAumBsSuLz SqTRIvKsQmEpQVNyRAhbdIzs2gHY0UP91EmuSBObg02JJDU5De2XGa5VrgLVwUaQI6w5f xe3zgrKb99EO1lgI+5P9dXLTIByavGglwxA= 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. Signed-off-by: Arnd Bergmann Acked-by: Sylvain Lemieux --- 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 Wed Jul 31 19:56:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11069211 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 91A211399 for ; Wed, 31 Jul 2019 20:02:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A7BD20243 for ; Wed, 31 Jul 2019 20:02:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E680219AC; Wed, 31 Jul 2019 20:02:20 +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 1F9A620243 for ; Wed, 31 Jul 2019 20:02:20 +0000 (UTC) X-Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by groups.io with SMTP; Wed, 31 Jul 2019 13:02:19 -0700 X-Received: by mail.kernel.org (Postfix) id 3776621726; Wed, 31 Jul 2019 20:02:19 +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 A9064214DA for ; Wed, 31 Jul 2019 20:02:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A9064214DA X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MxHLs-1iGtlI0h4q-00xYiP; Wed, 31 Jul 2019 22:01:44 +0200 From: Arnd Bergmann To: Linuxkernel+Patchwork-Soc via Email Integration Cc: Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , "David S. Miller" , Greg Kroah-Hartman , Alan Stern , Guenter Roeck , linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 08/14] net: lpc-enet: allow compile testing Date: Wed, 31 Jul 2019 21:56:50 +0200 Message-Id: <20190731195713.3150463-9-arnd@arndb.de> In-Reply-To: <20190731195713.3150463-1-arnd@arndb.de> References: <20190731195713.3150463-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:bQO/P7oE1AasL5WRFX8A8Iw79gwR2TUWl5KOlZaoQbsLC6qyZ3M BqjvpoU3FzeJMaTmEyNZPpDYQsGf01s7vM6mqVbCCqYpR+VH9U3/oy0xO+7d/XqDKrZRScs GKPYEfqcPhZKIPwd/VF2tMUAfS5j7EliScirqrFjPu8WusX9n+IWZVIlecysf5C6EC7vNJV Y+CHXjmLXL6XBHVmlDthg== X-UI-Out-Filterresults: notjunk:1;V03:K0:wgW8X3aAw54=:zzSiZhm815Ou/Nwd6C9iLM 8pGGZZ1MNm+TJLjXzf5qAu/AU+nMBlFA8b+4jZEd1w9esMERStkBfjfc+hCYa4fvIVEGyrOY2 rgAgi4qKEbp8czy7oAIf1f62ZHCdRci+Wx21+sgjylY/7OD9KMwh40IjuRtC5KIsOflIjss63 2ny0LZzhcyhnMnSt66utWr6Py58xbkNhZYgxX2fejPF1IW734b5FLedEO34kKt0kqZ34JFOZ/ 4Z9/Fm+TrnN/g7EYnNC+2gnV2/4enSXdUzsNIjPjlEBCPO7VXfFNakW/QZyqg0UYxAPidEN5m Qe/0NFGLMWfxGncHijKtiX9XzMqxxIvf4XjGxVSLEdlD0BDUGu6FqiQIKfhMyn1DFk/XbO42/ 82qzSohrF3yATVgLCrSAPqK+sOmomtx5lPd/+rmUhLqAGXFnbsnxQHaIV7OvOmqqTUnETc/kh 3ef4BZR3TAwakr2EnP5cY3eC0FhJHywe0TBxiRLevIBN2c1CtinvaCxz28sGp28S2SmUbCAy/ pjkz8586/aXzkaJyvAr5gL76CGT5dDNUXYo1CwW7GWieGTW/P17EAWnJp0jjMSqrYgvBN5WCN G2/uUtYXb8yOdCkFMBF+8CWo7hzKHuPjy+oBnUA6SrOJ61t3gb/hYLmoL3OjWWdbIGDPA5w1L YaPT07myPbkUcnsdWJKaPeeBaeioX1lnNsZZ+RfngtM1BGJ16w3IOWLg+EgehEy8bW7ev6L/k iaOINOy1fT0MDbzlmDp6pVMc3XbEFBEzxk9HUA== 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=1564603339; bh=b5KbTulCrvNcRchqjDlfcaY9WH+p61h9PLO3mEsdobc=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=MHT3mrH9koq7KZptNUJAFLmuenr7jQTIkX5SafGF1vQeumE67QyiXhGciQopl01R+Db ObzCS4rYIgPk65o9Qos8vyN3T9Z1gZiK4GTgBfgzVowTO3Bb+39EWCsh2fiRsZoWlqGCf 4MURoE4q2mLxtXnDddyX9UzTSrISi+EU7zA= X-Virus-Scanned: ClamAV using ClamSMTP The lpc-enet driver can now be built on all platforms, so allow compile testing as well. Signed-off-by: Arnd Bergmann Acked-by: Sylvain Lemieux --- 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 0893b77c385d..34fdf2100772 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 Wed Jul 31 19:56:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11069285 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 B93D0746 for ; Wed, 31 Jul 2019 20:08:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4AC726538 for ; Wed, 31 Jul 2019 20:08:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98E3627D29; Wed, 31 Jul 2019 20:08:24 +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 27DD227CEE for ; Wed, 31 Jul 2019 20:08:24 +0000 (UTC) X-Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by groups.io with SMTP; Wed, 31 Jul 2019 13:08:23 -0700 X-Received: by mail.kernel.org (Postfix) id 0F237208E4; Wed, 31 Jul 2019 20:08:23 +0000 (UTC) X-Greylist: delayed 614 seconds by postgrey-1.34 at mail.kernel.org; Wed, 31 Jul 2019 20:08:22 UTC DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 81E7D206A3 X-Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) (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 81E7D206A3 for ; Wed, 31 Jul 2019 20:08:22 +0000 (UTC) X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MyvFC-1iFEmI1isM-00vu1b; Wed, 31 Jul 2019 22:02:08 +0200 From: Arnd Bergmann To: Linuxkernel+Patchwork-Soc via Email Integration Cc: Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , "David S. Miller" , Greg Kroah-Hartman , Alan Stern , Guenter Roeck , linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org, Arnd Bergmann , Jiri Slaby , linux-kernel@vger.kernel.org Subject: [PATCH 09/14] serial: lpc32xx: allow compile testing Date: Wed, 31 Jul 2019 21:56:51 +0200 Message-Id: <20190731195713.3150463-10-arnd@arndb.de> In-Reply-To: <20190731195713.3150463-1-arnd@arndb.de> References: <20190731195713.3150463-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:U34UKG0WKd1du7DGye/96IP8sexEkIzBlk61JFzClDj31SLKqCI wfz+noGeI4XYslZMxD9cagGBYN/PWTDbo26SLz707TH/Ua6X9hBQLqZGlOQJxZ8AQi6UI9o cSjmHqUz43Veryx8v4Q1bfVU25rLjk0jJYvgztz+l1bZMNCjzxpn2Oz4oZ+VdmqEv+N2NyI AK7H4/I5OUe/oZGljJ50A== X-UI-Out-Filterresults: notjunk:1;V03:K0:gvCUndZ41r8=:yjye/faikVTAR/7Em0Zjxs pHEJRe8K8dtB/r0nz+01TZoPySfOMc6kCjWtkU7F3nn1lm05jDE3/Cf93YO3ED6nEmclbtVWE vNpwtBdlB5fZ4Q5uPuEcjyY2m/L8HFqpuXIcnjeumnqq5WDF8swzjRltcUr8XHQiqhvFnzUAv 9Y9wuztcwtvPvLgkyB4W2DAZfESNvlwP9PijAR/pNDRC0oqGk5XQGu4ms9hm2UJaPzK/DpDq0 QPQO1z1rqPUhWculeii+WlA+qUJRcFKp8NHAgp33cR6g9MeIbllhTpjJ0lg0AWtpknX7r14cn XnERRq5Q1zFOLrQyzXb3fbKemlGz8rguuxe4aooX7zKWLLwS3PayoLTBNOqx8DjFiXNSNbOYK jrEnNxreBg7rtmyNGmsU81ySnzzPSd263qSVx/Pq0LdgxPxL9+AU55K1EUBvx98BXDK8aOzaY DNV+lqwc9vHTLfg3BfrOVhuCoNOTXitbw/DoXeepCfJ+wi8MrOlBqdbnuYeEzsOdMXK0CXiRM W3iPCAjqGNl4ZJ7k9cpZ5jk+GX81E1sDq2iLGcJtCVSzkFkoARDb9bdSjmmqUtcBLOS4rAG7K 0B/+q4m7kYg/PtdsoOkWHrTy25tF+JxEIb/fm1MYkRzuzIfffdC58xE9rxhQpdw0Ok+hMRUS0 JveNm9HGf3FknuzpzFM5hiCodIYkLTGA46X+H9ZzV+cNzXNrYv/fJApYiRNn14QavTOSbJMFN Ha6/aAfVKYa7njj70j7/U0C44QQHvPhlL+TnAQ== 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=1564603703; bh=M6N2Lyzar9tn5JVScDP7OJhCqM6CJmUwN3pBksYsiHY=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=glcKsDFNRBF/MFYiX/64CvEdh3B5TK2sGtK8h03I83QazDP0Dse8Iz33DcAPJDivqW8 jU2L5wT+pHzk2m/RzIATamOEaswkpSuBlrrmC9fV9UTTm5BDD1F4scD/DUBov6jpa9x+X uxmLxdt2Jc7u2InTxD0P35JhfVnP3qjgKVM= 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 Wed Jul 31 19:56:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11069227 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 81101746 for ; Wed, 31 Jul 2019 20:03:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D1AA20243 for ; Wed, 31 Jul 2019 20:03:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6066C219AC; Wed, 31 Jul 2019 20:03:51 +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 B3704209CE for ; Wed, 31 Jul 2019 20:03:44 +0000 (UTC) X-Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by groups.io with SMTP; Wed, 31 Jul 2019 13:03:43 -0700 X-Received: by mail.kernel.org (Postfix) id 359DC214DA; Wed, 31 Jul 2019 20:03:43 +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 8CA08206A3 for ; Wed, 31 Jul 2019 20:03:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CA08206A3 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1Movrq-1iiz0R3bLi-00qWDH; Wed, 31 Jul 2019 22:02:57 +0200 From: Arnd Bergmann To: Linuxkernel+Patchwork-Soc via Email Integration Cc: Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , "David S. Miller" , Greg Kroah-Hartman , Alan Stern , Guenter Roeck , linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 10/14] ARM: lpc32xx: clean up header files Date: Wed, 31 Jul 2019 21:56:52 +0200 Message-Id: <20190731195713.3150463-11-arnd@arndb.de> In-Reply-To: <20190731195713.3150463-1-arnd@arndb.de> References: <20190731195713.3150463-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:/LhIgzDOVG5Q+X9XFfAhbZFk3l12JGjC84UmS1anNS/jA7+748N Y9tWamhprDvlrPz56AFbX3QzdSJ+M+7noEtpgxuax8FHc2708BPrBKKezAw1psuugfdsrRh MQhFtQ6ZWKDowzyFxjiE0TsIp+VEIviu7/lI3Y6zb1FiElIS3W9RHAsYr035BupH1spFCaS DpfdGbEgRDrjcHHtDS+vA== X-UI-Out-Filterresults: notjunk:1;V03:K0:PJ0dxqaWcWg=:eeSvLeu1RyA7KZHoSWuHN3 iBhmJHidpvs265m8g/hMFm8qKWd6XEFB1nyNfzGO5Qj1k6ScExPk8MjJGdGzD6YL2mryZE4F0 OXXwa0FUlRrhvw7ESd4BtUxy8+re7W/mqpEGhczf+oj3uQDOVmA5E4ymlpUlBOiiVKLF88Yv4 p2pwVfG7N43qybeqtBNqeunSt89HTYditI9hORMkEYPnsbwtOLUBrTb7oRpZZlhVZMSJ2CMHg qYpc3KICHU0dZk8DEtwXL8xgzkVtZ5P3nZ5YpE3U0j8UM1QQE/fgNC0IL6M3zIapw+kYrOVfh jzcZ4dX/wXiCwCcktb8ZaBJIbr8pWgQFeXlKlUS1xwjRnGeIpXCavYbgNtGLSUpQC0BbF18ji xHL004ivie5brPONQsEKo8c1cJ04pYQUWWz+g5zqXa0rrzQ5j6iCwBgC6LwPORVcEq6PrGgGR XRXkz5A35HNDPDFQrR5Pj7OchzTc7rBMTWgHVa5R9vxVgqG8HAbnUOHOuVeA4YmPJZXS0FKyb fEPPF7J3XCEyaaJpx6Yu4YOnT2ksxx34lUJ+pXjsUqlo/AQXNeDg7KRvBdp+uhfmkqRChr7J6 5Ge1OwuuBYggQtkv3fXqElSPJRrBmxmAY2UTEKUM+h8geaG7yPl2t5BR/tf4WjDpR91b7w7p8 2dyVGzqUe5LSGPv4S8y9GTUQFtEioqrjduZhwjsR5mr0GYMg1LIG44UM+JuWeXR1Jwxep7hi8 HQaPWuoy8C7lbeIEkj9K43J/ShhIeqTwCT91Mg== 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=1564603424; bh=pSW8rBjxfUKRduH6WTUQJN2070VrKatS13ReOmE9Go8=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=aNK79+XdJepZ5Srqcsmrqnih09P3zUooywweQduHvDyopidHykD0WvMc4w21pncwffY 4Fwq0lnhbRTUTSwwn0znUESxKIx9V5r9yj0/ikkT4zmICjgajzgu2ZQXOnLOfn31ROv7w N7VS3LYKhrPjo7YjsFytRTxwDPOs7JEcgds= 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. Signed-off-by: Arnd Bergmann Acked-by: Sylvain Lemieux --- 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 Wed Jul 31 19:56:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11069237 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 0D1A71399 for ; Wed, 31 Jul 2019 20:04:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED73520243 for ; Wed, 31 Jul 2019 20:04:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D59B627C05; Wed, 31 Jul 2019 20:04:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.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 3BD9320243 for ; Wed, 31 Jul 2019 20:04:30 +0000 (UTC) X-Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by groups.io with SMTP; Wed, 31 Jul 2019 13:04:29 -0700 X-Received: by mail.kernel.org (Postfix) id 6B75D214DA; Wed, 31 Jul 2019 20:04:29 +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 DD997206A3 for ; Wed, 31 Jul 2019 20:04:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DD997206A3 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MG90u-1i9MpD1XiO-00GdEL; Wed, 31 Jul 2019 22:03:55 +0200 From: Arnd Bergmann To: Linuxkernel+Patchwork-Soc via Email Integration Cc: Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , "David S. Miller" , Greg Kroah-Hartman , Alan Stern , Guenter Roeck , linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 11/14] ARM: lpc32xx: allow multiplatform build Date: Wed, 31 Jul 2019 21:56:53 +0200 Message-Id: <20190731195713.3150463-12-arnd@arndb.de> In-Reply-To: <20190731195713.3150463-1-arnd@arndb.de> References: <20190731195713.3150463-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:gID4RNpoX8Zy0tyRqB2A6yiPGJfcnxOOAaqeCpDCy5//AbU5fC+ Aq2RaOrGEVpMj/GW50xVSsjfcw1hj8Jqyy4sqmlL5C6GhIiSItYASN6wS4s0tJsnDSxDQGU 4cCKMnrp63iGJZf5+t0aWd3WlnBJDiiqakf3ozIiK3SnkTBYlqu6XZBcE3yOVYjdk8f1wxt jiefSp6XmrWvYU+WhrFqw== X-UI-Out-Filterresults: notjunk:1;V03:K0:eM8z4Th1230=:8gdVoiZjbL4WjyeaVcDmZr cpT0mCOoqZv4Cg0/dVlx28ZgDrevnB1uhSfamTVZMiViwm8GrOEJOg+bFuHgn0vUrAk64Eqzz dVnc+ygDk1KuMm0rOh3zEW2GPfr6AOumDW4SvzirTizwdiFGhBBf7jlqUYHzUVWsghQXkzC/6 X7rra8A4a09pZwHwUgQlDzt0cCEklYGimCBI4EsB9yaE0KENJj6skQJ5A2DCvdgcsb91AUkaf YP6QPfGJVColH35OSiBK+ZJXoNrj4ZvouhJc6jwgVvT5I47YZMoKIasuvvx6PmMa0D6DwxK17 3EsEOsRjZ3J+1pibA4uOuRZc7BKfB1zT75NkQSZF8qF7Ds7mY17jzHB0Ip4fk2ozwRBi4gIMB 9wCwQ7CvKSk/fe6RwLXPEw0QyWUCAE8FRGGmyzDKLWvG1qdoGTaMrxi2LNNrEhnNm0sIcU2Sr 4XP4mPbBJSpLb9J64YnV6PGs2fSYsA2aemNk7Wir4NJng1/wG/yqnA8G5sznbsj3sxiVnV1I1 rgq0vyKXldZvGlemusABzGEHSy3Mmd/E/e2+/BoKCioKYR1/lbn1nUDc6+h1BMBxGi8UkK/xm oQKxXdz/IguWloG6WLtpRPhsKUYhMexLuxanjICeC0MeBV1UYH0iJqH1NqfIwRxiCYVGbEzJL yEv38bGmbbOzDxt69iUvf+vr58AmBAm2WH67COjQgbWNFuTIn1dy9+05xd/GlTOFNMrlhMFmP rmRjILq3mssWIPxPDOxj/xJzsX0Dnu+IBGzyww== 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=1564603469; bh=ByYonvYD2hB9hMey3gteK3/4DHg044Xb21uADoSzbzY=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=iPdeezpcAPM4CoTOVbES69ZoPNqmfZ29zMQkwxq3wfShzyEzlMveWjgUVa2lzijZp0N JksU29Q7Q46m2Fyd9+PxHI3IJzfNdNU0+8humuTB6W+TOLlTFceIgsQIUt5vKYuRCMa5h tIoxOCZbytzBQp/3Gmdd5LuZCLlxung59Gk= 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 0cdc6c7974b3..2d75bd8dbaf0 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 From patchwork Wed Jul 31 19:56:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11069253 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 892911399 for ; Wed, 31 Jul 2019 20:05:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FC0E27C2D for ; Wed, 31 Jul 2019 20:05:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 63102219AC; Wed, 31 Jul 2019 20:05:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-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 4E99427C2D for ; Wed, 31 Jul 2019 20:05:44 +0000 (UTC) X-Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by groups.io with SMTP; Wed, 31 Jul 2019 13:05:43 -0700 X-Received: by mail.kernel.org (Postfix) id 6706A214DA; Wed, 31 Jul 2019 20:05:43 +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 D92AB206A3 for ; Wed, 31 Jul 2019 20:05:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D92AB206A3 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1Ml3ym-1ie2tU2XXw-00lY85; Wed, 31 Jul 2019 22:05:08 +0200 From: Arnd Bergmann To: Linuxkernel+Patchwork-Soc via Email Integration Cc: "David S. Miller" , Greg Kroah-Hartman , Alan Stern , Guenter Roeck , linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 12/14] ARM: dove: clean up mach/*.h headers Date: Wed, 31 Jul 2019 21:56:54 +0200 Message-Id: <20190731195713.3150463-13-arnd@arndb.de> In-Reply-To: <20190731195713.3150463-1-arnd@arndb.de> References: <20190731195713.3150463-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:wm+KSeGGuXF5WOxKnt5YWZSFWSzwpQiV1pnc7vH9hnQfyF3uo3n gCrFBQ3yKHG0+DFWqQmfJqP6Itkdlnc8qKU99KkNC34vbDMv3YzmXoRwQFdjHC8eo7cpDHV j+SDEsiC6bWTa2enEM/7xwU7Kn5GLhBnlOb3naY4fXgocB8zpeFrPODfH8cbg3PRji5BClB j8I/Iv2fiM5yc2zhXYchQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:5i9Pzgm/3dc=:/w8M1fT6vtSN5U1kHGY3ph SGSal8B1dZSKdDqAKV4r8z+19BRsTRWV16aimYGBkMDHyOUz6zpNKR4niLX/Om2qVaOQURJbL XURssmFZVOd8nruSi4JIxo9+TLstHX/YfK6xSI0/W42yzX8Y6brLdEPD+vU6LayI8OHSZr1mM Vbf0ESPZP0wo5wj5KNHgpJlbQmNb63x+7ABammyca8R2lwHzDfvYwu4R51VBnbiLrslfLjbns JPTvxyOWxtV7X56r6lSTiU3tyHin5fOZWnSD7b9mtkZ/es9F6EIx23V8OdLWXsivZjbWAxVui 7jfvISGfL858CtIlqu0abInX7iom6syFCHd/risPtyzH/8JzwPUdJV5z7ddlWiRIKXPGBdPse uYr6aeY0kmuOGfP8wSl7HkVPnf+Y3HRfzBePoED2LQPqEP9kD3y7CO5hOQEay1UJ6yn35LQ85 AkE8v7PeVXAxQ9Xd274uGZaTlhrfKLmt0fz/erSf6DS42HxMbcZe8cA9nT0OGb+qvw7VEbg3O N/HH/DkBh8Ckk1FEaqvDz7wuAHGrqiRlm+rlCNbJ5Zg6IjfZHcuQshUknPCoFOHtp3HHU46n6 3cSEpfZjWPldZXeQqZzlTvel84GguhGCCFVRS+AtoaVUP0zZntzy+e18HerdrZ28fUeulDRn9 wL88M+46YUFYW7o7K6zhFZ56wPZP+kO52PeXe44ViwpGJtwDCMKjz3LzfOgpLuPBluglyHuJm nFAS/hbAMJgT66nhvQMH9GdS8rPtkQfCmJ0Ifw== 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=1564603544; bh=Ze5HvusLd0T6esfFQsZZOCx4gMzfXEfkcmv7s1/Zxls=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=C/l6IN5BlDRCf6/4JjmhjUCCyUIFM5utrifDtUHrAf18N7WMf5AWR8VSZ3EsLBjUwsK OqkYsIAUNjW5b7ZothJOsWBEM9smnShMoNH7Ja+uIDjtPRR6YY2dOHkQNlj8D9qkdH96J almc01A/TOt73808bSDWx93cFHeEEikl7W8= X-Virus-Scanned: ClamAV using ClamSMTP This is a simple move of all header files that are no longer included by anything else from the include/mach directory to the platform directory itself as preparation for multiplatform support. The mach/uncompress.h headers are left in place for now, and are mildly modified to be independent of the other headers. They will be removed entirely when ARCH_MULTIPLATFORM gets enabled and they become obsolete. Rather than updating the path names inside of the comments of each header, I delete those comments to avoid having to update them again, should they get moved or copied another time. Signed-off-by: Arnd Bergmann Acked-by: Andrew Lunn --- .../{include/mach => }/bridge-regs.h | 4 +--- arch/arm/mach-dove/cm-a510.c | 3 +-- arch/arm/mach-dove/common.c | 4 ++-- arch/arm/mach-dove/dove-db-setup.c | 2 +- arch/arm/mach-dove/{include/mach => }/dove.h | 4 +--- arch/arm/mach-dove/include/mach/hardware.h | 19 ------------------- arch/arm/mach-dove/include/mach/uncompress.h | 8 +++----- arch/arm/mach-dove/irq.c | 5 ++++- arch/arm/mach-dove/{include/mach => }/irqs.h | 2 -- arch/arm/mach-dove/mpp.c | 2 +- arch/arm/mach-dove/pcie.c | 4 ++-- arch/arm/mach-dove/{include/mach => }/pm.h | 4 +--- 12 files changed, 17 insertions(+), 44 deletions(-) rename arch/arm/mach-dove/{include/mach => }/bridge-regs.h (96%) rename arch/arm/mach-dove/{include/mach => }/dove.h (99%) delete mode 100644 arch/arm/mach-dove/include/mach/hardware.h rename arch/arm/mach-dove/{include/mach => }/irqs.h (98%) rename arch/arm/mach-dove/{include/mach => }/pm.h (97%) diff --git a/arch/arm/mach-dove/include/mach/bridge-regs.h b/arch/arm/mach-dove/bridge-regs.h similarity index 96% rename from arch/arm/mach-dove/include/mach/bridge-regs.h rename to arch/arm/mach-dove/bridge-regs.h index f4a5b34489b7..ace0b0bfbf11 100644 --- a/arch/arm/mach-dove/include/mach/bridge-regs.h +++ b/arch/arm/mach-dove/bridge-regs.h @@ -1,6 +1,4 @@ /* - * arch/arm/mach-dove/include/mach/bridge-regs.h - * * Mbus-L to Mbus Bridge Registers * * This file is licensed under the terms of the GNU General Public @@ -11,7 +9,7 @@ #ifndef __ASM_ARCH_BRIDGE_REGS_H #define __ASM_ARCH_BRIDGE_REGS_H -#include +#include "dove.h" #define CPU_CONFIG (BRIDGE_VIRT_BASE + 0x0000) diff --git a/arch/arm/mach-dove/cm-a510.c b/arch/arm/mach-dove/cm-a510.c index b9a7c33db29a..9f25c993d863 100644 --- a/arch/arm/mach-dove/cm-a510.c +++ b/arch/arm/mach-dove/cm-a510.c @@ -22,8 +22,7 @@ #include #include -#include - +#include "dove.h" #include "common.h" static struct mv643xx_eth_platform_data cm_a510_ge00_data = { diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c index d7b826d2695c..01b830afcea9 100644 --- a/arch/arm/mach-dove/common.c +++ b/arch/arm/mach-dove/common.c @@ -22,11 +22,11 @@ #include #include #include -#include -#include #include #include #include +#include "bridge-regs.h" +#include "pm.h" #include "common.h" /* These can go away once Dove uses the mvebu-mbus DT binding */ diff --git a/arch/arm/mach-dove/dove-db-setup.c b/arch/arm/mach-dove/dove-db-setup.c index 8971c3c0f0fe..418ab21b9d9b 100644 --- a/arch/arm/mach-dove/dove-db-setup.c +++ b/arch/arm/mach-dove/dove-db-setup.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include "dove.h" #include "common.h" static struct mv643xx_eth_platform_data dove_db_ge00_data = { diff --git a/arch/arm/mach-dove/include/mach/dove.h b/arch/arm/mach-dove/dove.h similarity index 99% rename from arch/arm/mach-dove/include/mach/dove.h rename to arch/arm/mach-dove/dove.h index 00f45458b3ec..539e735f968d 100644 --- a/arch/arm/mach-dove/include/mach/dove.h +++ b/arch/arm/mach-dove/dove.h @@ -1,6 +1,4 @@ /* - * arch/arm/mach-dove/include/mach/dove.h - * * Generic definitions for Marvell Dove 88AP510 SoC * * This file is licensed under the terms of the GNU General Public @@ -11,7 +9,7 @@ #ifndef __ASM_ARCH_DOVE_H #define __ASM_ARCH_DOVE_H -#include +#include "irqs.h" /* * Marvell Dove address maps. diff --git a/arch/arm/mach-dove/include/mach/hardware.h b/arch/arm/mach-dove/include/mach/hardware.h deleted file mode 100644 index f1368b9a8ece..000000000000 --- a/arch/arm/mach-dove/include/mach/hardware.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * arch/arm/mach-dove/include/mach/hardware.h - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without any - * warranty of any kind, whether express or implied. - */ - -#ifndef __ASM_ARCH_HARDWARE_H -#define __ASM_ARCH_HARDWARE_H - -#include "dove.h" - -/* Macros below are required for compatibility with PXA AC'97 driver. */ -#define __REG(x) (*((volatile u32 *)((x) - DOVE_SB_REGS_PHYS_BASE + \ - DOVE_SB_REGS_VIRT_BASE))) -#define __PREG(x) (((u32)&(x)) - DOVE_SB_REGS_VIRT_BASE + \ - DOVE_SB_REGS_PHYS_BASE) -#endif diff --git a/arch/arm/mach-dove/include/mach/uncompress.h b/arch/arm/mach-dove/include/mach/uncompress.h index 5c8ae9b9d39a..7a4bd8838036 100644 --- a/arch/arm/mach-dove/include/mach/uncompress.h +++ b/arch/arm/mach-dove/include/mach/uncompress.h @@ -1,15 +1,13 @@ /* - * arch/arm/mach-dove/include/mach/uncompress.h - * * This file is licensed under the terms of the GNU General Public * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied. */ -#include +#define UART0_PHYS_BASE (0xf1000000 + 0x12000) -#define UART_THR ((volatile unsigned char *)(DOVE_UART0_PHYS_BASE + 0x0)) -#define UART_LSR ((volatile unsigned char *)(DOVE_UART0_PHYS_BASE + 0x14)) +#define UART_THR ((volatile unsigned char *)(UART0_PHYS_BASE + 0x0)) +#define UART_LSR ((volatile unsigned char *)(UART0_PHYS_BASE + 0x14)) #define LSR_THRE 0x20 diff --git a/arch/arm/mach-dove/irq.c b/arch/arm/mach-dove/irq.c index d6627c1f7f30..31ccbcee2627 100644 --- a/arch/arm/mach-dove/irq.c +++ b/arch/arm/mach-dove/irq.c @@ -11,9 +11,12 @@ #include #include #include + #include -#include #include + +#include "pm.h" +#include "bridge-regs.h" #include "common.h" static int __initdata gpio0_irqs[4] = { diff --git a/arch/arm/mach-dove/include/mach/irqs.h b/arch/arm/mach-dove/irqs.h similarity index 98% rename from arch/arm/mach-dove/include/mach/irqs.h rename to arch/arm/mach-dove/irqs.h index 8ff0fa8b4fcd..a0742179faff 100644 --- a/arch/arm/mach-dove/include/mach/irqs.h +++ b/arch/arm/mach-dove/irqs.h @@ -1,6 +1,4 @@ /* - * arch/arm/mach-dove/include/mach/irqs.h - * * IRQ definitions for Marvell Dove 88AP510 SoC * * This file is licensed under the terms of the GNU General Public diff --git a/arch/arm/mach-dove/mpp.c b/arch/arm/mach-dove/mpp.c index 8a433a51289c..6acd8488bb05 100644 --- a/arch/arm/mach-dove/mpp.c +++ b/arch/arm/mach-dove/mpp.c @@ -12,8 +12,8 @@ #include #include #include -#include #include +#include "dove.h" #include "mpp.h" struct dove_mpp_grp { diff --git a/arch/arm/mach-dove/pcie.c b/arch/arm/mach-dove/pcie.c index dfb62f3f5dcf..ee91ac6b5ebf 100644 --- a/arch/arm/mach-dove/pcie.c +++ b/arch/arm/mach-dove/pcie.c @@ -17,9 +17,9 @@ #include #include #include -#include -#include #include +#include "irqs.h" +#include "bridge-regs.h" #include "common.h" struct pcie_port { diff --git a/arch/arm/mach-dove/include/mach/pm.h b/arch/arm/mach-dove/pm.h similarity index 97% rename from arch/arm/mach-dove/include/mach/pm.h rename to arch/arm/mach-dove/pm.h index d22b9b174007..01267746d707 100644 --- a/arch/arm/mach-dove/include/mach/pm.h +++ b/arch/arm/mach-dove/pm.h @@ -1,6 +1,4 @@ /* - * arch/arm/mach-dove/include/mach/pm.h - * * This file is licensed under the terms of the GNU General Public * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied. @@ -10,7 +8,7 @@ #define __ASM_ARCH_PM_H #include -#include +#include "irqs.h" #define CLOCK_GATING_CONTROL (DOVE_PMU_VIRT_BASE + 0x38) #define CLOCK_GATING_BIT_USB0 0 From patchwork Wed Jul 31 19:56:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11069263 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 F1466746 for ; Wed, 31 Jul 2019 20:06:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDF1227C05 for ; Wed, 31 Jul 2019 20:06:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D285227DCD; Wed, 31 Jul 2019 20:06: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 4C57127C05 for ; Wed, 31 Jul 2019 20:06:19 +0000 (UTC) X-Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by groups.io with SMTP; Wed, 31 Jul 2019 13:06:18 -0700 X-Received: by mail.kernel.org (Postfix) id 84C28214DA; Wed, 31 Jul 2019 20:06:18 +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 021FE206A3 for ; Wed, 31 Jul 2019 20:06:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 021FE206A3 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MODeL-1hhZ8Q40pV-00OV4y; Wed, 31 Jul 2019 22:05:44 +0200 From: Arnd Bergmann To: Linuxkernel+Patchwork-Soc via Email Integration Cc: "David S. Miller" , Greg Kroah-Hartman , Alan Stern , Guenter Roeck , linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 13/14] ARM: orion/mvebu: unify debug-ll virtual addresses Date: Wed, 31 Jul 2019 21:56:55 +0200 Message-Id: <20190731195713.3150463-14-arnd@arndb.de> In-Reply-To: <20190731195713.3150463-1-arnd@arndb.de> References: <20190731195713.3150463-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:Y/ESiM0kAuRteAugQmjXsl6x4cLpUBC4xLlaR2JUNWvARfLIQGO TQM095s/TFn8AV8/Qoc4eHOnBtqAJBMExhkEcMP0vX7+87jSCb1X3nhD4ghe9K9doUwcdXD 05hEPdynsX/S9HHVozpw1JB6YUC5Qd0YS3ObojFB40I00QQE7cjOe+ixkJ6PWNW01oqP1w3 UjMSkHlzdbzCeitJ9hg3A== X-UI-Out-Filterresults: notjunk:1;V03:K0:fpfWvaEJtdo=:siCKSImWLjyCiT9PWAwOxl kzxySF8EIQd3cR7E2wjBeYRa1Acqc8iLK0RL//ox/DCx3W933S2VozzKlUNdX2jgf62v2+vPs lK17Y7VALtRB/PGpUsiWNGFVQ88jDpI89DJP3VNTSCF5F480mUb2F1z6pGQOze4ZIUU9N/q48 7rImV7js4LckRi8TskduWf+xuhgV5dXl1MB1cYwfILDqe/76r/q2XYQd6QudkDWK909llddKU 9bR6Lc46bzk0jv2OatvcjiEQC0eyaVGkDqGNmGMiU1qRGG423e7VNUPAjnQYUvsHjIJqqePmz HfA2ZCn1DhSfyzyMbxEltQ1w0QhA8hsq6Nf17NQPPnu5nm07PUEv3l+GUAprV9UaC+YPZzJzk mafDi0rVyKNTFNcSOz+gjiybL2xfqK1+y8iKUpZS90i+B7la/AqAsQ0/MbwsqHMwTl/i23Gyk VXHY7Lqs+rUPtECbf9gzg4V/iKuBxAj55MkIU0b6FxjY4IWWYI+R866bjwofevADHKQOpHxRF uoYL06eJdLBLHVv6xenXeNdsEJ221gFa2EJQle4LlRJVjiLtqFzKSfVogE0AwHANpY3RmD5O/ fonLICMrJSBR2X5f+GmESwgAKCrA9H4Oe4EjDGCNw+Gy6kSxB8qnllEOcETJAjW01BifOX9pq 1lJ3kRo767Tsz99Zwm3pLSn4JJHhh+Hn7QKoCVm/gUrzZcVARaBm646FvB0om/1J4KgykR6w8 EAp7pnbJhUaVFKokfOy2tCYPtHGWnObLJawqvg== 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=1564603579; bh=jfWDQwHEjq3dHtUiiw+USDbB4q8HmDFuC1hDBJKyvjw=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=xc66XBcvWSni1j9yGpax6x2wG2SIng/co8HUBf0CE5BXFBdxHzKEWuh8lDwxOLy4V8z rwzY9d1XQx2F/b4Rop9jGwjAaIXrSm9B+Z7LPYCumV0SQ91evjmBJzuu5nPahhykEsYf9 xKr4urT0OnqOfos9dsmICEANVnGYATjO7jc= X-Virus-Scanned: ClamAV using ClamSMTP In a multiplatform configuration, enabling DEBUG_LL breaks booting on all platforms with incompatible settings. In case of the Marvell platforms of the Orion/MVEBU family, the physical addresses are all the same, we just map them at different virtual addresses, which makes it impossible to run a kernel with DEBUG_LL enabled on a combination of the merged mvebu and the legacy boardfile based platforms. This is easily solved by using the same virtual address everywhere. I picked the address that is already used by mach-mvebu for UART0: 0xfec12000. All these platforms have a 1MB region with their internal registers, almost always at physical address 0xf1000000, so I'm updating the iotable for that entry. In case of mach-dove, this is slightly trickier, as the existing mapping is 8MB and a second 8MB mapping is already at the 0xfec00000 address. I have verified from the datasheet that the last 7MB of the physical mapping are "reserved" and nothing in Linux tries to use it either. I'm putting this 1MB mapping at the same address as the others, and the second 8MB register area immediately before that. Link: https://lore.kernel.org/linux-arm-kernel/87si3eb1z8.fsf@free-electrons.com/ Signed-off-by: Arnd Bergmann --- I posted this in 2015, and Gregory said he would like to see some testing on it. I don't think anyone ever tested it, but we probably still want to have this. --- arch/arm/Kconfig.debug | 5 +---- arch/arm/mach-dove/dove.h | 10 +++++----- arch/arm/mach-mv78xx0/mv78xx0.h | 4 ++-- arch/arm/mach-orion5x/orion5x.h | 4 ++-- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 85710e078afb..0ad316a160c7 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -1772,10 +1772,7 @@ config DEBUG_UART_VIRT default 0xfc705000 if DEBUG_ZTE_ZX default 0xfcfe8600 if DEBUG_BCM63XX_UART default 0xfd000000 if DEBUG_SPEAR3XX || DEBUG_SPEAR13XX - default 0xfd012000 if DEBUG_MVEBU_UART0_ALTERNATE && ARCH_MV78XX0 default 0xfd883000 if DEBUG_ALPINE_UART0 - default 0xfde12000 if DEBUG_MVEBU_UART0_ALTERNATE && ARCH_DOVE - default 0xfe012000 if DEBUG_MVEBU_UART0_ALTERNATE && ARCH_ORION5X default 0xfe017000 if DEBUG_MMP_UART2 default 0xfe018000 if DEBUG_MMP_UART3 default 0xfe100000 if DEBUG_IMX23_UART || DEBUG_IMX28_UART @@ -1790,7 +1787,7 @@ config DEBUG_UART_VIRT default 0xfec02000 if DEBUG_SOCFPGA_UART0 default 0xfec02100 if DEBUG_SOCFPGA_ARRIA10_UART1 default 0xfec03000 if DEBUG_SOCFPGA_CYCLONE5_UART1 - default 0xfec12000 if (DEBUG_MVEBU_UART0 || DEBUG_MVEBU_UART0_ALTERNATE) && ARCH_MVEBU + default 0xfec12000 if DEBUG_MVEBU_UART0 || DEBUG_MVEBU_UART0_ALTERNATE default 0xfec12100 if DEBUG_MVEBU_UART1_ALTERNATE default 0xfec10000 if DEBUG_SIRFATLAS7_UART0 default 0xfec20000 if DEBUG_DAVINCI_DMx_UART0 diff --git a/arch/arm/mach-dove/dove.h b/arch/arm/mach-dove/dove.h index 539e735f968d..320ed1696abd 100644 --- a/arch/arm/mach-dove/dove.h +++ b/arch/arm/mach-dove/dove.h @@ -18,8 +18,8 @@ * c8000000 fdb00000 1M Cryptographic SRAM * e0000000 @runtime 128M PCIe-0 Memory space * e8000000 @runtime 128M PCIe-1 Memory space - * f1000000 fde00000 8M on-chip south-bridge registers - * f1800000 fe600000 8M on-chip north-bridge registers + * f1000000 fec00000 1M on-chip south-bridge registers + * f1800000 fe400000 8M on-chip north-bridge registers * f2000000 fee00000 1M PCIe-0 I/O space * f2100000 fef00000 1M PCIe-1 I/O space */ @@ -42,11 +42,11 @@ #define DOVE_SCRATCHPAD_SIZE SZ_1M #define DOVE_SB_REGS_PHYS_BASE 0xf1000000 -#define DOVE_SB_REGS_VIRT_BASE IOMEM(0xfde00000) -#define DOVE_SB_REGS_SIZE SZ_8M +#define DOVE_SB_REGS_VIRT_BASE IOMEM(0xfec00000) +#define DOVE_SB_REGS_SIZE SZ_1M #define DOVE_NB_REGS_PHYS_BASE 0xf1800000 -#define DOVE_NB_REGS_VIRT_BASE IOMEM(0xfe600000) +#define DOVE_NB_REGS_VIRT_BASE IOMEM(0xfe400000) #define DOVE_NB_REGS_SIZE SZ_8M #define DOVE_PCIE0_IO_PHYS_BASE 0xf2000000 diff --git a/arch/arm/mach-mv78xx0/mv78xx0.h b/arch/arm/mach-mv78xx0/mv78xx0.h index 2db1265ec121..c1a9a1d1b295 100644 --- a/arch/arm/mach-mv78xx0/mv78xx0.h +++ b/arch/arm/mach-mv78xx0/mv78xx0.h @@ -37,7 +37,7 @@ * fee50000 f0d00000 64K PCIe #5 I/O space * fee60000 f0e00000 64K PCIe #6 I/O space * fee70000 f0f00000 64K PCIe #7 I/O space - * fd000000 f1000000 1M on-chip peripheral registers + * fec00000 f1000000 1M on-chip peripheral registers */ #define MV78XX0_CORE0_REGS_PHYS_BASE 0xf1020000 #define MV78XX0_CORE1_REGS_PHYS_BASE 0xf1024000 @@ -49,7 +49,7 @@ #define MV78XX0_PCIE_IO_SIZE SZ_1M #define MV78XX0_REGS_PHYS_BASE 0xf1000000 -#define MV78XX0_REGS_VIRT_BASE IOMEM(0xfd000000) +#define MV78XX0_REGS_VIRT_BASE IOMEM(0xfec00000) #define MV78XX0_REGS_SIZE SZ_1M #define MV78XX0_PCIE_MEM_PHYS_BASE 0xc0000000 diff --git a/arch/arm/mach-orion5x/orion5x.h b/arch/arm/mach-orion5x/orion5x.h index 3364df331f01..2b66120fba86 100644 --- a/arch/arm/mach-orion5x/orion5x.h +++ b/arch/arm/mach-orion5x/orion5x.h @@ -31,13 +31,13 @@ * fc000000 device bus mappings (cs0/cs1) * * virt phys size - * fe000000 f1000000 1M on-chip peripheral registers + * fec00000 f1000000 1M on-chip peripheral registers * fee00000 f2000000 64K PCIe I/O space * fee10000 f2100000 64K PCI I/O space * fd000000 f0000000 16M PCIe WA space (Orion-1/Orion-NAS only) ****************************************************************************/ #define ORION5X_REGS_PHYS_BASE 0xf1000000 -#define ORION5X_REGS_VIRT_BASE IOMEM(0xfe000000) +#define ORION5X_REGS_VIRT_BASE IOMEM(0xfec00000) #define ORION5X_REGS_SIZE SZ_1M #define ORION5X_PCIE_IO_PHYS_BASE 0xf2000000 From patchwork Wed Jul 31 19:56:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11069275 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 CF9041399 for ; Wed, 31 Jul 2019 20:06:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC1E527C05 for ; Wed, 31 Jul 2019 20:06:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B058227D0C; Wed, 31 Jul 2019 20:06:52 +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 15FFD27D29 for ; Wed, 31 Jul 2019 20:06:51 +0000 (UTC) X-Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by groups.io with SMTP; Wed, 31 Jul 2019 13:06:51 -0700 X-Received: by mail.kernel.org (Postfix) id 024F5206A3; Wed, 31 Jul 2019 20:06:51 +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 751F220659 for ; Wed, 31 Jul 2019 20:06:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 751F220659 X-Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1M2xjg-1hwDiO0mU8-003Ngr; Wed, 31 Jul 2019 22:06:16 +0200 From: Arnd Bergmann To: Linuxkernel+Patchwork-Soc via Email Integration Cc: "David S. Miller" , Greg Kroah-Hartman , Alan Stern , Guenter Roeck , linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 14/14] ARM: dove: multiplatform support Date: Wed, 31 Jul 2019 21:56:56 +0200 Message-Id: <20190731195713.3150463-15-arnd@arndb.de> In-Reply-To: <20190731195713.3150463-1-arnd@arndb.de> References: <20190731195713.3150463-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:85eWple6ACFlHQs06NQni6QWzJNxZWtwqV4c+ZTQxKwOfP+LnNf Lo+nP8CqmtyadmCr5iK1lbOIRMLVN71eEsKpshA+Ky2uivTEFWNNmUBZ0INsQeQSIulmCDj 6Yw/3jn/RXHZcg+SF0zv3g5krRPaHxNxLdRENv5pFB41mAMzH2YeVJxvloQsLzerDfNow2K /PmOUgDhr30s+fjeYcS2Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:ImgMlleMZiY=:/760y3qKqIc1sQDa49JSUQ YKUdYsdG5yy5b3Ks+fhV9CDyqe1+FeYnfRJOJCA8xzADRU41LnuYp5OLWw1QrW30GCNprqgOS iJUd9/YYnbqcQfbI/BJ2cFBlP7ZCDiT/kHH/Jk96dOFeZ8mU8sosbwAvD2Grv7h4RbH6nRvv5 zqF9ux+VB38DYe66bu03i4EbqSf+oHfEnmwrDZzW5ronWfCcrRqoKWHyVHCvicWLMby/Vomv6 bkbpADKbxwZbAIGelenCTzqa25zwrVbencKpdNspNCufWZwrqeb8DZL70FbFE2q62PfFIM1VT 9/EVKbWXtXRvSjgRKhOm2rYPdZV9pijB3THCtFNGD9pwnhx2czwCRx6Ax6N7ClYt8AZRedXfn g00DAep7mEOlLZPNvJy+kvT2YQueVFyehTpFFNKTcPe0Kdni+mW/3ZuyjKPiqCe0xnGqb4LtI TmFAql3hv/jl7XKDP7t1Pyi0rp0hEp9cCoiphO2BvLWDTsHclXJQ7FY99rO/N3FIK60HPc/px DMtgxO35opTCU8esYbZ3O10lRTFI/Sw7z7m0IqTJvtJabEbMyMrc5k6k2/3HZTjSvqzRRXYWB gkDBDcjpjwnEKJaWy/wff/vXeCH04pN3ae+x4Q05tFUjT6jR0X05IdnySaSbEuV0QAsTAHPJA En0+5mU1BLy5/YfBR3Rkiqyr9sYY7qrkXhE/6SejhNwAq5rCdVGTaZi4ZJfBbqA+ylskRGiT+ KVOq3DVl3VZjk34f09HAvxDEAQepsGpAqIlSkQ== 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=1564603611; bh=v/2KIbXfNV17idQotcBlYKbzhzcfRg2m5dwtuWoYTYo=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=avC6qYYxF+vtKbQEFpz0DJ8qUZ/anMLefmAdzIym47dHIc7XHT/v53nValURBSiLCbT vb3VKCrBrwYiE6A7ouM7ESWhgl7LBKwIeA74OfRRQ5PH7pHangSJgEtQLxBXXm5cxdDYb WhpHQIXkZGOxxDLepO0IZvCgBSx6KZUnesA= X-Virus-Scanned: ClamAV using ClamSMTP The dove platform is now ready to be enabled for multiplatform support, this patch does the switch over by modifying the Kconfig file, the defconfig and removing the last mach/*.h header that becomes obsolete with this. This work was originally done in 2015 as all the ARMv7 machiens gove moved over to multiplatform builds, but at the time it conflicted with some patches that Russell was trying to upstream, so we left it at that. I hope that there is no longer a need to keep dove separate from the rest, so we can either add it to the other ARMv7 platforms, or just replace it with the DT based platform code for the same hardware in mach-mvebu and remove mach-dove entirely. Acked-by: Andrew Lunn Cc: Russell King Signed-off-by: Arnd Bergmann --- arch/arm/Kconfig | 16 --------- arch/arm/configs/dove_defconfig | 2 ++ arch/arm/mach-dove/Kconfig | 16 ++++++--- arch/arm/mach-dove/Makefile | 2 ++ arch/arm/mach-dove/include/mach/uncompress.h | 34 -------------------- 5 files changed, 16 insertions(+), 54 deletions(-) delete mode 100644 arch/arm/mach-dove/include/mach/uncompress.h diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 65808e17cb3b..67f98f1ab399 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -435,22 +435,6 @@ config ARCH_IXP4XX help Support for Intel's IXP4XX (XScale) family of processors. -config ARCH_DOVE - bool "Marvell Dove" - select CPU_PJ4 - select GENERIC_CLOCKEVENTS - select GENERIC_IRQ_MULTI_HANDLER - select GPIOLIB - select HAVE_PCI - select MVEBU_MBUS - select PINCTRL - select PINCTRL_DOVE - select PLAT_ORION_LEGACY - select SPARSE_IRQ - select PM_GENERIC_DOMAINS if PM - help - Support for the Marvell Dove SoC 88AP510 - config ARCH_KS8695 bool "Micrel/Kendin KS8695" select CLKSRC_MMIO diff --git a/arch/arm/configs/dove_defconfig b/arch/arm/configs/dove_defconfig index e70c997d5f4c..1ced32deac75 100644 --- a/arch/arm/configs/dove_defconfig +++ b/arch/arm/configs/dove_defconfig @@ -8,6 +8,8 @@ CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_BLK_DEV_BSG is not set CONFIG_PARTITION_ADVANCED=y +# CONFIG_ARCH_MULTI_V6 is not set +CONFIG_ARCH_MULTI_V7=y CONFIG_ARCH_DOVE=y CONFIG_MACH_DOVE_DB=y CONFIG_MACH_CM_A510=y diff --git a/arch/arm/mach-dove/Kconfig b/arch/arm/mach-dove/Kconfig index 7747fe64420a..c30c69c664ea 100644 --- a/arch/arm/mach-dove/Kconfig +++ b/arch/arm/mach-dove/Kconfig @@ -1,7 +1,17 @@ # SPDX-License-Identifier: GPL-2.0 -if ARCH_DOVE +menuconfig ARCH_DOVE + bool "Marvell Dove" if ARCH_MULTI_V7 + select CPU_PJ4 + select GPIOLIB + select MVEBU_MBUS + select PINCTRL + select PINCTRL_DOVE + select PLAT_ORION_LEGACY + select PM_GENERIC_DOMAINS if PM + help + Support for the Marvell Dove SoC 88AP510 -menu "Marvell Dove Implementations" +if ARCH_DOVE config DOVE_LEGACY bool @@ -21,6 +31,4 @@ config MACH_CM_A510 Say 'Y' here if you want your kernel to support the CompuLab CM-A510 Board. -endmenu - endif diff --git a/arch/arm/mach-dove/Makefile b/arch/arm/mach-dove/Makefile index cdf163cab738..e83f6492834d 100644 --- a/arch/arm/mach-dove/Makefile +++ b/arch/arm/mach-dove/Makefile @@ -1,4 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 +ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/arch/arm/plat-orion/include + obj-y += common.o obj-$(CONFIG_DOVE_LEGACY) += irq.o mpp.o obj-$(CONFIG_PCI) += pcie.o diff --git a/arch/arm/mach-dove/include/mach/uncompress.h b/arch/arm/mach-dove/include/mach/uncompress.h deleted file mode 100644 index 7a4bd8838036..000000000000 --- a/arch/arm/mach-dove/include/mach/uncompress.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without any - * warranty of any kind, whether express or implied. - */ - -#define UART0_PHYS_BASE (0xf1000000 + 0x12000) - -#define UART_THR ((volatile unsigned char *)(UART0_PHYS_BASE + 0x0)) -#define UART_LSR ((volatile unsigned char *)(UART0_PHYS_BASE + 0x14)) - -#define LSR_THRE 0x20 - -static void putc(const char c) -{ - int i; - - for (i = 0; i < 0x1000; i++) { - /* Transmit fifo not full? */ - if (*UART_LSR & LSR_THRE) - break; - } - - *UART_THR = c; -} - -static void flush(void) -{ -} - -/* - * nothing to do - */ -#define arch_decomp_setup()