Inter core i7处理器中(x86架构)驱动开发:关于APCI Hardware ID的描述
? ?最近在調(diào)試Inter平臺core i7,基于X86架構(gòu)的工控產(chǎn)品,在移植驅(qū)動的過程中,發(fā)現(xiàn)GPIO和I2C的device ID添加到pnp驅(qū)動框架后無法進(jìn)入probe函數(shù),后面找了下原因,因為pnp遵循的是ACPI規(guī)范,是由于如下Hardware ID字段是需要從BIOS中進(jìn)行描述的,而目前的驅(qū)動匹配不到對應(yīng)的字段,自然就不可能注冊成功了。
? ?PNP是什么東西?不是三極管的那個PNP啦,這個PNP表示的是:Plug-and-Play,譯文為即插即用。
? ?PnP的作用是自動配置底層計算機(jī)中的板卡和其他設(shè)備,然后告訴對應(yīng)設(shè)備都做了什么。PnP的任務(wù)是把物理設(shè)備和軟件設(shè)備驅(qū)動程序相配合,并操作設(shè)備,在每個設(shè)備和它的驅(qū)動程序之間建立通信信道。然后,PnP分配下列資源給設(shè)備和硬件:I/O地址、IRQ、DMA通道和內(nèi)存段。即插即用設(shè)備配置的控制權(quán)將從系統(tǒng)BIOS傳遞到系統(tǒng)
軟件,所以驅(qū)動中一定會有代碼進(jìn)行描述,到時可以跟一下這部分的代碼深入了解一下。由于PNP遵循ACPI的規(guī)范,那么既然是規(guī)范,那肯定要照著做了,規(guī)范怎么說,那就怎么做。
以下是關(guān)于ACPI Spec中對Hardware ID的描述,描述如下:
有關(guān)ASL語言可以參考ACPI SPEC手冊的ACPI Source Language (ASL)Reference章節(jié)。
如上,關(guān)于Hardware ID手冊中的意思大致如下:
? ? ? 該對象用于向OSPM提供設(shè)備的PNP ID或ACPI ID。?在描述平臺時,任何_HID對象的使用都是可選的。但是,_HID對象必須是用于描述將由OSPM枚舉的任何設(shè)備。 當(dāng)總線枚舉器不能檢測到設(shè)備ID時,OSPM只枚舉一個設(shè)備。當(dāng)總線枚舉器不能檢測到設(shè)備ID時。例如,ISA總線上的設(shè)備是由OSPM列舉。除了OSPM使用_ADR對象來描述總線枚舉器枚舉的設(shè)備。
? ? 其中OPSM是:OSPM(OS-directed Power Management) :OSPM 操作系統(tǒng)支持 ACPI 的一個部分,操作系統(tǒng) (OS)可以從操作系統(tǒng)下驅(qū)動程序的角度控制 ACPI 子模塊,同時支持 ACPI 包括 SCI 中斷,設(shè)備事件,系統(tǒng)事件模式,這些事件模式可以充分支持 Hot-plug 方式。
? ? 所以解決驅(qū)動匹配不上的問題,只要在BIOS中的ASL工程中對應(yīng)Hardware描述的部分添加一個字段描述,確保驅(qū)動中的字段和BIOS中的字段一致,這樣就可以匹配成功了。
OSPM?
操作系統(tǒng)支持
?ACPI?
的一個部分,操作系統(tǒng)
?
(
OS
)可以從操作系統(tǒng)下驅(qū)動程
序的角度控制
?
ACPI?
子模塊,
同時支持
?
ACPI?
包括
?SCI?
中斷,
設(shè)備事件,
系統(tǒng)事件模式,
這些事件模式可以充分支持
?
Hot-pl
ug?
方式。
以下是ACPI中關(guān)于PNP ID和ACPI ID的規(guī)范信息:
網(wǎng)址:http://www.uefi.org/PNP_ACPI_Registry
PNP ID AND ACPI ID REGISTRY
This is an industry registry of PNP ID and ACPI ID used in the _HID (Hardware ID), _CID (Compatibility ID) or _SUB (Subsystem ID) objects as described in the ACPI Specification for devices that do not have standard enumeration mechanism.? All these devices must contain a _HID (and possibly _CID and _SUB as well) in order to allow the operating system to uniquely recognize the device so that it can load the appropriate driver software. Each device manufacturer is responsible for assigning the PNP ID or ACPI ID for each of these products.
Both PNP ID and ACPI ID consist of two parts: a Vendor ID, followed by a product identifier. Each manufacturer of these devices must be assigned an industry-unique Vendor ID. Your company may already have a Vendor ID from previous work, such as EISA boards or other Plug and Play devices (PNPISA cards, PNP serial devices, PNP monitors, and so on). If you do not have a vendor ID, or do not know if you have one, the UEFI Forum can assign one for you as described on this page, or can verify an existing ID.
The format of Vendor IDs varies depending on the form of ID you choose:
- PNP ID:?PNP Vendor IDs consist of 3 characters, each character being an uppercase letter (A-Z).
- ACPI ID:?ACPI Vendor IDs consist of 4 characters, each character being either an uppercase letter (A-Z) or a numeral (0-9).
It is important to note that the use of PNP ID and ACPI ID are completely interchangeable for use with ACPI. The decision is strictly related to the availability of the characters you want. The PNP ID is legacy, intended for the Plug and Play Specifications that could not support 4 characters, but is still supported in ACPI. ACPI ID enables a much bigger namespace for the ecosystem.
Vendor IDs are subject to uniqueness requirements and some ID requests may not be available. For instance, Microsoft has reserved the PNP ID’s Vendor ID "PNP" to identify various devices that do not have an existing EISA ID, as well as defining compatibility devices. These IDs are defined in the?file. The ACPI Specification reserves the ACPI ID’s Vendor ID “ACPI” for use only with devices defined in that specification. Additionally, Vendor IDs consisting only of valid hexadecimal characters (0-9 and A-F) are reserved for assignment by the?PCI SIG?(these Vendor IDs must be registered with the PCI SIG but can still be used in ACPI). Finally, it may simply be that the character string you request has previously been assigned to another company.
Product Identifiers are always four-character hexadecimal numbers (0-9 and A-F). The Device Manufacturer is responsible for assigning this identifier to each individual product MODEL. Once an identifier is assigned to a product model, it must not be assigned to any other product model manufactured by the same company (that is, that uses the same Vendor ID).
The registry aims to ensure fair, orderly, consistent and conflict free naming of the Vendor IDs.? Originally implemented by Microsoft, this registry is used to help companies avoid unnecessary collisions in implementation.
TO REGISTER A NEW UNIQUE VENDOR ID FOR THE PNP ID OR ACPI ID
Send a request to the?ACPI Specification Workgroup Chairperson?specifying whether the Vendor ID is for PNP ID or ACPI ID. All requests are subject to Work Group approval based on the objectives noted above.
The list of currently approved Vendor IDs for?PNP ID?and?ACPI ID.? Please note, due to the size of the PNP ID List, your internet browser may take a minute to for the page to load. ??
總結(jié)
以上是生活随笔為你收集整理的Inter core i7处理器中(x86架构)驱动开发:关于APCI Hardware ID的描述的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Java通过坐标点进行拟合函数
- 下一篇: 什么是句柄什么是句柄对象