Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5621caac authored by Rob Herring's avatar Rob Herring
Browse files

ARM: kill off __mem_pci



__mem_pci is only used to enable readl/writel and friends. Just condition
this on readl being defined and remove all the __mem_pci defines.

Signed-off-by: default avatarRob Herring <rob.herring@calxeda.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Lennert Buytenhek <kernel@wantstofly.org>
Cc: Imre Kaloz <kaloz@openwrt.org>
Cc: Krzysztof Halasa <khc@pm.waw.pl>
Cc: Nicolas Pitre <nico@fluxnic.net>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Colin Cross <ccross@android.com>
Cc: Olof Johansson <olof@lixom.net>
Cc: Stephen Warren <swarren@nvidia.com>
parent 4d5fc58d
Loading
Loading
Loading
Loading
+17 −29
Original line number Diff line number Diff line
@@ -118,7 +118,6 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
#include <mach/io.h>
#else
#define __io(a)		({ (void)(a); __typesafe_io(0); })
#define __mem_pci(a)	(a)
#endif

/*
@@ -221,18 +220,18 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
 * Again, this are defined to perform little endian accesses.  See the
 * IO port primitives for more information.
 */
#ifdef __mem_pci
#define readb_relaxed(c) ({ u8  __r = __raw_readb(__mem_pci(c)); __r; })
#ifndef readl
#define readb_relaxed(c) ({ u8  __r = __raw_readb(c); __r; })
#define readw_relaxed(c) ({ u16 __r = le16_to_cpu((__force __le16) \
					__raw_readw(__mem_pci(c))); __r; })
					__raw_readw(c)); __r; })
#define readl_relaxed(c) ({ u32 __r = le32_to_cpu((__force __le32) \
					__raw_readl(__mem_pci(c))); __r; })
					__raw_readl(c)); __r; })

#define writeb_relaxed(v,c)	((void)__raw_writeb(v,__mem_pci(c)))
#define writeb_relaxed(v,c)	((void)__raw_writeb(v,c))
#define writew_relaxed(v,c)	((void)__raw_writew((__force u16) \
					cpu_to_le16(v),__mem_pci(c)))
					cpu_to_le16(v),c))
#define writel_relaxed(v,c)	((void)__raw_writel((__force u32) \
					cpu_to_le32(v),__mem_pci(c)))
					cpu_to_le32(v),c))

#define readb(c)		({ u8  __v = readb_relaxed(c); __iormb(); __v; })
#define readw(c)		({ u16 __v = readw_relaxed(c); __iormb(); __v; })
@@ -242,30 +241,19 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
#define writew(v,c)		({ __iowmb(); writew_relaxed(v,c); })
#define writel(v,c)		({ __iowmb(); writel_relaxed(v,c); })

#define readsb(p,d,l)		__raw_readsb(__mem_pci(p),d,l)
#define readsw(p,d,l)		__raw_readsw(__mem_pci(p),d,l)
#define readsl(p,d,l)		__raw_readsl(__mem_pci(p),d,l)
#define readsb(p,d,l)		__raw_readsb(p,d,l)
#define readsw(p,d,l)		__raw_readsw(p,d,l)
#define readsl(p,d,l)		__raw_readsl(p,d,l)

#define writesb(p,d,l)		__raw_writesb(__mem_pci(p),d,l)
#define writesw(p,d,l)		__raw_writesw(__mem_pci(p),d,l)
#define writesl(p,d,l)		__raw_writesl(__mem_pci(p),d,l)
#define writesb(p,d,l)		__raw_writesb(p,d,l)
#define writesw(p,d,l)		__raw_writesw(p,d,l)
#define writesl(p,d,l)		__raw_writesl(p,d,l)

#define memset_io(c,v,l)	_memset_io(__mem_pci(c),(v),(l))
#define memcpy_fromio(a,c,l)	_memcpy_fromio((a),__mem_pci(c),(l))
#define memcpy_toio(c,a,l)	_memcpy_toio(__mem_pci(c),(a),(l))
#define memset_io(c,v,l)	_memset_io(c,(v),(l))
#define memcpy_fromio(a,c,l)	_memcpy_fromio((a),c,(l))
#define memcpy_toio(c,a,l)	_memcpy_toio(c,(a),(l))

#elif !defined(readb)

#define readb(c)			(__readwrite_bug("readb"),0)
#define readw(c)			(__readwrite_bug("readw"),0)
#define readl(c)			(__readwrite_bug("readl"),0)
#define writeb(v,c)			__readwrite_bug("writeb")
#define writew(v,c)			__readwrite_bug("writew")
#define writel(v,c)			__readwrite_bug("writel")

#define check_signature(io,sig,len)	(0)

#endif	/* __mem_pci */
#endif	/* readl */

/*
 * ioremap and friends.
+0 −1
Original line number Diff line number Diff line
@@ -15,6 +15,5 @@

#define __io(a)  	((void __iomem *)(((a) - DOVE_PCIE0_IO_BUS_BASE) + \
						 DOVE_PCIE0_IO_VIRT_BASE))
#define __mem_pci(a)	(a)

#endif
+0 −13
Original line number Diff line number Diff line
@@ -27,18 +27,5 @@
 * Translation of various region addresses to virtual addresses
 */
#define __io(a)			((void __iomem *)(PCIO_BASE + (a)))
#if 1
#define __mem_pci(a)		(a)
#else

static inline void __iomem *___mem_pci(void __iomem *p)
{
	unsigned long a = (unsigned long)p;
	BUG_ON(a <= 0xc0000000 || a >= 0xe0000000);
	return p;
}

#define __mem_pci(a)		___mem_pci(a)
#endif

#endif
+0 −1
Original line number Diff line number Diff line
@@ -29,6 +29,5 @@
#define PCI_IO_VADDR            0xee000000

#define __io(a)			((void __iomem *)(PCI_IO_VADDR + (a)))
#define __mem_pci(a)		(a)

#endif
+0 −2
Original line number Diff line number Diff line
@@ -22,8 +22,6 @@
#define IO_SPACE_LIMIT 0xffffffff

#define __io(a) __iop13xx_io(a)
#define __mem_pci(a) (a)
#define __mem_isa(a) (a)

extern void __iomem * __iop13xx_io(unsigned long io_addr);

Loading