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 | * ppc64 "iomap" interface implementation. |
| 4 | * |
| 5 | * (C) Copyright 2004 Linus Torvalds |
| 6 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | #include <linux/pci.h> |
| 8 | #include <linux/mm.h> |
Paul Gortmaker | 9308794 | 2011-07-29 16:19:31 +1000 | [diff] [blame] | 9 | #include <linux/export.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | #include <asm/io.h> |
Benjamin Herrenschmidt | 50747cb | 2007-07-26 14:07:13 +1000 | [diff] [blame] | 11 | #include <asm/pci-bridge.h> |
Benjamin Herrenschmidt | 38e9d36 | 2017-01-30 18:11:55 +1100 | [diff] [blame] | 12 | #include <asm/isa-bridge.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | void __iomem *ioport_map(unsigned long port, unsigned int len) |
| 15 | { |
Benjamin Herrenschmidt | 68a6435 | 2006-11-13 09:27:39 +1100 | [diff] [blame] | 16 | return (void __iomem *) (port + _IO_BASE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | EXPORT_SYMBOL(ioport_map); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | |
Benjamin Herrenschmidt | 81210c2 | 2011-08-05 16:01:20 +1000 | [diff] [blame] | 20 | #ifdef CONFIG_PCI |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | void pci_iounmap(struct pci_dev *dev, void __iomem *addr) |
| 22 | { |
Benjamin Herrenschmidt | 50747cb | 2007-07-26 14:07:13 +1000 | [diff] [blame] | 23 | if (isa_vaddr_is_ioport(addr)) |
| 24 | return; |
| 25 | if (pcibios_vaddr_is_ioport(addr)) |
| 26 | return; |
| 27 | iounmap(addr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | } |
Benjamin Herrenschmidt | 50747cb | 2007-07-26 14:07:13 +1000 | [diff] [blame] | 29 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | EXPORT_SYMBOL(pci_iounmap); |
Benjamin Herrenschmidt | a85fe3f | 2011-08-11 01:15:44 +1000 | [diff] [blame] | 31 | #endif /* CONFIG_PCI */ |