Cstyle的UEFI導讀:第20.0篇 IGD OpRegion interface && IGD OpRegion PROTOCOL,cstyleuefi
ACPI IGD OpRegion interface是用SCI來實現IGD driver,OS,BIOS之間溝通的橋樑,IGD OpRegion PROTOCOL是UEFI BIOS構建橋樑的脊樑。
Legacy的實現方式下與OS溝通的方式:
OpRegion Memory Layout:
Mailbox1當中提供的Public ACPI Methods可以從ACPI spec Appendix B Video Extensions裡面找到對應的每一個method,它為IGD graphics devices提供了一個標準的ACPI規定的溝通渠道。Mailbox2當值提供了IGD graphic driver如何通過SWSCI與BIOS溝通的連接埠資訊。Mailbox3,ASLE (ASL event)Support,This is the mailbox for communicating all driver features related information between the driver and the SBIOS
ASL Storage Register,用來儲存IGD OpRegion Header地址:
IGD與BIOS溝通(SCI):
SWSCI Register,IGD通過DMI向ICH發送SCI來觸發TCOSCI_STS bit in its GPE0 register來觸發真正的SCI event,然後通過BIOS裡面定義的ASL _Lxx method來處理,同時通過Mailbox2來傳遞訊息。主要是在觸發SCI之前預先填好mailbox裡面對應的參數,包括Function-Code等資訊 ,然後觸發SCI,在L_xx method當中會去讀取mailbox2當中的相應欄位,來做相應的處理,最後通過另外的一些欄位來返回處理的結果和狀態。(TCO:total cost of ownership.Ref intel EDS) Under the new scheme, rather than writing to the SWSMI bit (bit 0 of the SWSMI registerat offset 0xe0 in the PCI configuration space of the graphics device), the graphics driverwrites to the SWSCI register (bit 0, offset 0xe8 assuming SWSCI is configured for SCIoperation). This register serves two purposes:1) Support selection of SMI or SCI event source (SMISCISEL - bit15)2) SCI Event trigger (GSSCIE – bit 0)To generate a SW SCI event, software (system BIOS/graphics driver) should program bit15 (SMISCISEL) to 1. This is typically programmed once (assuming SMIs are nevertriggered).On a write transition of 0->1 of bit 0 of this register, the GMCH sends a single SCImessage down the DMI link to ICH. ICH will set the DMISCI bit in its TCO1_STS registerand TCOSCI_STS bit in its GPE0 register, upon receiving this message from DMI. Thecorresponding SCI event handler in BIOS is to be defined as an _Lxx method.Once written as 1, software must write a "0" to this bit to clear it.All other write transitions (1->0, 0->0, 1->1) will be ignored. Writes will likewise beignored if bit 15 is 0.To generate an SW SMI event, software should program bit 15 to 0 and trigger SMIthrough writes to SWSMI register (see SWSMI register for programming details).
Video BIOS Table(VBT) 這個就是我們常見的所謂的使用BMP工具來配置VBIOS/GOP的時候產生的一個bin檔案,最終會被包在BIOS rom裡面,在post過程當中由BIOS來讀取到記憶體裡面去,跟上面的各種Mailbox(一般由ASL code,IgdoPRn.Asl來建立)一起構成IGD OpRegion table,這部分一般是由 IGD OpRegion PROTOCOL &ACPI Protocl來完成,最終產生的table被video BIOS and device driver來讀取,擷取當前硬體的各種資訊:Flat Panel Timings, Generic Mode Timing, GPIO pins, Clock等。table可以在post當中根據使用者在setup裡面的設定值或者是platformPolicy來動態改變(table被儲存在EFI_GLOBAL_NVS_AREA->IgdOpRegionAddress:IgdOpRegion當中被ACPI driver來讀取),以此來實現使用者的不同定製(參考IgdOprom.c)。
IGD OpRegion PROTOCOL 這裡提到的protocol就是用來建立IgdOpRegionTable的DXE driver,它為VBIOS/GOP以及IGD driver提供相關的資訊。主要是從FV裡面讀取BMP配置產生的Bin file以及platform policy以及setup值來定製系統的各種參數,並輔助acpi driver 來建立acpi table(GNVS->ASLB)。
好了今天就先記錄到這裡,詳情可參考ACPI spc,Intel IgdOpRn spc,以及相關的spc。
轉載請註明出處Cstyle.z.zhou@outlook.com // http://blog.csdn.net/CStyle_0x007