On 07/11/2012 03:25 PM, Rafał Miłecki wrote:
> 2012/7/11 Rafał Miłecki <[email protected]>:
>> My main bcma bus has 2 PCIe slots with 2 802.11 cards. The problem is
>> that only one card can be registered at the time. Function responsible
>> for registering PCI controller is:
>> void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc)
>>
>> The problem is that bcma uses the same IO resource for both controllers:
>> pc_host->io_resource.name = "BCMA PCIcore external I/O",
>> pc_host->io_resource.start = 0x100;
>> pc_host->io_resource.end = 0x7FF;
>> pc_host->io_resource.flags = IORESOURCE_IO | IORESOURCE_PCI_FIXED;
>>
>> My root io_resource is 0x0000 to 0xFFFF but kernel doesn't allow to
>> register two controllers with overlapping IO resource (0x100 to
>> 0x7FF). When bcma calls register_pci_controller, it fails at:
>> if (request_resource(&ioport_resource, hose->io_resource) < 0)
>> for the second controller.

I haven't thought about this problem when having two PCIe controllers.

>> Any idea how to find out, what IO resource we should set for second 
>> controller?
> 
> I've hacked bcma to set (some random "start", just over 0x7FF):
> pc_host->io_resource.start = 0x850;
> pc_host->io_resource.end = 0xF4F;
> for second PCIe controller. Card connected to that controller was
> successfully detected and initialized.

I do not know if that is a valid way to got, I do not have much
knowledge about PCI and was happy that this code worked with my device.

> Hauke: how did you find out that
> pc_host->io_resource.start = 0x100;
This is from "static u32 pci_iobase = 0x100;" in
src-rt-6.x/linux/linux-2.6/arch/mips/brcm-boards/bcm947xx/pcibios.c from
the Broadcom SDK. When looking into that file be aware that the pci bus
number 0 is the main sb/ai bus in that code.
> pc_host->io_resource.end = 0x7FF;
I do not know where I got the size from any more.
> ?
> 


_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to