[PATCH] Fallback to PCI IRQs for TI bridges

Pavel Roskin proski at gnu.org
Tue May 13 03:09:47 BST 2003


On Tue, 13 May 2003, Tim Small wrote:

> OK, a couple of quick questions...  Why would you want to do these 
> things for a PCI<->Cardbus bridge, but not for a PCI <-> PCMCIA bridge?  
> In fact, I'm not very sure what the first line does at all, but I assume 
> the second two lines are needed to populate the device structure with 
> the codes that would be used by device drivers to search for the device 
> (and /proc/pci etc.).  I'm pretty much stabbing around in the dark at 
> the moment, so any explanation would be helpful ;-)..

The same is true for me.

> +			pci_read_bases(dev, 1, 0);

Note that the last argument is 0, not PCI_ROM_ADDRESS (0x30) as for normal 
devices.  I'm looking at Linux 2.5.69 now, file drivers/pci/probe.c, and 
my understanding of pci_read_bases() is that setting rom=0 skips reading 
part from that from ROM.

> +			pci_read_config_word(dev, PCI_CB_SUBSYSTEM_VENDOR_ID, &dev->subsystem_vendor);
> +			pci_read_config_word(dev, PCI_CB_SUBSYSTEM_ID, &dev->subsystem_device);

Pure PCMCIA bridges may not have these registers.  It may be better to
read PCI_SUBSYSTEM_VENDOR_ID and PCI_SUBSYSTEM_ID respectively, like it's
done for normal devices.  On the other hand, PCI_HEADER_TYPE_CARDBUS might
mean that you have those registers.

The output of "lspci -x -s 00:14" may be useful to see the dump of the 
configuration space for your bridges.  Perhaps you need to talk to PCI 
specialists.

> Hmm, where do the two IRQs (10, and 12) come from?

You have two different PCI functions, 00:14.0 and 00:14.1, and they have 
different IRQs.

> >I don't see corresponding code in drivers/pci/pci.c in Linux 2.5.69.  It
> >may happen that it will work for you without changes.

I missed it completely.  Essentially the same code is in 
pci_setup_device(), file drivers/pci/probe.c

I'm afraid I'm a wrong person to continue this discussion.  I have to 
choose what I'm working on.  Otherwise I spend too much time and make too 
many errors.

-- 
Regards,
Pavel Roskin





More information about the linux-pcmcia mailing list