blob: 904e4b3af95dcc6a45aa44f85924b45647455fc6 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * S390 version
Heiko Carstensa53c8fa2012-07-20 11:15:04 +02003 * Copyright IBM Corp. 1999
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
5 *
6 * Derived from "include/asm-i386/io.h"
7 */
8
9#ifndef _S390_IO_H
10#define _S390_IO_H
11
Jan Glaubercd248342012-11-29 12:50:30 +010012#include <linux/kernel.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#include <asm/page.h>
Jan Glaubercd248342012-11-29 12:50:30 +010014#include <asm/pci_io.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
Michael Holzheu576ebd72013-05-21 16:08:22 +020016#define xlate_dev_mem_ptr xlate_dev_mem_ptr
Thierry Reding4707a342014-07-28 17:20:33 +020017void *xlate_dev_mem_ptr(phys_addr_t phys);
18#define unxlate_dev_mem_ptr unxlate_dev_mem_ptr
19void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr);
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
21/*
22 * Convert a virtual cached pointer to an uncached pointer
23 */
24#define xlate_dev_kmem_ptr(p) p
25
Jan Glaubercd248342012-11-29 12:50:30 +010026#define IO_SPACE_LIMIT 0
27
Jan Glaubercd248342012-11-29 12:50:30 +010028#define ioremap_nocache(addr, size) ioremap(addr, size)
29#define ioremap_wc ioremap_nocache
Toshi Kani556269c2015-06-04 18:55:16 +020030#define ioremap_wt ioremap_nocache
Jan Glaubercd248342012-11-29 12:50:30 +010031
Jan Glaubercd248342012-11-29 12:50:30 +010032static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
33{
34 return (void __iomem *) offset;
35}
36
37static inline void iounmap(volatile void __iomem *addr)
38{
39}
40
Frank Blaschka99e97b72014-11-06 13:17:06 +010041static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
42{
43 return NULL;
44}
45
46static inline void ioport_unmap(void __iomem *p)
47{
48}
49
Logan Gunthorpe7e9710a2017-05-29 13:13:08 -060050#ifdef CONFIG_PCI
51
Jan Glaubercd248342012-11-29 12:50:30 +010052/*
53 * s390 needs a private implementation of pci_iomap since ioremap with its
54 * offset parameter isn't sufficient. That's because BAR spaces are not
55 * disjunctive on s390 so we need the bar parameter of pci_iomap to find
56 * the corresponding device and create the mapping cookie.
57 */
58#define pci_iomap pci_iomap
59#define pci_iounmap pci_iounmap
Luis R. Rodriguezee03c582015-08-26 16:34:10 -070060#define pci_iomap_wc pci_iomap
61#define pci_iomap_wc_range pci_iomap_range
Jan Glaubercd248342012-11-29 12:50:30 +010062
63#define memcpy_fromio(dst, src, count) zpci_memcpy_fromio(dst, src, count)
64#define memcpy_toio(dst, src, count) zpci_memcpy_toio(dst, src, count)
65#define memset_io(dst, val, count) zpci_memset_io(dst, val, count)
66
67#define __raw_readb zpci_read_u8
68#define __raw_readw zpci_read_u16
69#define __raw_readl zpci_read_u32
70#define __raw_readq zpci_read_u64
71#define __raw_writeb zpci_write_u8
72#define __raw_writew zpci_write_u16
73#define __raw_writel zpci_write_u32
74#define __raw_writeq zpci_write_u64
75
76#endif /* CONFIG_PCI */
77
78#include <asm-generic/io.h>
79
Linus Torvalds1da177e2005-04-16 15:20:36 -070080#endif