aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/pci-bridge.h
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2007-07-26 00:07:13 -0400
committerPaul Mackerras <paulus@samba.org>2007-07-26 02:17:47 -0400
commit6dfbde209171cd15407e7540d363a434a489aaca (patch)
tree0db7a89f32b3b61d3334085b67c276945dd6560f /include/asm-powerpc/pci-bridge.h
parentf5d834fc34e61f1a40435981062000e5d2b2baa8 (diff)
[POWERPC] Add function to check if address is an IO port
This adds a function that tells you if a given kernel virtual address is hitting a PCI or ISA IO port permanent mapping or not. This is to be used in the next patch to fix iomap APIs to properly unmap things. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc/pci-bridge.h')
-rw-r--r--include/asm-powerpc/pci-bridge.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index d53e0eb1de16..e909769b6410 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -71,6 +71,14 @@ static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
71 return bus->sysdata; 71 return bus->sysdata;
72} 72}
73 73
74static inline int isa_vaddr_is_ioport(void __iomem *address)
75{
76 /* No specific ISA handling on ppc32 at this stage, it
77 * all goes through PCI
78 */
79 return 0;
80}
81
74/* These are used for config access before all the PCI probing 82/* These are used for config access before all the PCI probing
75 has been done. */ 83 has been done. */
76int early_read_config_byte(struct pci_controller *hose, int bus, int dev_fn, 84int early_read_config_byte(struct pci_controller *hose, int bus, int dev_fn,
@@ -241,6 +249,13 @@ extern void pcibios_free_controller(struct pci_controller *phb);
241 249
242extern void isa_bridge_find_early(struct pci_controller *hose); 250extern void isa_bridge_find_early(struct pci_controller *hose);
243 251
252static inline int isa_vaddr_is_ioport(void __iomem *address)
253{
254 /* Check if address hits the reserved legacy IO range */
255 unsigned long ea = (unsigned long)address;
256 return ea >= ISA_IO_BASE && ea < ISA_IO_END;
257}
258
244extern int pcibios_unmap_io_space(struct pci_bus *bus); 259extern int pcibios_unmap_io_space(struct pci_bus *bus);
245extern int pcibios_map_io_space(struct pci_bus *bus); 260extern int pcibios_map_io_space(struct pci_bus *bus);
246 261
@@ -271,11 +286,16 @@ extern struct pci_controller *
271pcibios_alloc_controller(struct device_node *dev); 286pcibios_alloc_controller(struct device_node *dev);
272#ifdef CONFIG_PCI 287#ifdef CONFIG_PCI
273extern unsigned long pci_address_to_pio(phys_addr_t address); 288extern unsigned long pci_address_to_pio(phys_addr_t address);
289extern int pcibios_vaddr_is_ioport(void __iomem *address);
274#else 290#else
275static inline unsigned long pci_address_to_pio(phys_addr_t address) 291static inline unsigned long pci_address_to_pio(phys_addr_t address)
276{ 292{
277 return (unsigned long)-1; 293 return (unsigned long)-1;
278} 294}
295static inline int pcibios_vaddr_is_ioport(void __iomem *address)
296{
297 return 0;
298}
279#endif 299#endif
280 300
281 301