2 * ppc64 "iomap" interface implementation.
4 * (C) Copyright 2004 Linus Torvalds
8 #include <linux/export.h>
10 #include <asm/pci-bridge.h>
11 #include <asm/isa-bridge.h>
14 * Here comes the ppc64 implementation of the IOMAP
17 unsigned int ioread8(void __iomem
*addr
)
21 unsigned int ioread16(void __iomem
*addr
)
25 unsigned int ioread16be(void __iomem
*addr
)
27 return readw_be(addr
);
29 unsigned int ioread32(void __iomem
*addr
)
33 unsigned int ioread32be(void __iomem
*addr
)
35 return readl_be(addr
);
37 EXPORT_SYMBOL(ioread8
);
38 EXPORT_SYMBOL(ioread16
);
39 EXPORT_SYMBOL(ioread16be
);
40 EXPORT_SYMBOL(ioread32
);
41 EXPORT_SYMBOL(ioread32be
);
43 u64
ioread64(void __iomem
*addr
)
47 u64
ioread64be(void __iomem
*addr
)
49 return readq_be(addr
);
51 EXPORT_SYMBOL(ioread64
);
52 EXPORT_SYMBOL(ioread64be
);
53 #endif /* __powerpc64__ */
55 void iowrite8(u8 val
, void __iomem
*addr
)
59 void iowrite16(u16 val
, void __iomem
*addr
)
63 void iowrite16be(u16 val
, void __iomem
*addr
)
67 void iowrite32(u32 val
, void __iomem
*addr
)
71 void iowrite32be(u32 val
, void __iomem
*addr
)
75 EXPORT_SYMBOL(iowrite8
);
76 EXPORT_SYMBOL(iowrite16
);
77 EXPORT_SYMBOL(iowrite16be
);
78 EXPORT_SYMBOL(iowrite32
);
79 EXPORT_SYMBOL(iowrite32be
);
81 void iowrite64(u64 val
, void __iomem
*addr
)
85 void iowrite64be(u64 val
, void __iomem
*addr
)
89 EXPORT_SYMBOL(iowrite64
);
90 EXPORT_SYMBOL(iowrite64be
);
91 #endif /* __powerpc64__ */
94 * These are the "repeat read/write" functions. Note the
95 * non-CPU byte order. We do things in "IO byteorder"
98 * FIXME! We could make these do EEH handling if we really
99 * wanted. Not clear if we do.
101 void ioread8_rep(void __iomem
*addr
, void *dst
, unsigned long count
)
103 readsb(addr
, dst
, count
);
105 void ioread16_rep(void __iomem
*addr
, void *dst
, unsigned long count
)
107 readsw(addr
, dst
, count
);
109 void ioread32_rep(void __iomem
*addr
, void *dst
, unsigned long count
)
111 readsl(addr
, dst
, count
);
113 EXPORT_SYMBOL(ioread8_rep
);
114 EXPORT_SYMBOL(ioread16_rep
);
115 EXPORT_SYMBOL(ioread32_rep
);
117 void iowrite8_rep(void __iomem
*addr
, const void *src
, unsigned long count
)
119 writesb(addr
, src
, count
);
121 void iowrite16_rep(void __iomem
*addr
, const void *src
, unsigned long count
)
123 writesw(addr
, src
, count
);
125 void iowrite32_rep(void __iomem
*addr
, const void *src
, unsigned long count
)
127 writesl(addr
, src
, count
);
129 EXPORT_SYMBOL(iowrite8_rep
);
130 EXPORT_SYMBOL(iowrite16_rep
);
131 EXPORT_SYMBOL(iowrite32_rep
);
133 void __iomem
*ioport_map(unsigned long port
, unsigned int len
)
135 return (void __iomem
*) (port
+ _IO_BASE
);
138 void ioport_unmap(void __iomem
*addr
)
142 EXPORT_SYMBOL(ioport_map
);
143 EXPORT_SYMBOL(ioport_unmap
);
146 void pci_iounmap(struct pci_dev
*dev
, void __iomem
*addr
)
148 if (isa_vaddr_is_ioport(addr
))
150 if (pcibios_vaddr_is_ioport(addr
))
155 EXPORT_SYMBOL(pci_iounmap
);
156 #endif /* CONFIG_PCI */