blob: cd6b9ee7b69c928118e9bce7c8691651a79a9b52 [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 Holzheub2a68c22012-05-09 16:27:36 +020016void *xlate_dev_mem_ptr(unsigned long phys);
Michael Holzheu576ebd72013-05-21 16:08:22 +020017#define xlate_dev_mem_ptr xlate_dev_mem_ptr
Michael Holzheub2a68c22012-05-09 16:27:36 +020018void unxlate_dev_mem_ptr(unsigned long phys, void *addr);
Linus Torvalds1da177e2005-04-16 15:20:36 -070019
20/*
21 * Convert a virtual cached pointer to an uncached pointer
22 */
23#define xlate_dev_kmem_ptr(p) p
24
Jan Glaubercd248342012-11-29 12:50:30 +010025#define IO_SPACE_LIMIT 0
26
27#ifdef CONFIG_PCI
28
29#define ioremap_nocache(addr, size) ioremap(addr, size)
30#define ioremap_wc ioremap_nocache
31
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
41/*
42 * s390 needs a private implementation of pci_iomap since ioremap with its
43 * offset parameter isn't sufficient. That's because BAR spaces are not
44 * disjunctive on s390 so we need the bar parameter of pci_iomap to find
45 * the corresponding device and create the mapping cookie.
46 */
47#define pci_iomap pci_iomap
48#define pci_iounmap pci_iounmap
49
50#define memcpy_fromio(dst, src, count) zpci_memcpy_fromio(dst, src, count)
51#define memcpy_toio(dst, src, count) zpci_memcpy_toio(dst, src, count)
52#define memset_io(dst, val, count) zpci_memset_io(dst, val, count)
53
54#define __raw_readb zpci_read_u8
55#define __raw_readw zpci_read_u16
56#define __raw_readl zpci_read_u32
57#define __raw_readq zpci_read_u64
58#define __raw_writeb zpci_write_u8
59#define __raw_writew zpci_write_u16
60#define __raw_writel zpci_write_u32
61#define __raw_writeq zpci_write_u64
62
Heiko Carstens478740a2013-01-07 14:03:34 +010063#define readb_relaxed readb
64#define readw_relaxed readw
65#define readl_relaxed readl
66#define readq_relaxed readq
67
Jan Glaubercd248342012-11-29 12:50:30 +010068#endif /* CONFIG_PCI */
69
70#include <asm-generic/io.h>
71
Linus Torvalds1da177e2005-04-16 15:20:36 -070072#endif