xref: /openbmc/linux/arch/powerpc/include/asm/io-defs.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2b8b572e1SStephen Rothwell /* This file is meant to be include multiple times by other headers */
3b8b572e1SStephen Rothwell /* last 2 argments are used by platforms/cell/io-workarounds.[ch] */
4b8b572e1SStephen Rothwell 
5b8b572e1SStephen Rothwell DEF_PCI_AC_RET(readb, u8, (const PCI_IO_ADDR addr), (addr), mem, addr)
6b8b572e1SStephen Rothwell DEF_PCI_AC_RET(readw, u16, (const PCI_IO_ADDR addr), (addr), mem, addr)
7b8b572e1SStephen Rothwell DEF_PCI_AC_RET(readl, u32, (const PCI_IO_ADDR addr), (addr), mem, addr)
8b8b572e1SStephen Rothwell DEF_PCI_AC_RET(readw_be, u16, (const PCI_IO_ADDR addr), (addr), mem, addr)
9b8b572e1SStephen Rothwell DEF_PCI_AC_RET(readl_be, u32, (const PCI_IO_ADDR addr), (addr), mem, addr)
10b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(writeb, (u8 val, PCI_IO_ADDR addr), (val, addr), mem, addr)
11b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(writew, (u16 val, PCI_IO_ADDR addr), (val, addr), mem, addr)
12b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(writel, (u32 val, PCI_IO_ADDR addr), (val, addr), mem, addr)
13b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(writew_be, (u16 val, PCI_IO_ADDR addr), (val, addr), mem, addr)
14b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(writel_be, (u32 val, PCI_IO_ADDR addr), (val, addr), mem, addr)
15b8b572e1SStephen Rothwell 
16b8b572e1SStephen Rothwell #ifdef __powerpc64__
17b8b572e1SStephen Rothwell DEF_PCI_AC_RET(readq, u64, (const PCI_IO_ADDR addr), (addr), mem, addr)
18b8b572e1SStephen Rothwell DEF_PCI_AC_RET(readq_be, u64, (const PCI_IO_ADDR addr), (addr), mem, addr)
19b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(writeq, (u64 val, PCI_IO_ADDR addr), (val, addr), mem, addr)
20b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(writeq_be, (u64 val, PCI_IO_ADDR addr), (val, addr), mem, addr)
21b8b572e1SStephen Rothwell #endif /* __powerpc64__ */
22b8b572e1SStephen Rothwell 
23b8b572e1SStephen Rothwell DEF_PCI_AC_RET(inb, u8, (unsigned long port), (port), pio, port)
24b8b572e1SStephen Rothwell DEF_PCI_AC_RET(inw, u16, (unsigned long port), (port), pio, port)
25b8b572e1SStephen Rothwell DEF_PCI_AC_RET(inl, u32, (unsigned long port), (port), pio, port)
26b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(outb, (u8 val, unsigned long port), (val, port), pio, port)
27b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(outw, (u16 val, unsigned long port), (val, port), pio, port)
28b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(outl, (u32 val, unsigned long port), (val, port), pio, port)
29b8b572e1SStephen Rothwell 
30b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(readsb, (const PCI_IO_ADDR a, void *b, unsigned long c),
31b8b572e1SStephen Rothwell 		 (a, b, c), mem, a)
32b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(readsw, (const PCI_IO_ADDR a, void *b, unsigned long c),
33b8b572e1SStephen Rothwell 		 (a, b, c), mem, a)
34b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(readsl, (const PCI_IO_ADDR a, void *b, unsigned long c),
35b8b572e1SStephen Rothwell 		 (a, b, c), mem, a)
36b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(writesb, (PCI_IO_ADDR a, const void *b, unsigned long c),
37b8b572e1SStephen Rothwell 		 (a, b, c), mem, a)
38b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(writesw, (PCI_IO_ADDR a, const void *b, unsigned long c),
39b8b572e1SStephen Rothwell 		 (a, b, c), mem, a)
40b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(writesl, (PCI_IO_ADDR a, const void *b, unsigned long c),
41b8b572e1SStephen Rothwell 		 (a, b, c), mem, a)
42b8b572e1SStephen Rothwell 
43b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(insb, (unsigned long p, void *b, unsigned long c),
44b8b572e1SStephen Rothwell 		 (p, b, c), pio, p)
45b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(insw, (unsigned long p, void *b, unsigned long c),
46b8b572e1SStephen Rothwell 		 (p, b, c), pio, p)
47b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
48b8b572e1SStephen Rothwell 		 (p, b, c), pio, p)
49b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
50b8b572e1SStephen Rothwell 		 (p, b, c), pio, p)
51b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
52b8b572e1SStephen Rothwell 		 (p, b, c), pio, p)
53b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
54b8b572e1SStephen Rothwell 		 (p, b, c), pio, p)
55b8b572e1SStephen Rothwell 
56b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(memset_io, (PCI_IO_ADDR a, int c, unsigned long n),
57b8b572e1SStephen Rothwell 		 (a, c, n), mem, a)
58b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(memcpy_fromio, (void *d, const PCI_IO_ADDR s, unsigned long n),
59b8b572e1SStephen Rothwell 		 (d, s, n), mem, s)
60b8b572e1SStephen Rothwell DEF_PCI_AC_NORET(memcpy_toio, (PCI_IO_ADDR d, const void *s, unsigned long n),
61b8b572e1SStephen Rothwell 		 (d, s, n), mem, d)
62