在UEFI-aware OS上遇到的SMBus Controller問題

最近遇到在UEFI-aware的Windows上,Wellsburg的SMBus Controller I/O Space沒被enable。這可以透過取得PCI Configuration Space的0x04,確認bit 0(IO space)與bit 1(Memory space)是否為0得知。然而卻一直無法得知這算是BIOS還是OS Driver問題。

目前知道並非所有的linux diver都會去enable這個register,而Wellsburg使用到的i2c-i801則會去enable。可以參考i2c-i801.c的i801_probe,裡面會使用到pcim_enable_device。接著可以trace到以下的code:

1388  * pci_enable_device - Initialize device before it's used by a driver.
1389  * @dev: PCI device to be initialized
1390  *
1391  *  Initialize device before it's used by a driver. Ask low-level code
1392  *  to enable I/O and memory. Wake up the device if it was suspended.
1393  *  Beware, this function can fail.
1394  *
1395  *  Note we don't actually enable the device many times if we call
1396  *  this function repeatedly (we just increment the count).
1397  */
1398 int pci_enable_device(struct pci_dev *dev)
1399 {
1400         return pci_enable_device_flags(dev, IORESOURCE_MEM | IORESOURCE_IO);
1401 }

至於到底是BIOS要去enable,還是OS driver要去enable,等我找到資料再補充。