LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Why PCI device had separate configuration space and memory/IO mapped space? (https://www.linuxquestions.org/questions/linux-hardware-18/why-pci-device-had-separate-configuration-space-and-memory-io-mapped-space-4175455626/)

haribabu1836 03-26-2013 03:57 AM

Why PCI device had separate configuration space and memory/IO mapped space?
 
Hi,

I had worked on pci driver but still don't know why PCI/PCIe devices have separate pci configuration space and memory/IO mapped address space?
Why can't this can be a single device address space?
Is there any hardware limitations in PCI cause different address space?
Please let me know.

Thank you.

Wim Sturkenboom 04-03-2013 08:09 AM

Disclaimer: I know about zero about PCI ;) But as I see it

You actually can't have the configuration space in one of the other spaces. The memory / IO space does not have a base address at the moment that the system boots up so can't be accessed. Therefore you also can't access the configuration space to do whatever has to be done (read IDs, set base address) if you have a single device address space that includes the configuration space. Also, at boot time it's unknow if the device will use IO mapped IO or memory mapped IO; so in which space should it be placed?

Also note that, although the configuration space is implemented on the PCI card, it's actually addressed based on slot. E.g. the addresses for the configuration space for a card in slot 1 is baseaddress + 0..255, for a card in slot 2 is baseaddress + 256..511 etc. I think (but I'm not sure) it works slightly different from this, but it gives the basic idea.

The reading that I did:
http://en.wikipedia.org/wiki/Conventional_PCI
http://en.wikipedia.org/wiki/PCI_configuration_space

Note: one can think of other implementations where the addresses of a card in slot N depend on the amount of space required by the card in slot N-1.

Hope this helps a little.


All times are GMT -5. The time now is 04:59 AM.