Stephen Williams wrote:
Pierre Patino pierre-at-cruzio.com |suse-amd64| wrote:
Greetings
I'm working on a driver for a PCI card. During the installation, I read the BAR0 and BAR1 registers two different ways and I get two different results for BAR1.
pci_resource_start(0) = A pci_read_config_dword(0x10) = A
pci_resource_start(1) = B pci_read_config_dword(0x14) = B+8
Any ideas anyone?
This is not AMD64 specific...
Think for a minute about what you are doing. In one case you are getting from the kernel an interpretation of an address, and in the other case you are reading a bit-field that includes an address and a few other bits as well.
To cut to the chase, BAR1 contains more then just the base address. Look at your datasheet for a description of the "prefetchable" flag in the BARs.
Thanks for the info. I'm not an expert on the PCI standard and it shows. Now if I could only figure out why hwinfo gives me a different interrupt number that what's in address 0x3c in the configuration space.....