Commit d092a870 authored by Christoph Hellwig's avatar Christoph Hellwig

arch: rely on asm-generic/io.h for default ioremap_* definitions

Various architectures that use asm-generic/io.h still defined their
own default versions of ioremap_nocache, ioremap_wt and ioremap_wc
that point back to plain ioremap directly or indirectly.  Remove these
definitions and rely on asm-generic/io.h instead.  For this to work
the backup ioremap_* defintions needs to be changed to purely cpp
macros instea of inlines to cover for architectures like openrisc
that only define ioremap after including <asm-generic/io.h>.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarPalmer Dabbelt <palmer@dabbelt.com>
parent 97c9801a
...@@ -34,10 +34,6 @@ static inline void ioport_unmap(void __iomem *addr) ...@@ -34,10 +34,6 @@ static inline void ioport_unmap(void __iomem *addr)
extern void iounmap(const void __iomem *addr); extern void iounmap(const void __iomem *addr);
#define ioremap_nocache(phy, sz) ioremap(phy, sz)
#define ioremap_wc(phy, sz) ioremap(phy, sz)
#define ioremap_wt(phy, sz) ioremap(phy, sz)
/* /*
* io{read,write}{16,32}be() macros * io{read,write}{16,32}be() macros
*/ */
......
...@@ -392,7 +392,6 @@ static inline void memcpy_toio(volatile void __iomem *to, const void *from, ...@@ -392,7 +392,6 @@ static inline void memcpy_toio(volatile void __iomem *to, const void *from,
*/ */
void __iomem *ioremap(resource_size_t res_cookie, size_t size); void __iomem *ioremap(resource_size_t res_cookie, size_t size);
#define ioremap ioremap #define ioremap ioremap
#define ioremap_nocache ioremap
/* /*
* Do not use ioremap_cache for mapping memory. Use memremap instead. * Do not use ioremap_cache for mapping memory. Use memremap instead.
......
...@@ -167,9 +167,7 @@ extern void iounmap(volatile void __iomem *addr); ...@@ -167,9 +167,7 @@ extern void iounmap(volatile void __iomem *addr);
extern void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size); extern void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size);
#define ioremap(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE)) #define ioremap(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
#define ioremap_nocache(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
#define ioremap_wc(addr, size) __ioremap((addr), (size), __pgprot(PROT_NORMAL_NC)) #define ioremap_wc(addr, size) __ioremap((addr), (size), __pgprot(PROT_NORMAL_NC))
#define ioremap_wt(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
/* /*
* PCI configuration space mapping function. * PCI configuration space mapping function.
......
...@@ -42,7 +42,6 @@ extern void iounmap(void *addr); ...@@ -42,7 +42,6 @@ extern void iounmap(void *addr);
#define ioremap(addr, size) __ioremap((addr), (size), pgprot_noncached(PAGE_KERNEL)) #define ioremap(addr, size) __ioremap((addr), (size), pgprot_noncached(PAGE_KERNEL))
#define ioremap_wc(addr, size) __ioremap((addr), (size), pgprot_writecombine(PAGE_KERNEL)) #define ioremap_wc(addr, size) __ioremap((addr), (size), pgprot_writecombine(PAGE_KERNEL))
#define ioremap_nocache(addr, size) ioremap((addr), (size))
#define ioremap_cache ioremap_cache #define ioremap_cache ioremap_cache
#include <asm-generic/io.h> #include <asm-generic/io.h>
......
...@@ -263,7 +263,6 @@ static inline void __iomem * ioremap_cache (unsigned long phys_addr, unsigned lo ...@@ -263,7 +263,6 @@ static inline void __iomem * ioremap_cache (unsigned long phys_addr, unsigned lo
return ioremap(phys_addr, size); return ioremap(phys_addr, size);
} }
#define ioremap ioremap #define ioremap ioremap
#define ioremap_nocache ioremap
#define ioremap_cache ioremap_cache #define ioremap_cache ioremap_cache
#define ioremap_uc ioremap_uc #define ioremap_uc ioremap_uc
#define iounmap iounmap #define iounmap iounmap
......
...@@ -39,9 +39,6 @@ extern resource_size_t isa_mem_base; ...@@ -39,9 +39,6 @@ extern resource_size_t isa_mem_base;
extern void iounmap(volatile void __iomem *addr); extern void iounmap(volatile void __iomem *addr);
extern void __iomem *ioremap(phys_addr_t address, unsigned long size); extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
#define ioremap_nocache(addr, size) ioremap((addr), (size))
#define ioremap_wc(addr, size) ioremap((addr), (size))
#define ioremap_wt(addr, size) ioremap((addr), (size))
#endif /* CONFIG_MMU */ #endif /* CONFIG_MMU */
......
...@@ -33,10 +33,6 @@ static inline void iounmap(void __iomem *addr) ...@@ -33,10 +33,6 @@ static inline void iounmap(void __iomem *addr)
__iounmap(addr); __iounmap(addr);
} }
#define ioremap_nocache ioremap
#define ioremap_wc ioremap
#define ioremap_wt ioremap
/* Pages to physical address... */ /* Pages to physical address... */
#define page_to_phys(page) virt_to_phys(page_to_virt(page)) #define page_to_phys(page) virt_to_phys(page_to_virt(page))
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#define PIO_OFFSET 0 #define PIO_OFFSET 0
#define PIO_MASK 0 #define PIO_MASK 0
#define ioremap_nocache ioremap
#include <asm-generic/io.h> #include <asm-generic/io.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
......
...@@ -16,16 +16,6 @@ ...@@ -16,16 +16,6 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
extern void __iomem *ioremap(phys_addr_t offset, unsigned long size); extern void __iomem *ioremap(phys_addr_t offset, unsigned long size);
/*
* The RISC-V ISA doesn't yet specify how to query or modify PMAs, so we can't
* change the properties of memory regions. This should be fixed by the
* upcoming platform spec.
*/
#define ioremap_nocache(addr, size) ioremap((addr), (size))
#define ioremap_wc(addr, size) ioremap((addr), (size))
#define ioremap_wt(addr, size) ioremap((addr), (size))
extern void iounmap(volatile void __iomem *addr); extern void iounmap(volatile void __iomem *addr);
/* Generic IO read/write. These perform native-endian accesses. */ /* Generic IO read/write. These perform native-endian accesses. */
......
...@@ -26,10 +26,6 @@ void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr); ...@@ -26,10 +26,6 @@ void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr);
#define IO_SPACE_LIMIT 0 #define IO_SPACE_LIMIT 0
#define ioremap_nocache(addr, size) ioremap(addr, size)
#define ioremap_wc ioremap_nocache
#define ioremap_wt ioremap_nocache
void __iomem *ioremap(unsigned long offset, unsigned long size); void __iomem *ioremap(unsigned long offset, unsigned long size);
void iounmap(volatile void __iomem *addr); void iounmap(volatile void __iomem *addr);
......
...@@ -205,7 +205,6 @@ extern void __iomem *ioremap_encrypted(resource_size_t phys_addr, unsigned long ...@@ -205,7 +205,6 @@ extern void __iomem *ioremap_encrypted(resource_size_t phys_addr, unsigned long
*/ */
void __iomem *ioremap(resource_size_t offset, unsigned long size); void __iomem *ioremap(resource_size_t offset, unsigned long size);
#define ioremap ioremap #define ioremap ioremap
#define ioremap_nocache ioremap
extern void iounmap(volatile void __iomem *addr); extern void iounmap(volatile void __iomem *addr);
#define iounmap iounmap #define iounmap iounmap
......
...@@ -52,10 +52,6 @@ static inline void __iomem *ioremap_cache(unsigned long offset, ...@@ -52,10 +52,6 @@ static inline void __iomem *ioremap_cache(unsigned long offset,
} }
#define ioremap_cache ioremap_cache #define ioremap_cache ioremap_cache
#define ioremap_nocache ioremap
#define ioremap_wc ioremap
#define ioremap_wt ioremap
static inline void iounmap(volatile void __iomem *addr) static inline void iounmap(volatile void __iomem *addr)
{ {
unsigned long va = (unsigned long) addr; unsigned long va = (unsigned long) addr;
......
...@@ -949,27 +949,15 @@ static inline void iounmap(void __iomem *addr) ...@@ -949,27 +949,15 @@ static inline void iounmap(void __iomem *addr)
#endif /* CONFIG_MMU */ #endif /* CONFIG_MMU */
#ifndef ioremap_nocache #ifndef ioremap_nocache
#define ioremap_nocache ioremap_nocache #define ioremap_nocache ioremap
static inline void __iomem *ioremap_nocache(phys_addr_t offset, size_t size)
{
return ioremap(offset, size);
}
#endif #endif
#ifndef ioremap_wc #ifndef ioremap_wc
#define ioremap_wc ioremap_wc #define ioremap_wc ioremap
static inline void __iomem *ioremap_wc(phys_addr_t offset, size_t size)
{
return ioremap_nocache(offset, size);
}
#endif #endif
#ifndef ioremap_wt #ifndef ioremap_wt
#define ioremap_wt ioremap_wt #define ioremap_wt ioremap
static inline void __iomem *ioremap_wt(phys_addr_t offset, size_t size)
{
return ioremap_nocache(offset, size);
}
#endif #endif
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment