差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

cpp:linux_kernel:smbus_controller [2016/01/21 21:53]
tony [Problem]
cpp:linux_kernel:smbus_controller [2023/06/25 09:48]
行 1: 行 1:
-{{tag>​linux}} +
-====== 在UEFI-aware OS上遇到的SMBus Controller問題 ====== +
-===== Problem ===== +
-最近遇到在UEFI-aware的Windows上,SMBus Controller沒被enable的情況,這是發生在Wellsburg的PCH chip。可以透過取得SMBus Controller的PCI Configuration的0x04,確認bit 0(IO space)與bit 1(Memory space)是否為0得知。然而卻一直無法得知這算是BIOS還是OS Driver該去enable的。\\ +
-\\ +
-目前知道並非所有的linux diver都會去enable這個register,而Wellsburg使用到的i2c-i801則會去enable。可以參考[[http://​lxr.free-electrons.com/​source/​drivers/​i2c/​busses/​i2c-i801.c|i2c-i801.c]]的i801_probe,裡面會使用到[[http://​lxr.free-electrons.com/​source/​drivers/​pci/​pci.c#​L1467|pcim_enable_device]]。接著可以trace到以下的code:​ +
-<code cpp> +
-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 } +
-</​code>​ +
-至於到底是BIOS要去enable,還是OS driver要去enable,等我找到資料再補充。 +
-===== Reference ===== +
-  * [[http://​lxr.free-electrons.com/​source/​drivers/​i2c/​busses/​i2c-i801.c|i2c-i801.c]]+