PCI 버스에는 여러가지 장치가 물리는데 그 장치를 사용하려면, 각 장치가 어떤 것이고(identification), 어떻게 장치와 통신해야 하는지(protocol)를 알아야 한다. PCI 버스에서는 장치를 인식하고, 그 장치의 기본적인 정보를 얻어오기 위해 configuration space를 사용한다. 각 장치에 대해 할당된 configuration space를 통해 파악하게 되며 Device ID,Vendor ID,Status,Class code 등의 정보들이 해당 주소 공간에 저장되어 있다. 

PCI configuration space header

디바이스의 PCI configuration space 정보를 읽으면 디바이스와 통신을 하기 위한 기본적인 정보를 알 수 있다. PCI slot에 연결된 장치치에 대한 configuration space는 집적으로 읽을수 없다. 즉, OS가 부팅하면서 PCI에 연결된 모든 디바이스를 검색 해야 한다. 이때, PCI디바이스는 물리적으로 모든 디바이스에 bus, device, function 이라는 번호가 부여된다. 이 번호는 PCI slot에 따라 부여되는 것이기 때문에, 모든 bus, 모든 device, 모든 function을 스캔 해 보면, 컴퓨터에 달린 모든 디바이스 정보를 알 수 있다. 이 과정을 enumeration이라 한다

PCI enumeration 과정

계속 공부를 진행하며 bus, device, function의 차이에 대해 궁금해졌다. 우리가 사용하는 PC에서 PCI slot에 장치를 연결한다면 해당 장치는 모두 다른 bus번호로 연결되는 것인지 등 어떤 디바이스들이 같은 bus를 공유하는지에 대해 궁금했다.

PCI address

Configuration Address Space

  • 'Configuration Address Space’ has been defined to support PCI hardware configuration

  • 'Configuration Address Space’ provides access to 256 bytes of special configuration registers per PCI device.

  • PCI Express introduces 'Extended Configuration Space‘ which extends the Configuration Space to 4096 bytes per Function

  • ‘Configuration Read’ command and ‘Configuration Write’ command are used to transfer data between each ‘Configuration Address Space’ of PCI devices

Memory Address Space

  • ‘Memory address space’ is used for burst transactions

  • Two different address formats are used: 32-bit address format and 64-bit address format

  • ‘Memory Read’ command and ‘Memory Write’ command are used to transfer data in ‘Memory Address Space’

I/O Address Space

  • ‘I/O address space’ is for compatibility with the x86 architecture's I/O port address space. Future revisions of PCI Express specification may deprecate the use of ‘I/O Address Space’

  • ‘I/O Read’ command and ‘I/O Write’ command are used to transfer data in ‘I/O Address Space’.

Configuration Address Space

  • PCI devices have a set of registers referred to as 'Configuration Space‘

  • This configuration space is used for auto configuration of inserted PCI cards

  • Configuration Space registers are mapped to memory locations

  • PCI framework S/W should access the configuration space.

+ Recent posts