Skip to content

Commit dfae714

Browse files
haukelinvjw
authored andcommitted
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>
1 parent 017c4c3 commit dfae714

6 files changed

Lines changed: 31 additions & 8 deletions

File tree

‎drivers/bcma/driver_pci_host.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,13 +452,17 @@ void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc)
452452
pc_host->mem_resource.start = BCMA_SOC_PCI_MEM;
453453
pc_host->mem_resource.end = BCMA_SOC_PCI_MEM +
454454
BCMA_SOC_PCI_MEM_SZ - 1;
455+
pc_host->io_resource.start = 0x100;
456+
pc_host->io_resource.end = 0x47F;
455457
pci_membase_1G = BCMA_SOC_PCIE_DMA_H32;
456458
pcicore_write32(pc, BCMA_CORE_PCI_SBTOPCI0,
457459
tmp | BCMA_SOC_PCI_MEM);
458460
} else if (pc->core->core_unit == 1) {
459461
pc_host->mem_resource.start = BCMA_SOC_PCI1_MEM;
460462
pc_host->mem_resource.end = BCMA_SOC_PCI1_MEM +
461463
BCMA_SOC_PCI_MEM_SZ - 1;
464+
pc_host->io_resource.start = 0x480;
465+
pc_host->io_resource.end = 0x7FF;
462466
pci_membase_1G = BCMA_SOC_PCIE1_DMA_H32;
463467
pc_host->host_cfg_addr = BCMA_SOC_PCI1_CFG;
464468
pcicore_write32(pc, BCMA_CORE_PCI_SBTOPCI0,

‎drivers/bcma/main.c‎

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,18 @@ struct bcma_device *bcma_find_core(struct bcma_bus *bus, u16 coreid)
8181
}
8282
EXPORT_SYMBOL_GPL(bcma_find_core);
8383

84+
static 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+
8496
static void bcma_release_core_dev(struct device *dev)
8597
{
8698
struct bcma_device *core = container_of(dev, struct bcma_device, dev);
@@ -211,10 +223,17 @@ int __devinit bcma_bus_register(struct bcma_bus *bus)
211223
}
212224

213225
/* 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);
215234
if (core) {
216-
bus->drv_pci.core = core;
217-
bcma_core_pci_init(&bus->drv_pci);
235+
bus->drv_pci[1].core = core;
236+
bcma_core_pci_init(&bus->drv_pci[1]);
218237
}
219238

220239
/* Init GBIT MAC COMMON core */

‎drivers/net/wireless/b43/main.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4652,7 +4652,7 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
46524652
switch (dev->dev->bus_type) {
46534653
#ifdef CONFIG_B43_BCMA
46544654
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],
46564656
dev->dev->bdev, true);
46574657
break;
46584658
#endif

‎drivers/net/wireless/brcm80211/brcmsmac/aiutils.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ void ai_pci_up(struct si_pub *sih)
692692
sii = container_of(sih, struct si_info, pub);
693693

694694
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);
696696
}
697697

698698
/* Unconfigure and/or apply various WARs when going down */
@@ -703,7 +703,7 @@ void ai_pci_down(struct si_pub *sih)
703703
sii = container_of(sih, struct si_info, pub);
704704

705705
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);
707707
}
708708

709709
/* Enable BT-COEX & Ex-PA for 4313 */

‎drivers/net/wireless/brcm80211/brcmsmac/main.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5077,7 +5077,7 @@ static int brcms_b_up_prep(struct brcms_hardware *wlc_hw)
50775077
* Configure pci/pcmcia here instead of in brcms_c_attach()
50785078
* to allow mfg hotswap: down, hotswap (chip power cycle), up.
50795079
*/
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,
50815081
true);
50825082

50835083
/*

‎include/linux/bcma/bcma.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ struct bcma_bus {
251251
u8 num;
252252

253253
struct bcma_drv_cc drv_cc;
254-
struct bcma_drv_pci drv_pci;
254+
struct bcma_drv_pci drv_pci[2];
255255
struct bcma_drv_mips drv_mips;
256256
struct bcma_drv_gmac_cmn drv_gmac_cmn;
257257

0 commit comments

Comments
 (0)