Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  *  S390 version
0004  *    Copyright IBM Corp. 1999
0005  *    Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
0006  *
0007  *  Derived from "include/asm-i386/io.h"
0008  */
0009 
0010 #ifndef _S390_IO_H
0011 #define _S390_IO_H
0012 
0013 #include <linux/kernel.h>
0014 #include <asm/page.h>
0015 #include <asm/pgtable.h>
0016 #include <asm/pci_io.h>
0017 
0018 #define xlate_dev_mem_ptr xlate_dev_mem_ptr
0019 void *xlate_dev_mem_ptr(phys_addr_t phys);
0020 #define unxlate_dev_mem_ptr unxlate_dev_mem_ptr
0021 void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr);
0022 
0023 #define IO_SPACE_LIMIT 0
0024 
0025 void __iomem *ioremap_prot(phys_addr_t addr, size_t size, unsigned long prot);
0026 void __iomem *ioremap(phys_addr_t addr, size_t size);
0027 void __iomem *ioremap_wc(phys_addr_t addr, size_t size);
0028 void __iomem *ioremap_wt(phys_addr_t addr, size_t size);
0029 void iounmap(volatile void __iomem *addr);
0030 
0031 static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
0032 {
0033     return NULL;
0034 }
0035 
0036 static inline void ioport_unmap(void __iomem *p)
0037 {
0038 }
0039 
0040 #ifdef CONFIG_PCI
0041 
0042 /*
0043  * s390 needs a private implementation of pci_iomap since ioremap with its
0044  * offset parameter isn't sufficient. That's because BAR spaces are not
0045  * disjunctive on s390 so we need the bar parameter of pci_iomap to find
0046  * the corresponding device and create the mapping cookie.
0047  */
0048 #define pci_iomap pci_iomap
0049 #define pci_iomap_range pci_iomap_range
0050 #define pci_iounmap pci_iounmap
0051 #define pci_iomap_wc pci_iomap_wc
0052 #define pci_iomap_wc_range pci_iomap_wc_range
0053 
0054 #define ioremap ioremap
0055 #define ioremap_wt ioremap_wt
0056 #define ioremap_wc ioremap_wc
0057 
0058 #define memcpy_fromio(dst, src, count)  zpci_memcpy_fromio(dst, src, count)
0059 #define memcpy_toio(dst, src, count)    zpci_memcpy_toio(dst, src, count)
0060 #define memset_io(dst, val, count)  zpci_memset_io(dst, val, count)
0061 
0062 #define mmiowb()    zpci_barrier()
0063 
0064 #define __raw_readb zpci_read_u8
0065 #define __raw_readw zpci_read_u16
0066 #define __raw_readl zpci_read_u32
0067 #define __raw_readq zpci_read_u64
0068 #define __raw_writeb    zpci_write_u8
0069 #define __raw_writew    zpci_write_u16
0070 #define __raw_writel    zpci_write_u32
0071 #define __raw_writeq    zpci_write_u64
0072 
0073 #endif /* CONFIG_PCI */
0074 
0075 #include <asm-generic/io.h>
0076 
0077 #endif