VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   35 Branches   59 Tags
b24413180f560 (Greg Kroah-Hartman  2017-11-01 15:07:57 +0100   1) // SPDX-License-Identifier: GPL-2.0
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700   2) /*
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700   3)  * Implement the default iomap interfaces
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700   4)  *
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700   5)  * (C) Copyright 2004 Linus Torvalds
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700   6)  */
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700   7) #include <linux/pci.h>
9ac7849e35f70 (Tejun Heo           2007-01-20 16:00:26 +0900   8) #include <linux/io.h>
9ac7849e35f70 (Tejun Heo           2007-01-20 16:00:26 +0900   9) 
8bc3bcc93a2b4 (Paul Gortmaker      2011-11-16 21:29:17 -0500  10) #include <linux/export.h>
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  11) 
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  12) /*
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  13)  * Read/write from/to an (offsettable) iomem cookie. It might be a PIO
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  14)  * access or a MMIO access, these functions don't care. The info is
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  15)  * encoded in the hardware mapping set up by the mapping functions
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  16)  * (or the cookie itself, depending on implementation and hw).
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  17)  *
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  18)  * The generic routines don't assume any hardware mappings, and just
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  19)  * encode the PIO/MMIO as part of the cookie. They coldly assume that
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  20)  * the MMIO IO mappings are not in the low address range.
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  21)  *
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  22)  * Architectures for which this is not true can't use this generic
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  23)  * implementation and should do their own copy.
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  24)  */
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  25) 
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  26) #ifndef HAVE_ARCH_PIO_SIZE
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  27) /*
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  28)  * We encode the physical PIO addresses (0-0xffff) into the
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  29)  * pointer by offsetting them with a constant (0x10000) and
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  30)  * assuming that all the low addresses are always PIO. That means
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  31)  * we can do some sanity checks on the low bits, and don't
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  32)  * need to just take things for granted.
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  33)  */
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  34) #define PIO_OFFSET	0x10000UL
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  35) #define PIO_MASK	0x0ffffUL
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  36) #define PIO_RESERVED	0x40000UL
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  37) #endif
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  38) 
6cbf0c704d7c3 (Linus Torvalds      2007-05-04 20:44:23 -0700  39) static void bad_io_access(unsigned long port, const char *access)
6cbf0c704d7c3 (Linus Torvalds      2007-05-04 20:44:23 -0700  40) {
6cbf0c704d7c3 (Linus Torvalds      2007-05-04 20:44:23 -0700  41) 	static int count = 10;
6cbf0c704d7c3 (Linus Torvalds      2007-05-04 20:44:23 -0700  42) 	if (count) {
6cbf0c704d7c3 (Linus Torvalds      2007-05-04 20:44:23 -0700  43) 		count--;
5cd2b459d326a (Arjan van de Ven    2008-07-25 19:45:39 -0700  44) 		WARN(1, KERN_ERR "Bad IO access at port %#lx (%s)\n", port, access);
6cbf0c704d7c3 (Linus Torvalds      2007-05-04 20:44:23 -0700  45) 	}
6cbf0c704d7c3 (Linus Torvalds      2007-05-04 20:44:23 -0700  46) }
6cbf0c704d7c3 (Linus Torvalds      2007-05-04 20:44:23 -0700  47) 
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  48) /*
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  49)  * Ugly macros are a way of life.
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  50)  */
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  51) #define IO_COND(addr, is_pio, is_mmio) do {			\
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  52) 	unsigned long port = (unsigned long __force)addr;	\
6cbf0c704d7c3 (Linus Torvalds      2007-05-04 20:44:23 -0700  53) 	if (port >= PIO_RESERVED) {				\
6cbf0c704d7c3 (Linus Torvalds      2007-05-04 20:44:23 -0700  54) 		is_mmio;					\
6cbf0c704d7c3 (Linus Torvalds      2007-05-04 20:44:23 -0700  55) 	} else if (port > PIO_OFFSET) {				\
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  56) 		port &= PIO_MASK;				\
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  57) 		is_pio;						\
6cbf0c704d7c3 (Linus Torvalds      2007-05-04 20:44:23 -0700  58) 	} else							\
6cbf0c704d7c3 (Linus Torvalds      2007-05-04 20:44:23 -0700  59) 		bad_io_access(port, #is_pio );			\
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  60) } while (0)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  61) 
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100  62) #ifndef pio_read16be
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100  63) #define pio_read16be(port) swab16(inw(port))
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100  64) #define pio_read32be(port) swab32(inl(port))
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100  65) #endif
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100  66) 
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100  67) #ifndef mmio_read16be
aecc787c06f43 (Logan Gunthorpe     2019-01-16 11:25:18 -0700  68) #define mmio_read16be(addr) swab16(readw(addr))
aecc787c06f43 (Logan Gunthorpe     2019-01-16 11:25:18 -0700  69) #define mmio_read32be(addr) swab32(readl(addr))
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700  70) #define mmio_read64be(addr) swab64(readq(addr))
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100  71) #endif
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100  72) 
8f28ca6bd8211 (Krzysztof Kozlowski 2020-08-14 17:32:07 -0700  73) unsigned int ioread8(const void __iomem *addr)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  74) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  75) 	IO_COND(addr, return inb(port), return readb(addr));
6cbf0c704d7c3 (Linus Torvalds      2007-05-04 20:44:23 -0700  76) 	return 0xff;
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  77) }
8f28ca6bd8211 (Krzysztof Kozlowski 2020-08-14 17:32:07 -0700  78) unsigned int ioread16(const void __iomem *addr)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  79) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  80) 	IO_COND(addr, return inw(port), return readw(addr));
6cbf0c704d7c3 (Linus Torvalds      2007-05-04 20:44:23 -0700  81) 	return 0xffff;
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  82) }
8f28ca6bd8211 (Krzysztof Kozlowski 2020-08-14 17:32:07 -0700  83) unsigned int ioread16be(const void __iomem *addr)
dae409a277887 (James Bottomley     2005-04-16 15:25:54 -0700  84) {
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100  85) 	IO_COND(addr, return pio_read16be(port), return mmio_read16be(addr));
6cbf0c704d7c3 (Linus Torvalds      2007-05-04 20:44:23 -0700  86) 	return 0xffff;
dae409a277887 (James Bottomley     2005-04-16 15:25:54 -0700  87) }
8f28ca6bd8211 (Krzysztof Kozlowski 2020-08-14 17:32:07 -0700  88) unsigned int ioread32(const void __iomem *addr)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  89) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  90) 	IO_COND(addr, return inl(port), return readl(addr));
6cbf0c704d7c3 (Linus Torvalds      2007-05-04 20:44:23 -0700  91) 	return 0xffffffff;
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  92) }
8f28ca6bd8211 (Krzysztof Kozlowski 2020-08-14 17:32:07 -0700  93) unsigned int ioread32be(const void __iomem *addr)
dae409a277887 (James Bottomley     2005-04-16 15:25:54 -0700  94) {
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100  95) 	IO_COND(addr, return pio_read32be(port), return mmio_read32be(addr));
6cbf0c704d7c3 (Linus Torvalds      2007-05-04 20:44:23 -0700  96) 	return 0xffffffff;
dae409a277887 (James Bottomley     2005-04-16 15:25:54 -0700  97) }
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  98) EXPORT_SYMBOL(ioread8);
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700  99) EXPORT_SYMBOL(ioread16);
dae409a277887 (James Bottomley     2005-04-16 15:25:54 -0700 100) EXPORT_SYMBOL(ioread16be);
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 101) EXPORT_SYMBOL(ioread32);
dae409a277887 (James Bottomley     2005-04-16 15:25:54 -0700 102) EXPORT_SYMBOL(ioread32be);
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 103) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 104) #ifdef readq
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 105) static u64 pio_read64_lo_hi(unsigned long port)
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 106) {
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 107) 	u64 lo, hi;
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 108) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 109) 	lo = inl(port);
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 110) 	hi = inl(port + sizeof(u32));
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 111) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 112) 	return lo | (hi << 32);
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 113) }
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 114) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 115) static u64 pio_read64_hi_lo(unsigned long port)
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 116) {
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 117) 	u64 lo, hi;
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 118) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 119) 	hi = inl(port + sizeof(u32));
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 120) 	lo = inl(port);
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 121) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 122) 	return lo | (hi << 32);
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 123) }
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 124) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 125) static u64 pio_read64be_lo_hi(unsigned long port)
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 126) {
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 127) 	u64 lo, hi;
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 128) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 129) 	lo = pio_read32be(port + sizeof(u32));
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 130) 	hi = pio_read32be(port);
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 131) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 132) 	return lo | (hi << 32);
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 133) }
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 134) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 135) static u64 pio_read64be_hi_lo(unsigned long port)
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 136) {
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 137) 	u64 lo, hi;
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 138) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 139) 	hi = pio_read32be(port);
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 140) 	lo = pio_read32be(port + sizeof(u32));
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 141) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 142) 	return lo | (hi << 32);
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 143) }
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 144) 
8f28ca6bd8211 (Krzysztof Kozlowski 2020-08-14 17:32:07 -0700 145) u64 ioread64_lo_hi(const void __iomem *addr)
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 146) {
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 147) 	IO_COND(addr, return pio_read64_lo_hi(port), return readq(addr));
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 148) 	return 0xffffffffffffffffULL;
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 149) }
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 150) 
8f28ca6bd8211 (Krzysztof Kozlowski 2020-08-14 17:32:07 -0700 151) u64 ioread64_hi_lo(const void __iomem *addr)
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 152) {
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 153) 	IO_COND(addr, return pio_read64_hi_lo(port), return readq(addr));
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 154) 	return 0xffffffffffffffffULL;
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 155) }
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 156) 
8f28ca6bd8211 (Krzysztof Kozlowski 2020-08-14 17:32:07 -0700 157) u64 ioread64be_lo_hi(const void __iomem *addr)
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 158) {
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 159) 	IO_COND(addr, return pio_read64be_lo_hi(port),
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 160) 		return mmio_read64be(addr));
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 161) 	return 0xffffffffffffffffULL;
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 162) }
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 163) 
8f28ca6bd8211 (Krzysztof Kozlowski 2020-08-14 17:32:07 -0700 164) u64 ioread64be_hi_lo(const void __iomem *addr)
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 165) {
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 166) 	IO_COND(addr, return pio_read64be_hi_lo(port),
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 167) 		return mmio_read64be(addr));
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 168) 	return 0xffffffffffffffffULL;
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 169) }
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 170) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 171) EXPORT_SYMBOL(ioread64_lo_hi);
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 172) EXPORT_SYMBOL(ioread64_hi_lo);
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 173) EXPORT_SYMBOL(ioread64be_lo_hi);
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 174) EXPORT_SYMBOL(ioread64be_hi_lo);
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 175) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 176) #endif /* readq */
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 177) 
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100 178) #ifndef pio_write16be
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100 179) #define pio_write16be(val,port) outw(swab16(val),port)
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100 180) #define pio_write32be(val,port) outl(swab32(val),port)
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100 181) #endif
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100 182) 
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100 183) #ifndef mmio_write16be
aecc787c06f43 (Logan Gunthorpe     2019-01-16 11:25:18 -0700 184) #define mmio_write16be(val,port) writew(swab16(val),port)
aecc787c06f43 (Logan Gunthorpe     2019-01-16 11:25:18 -0700 185) #define mmio_write32be(val,port) writel(swab32(val),port)
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 186) #define mmio_write64be(val,port) writeq(swab64(val),port)
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100 187) #endif
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100 188) 
9f741cb8fecef (Harvey Harrison     2008-02-08 04:19:55 -0800 189) void iowrite8(u8 val, void __iomem *addr)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 190) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 191) 	IO_COND(addr, outb(val,port), writeb(val, addr));
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 192) }
9f741cb8fecef (Harvey Harrison     2008-02-08 04:19:55 -0800 193) void iowrite16(u16 val, void __iomem *addr)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 194) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 195) 	IO_COND(addr, outw(val,port), writew(val, addr));
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 196) }
9f741cb8fecef (Harvey Harrison     2008-02-08 04:19:55 -0800 197) void iowrite16be(u16 val, void __iomem *addr)
dae409a277887 (James Bottomley     2005-04-16 15:25:54 -0700 198) {
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100 199) 	IO_COND(addr, pio_write16be(val,port), mmio_write16be(val, addr));
dae409a277887 (James Bottomley     2005-04-16 15:25:54 -0700 200) }
9f741cb8fecef (Harvey Harrison     2008-02-08 04:19:55 -0800 201) void iowrite32(u32 val, void __iomem *addr)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 202) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 203) 	IO_COND(addr, outl(val,port), writel(val, addr));
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 204) }
9f741cb8fecef (Harvey Harrison     2008-02-08 04:19:55 -0800 205) void iowrite32be(u32 val, void __iomem *addr)
dae409a277887 (James Bottomley     2005-04-16 15:25:54 -0700 206) {
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100 207) 	IO_COND(addr, pio_write32be(val,port), mmio_write32be(val, addr));
dae409a277887 (James Bottomley     2005-04-16 15:25:54 -0700 208) }
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 209) EXPORT_SYMBOL(iowrite8);
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 210) EXPORT_SYMBOL(iowrite16);
dae409a277887 (James Bottomley     2005-04-16 15:25:54 -0700 211) EXPORT_SYMBOL(iowrite16be);
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 212) EXPORT_SYMBOL(iowrite32);
dae409a277887 (James Bottomley     2005-04-16 15:25:54 -0700 213) EXPORT_SYMBOL(iowrite32be);
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 214) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 215) #ifdef writeq
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 216) static void pio_write64_lo_hi(u64 val, unsigned long port)
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 217) {
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 218) 	outl(val, port);
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 219) 	outl(val >> 32, port + sizeof(u32));
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 220) }
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 221) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 222) static void pio_write64_hi_lo(u64 val, unsigned long port)
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 223) {
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 224) 	outl(val >> 32, port + sizeof(u32));
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 225) 	outl(val, port);
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 226) }
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 227) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 228) static void pio_write64be_lo_hi(u64 val, unsigned long port)
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 229) {
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 230) 	pio_write32be(val, port + sizeof(u32));
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 231) 	pio_write32be(val >> 32, port);
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 232) }
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 233) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 234) static void pio_write64be_hi_lo(u64 val, unsigned long port)
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 235) {
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 236) 	pio_write32be(val >> 32, port);
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 237) 	pio_write32be(val, port + sizeof(u32));
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 238) }
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 239) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 240) void iowrite64_lo_hi(u64 val, void __iomem *addr)
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 241) {
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 242) 	IO_COND(addr, pio_write64_lo_hi(val, port),
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 243) 		writeq(val, addr));
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 244) }
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 245) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 246) void iowrite64_hi_lo(u64 val, void __iomem *addr)
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 247) {
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 248) 	IO_COND(addr, pio_write64_hi_lo(val, port),
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 249) 		writeq(val, addr));
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 250) }
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 251) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 252) void iowrite64be_lo_hi(u64 val, void __iomem *addr)
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 253) {
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 254) 	IO_COND(addr, pio_write64be_lo_hi(val, port),
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 255) 		mmio_write64be(val, addr));
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 256) }
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 257) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 258) void iowrite64be_hi_lo(u64 val, void __iomem *addr)
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 259) {
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 260) 	IO_COND(addr, pio_write64be_hi_lo(val, port),
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 261) 		mmio_write64be(val, addr));
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 262) }
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 263) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 264) EXPORT_SYMBOL(iowrite64_lo_hi);
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 265) EXPORT_SYMBOL(iowrite64_hi_lo);
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 266) EXPORT_SYMBOL(iowrite64be_lo_hi);
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 267) EXPORT_SYMBOL(iowrite64be_hi_lo);
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 268) 
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 269) #endif /* readq */
79bf0cbd86ac4 (Logan Gunthorpe     2019-01-16 11:25:20 -0700 270) 
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 271) /*
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 272)  * These are the "repeat MMIO read/write" functions.
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 273)  * Note the "__raw" accesses, since we don't want to
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 274)  * convert to CPU byte order. We write in "IO byte
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 275)  * order" (we also don't have IO barriers).
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 276)  */
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100 277) #ifndef mmio_insb
8f28ca6bd8211 (Krzysztof Kozlowski 2020-08-14 17:32:07 -0700 278) static inline void mmio_insb(const void __iomem *addr, u8 *dst, int count)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 279) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 280) 	while (--count >= 0) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 281) 		u8 data = __raw_readb(addr);
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 282) 		*dst = data;
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 283) 		dst++;
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 284) 	}
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 285) }
8f28ca6bd8211 (Krzysztof Kozlowski 2020-08-14 17:32:07 -0700 286) static inline void mmio_insw(const void __iomem *addr, u16 *dst, int count)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 287) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 288) 	while (--count >= 0) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 289) 		u16 data = __raw_readw(addr);
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 290) 		*dst = data;
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 291) 		dst++;
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 292) 	}
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 293) }
8f28ca6bd8211 (Krzysztof Kozlowski 2020-08-14 17:32:07 -0700 294) static inline void mmio_insl(const void __iomem *addr, u32 *dst, int count)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 295) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 296) 	while (--count >= 0) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 297) 		u32 data = __raw_readl(addr);
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 298) 		*dst = data;
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 299) 		dst++;
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 300) 	}
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 301) }
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100 302) #endif
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 303) 
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100 304) #ifndef mmio_outsb
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 305) static inline void mmio_outsb(void __iomem *addr, const u8 *src, int count)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 306) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 307) 	while (--count >= 0) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 308) 		__raw_writeb(*src, addr);
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 309) 		src++;
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 310) 	}
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 311) }
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 312) static inline void mmio_outsw(void __iomem *addr, const u16 *src, int count)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 313) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 314) 	while (--count >= 0) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 315) 		__raw_writew(*src, addr);
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 316) 		src++;
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 317) 	}
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 318) }
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 319) static inline void mmio_outsl(void __iomem *addr, const u32 *src, int count)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 320) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 321) 	while (--count >= 0) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 322) 		__raw_writel(*src, addr);
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 323) 		src++;
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 324) 	}
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 325) }
34ba8a5cd0b0d (Linus Torvalds      2006-11-11 17:24:46 +1100 326) #endif
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 327) 
8f28ca6bd8211 (Krzysztof Kozlowski 2020-08-14 17:32:07 -0700 328) void ioread8_rep(const void __iomem *addr, void *dst, unsigned long count)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 329) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 330) 	IO_COND(addr, insb(port,dst,count), mmio_insb(addr, dst, count));
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 331) }
8f28ca6bd8211 (Krzysztof Kozlowski 2020-08-14 17:32:07 -0700 332) void ioread16_rep(const void __iomem *addr, void *dst, unsigned long count)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 333) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 334) 	IO_COND(addr, insw(port,dst,count), mmio_insw(addr, dst, count));
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 335) }
8f28ca6bd8211 (Krzysztof Kozlowski 2020-08-14 17:32:07 -0700 336) void ioread32_rep(const void __iomem *addr, void *dst, unsigned long count)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 337) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 338) 	IO_COND(addr, insl(port,dst,count), mmio_insl(addr, dst, count));
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 339) }
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 340) EXPORT_SYMBOL(ioread8_rep);
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 341) EXPORT_SYMBOL(ioread16_rep);
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 342) EXPORT_SYMBOL(ioread32_rep);
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 343) 
9f741cb8fecef (Harvey Harrison     2008-02-08 04:19:55 -0800 344) void iowrite8_rep(void __iomem *addr, const void *src, unsigned long count)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 345) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 346) 	IO_COND(addr, outsb(port, src, count), mmio_outsb(addr, src, count));
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 347) }
9f741cb8fecef (Harvey Harrison     2008-02-08 04:19:55 -0800 348) void iowrite16_rep(void __iomem *addr, const void *src, unsigned long count)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 349) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 350) 	IO_COND(addr, outsw(port, src, count), mmio_outsw(addr, src, count));
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 351) }
9f741cb8fecef (Harvey Harrison     2008-02-08 04:19:55 -0800 352) void iowrite32_rep(void __iomem *addr, const void *src, unsigned long count)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 353) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 354) 	IO_COND(addr, outsl(port, src,count), mmio_outsl(addr, src, count));
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 355) }
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 356) EXPORT_SYMBOL(iowrite8_rep);
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 357) EXPORT_SYMBOL(iowrite16_rep);
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 358) EXPORT_SYMBOL(iowrite32_rep);
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 359) 
ce816fa88cca0 (Uwe Kleine-König    2014-04-07 15:39:19 -0700 360) #ifdef CONFIG_HAS_IOPORT_MAP
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 361) /* Create a virtual mapping cookie for an IO port range */
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 362) void __iomem *ioport_map(unsigned long port, unsigned int nr)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 363) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 364) 	if (port > PIO_MASK)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 365) 		return NULL;
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 366) 	return (void __iomem *) (unsigned long) (port + PIO_OFFSET);
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 367) }
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 368) 
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 369) void ioport_unmap(void __iomem *addr)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 370) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 371) 	/* Nothing to do */
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 372) }
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 373) EXPORT_SYMBOL(ioport_map);
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 374) EXPORT_SYMBOL(ioport_unmap);
ce816fa88cca0 (Uwe Kleine-König    2014-04-07 15:39:19 -0700 375) #endif /* CONFIG_HAS_IOPORT_MAP */
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 376) 
82ed223c264de (Jonas Bonn          2011-07-02 17:23:29 +0200 377) #ifdef CONFIG_PCI
66eab4df288aa (Michael S. Tsirkin  2011-11-24 20:45:20 +0200 378) /* Hide the details if this is a MMIO or PIO address space and just do what
66eab4df288aa (Michael S. Tsirkin  2011-11-24 20:45:20 +0200 379)  * you expect in the correct way. */
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 380) void pci_iounmap(struct pci_dev *dev, void __iomem * addr)
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 381) {
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 382) 	IO_COND(addr, /* nothing */, iounmap(addr));
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 383) }
^1da177e4c3f4 (Linus Torvalds      2005-04-16 15:20:36 -0700 384) EXPORT_SYMBOL(pci_iounmap);
82ed223c264de (Jonas Bonn          2011-07-02 17:23:29 +0200 385) #endif /* CONFIG_PCI */