Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * S390 version |
Heiko Carstens | a53c8fa | 2012-07-20 11:15:04 +0200 | [diff] [blame] | 4 | * Copyright IBM Corp. 1999 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com) |
| 6 | * |
| 7 | * Derived from "include/asm-i386/io.h" |
| 8 | */ |
| 9 | |
| 10 | #ifndef _S390_IO_H |
| 11 | #define _S390_IO_H |
| 12 | |
Jan Glauber | cd24834 | 2012-11-29 12:50:30 +0100 | [diff] [blame] | 13 | #include <linux/kernel.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | #include <asm/page.h> |
Jan Glauber | cd24834 | 2012-11-29 12:50:30 +0100 | [diff] [blame] | 15 | #include <asm/pci_io.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | |
Michael Holzheu | 576ebd7 | 2013-05-21 16:08:22 +0200 | [diff] [blame] | 17 | #define xlate_dev_mem_ptr xlate_dev_mem_ptr |
Thierry Reding | 4707a34 | 2014-07-28 17:20:33 +0200 | [diff] [blame] | 18 | void *xlate_dev_mem_ptr(phys_addr_t phys); |
| 19 | #define unxlate_dev_mem_ptr unxlate_dev_mem_ptr |
| 20 | void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | |
| 22 | /* |
| 23 | * Convert a virtual cached pointer to an uncached pointer |
| 24 | */ |
| 25 | #define xlate_dev_kmem_ptr(p) p |
| 26 | |
Jan Glauber | cd24834 | 2012-11-29 12:50:30 +0100 | [diff] [blame] | 27 | #define IO_SPACE_LIMIT 0 |
| 28 | |
Jan Glauber | cd24834 | 2012-11-29 12:50:30 +0100 | [diff] [blame] | 29 | #define ioremap_nocache(addr, size) ioremap(addr, size) |
| 30 | #define ioremap_wc ioremap_nocache |
Toshi Kani | 556269c | 2015-06-04 18:55:16 +0200 | [diff] [blame] | 31 | #define ioremap_wt ioremap_nocache |
Jan Glauber | cd24834 | 2012-11-29 12:50:30 +0100 | [diff] [blame] | 32 | |
Jan Glauber | cd24834 | 2012-11-29 12:50:30 +0100 | [diff] [blame] | 33 | static inline void __iomem *ioremap(unsigned long offset, unsigned long size) |
| 34 | { |
| 35 | return (void __iomem *) offset; |
| 36 | } |
| 37 | |
| 38 | static inline void iounmap(volatile void __iomem *addr) |
| 39 | { |
| 40 | } |
| 41 | |
Frank Blaschka | 99e97b7 | 2014-11-06 13:17:06 +0100 | [diff] [blame] | 42 | static inline void __iomem *ioport_map(unsigned long port, unsigned int nr) |
| 43 | { |
| 44 | return NULL; |
| 45 | } |
| 46 | |
| 47 | static inline void ioport_unmap(void __iomem *p) |
| 48 | { |
| 49 | } |
| 50 | |
Logan Gunthorpe | 7e9710a | 2017-05-29 13:13:08 -0600 | [diff] [blame] | 51 | #ifdef CONFIG_PCI |
| 52 | |
Jan Glauber | cd24834 | 2012-11-29 12:50:30 +0100 | [diff] [blame] | 53 | /* |
| 54 | * s390 needs a private implementation of pci_iomap since ioremap with its |
| 55 | * offset parameter isn't sufficient. That's because BAR spaces are not |
| 56 | * disjunctive on s390 so we need the bar parameter of pci_iomap to find |
| 57 | * the corresponding device and create the mapping cookie. |
| 58 | */ |
| 59 | #define pci_iomap pci_iomap |
| 60 | #define pci_iounmap pci_iounmap |
Luis R. Rodriguez | ee03c58 | 2015-08-26 16:34:10 -0700 | [diff] [blame] | 61 | #define pci_iomap_wc pci_iomap |
| 62 | #define pci_iomap_wc_range pci_iomap_range |
Jan Glauber | cd24834 | 2012-11-29 12:50:30 +0100 | [diff] [blame] | 63 | |
| 64 | #define memcpy_fromio(dst, src, count) zpci_memcpy_fromio(dst, src, count) |
| 65 | #define memcpy_toio(dst, src, count) zpci_memcpy_toio(dst, src, count) |
| 66 | #define memset_io(dst, val, count) zpci_memset_io(dst, val, count) |
| 67 | |
| 68 | #define __raw_readb zpci_read_u8 |
| 69 | #define __raw_readw zpci_read_u16 |
| 70 | #define __raw_readl zpci_read_u32 |
| 71 | #define __raw_readq zpci_read_u64 |
| 72 | #define __raw_writeb zpci_write_u8 |
| 73 | #define __raw_writew zpci_write_u16 |
| 74 | #define __raw_writel zpci_write_u32 |
| 75 | #define __raw_writeq zpci_write_u64 |
| 76 | |
| 77 | #endif /* CONFIG_PCI */ |
| 78 | |
| 79 | #include <asm-generic/io.h> |
| 80 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | #endif |