aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2006-12-07 09:35:43 -0500
committerRalf Baechle <ralf@linux-mips.org>2007-02-18 16:31:34 -0500
commit140c1729a221dc6eacfcbf2a073dbf00fad13e43 (patch)
treeb6baff7c6e68f7ca45aacded88b02ccb5f2cd286 /include/asm-mips
parent4c1569949a756327aa0ad7aa15a62266b6a00c3e (diff)
[MIPS] Iomap implementation.
This implementation has support for the concept of one separate ioport address space by PCI domain. A pointer to the virtual address where the port space of a domain has been mapped has been added to struct pci_controller and systems should be fixed to fill in this value. For single domain systems this will be the same value as passed to set_io_port_base(). Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'include/asm-mips')
-rw-r--r--include/asm-mips/io.h29
-rw-r--r--include/asm-mips/pci.h1
2 files changed, 2 insertions, 28 deletions
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h
index b6a2eb816628..92ec2618560c 100644
--- a/include/asm-mips/io.h
+++ b/include/asm-mips/io.h
@@ -20,6 +20,7 @@
20#include <asm/byteorder.h> 20#include <asm/byteorder.h>
21#include <asm/cpu.h> 21#include <asm/cpu.h>
22#include <asm/cpu-features.h> 22#include <asm/cpu-features.h>
23#include <asm-generic/iomap.h>
23#include <asm/page.h> 24#include <asm/page.h>
24#include <asm/pgtable-bits.h> 25#include <asm/pgtable-bits.h>
25#include <asm/processor.h> 26#include <asm/processor.h>
@@ -518,34 +519,6 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int
518} 519}
519 520
520/* 521/*
521 * Memory Mapped I/O
522 */
523#define ioread8(addr) readb(addr)
524#define ioread16(addr) readw(addr)
525#define ioread32(addr) readl(addr)
526
527#define iowrite8(b,addr) writeb(b,addr)
528#define iowrite16(w,addr) writew(w,addr)
529#define iowrite32(l,addr) writel(l,addr)
530
531#define ioread8_rep(a,b,c) readsb(a,b,c)
532#define ioread16_rep(a,b,c) readsw(a,b,c)
533#define ioread32_rep(a,b,c) readsl(a,b,c)
534
535#define iowrite8_rep(a,b,c) writesb(a,b,c)
536#define iowrite16_rep(a,b,c) writesw(a,b,c)
537#define iowrite32_rep(a,b,c) writesl(a,b,c)
538
539/* Create a virtual mapping cookie for an IO port range */
540extern void __iomem *ioport_map(unsigned long port, unsigned int nr);
541extern void ioport_unmap(void __iomem *);
542
543/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
544struct pci_dev;
545extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
546extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
547
548/*
549 * ISA space is 'always mapped' on currently supported MIPS systems, no need 522 * ISA space is 'always mapped' on currently supported MIPS systems, no need
550 * to explicitly ioremap() it. The fact that the ISA IO space is mapped 523 * to explicitly ioremap() it. The fact that the ISA IO space is mapped
551 * to PAGE_OFFSET is pure coincidence - it does not mean ISA values 524 * to PAGE_OFFSET is pure coincidence - it does not mean ISA values
diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h
index 7f0f120ca07c..3eea3ba0fca5 100644
--- a/include/asm-mips/pci.h
+++ b/include/asm-mips/pci.h
@@ -32,6 +32,7 @@ struct pci_controller {
32 unsigned long mem_offset; 32 unsigned long mem_offset;
33 struct resource *io_resource; 33 struct resource *io_resource;
34 unsigned long io_offset; 34 unsigned long io_offset;
35 unsigned long io_map_base;
35 36
36 unsigned int index; 37 unsigned int index;
37 /* For compatibility with current (as of July 2003) pciutils 38 /* For compatibility with current (as of July 2003) pciutils