aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-09-29 14:40:18 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-10-19 15:52:59 -0400
commitdfae714361ba75323914da19eb411aaae53d6af0 (patch)
treeab36b15dca4e8d17f87f86f9f5ad03e0eafc9b68 /drivers
parent017c4c3bdeb4e6c38094eb2330a57370f68f4853 (diff)
bcma: add an extra pcie core struct
The BCM4706 has two PCIe host controller on the bcma bus. For PCIe client mode it is assumed that there is only one PCIe controller so the PCIe driver, like b43 and brcmsmac are accessing the first PCIe controller when they want to issue a operation on the host controller. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/bcma/driver_pci_host.c4
-rw-r--r--drivers/bcma/main.c25
-rw-r--r--drivers/net/wireless/b43/main.c2
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/aiutils.c4
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/main.c2
5 files changed, 30 insertions, 7 deletions
diff --git a/drivers/bcma/driver_pci_host.c b/drivers/bcma/driver_pci_host.c
index 9baf886e82df..63172c9f871a 100644
--- a/drivers/bcma/driver_pci_host.c
+++ b/drivers/bcma/driver_pci_host.c
@@ -452,6 +452,8 @@ void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc)
452 pc_host->mem_resource.start = BCMA_SOC_PCI_MEM; 452 pc_host->mem_resource.start = BCMA_SOC_PCI_MEM;
453 pc_host->mem_resource.end = BCMA_SOC_PCI_MEM + 453 pc_host->mem_resource.end = BCMA_SOC_PCI_MEM +
454 BCMA_SOC_PCI_MEM_SZ - 1; 454 BCMA_SOC_PCI_MEM_SZ - 1;
455 pc_host->io_resource.start = 0x100;
456 pc_host->io_resource.end = 0x47F;
455 pci_membase_1G = BCMA_SOC_PCIE_DMA_H32; 457 pci_membase_1G = BCMA_SOC_PCIE_DMA_H32;
456 pcicore_write32(pc, BCMA_CORE_PCI_SBTOPCI0, 458 pcicore_write32(pc, BCMA_CORE_PCI_SBTOPCI0,
457 tmp | BCMA_SOC_PCI_MEM); 459 tmp | BCMA_SOC_PCI_MEM);
@@ -459,6 +461,8 @@ void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc)
459 pc_host->mem_resource.start = BCMA_SOC_PCI1_MEM; 461 pc_host->mem_resource.start = BCMA_SOC_PCI1_MEM;
460 pc_host->mem_resource.end = BCMA_SOC_PCI1_MEM + 462 pc_host->mem_resource.end = BCMA_SOC_PCI1_MEM +
461 BCMA_SOC_PCI_MEM_SZ - 1; 463 BCMA_SOC_PCI_MEM_SZ - 1;
464 pc_host->io_resource.start = 0x480;
465 pc_host->io_resource.end = 0x7FF;
462 pci_membase_1G = BCMA_SOC_PCIE1_DMA_H32; 466 pci_membase_1G = BCMA_SOC_PCIE1_DMA_H32;
463 pc_host->host_cfg_addr = BCMA_SOC_PCI1_CFG; 467 pc_host->host_cfg_addr = BCMA_SOC_PCI1_CFG;
464 pcicore_write32(pc, BCMA_CORE_PCI_SBTOPCI0, 468 pcicore_write32(pc, BCMA_CORE_PCI_SBTOPCI0,
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index d6b5c4ca4c43..7f473cf0469e 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -81,6 +81,18 @@ struct bcma_device *bcma_find_core(struct bcma_bus *bus, u16 coreid)
81} 81}
82EXPORT_SYMBOL_GPL(bcma_find_core); 82EXPORT_SYMBOL_GPL(bcma_find_core);
83 83
84static struct bcma_device *bcma_find_core_unit(struct bcma_bus *bus, u16 coreid,
85 u8 unit)
86{
87 struct bcma_device *core;
88
89 list_for_each_entry(core, &bus->cores, list) {
90 if (core->id.id == coreid && core->core_unit == unit)
91 return core;
92 }
93 return NULL;
94}
95
84static void bcma_release_core_dev(struct device *dev) 96static void bcma_release_core_dev(struct device *dev)
85{ 97{
86 struct bcma_device *core = container_of(dev, struct bcma_device, dev); 98 struct bcma_device *core = container_of(dev, struct bcma_device, dev);
@@ -211,10 +223,17 @@ int __devinit bcma_bus_register(struct bcma_bus *bus)
211 } 223 }
212 224
213 /* Init PCIE core */ 225 /* Init PCIE core */
214 core = bcma_find_core(bus, BCMA_CORE_PCIE); 226 core = bcma_find_core_unit(bus, BCMA_CORE_PCIE, 0);
227 if (core) {
228 bus->drv_pci[0].core = core;
229 bcma_core_pci_init(&bus->drv_pci[0]);
230 }
231
232 /* Init PCIE core */
233 core = bcma_find_core_unit(bus, BCMA_CORE_PCIE, 1);
215 if (core) { 234 if (core) {
216 bus->drv_pci.core = core; 235 bus->drv_pci[1].core = core;
217 bcma_core_pci_init(&bus->drv_pci); 236 bcma_core_pci_init(&bus->drv_pci[1]);
218 } 237 }
219 238
220 /* Init GBIT MAC COMMON core */ 239 /* Init GBIT MAC COMMON core */
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 73730e94e0ac..7358ea2eb576 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4652,7 +4652,7 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
4652 switch (dev->dev->bus_type) { 4652 switch (dev->dev->bus_type) {
4653#ifdef CONFIG_B43_BCMA 4653#ifdef CONFIG_B43_BCMA
4654 case B43_BUS_BCMA: 4654 case B43_BUS_BCMA:
4655 bcma_core_pci_irq_ctl(&dev->dev->bdev->bus->drv_pci, 4655 bcma_core_pci_irq_ctl(&dev->dev->bdev->bus->drv_pci[0],
4656 dev->dev->bdev, true); 4656 dev->dev->bdev, true);
4657 break; 4657 break;
4658#endif 4658#endif
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
index b89f1272b93f..de96290f5ccd 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
@@ -692,7 +692,7 @@ void ai_pci_up(struct si_pub *sih)
692 sii = container_of(sih, struct si_info, pub); 692 sii = container_of(sih, struct si_info, pub);
693 693
694 if (sii->icbus->hosttype == BCMA_HOSTTYPE_PCI) 694 if (sii->icbus->hosttype == BCMA_HOSTTYPE_PCI)
695 bcma_core_pci_extend_L1timer(&sii->icbus->drv_pci, true); 695 bcma_core_pci_extend_L1timer(&sii->icbus->drv_pci[0], true);
696} 696}
697 697
698/* Unconfigure and/or apply various WARs when going down */ 698/* Unconfigure and/or apply various WARs when going down */
@@ -703,7 +703,7 @@ void ai_pci_down(struct si_pub *sih)
703 sii = container_of(sih, struct si_info, pub); 703 sii = container_of(sih, struct si_info, pub);
704 704
705 if (sii->icbus->hosttype == BCMA_HOSTTYPE_PCI) 705 if (sii->icbus->hosttype == BCMA_HOSTTYPE_PCI)
706 bcma_core_pci_extend_L1timer(&sii->icbus->drv_pci, false); 706 bcma_core_pci_extend_L1timer(&sii->icbus->drv_pci[0], false);
707} 707}
708 708
709/* Enable BT-COEX & Ex-PA for 4313 */ 709/* Enable BT-COEX & Ex-PA for 4313 */
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 75086b37c817..565c15abbed5 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -5077,7 +5077,7 @@ static int brcms_b_up_prep(struct brcms_hardware *wlc_hw)
5077 * Configure pci/pcmcia here instead of in brcms_c_attach() 5077 * Configure pci/pcmcia here instead of in brcms_c_attach()
5078 * to allow mfg hotswap: down, hotswap (chip power cycle), up. 5078 * to allow mfg hotswap: down, hotswap (chip power cycle), up.
5079 */ 5079 */
5080 bcma_core_pci_irq_ctl(&wlc_hw->d11core->bus->drv_pci, wlc_hw->d11core, 5080 bcma_core_pci_irq_ctl(&wlc_hw->d11core->bus->drv_pci[0], wlc_hw->d11core,
5081 true); 5081 true);
5082 5082
5083 /* 5083 /*