1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun * S390 version
4*4882a593Smuzhiyun * Copyright IBM Corp. 1999
5*4882a593Smuzhiyun * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
6*4882a593Smuzhiyun *
7*4882a593Smuzhiyun * Derived from "include/asm-i386/io.h"
8*4882a593Smuzhiyun */
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun #ifndef _S390_IO_H
11*4882a593Smuzhiyun #define _S390_IO_H
12*4882a593Smuzhiyun
13*4882a593Smuzhiyun #include <linux/kernel.h>
14*4882a593Smuzhiyun #include <asm/page.h>
15*4882a593Smuzhiyun #include <asm/pgtable.h>
16*4882a593Smuzhiyun #include <asm/pci_io.h>
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun #define xlate_dev_mem_ptr xlate_dev_mem_ptr
19*4882a593Smuzhiyun void *xlate_dev_mem_ptr(phys_addr_t phys);
20*4882a593Smuzhiyun #define unxlate_dev_mem_ptr unxlate_dev_mem_ptr
21*4882a593Smuzhiyun void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr);
22*4882a593Smuzhiyun
23*4882a593Smuzhiyun /*
24*4882a593Smuzhiyun * Convert a virtual cached pointer to an uncached pointer
25*4882a593Smuzhiyun */
26*4882a593Smuzhiyun #define xlate_dev_kmem_ptr(p) p
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun #define IO_SPACE_LIMIT 0
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun void __iomem *ioremap_prot(phys_addr_t addr, size_t size, unsigned long prot);
31*4882a593Smuzhiyun void __iomem *ioremap(phys_addr_t addr, size_t size);
32*4882a593Smuzhiyun void __iomem *ioremap_wc(phys_addr_t addr, size_t size);
33*4882a593Smuzhiyun void __iomem *ioremap_wt(phys_addr_t addr, size_t size);
34*4882a593Smuzhiyun void iounmap(volatile void __iomem *addr);
35*4882a593Smuzhiyun
ioport_map(unsigned long port,unsigned int nr)36*4882a593Smuzhiyun static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
37*4882a593Smuzhiyun {
38*4882a593Smuzhiyun return NULL;
39*4882a593Smuzhiyun }
40*4882a593Smuzhiyun
ioport_unmap(void __iomem * p)41*4882a593Smuzhiyun static inline void ioport_unmap(void __iomem *p)
42*4882a593Smuzhiyun {
43*4882a593Smuzhiyun }
44*4882a593Smuzhiyun
45*4882a593Smuzhiyun #ifdef CONFIG_PCI
46*4882a593Smuzhiyun
47*4882a593Smuzhiyun /*
48*4882a593Smuzhiyun * s390 needs a private implementation of pci_iomap since ioremap with its
49*4882a593Smuzhiyun * offset parameter isn't sufficient. That's because BAR spaces are not
50*4882a593Smuzhiyun * disjunctive on s390 so we need the bar parameter of pci_iomap to find
51*4882a593Smuzhiyun * the corresponding device and create the mapping cookie.
52*4882a593Smuzhiyun */
53*4882a593Smuzhiyun #define pci_iomap pci_iomap
54*4882a593Smuzhiyun #define pci_iomap_range pci_iomap_range
55*4882a593Smuzhiyun #define pci_iounmap pci_iounmap
56*4882a593Smuzhiyun #define pci_iomap_wc pci_iomap_wc
57*4882a593Smuzhiyun #define pci_iomap_wc_range pci_iomap_wc_range
58*4882a593Smuzhiyun
59*4882a593Smuzhiyun #define ioremap ioremap
60*4882a593Smuzhiyun #define ioremap_wt ioremap_wt
61*4882a593Smuzhiyun #define ioremap_wc ioremap_wc
62*4882a593Smuzhiyun
63*4882a593Smuzhiyun #define memcpy_fromio(dst, src, count) zpci_memcpy_fromio(dst, src, count)
64*4882a593Smuzhiyun #define memcpy_toio(dst, src, count) zpci_memcpy_toio(dst, src, count)
65*4882a593Smuzhiyun #define memset_io(dst, val, count) zpci_memset_io(dst, val, count)
66*4882a593Smuzhiyun
67*4882a593Smuzhiyun #define mmiowb() zpci_barrier()
68*4882a593Smuzhiyun
69*4882a593Smuzhiyun #define __raw_readb zpci_read_u8
70*4882a593Smuzhiyun #define __raw_readw zpci_read_u16
71*4882a593Smuzhiyun #define __raw_readl zpci_read_u32
72*4882a593Smuzhiyun #define __raw_readq zpci_read_u64
73*4882a593Smuzhiyun #define __raw_writeb zpci_write_u8
74*4882a593Smuzhiyun #define __raw_writew zpci_write_u16
75*4882a593Smuzhiyun #define __raw_writel zpci_write_u32
76*4882a593Smuzhiyun #define __raw_writeq zpci_write_u64
77*4882a593Smuzhiyun
78*4882a593Smuzhiyun #endif /* CONFIG_PCI */
79*4882a593Smuzhiyun
80*4882a593Smuzhiyun #include <asm-generic/io.h>
81*4882a593Smuzhiyun
82*4882a593Smuzhiyun #endif
83