From patchwork Wed Jul 11 12:08:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 141726 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp205850ljj; Wed, 11 Jul 2018 05:08:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpffJW8c1STh4o4mkJG9iJZ+E6k824SkaTeHMB1dnlUuL+dfIloKACZwR2kbCdzIewCutxR+ X-Received: by 2002:a65:64c6:: with SMTP id t6-v6mr26608639pgv.223.1531310913237; Wed, 11 Jul 2018 05:08:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531310913; cv=none; d=google.com; s=arc-20160816; b=MuttwFkK+m5Jcui919wdYCRxS+eqD1STdjSz/9dVfeQd5QC0q88PV+rmQc00zrSlW8 JdFLHq3/fwpuM6ks0s+9aUcNGAvP2B0+wNuL0DMsMZ3lCbmo8hhMkhrPi/68rOFerkR3 YtuYGoOkNdnWHu/YEW7yNJRxG5YzsnxeM798RUctKqKUZujYU5nbK0AM0riLzrydpYL4 n6TqjcoL5yeDTS5/QSBzU7QNlbrBJYsxYyjO7NjHLfXxQgeT1QmM0YZUKVzmKP1rNO53 LO2vIygDVcFlNNFBxTVUh5fkbtbtBaDv1GUuhAYrISys+lpn6HIecNr+l42PNv1RjFkE wkFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=LTVP7gumY36KMFNKp+lxCRIxG4IV8MuUKw617Vr7zFU=; b=sr+OAbAqk1gH/a5/kMmhbLy+YEo0T2RpFp+jf5TyOrXMFH/UsbEM5uUYQWfCqxfnpo BU12swu4AKGlVr1lnDdIa6hbt7y5jg22GIQFAG3TW4Dig7apt+I5zF1c7K2CjRwb2iPd ASNEHEl/l/tQ9e8oKfx3X1kXfBV95V7XknT15qV0QcL4jOe2E/VbT2QCx0LAqgmcmaOE YSR/7tjbZb6OTt/bCSqSxc+Uk8Lh6vqfBp6XoKPZ2cVZLWKBndr2YX6f910iCiJ1Lsys eis+wxAW8oN+gcdw/P8OAriIDKyaXGW/VsjaTE2AYoR0zYntWdOHh46hGHSJ9YfiLbzn kRUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v2-v6si3930919pgt.228.2018.07.11.05.08.32; Wed, 11 Jul 2018 05:08:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732783AbeGKMMc (ORCPT + 23 others); Wed, 11 Jul 2018 08:12:32 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:59334 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726457AbeGKMMb (ORCPT ); Wed, 11 Jul 2018 08:12:31 -0400 Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0MFOee-1fpH821VW0-00EJpZ; Wed, 11 Jul 2018 14:08:26 +0200 From: Arnd Bergmann To: Tony Luck , Fenghua Yu Cc: Boris Brezillon , linux-ia64@vger.kernel.org, linux-alpha@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] ia64: use asm-generic/io.h Date: Wed, 11 Jul 2018 14:08:05 +0200 Message-Id: <20180711120824.3882108-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:0O5ipnYJOrcVpf3YZJ5qHfPDb9qRq7llKIN1cHiJv0RHNzxs2k+ aIfnikcCyeiuX/TFKfUXC468MqA+ykG491GQS2nT9kVxqugrZZrota3OgoGtrBUUPdR4lmC fg9VT3NAaWHsoMDlKDFRZsNUSWZhci6miVjAYwZ6JFdVzpfZQPkmkaGktZet7fizrw22cYh CxqmB8agInPBshtxSzvPw== X-UI-Out-Filterresults: notjunk:1; V01:K0:LxRVDpJQnzc=:MEVQgcPKAqSrb/BRzFyKtA gXIghciRc4EZz+B8lB6Jn+wm9xW+axDpONu4p/Mb5R55wbbz1q5Ks+6Cy4M1mWkTxJwlotnlU NSV18mp2agctCOXvoiQjE20t+ZQRjXL/JSXMCT86KKeJp5wQze6pwZxatfKpH9mAt9SyeV2mD 34boMdOkgDAijA3/6vaHPoSPvBxg6gGGa0hhYkWeem9R8A/0aq8Ys9Zvzeg/TBzGrJ5S5+bf3 63YqTSNhXQDXvQWa+VSKOEhw3/wmSQsVCBm89a4ATz+cq5kBAnpr0sp5YNK4WRFqNaSqGyZL+ K7zEBHHI03r1TieoeiBreFZJI9OVYxJ/RK2TxkrxTaT+tV6mgNQ2q81GceqYx3d0hIldls6IF yeA9diRM2Tmyib1vn+/8yEjc2yU64VFIwhpYiUF3V/XkEBwG+PMeP9S6g7wVaeb+k/hhd8AEa nUCfK6HGoXus0YCb6lgVMtOZ3lATOgSYq4kgi6Eb+MGEOaeD67IwxFXoP+nEUVtUBZBd4K/RD egmFyDrK/ReKRCOmB1TL0QyvlrChF4vG93zY33u/alaHnWg7ZWRbEsMhL0G4wJ3JU5sETDMzx a1eF6HjpKGGsmpYwhNPfCznnE1a5KwwHShJJznV4Eo4UGWuF8C4W6fvAZMPTZ2CTvOjyukJbg Szvl9BwtBPMn/AuEl1xKydfZNbOZQiq3SF9HLq1WL3X0YHpHYrhQYviKVlXded9aiJho= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org asm-generic/io.h provides a generic implementation of all I/O accessors, which the architectures can override. Since ia64 does not provide readsl/writesl etc, any driver using those fails to build, and including asm-generic/io.h will provide the missing interfaces, as well as any other future interfaces that get added there. We need to #define a couple of symbols to themselves in the ia64 to ensure that we use the ia64 specific version of those rather than the generic one. There should be no other effect than adding {read,write}s{b,w,l}() as well as {in,out}s{b,w,l}_p(), which were also not provided by ia64 but are provided by the generic header for historic reasons. Signed-off-by: Arnd Bergmann --- arch/ia64/include/asm/io.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) -- 2.9.0 Tested-by: Boris Brezillon diff --git a/arch/ia64/include/asm/io.h b/arch/ia64/include/asm/io.h index fb0651961e2c..6f952171abf9 100644 --- a/arch/ia64/include/asm/io.h +++ b/arch/ia64/include/asm/io.h @@ -83,12 +83,14 @@ virt_to_phys (volatile void *address) { return (unsigned long) address - PAGE_OFFSET; } +#define virt_to_phys virt_to_phys static inline void* phys_to_virt (unsigned long address) { return (void *) (address + PAGE_OFFSET); } +#define phys_to_virt phys_to_virt #define ARCH_HAS_VALID_PHYS_ADDR_RANGE extern u64 kern_mem_attribute (unsigned long phys_addr, unsigned long size); @@ -433,9 +435,11 @@ static inline void __iomem * ioremap_cache (unsigned long phys_addr, unsigned lo { return ioremap(phys_addr, size); } +#define ioremap ioremap +#define ioremap_nocache ioremap_nocache #define ioremap_cache ioremap_cache #define ioremap_uc ioremap_nocache - +#define iounmap iounmap /* * String version of IO memory access ops: @@ -444,6 +448,13 @@ extern void memcpy_fromio(void *dst, const volatile void __iomem *src, long n); extern void memcpy_toio(volatile void __iomem *dst, const void *src, long n); extern void memset_io(volatile void __iomem *s, int c, long n); +#define memcpy_fromio memcpy_fromio +#define memcpy_toio memcpy_toio +#define memset_io memset_io +#define xlate_dev_kmem_ptr xlate_dev_kmem_ptr +#define xlate_dev_mem_ptr xlate_dev_mem_ptr +#include + # endif /* __KERNEL__ */ #endif /* _ASM_IA64_IO_H */ From patchwork Wed Jul 11 12:08:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 141727 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp206337ljj; Wed, 11 Jul 2018 05:09:00 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcVrh9S7696vsJROW60xV/OFzGALSHZiF3PFBnnFNq5pu2OZrM76ZYyIRXQtbPSCm8GGZ6b X-Received: by 2002:a63:c608:: with SMTP id w8-v6mr6489225pgg.16.1531310940856; Wed, 11 Jul 2018 05:09:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531310940; cv=none; d=google.com; s=arc-20160816; b=EniA3rKq4dtke8GhrQ0Z/kx4MVK3fuAr4T4MjXx7FHybUVnz7QedXEyVHk3sgsnAck vXpqcIJM91T3vJr/e0aIvs0hG69noEW/6YHXCkNugyZ8RpoO6d0pd9dnZQQMfzAw2p+N tb+PSOlcH55DXiqf0m2s88+1eE2Ygkv2brif/wZakSAjoXfsg+oSUtscsl4Kb/QUb9jS BN5v0YVsmwpRzD7XAMiv2Ze9Z9PPPfOclUEQ5W/Us0KNgPjkFqMbA8rybCg3NwB33uTN TvgwWho8AJL+JDA7KI27r1uQgmuq6olKdLLfFnjNUXY/o/wjEKq+bKa/vn7Ze6SpYxph Y7SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=6qqLsqNk9bWBryUrKXDR6Ugu0CY4TJrtpHUlCaeMRE4=; b=QLrYosd3LoAbGajHkTRgbkCHhRwp54igF9O+kanhNvE+WI0iZNgGmCbAejPjaeMl53 Mr58fYLR6zynfDkYSSC9PPEL0BNZZ/FNRpRXlNgnk/uHJKKa0nP1U7zZskmCpVo7k4BE uOpJT7IgL9fr0Ebwwc0JK1UGWIxHFtmb00PeaOEmkUloMnVeo0cRm5j7LLfECE77QfIJ yp12L1OPyv/XlNvBfXMG6sZY8L5IVOzobmzDElv3XJ32tqf5H5EAC/BOxoZX7HzTgutf WZJkPvGT1m11AnTDIFBU3e3wFh90blFYeMuIqIl1k3s5PY3EUBC3WZEJ2gJpiQu028Sx p7+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s2-v6si3502723plp.259.2018.07.11.05.09.00; Wed, 11 Jul 2018 05:09:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732830AbeGKMNA (ORCPT + 23 others); Wed, 11 Jul 2018 08:13:00 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:44452 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726457AbeGKMM7 (ORCPT ); Wed, 11 Jul 2018 08:12:59 -0400 Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0M7nzI-1fyzzx1Ihc-00vSfd; Wed, 11 Jul 2018 14:08:53 +0200 From: Arnd Bergmann To: "David S. Miller" , Arnd Bergmann Cc: Boris Brezillon , linux-ia64@vger.kernel.org, linux-alpha@vger.kernel.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] sparc64: add reads{b,w,l}/writes{b,w,l} Date: Wed, 11 Jul 2018 14:08:06 +0200 Message-Id: <20180711120824.3882108-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180711120824.3882108-1-arnd@arndb.de> References: <20180711120824.3882108-1-arnd@arndb.de> X-Provags-ID: V03:K1:wkkgXftNy6ebXNUe1Td0Auor9Sdh11vLJ6ZgqhxeXn4FovZjF05 6XDZDJF4tjIRhK9MQh5T596MZLuhHyuvS/pKoV/J+lEjHONRn6/QmRUVlP47x/+MOfBzfqu ox47Fj6UYQNdSeLQD/SejRwlhkzWIl6gvV+yF4+H8hyiXarrIPwkTEaZZKNKfOy29RDseiz Og9z3NpucMaEKQiOd/2Ig== X-UI-Out-Filterresults: notjunk:1; V01:K0:67xNIxIBSzk=:ocslP4G0Bwp2Kgvc6pyyta a+Lgpu5TXbDml3DJtx2nIDp1EVuyg+FZ33JBUjcbVQ+BmceBbFs/m3ZcR7mYsGNXGh53ipTtL Gy4A3Wiy999mRSp2G7SUPRjxVZH7b/SniztRTnwEe9HnYkxDhKVzjHjmlVp0Pm7HyozPD6BP3 0ebBXkF8j7cyDpMDRljjkiD87+yDIJwAT2v95VVYp6BYsWZwmSv53d38qsKEtgHgjb8rNjuMj Hjhb9mL2G+FwerOY1RdgIvwvc+XUo2BrH5/KQT9SmExIaeyZvX3SIMitMeR7wtkpgYCtI2fPx 5kaAdJiy8uAi3ftGtaiofZH+OS/1lB03Cpu5/u/i9y69LWSbcv9MJrbT8qshjvTA7IVRoMv+M 3jyV9A+BWCq+cRww63fUJKcZoAul2QxqqMAQZ0T1bBYtOPqxWgKbv5V75MCBE+Soh++0QrJDX u2hofn+Yp4Qo5wv1nZGqSO0FbTHe9PGQU9wj5fK/zSnEl7aQv9jSUk0/7WBX3JeAqzoM7SQam qLmaoB7iaLfyigIbVVzD8fFPPVihlTU/EeJbsJ/960fxQ4yynhUkSEWQZdthth3L/piWdcxV/ JiVFRmrhAIOMGClSH7u11NozFSPQW7OawqDvIWQY9MP5RaFHTURxyqe7st0YEEXuO1u2D6fNJ GxrVA6uvq93RoVD4C3O/o/VOQZXYXeJDOdLiInLErwtjmgo/mVWa+8z9VaRpe4WmNZ8M= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some drivers need these for compile-testing. On most architectures they come from asm-generic/io.h, but not on sparc64, which has its own definitions. Since we already have ioread*_rep()/iowrite*_rep() that have the same behavior on sparc64 (i.e. all PCI I/O space is memory mapped), we can rename the existing helpers and add macros to define them to the same implementation. Signed-off-by: Arnd Bergmann --- arch/sparc/include/asm/io_64.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) -- 2.9.0 Acked-by: David S. Miller Tested-by: Boris Brezillon diff --git a/arch/sparc/include/asm/io_64.h b/arch/sparc/include/asm/io_64.h index 9a1e9cbc7e6d..b162c23ae8c2 100644 --- a/arch/sparc/include/asm/io_64.h +++ b/arch/sparc/include/asm/io_64.h @@ -243,35 +243,42 @@ void insb(unsigned long, void *, unsigned long); void insw(unsigned long, void *, unsigned long); void insl(unsigned long, void *, unsigned long); -static inline void ioread8_rep(void __iomem *port, void *buf, unsigned long count) +static inline void readsb(void __iomem *port, void *buf, unsigned long count) { insb((unsigned long __force)port, buf, count); } -static inline void ioread16_rep(void __iomem *port, void *buf, unsigned long count) +static inline void readsw(void __iomem *port, void *buf, unsigned long count) { insw((unsigned long __force)port, buf, count); } -static inline void ioread32_rep(void __iomem *port, void *buf, unsigned long count) +static inline void readsl(void __iomem *port, void *buf, unsigned long count) { insl((unsigned long __force)port, buf, count); } -static inline void iowrite8_rep(void __iomem *port, const void *buf, unsigned long count) +static inline void writesb(void __iomem *port, const void *buf, unsigned long count) { outsb((unsigned long __force)port, buf, count); } -static inline void iowrite16_rep(void __iomem *port, const void *buf, unsigned long count) +static inline void writesw(void __iomem *port, const void *buf, unsigned long count) { outsw((unsigned long __force)port, buf, count); } -static inline void iowrite32_rep(void __iomem *port, const void *buf, unsigned long count) +static inline void writesl(void __iomem *port, const void *buf, unsigned long count) { outsl((unsigned long __force)port, buf, count); } +#define ioread8_rep(p,d,l) readsb(p,d,l) +#define ioread16_rep(p,d,l) readsw(p,d,l) +#define ioread32_rep(p,d,l) readsl(p,d,l) +#define iowrite8_rep(p,d,l) writesb(p,d,l) +#define iowrite16_rep(p,d,l) writesw(p,d,l) +#define iowrite32_rep(p,d,l) writesl(p,d,l) + /* Valid I/O Space regions are anywhere, because each PCI bus supported * can live in an arbitrary area of the physical address range. */