blob: 72862a4d3a5db76387828bd6cb3b8abb68693081 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001// SPDX-License-Identifier: GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 * ppc64 "iomap" interface implementation.
4 *
5 * (C) Copyright 2004 Linus Torvalds
6 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07007#include <linux/pci.h>
8#include <linux/mm.h>
Paul Gortmaker93087942011-07-29 16:19:31 +10009#include <linux/export.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070010#include <asm/io.h>
Benjamin Herrenschmidt50747cb2007-07-26 14:07:13 +100011#include <asm/pci-bridge.h>
Benjamin Herrenschmidt38e9d362017-01-30 18:11:55 +110012#include <asm/isa-bridge.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
Linus Torvalds1da177e2005-04-16 15:20:36 -070014void __iomem *ioport_map(unsigned long port, unsigned int len)
15{
Benjamin Herrenschmidt68a64352006-11-13 09:27:39 +110016 return (void __iomem *) (port + _IO_BASE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070017}
Linus Torvalds1da177e2005-04-16 15:20:36 -070018EXPORT_SYMBOL(ioport_map);
Linus Torvalds1da177e2005-04-16 15:20:36 -070019
Benjamin Herrenschmidt81210c22011-08-05 16:01:20 +100020#ifdef CONFIG_PCI
Linus Torvalds1da177e2005-04-16 15:20:36 -070021void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
22{
Benjamin Herrenschmidt50747cb2007-07-26 14:07:13 +100023 if (isa_vaddr_is_ioport(addr))
24 return;
25 if (pcibios_vaddr_is_ioport(addr))
26 return;
27 iounmap(addr);
Linus Torvalds1da177e2005-04-16 15:20:36 -070028}
Benjamin Herrenschmidt50747cb2007-07-26 14:07:13 +100029
Linus Torvalds1da177e2005-04-16 15:20:36 -070030EXPORT_SYMBOL(pci_iounmap);
Benjamin Herrenschmidta85fe3f2011-08-11 01:15:44 +100031#endif /* CONFIG_PCI */