diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-04-20 03:38:00 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-04-20 03:38:00 -0400 |
commit | 0bb34a6bf1f71d5ad2abfda582a2c2794957bc7b (patch) | |
tree | 2ac5a8400ac65001b78f173b51bd41b0f38d9376 /arch/sh/include/asm/pci.h | |
parent | 394b6d2fe624246e258a218dac68d44fe9a8411f (diff) |
sh: pci: Consolidate pci_iomap() and use the generic I/O base.
This consolidates the pci_iomap() definitions and reworks how the I/O
port base is handled. PCI channels can register their own I/O map base,
or if none is provided, the system-wide generic I/O base is used instead.
Functionally nothing changes, while this allows us to kill off lots of
I/O address special casing and lookups.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include/asm/pci.h')
-rw-r--r-- | arch/sh/include/asm/pci.h | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/arch/sh/include/asm/pci.h b/arch/sh/include/asm/pci.h index e8265fd0bb6f..532428289772 100644 --- a/arch/sh/include/asm/pci.h +++ b/arch/sh/include/asm/pci.h | |||
@@ -26,6 +26,8 @@ struct pci_channel { | |||
26 | int enabled; | 26 | int enabled; |
27 | unsigned long reg_base; | 27 | unsigned long reg_base; |
28 | unsigned long io_base; | 28 | unsigned long io_base; |
29 | |||
30 | unsigned long io_map_base; | ||
29 | }; | 31 | }; |
30 | 32 | ||
31 | /* | 33 | /* |
@@ -110,31 +112,11 @@ static inline int __is_pci_memory(unsigned long phys_addr, unsigned long size) | |||
110 | } | 112 | } |
111 | return 0; | 113 | return 0; |
112 | } | 114 | } |
113 | |||
114 | static inline void __iomem *__get_pci_io_base(unsigned long port, | ||
115 | unsigned long size) | ||
116 | { | ||
117 | struct pci_channel *p; | ||
118 | struct resource *res; | ||
119 | |||
120 | for (p = board_pci_channels; p->init; p++) { | ||
121 | res = p->io_resource; | ||
122 | if (p->enabled && (port >= res->start) && | ||
123 | (port + size) <= (res->end + 1)) | ||
124 | return (void __iomem *)(p->io_base + port); | ||
125 | } | ||
126 | return NULL; | ||
127 | } | ||
128 | #else | 115 | #else |
129 | static inline int __is_pci_memory(unsigned long phys_addr, unsigned long size) | 116 | static inline int __is_pci_memory(unsigned long phys_addr, unsigned long size) |
130 | { | 117 | { |
131 | return 0; | 118 | return 0; |
132 | } | 119 | } |
133 | static inline void __iomem *__get_pci_io_base(unsigned long port, | ||
134 | unsigned long size) | ||
135 | { | ||
136 | return NULL; | ||
137 | } | ||
138 | #endif | 120 | #endif |
139 | 121 | ||
140 | /* Board-specific fixup routines. */ | 122 | /* Board-specific fixup routines. */ |