aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/io-workarounds.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/io-workarounds.c')
-rw-r--r--arch/powerpc/kernel/io-workarounds.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/arch/powerpc/kernel/io-workarounds.c b/arch/powerpc/kernel/io-workarounds.c
index 7e5845798788..d36515eaa314 100644
--- a/arch/powerpc/kernel/io-workarounds.c
+++ b/arch/powerpc/kernel/io-workarounds.c
@@ -144,7 +144,19 @@ static void __iomem *iowa_ioremap(phys_addr_t addr, unsigned long size,
144 return res; 144 return res;
145} 145}
146 146
147/* Regist new bus to support workaround */ 147/* Enable IO workaround */
148static void __devinit io_workaround_init(void)
149{
150 static int io_workaround_inited;
151
152 if (io_workaround_inited)
153 return;
154 ppc_pci_io = iowa_pci_io;
155 ppc_md.ioremap = iowa_ioremap;
156 io_workaround_inited = 1;
157}
158
159/* Register new bus to support workaround */
148void __devinit iowa_register_bus(struct pci_controller *phb, 160void __devinit iowa_register_bus(struct pci_controller *phb,
149 struct ppc_pci_io *ops, 161 struct ppc_pci_io *ops,
150 int (*initfunc)(struct iowa_bus *, void *), void *data) 162 int (*initfunc)(struct iowa_bus *, void *), void *data)
@@ -152,6 +164,8 @@ void __devinit iowa_register_bus(struct pci_controller *phb,
152 struct iowa_bus *bus; 164 struct iowa_bus *bus;
153 struct device_node *np = phb->dn; 165 struct device_node *np = phb->dn;
154 166
167 io_workaround_init();
168
155 if (iowa_bus_count >= IOWA_MAX_BUS) { 169 if (iowa_bus_count >= IOWA_MAX_BUS) {
156 pr_err("IOWA:Too many pci bridges, " 170 pr_err("IOWA:Too many pci bridges, "
157 "workarounds disabled for %s\n", np->full_name); 171 "workarounds disabled for %s\n", np->full_name);
@@ -171,14 +185,3 @@ void __devinit iowa_register_bus(struct pci_controller *phb,
171 pr_debug("IOWA:[%d]Add bus, %s.\n", iowa_bus_count-1, np->full_name); 185 pr_debug("IOWA:[%d]Add bus, %s.\n", iowa_bus_count-1, np->full_name);
172} 186}
173 187
174/* enable IO workaround */
175void __devinit io_workaround_init(void)
176{
177 static int io_workaround_inited;
178
179 if (io_workaround_inited)
180 return;
181 ppc_pci_io = iowa_pci_io;
182 ppc_md.ioremap = iowa_ioremap;
183 io_workaround_inited = 1;
184}