diff options
Diffstat (limited to 'drivers/bcma/driver_pci.c')
-rw-r--r-- | drivers/bcma/driver_pci.c | 38 |
1 files changed, 5 insertions, 33 deletions
diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c index 155d953dba74..4d38ae179b48 100644 --- a/drivers/bcma/driver_pci.c +++ b/drivers/bcma/driver_pci.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * Broadcom specific AMBA | 2 | * Broadcom specific AMBA |
3 | * PCI Core | 3 | * PCI Core |
4 | * | 4 | * |
5 | * Copyright 2005, Broadcom Corporation | 5 | * Copyright 2005, 2011, Broadcom Corporation |
6 | * Copyright 2006, 2007, Michael Buesch <m@bues.ch> | 6 | * Copyright 2006, 2007, Michael Buesch <m@bues.ch> |
7 | * Copyright 2011, 2012, Hauke Mehrtens <hauke@hauke-m.de> | 7 | * Copyright 2011, 2012, Hauke Mehrtens <hauke@hauke-m.de> |
8 | * | 8 | * |
@@ -179,47 +179,19 @@ static void __devinit bcma_core_pci_clientmode_init(struct bcma_drv_pci *pc) | |||
179 | bcma_pcicore_serdes_workaround(pc); | 179 | bcma_pcicore_serdes_workaround(pc); |
180 | } | 180 | } |
181 | 181 | ||
182 | static bool __devinit bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc) | ||
183 | { | ||
184 | struct bcma_bus *bus = pc->core->bus; | ||
185 | u16 chipid_top; | ||
186 | |||
187 | chipid_top = (bus->chipinfo.id & 0xFF00); | ||
188 | if (chipid_top != 0x4700 && | ||
189 | chipid_top != 0x5300) | ||
190 | return false; | ||
191 | |||
192 | #ifdef CONFIG_SSB_DRIVER_PCICORE | ||
193 | if (bus->sprom.boardflags_lo & SSB_BFL_NOPCI) | ||
194 | return false; | ||
195 | #endif /* CONFIG_SSB_DRIVER_PCICORE */ | ||
196 | |||
197 | #if 0 | ||
198 | /* TODO: on BCMA we use address from EROM instead of magic formula */ | ||
199 | u32 tmp; | ||
200 | return !mips_busprobe32(tmp, (bus->mmio + | ||
201 | (pc->core->core_index * BCMA_CORE_SIZE))); | ||
202 | #endif | ||
203 | |||
204 | return true; | ||
205 | } | ||
206 | |||
207 | void __devinit bcma_core_pci_init(struct bcma_drv_pci *pc) | 182 | void __devinit bcma_core_pci_init(struct bcma_drv_pci *pc) |
208 | { | 183 | { |
209 | if (pc->setup_done) | 184 | if (pc->setup_done) |
210 | return; | 185 | return; |
211 | 186 | ||
212 | if (bcma_core_pci_is_in_hostmode(pc)) { | ||
213 | #ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE | 187 | #ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE |
188 | pc->hostmode = bcma_core_pci_is_in_hostmode(pc); | ||
189 | if (pc->hostmode) | ||
214 | bcma_core_pci_hostmode_init(pc); | 190 | bcma_core_pci_hostmode_init(pc); |
215 | #else | ||
216 | pr_err("Driver compiled without support for hostmode PCI\n"); | ||
217 | #endif /* CONFIG_BCMA_DRIVER_PCI_HOSTMODE */ | 191 | #endif /* CONFIG_BCMA_DRIVER_PCI_HOSTMODE */ |
218 | } else { | ||
219 | bcma_core_pci_clientmode_init(pc); | ||
220 | } | ||
221 | 192 | ||
222 | pc->setup_done = true; | 193 | if (!pc->hostmode) |
194 | bcma_core_pci_clientmode_init(pc); | ||
223 | } | 195 | } |
224 | 196 | ||
225 | int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core, | 197 | int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core, |