PCI Driver Development

Developing a driver for a PCI motion control board based on a PLX9052 the following problem occured:
Invoking /usr/sbin/pci -v lists the correct device and vendor ID but no base addresses are shown.
Using pci_attach_device() from the API reads back only zeros for the base addresses.

How to find out the base addresses? Is there a problem with the board or the pci-bios?

What version of QNX? Post the output of “pci -v”
I seem to remember some of the Class Codes are not supported. eg: QNX6 does not support devices with an class code 068000h (bridge device). If your pci-device belongs to the class bridge-device, you have to update the eeprom of your card with a sensefull class-code.

There are two types of address IO and memory, have you check for both type?

The PLX chips need to be configured from an on-card rom before any pci transactions are useful. Here’s the brief, plxtech.com/products/9052/briefs/9052.pdf

How complete is the board? Is it a prototype? Does it work on another pc?

Make sure you pass PCI_INIT_ALL to the pci_attach_device() call. I think I already answered this on osnews.com. ;)

Kinda late reply, but I think this problem will bite again and again, so here it goes…

The problem is actually with PCI server. It has a bug that results in incomplete initialization of non-transparent PCI-PCI bridges. Half of fields in the pci_dev_info structure will be left blank (notably, IRQ and memory ranges).

There is a PR filed for that, but last time I asked QNX said they have no plans to fix it even in 6.3. People with PE have option of fixing it themselves (source is included). It is a one line fix…

igor - I don’t think so. I have used these PLX chips myself and they aren’t bridges, just generic PCI devices. The PCI_INIT_ALL will provide the I/O addresses required.

Oh well, 9052 apparently is a ‘target’ chip. I had 9054 (‘master’) in mind. Don’t know what class 9052 belongs too. What I said applies to anything that has class BRIDGE and subclass OTHER.