ACPI-设备配置(device configuration)

17 篇文章 1 订阅
3 篇文章 0 订阅

        主要讲讲OSPM用来配置设备的对象(objects),一般有三种对象:

1. 设备识别对象,将平台设备与PnP ID 关联

2. 设备配置对象,用来声明配置硬件资源和特性

3. 设备插入和移除对象,来提供动态插入或者移除设备的机制

一.设备识别对象

ObjectDescription
_ADRObject that evaluates to a device’s address on its parent bus.
_CIDObject that evaluates to a device’s Plug and Play-compatible ID list.
_CLSObject that evaluates to a package of coded device-class information.
_DDNObject that associates a logical software name (for example, COM1) with a device.
_HIDObject that evaluates to a device’s Plug and Play hardware ID.
_HRVObject that evaluates to an integer hardware revision number.
_MLSObject that provides a human readable description of a device in multiple languages.
_PLDObject that provides physical location description information.
_SUBObject that evaluates to a device’s Plug and Play subsystem ID.
_SUNObject that evaluates to the slot-unique ID number for a slot.
_STRObject that contains a Unicode identifier for a device. Can also be used for thermal zones.
_UIDObject that specifies a device’s unique persistent ID, or a control method that generates it.

 常用的一般如下,他们一般用name来执行,有的也可以用method实现

_ADR: 赋值设备在其父线上的地址。     Name(_ADR,0x00140000)

_DDN: 关联一个设备的逻辑软件名称,如串口的COM1/COM2。   Name (_DDN, "COM1")

_HID: 赋值一个设备的PnP ID。    Name(_HID, EISAID("PNP0501"))

_PLD: 提供物理位置的描述信息,如USB port。  Method(_PLD) { Return (GPLD(0,11)) } 

_UID: 陈述一个设备的唯一ID,或者用method产生一个唯一ID。Name(_UID, 1)

_CLS: 赋值设备PCI定义的class、subclass code 

                Name(_CLS, Package (3)
                {
                        0x01, // Base Class (01h == Mass Storage)
                        0x06, // Sub-Class (06h == SATA)
                        0x01, // Programming Interface (01h == AHCI)

                })

二. 设备配置对象

    在ACPI 枚举设备时,OSPM可以用设备配置对象来配置硬件资源,它们可以用name提供当下或者可能的资源需求信息,也能用method来配置信息

_CCACache Coherency Attribute – specifies whether a device and its descendants support hardware
managed cache coherency.
_CDMObject that specifies a clock domain for a processor.
_CRSObject that specifies a device’s current resource settings, or a control method that generates such
an object.
_DISControl method that disables a device.
_DMAObject that specifies a device’s current resources for DMA transactions.
_DSDObject that evaluates to device specific information
_FIXObject used to provide correlation between the fixed-hardware register blocks defined in the
FADT and the devices that implement these fixed-hardware registers.
_GSBObject that provides the Global System Interrupt Base for a hot-plugged I/O APIC device.
_HMAObject that provides updated HMAT structures.
_HPPObject that specifies the cache-line size, latency timer, SERR enable, and PERR enable values to
be used when configuring a PCI device inserted into a hot-plug slot or initial configuration of a
PCI device at system boot.
_HPXObject that provides device parameters when configuring a PCI device inserted into a hot-plug
slot or initial configuration of a PCI device at system boot. Supersedes _HPP.
_MATObject that evaluates to a buffer of Interrupt Controller Structures.
_OSCAn object OSPM evaluates to convey specific software support / capabilities to the platform al
lowing the platform to configure itself appropriately.
_PRSAn object that specifies a device’s possible resource settings, or a control method that generates
such an object.
_PRTObject that specifies the PCI interrupt routing table.
_PXMObject that specifies a proximity domain for a device.
_SLIObject that provides updated distance information for a system locality.
_SRSControl method that sets a device’s setting

        常用的几个如下:

_CRS: 描述当下分配到设备的系统资源,其数据为一串字节流,格式要满足Resource Data Types for ACPI (参见ACPI 6.4)

Name(_CRS, ResourceTemplate()
    {
        IO(Decode16, 0x20, 0x20, 0, 0x2)
        IO(Decode16, 0xA0, 0xA0, 0, 0x2)                                                                                                    IRQ(Edge, ActiveHigh, Exclusive ){2}
        IRQNoFlags(){2}
    })

或者用method 方法:

Method(_CRS,0, Serialized)
  {
    Name(BFFR, ResourceTemplate()
    {
      IO(Decode16,0x62,0x62,0,1)  // DIN/DOUT
      IO(Decode16,0x66,0x66,0,1)  // CMD/STS
    })

    Return(BFFR)
  }

_DIS: 采用method禁用设备,当禁用后,设备不会decode任何硬件资源,有时候系统里右键点击设备,可以看到禁用设备就是调用此对象;同时,method_STA bit1 需要清掉。

Method(_DIS, 0) {^^SIO1.DCNT(0, 0)}   

_PRS: 用一连串字节流来描述设备可能用到的资源,其格式同_CRS                                                Name(_PRS, ResourceTemplate(){
        StartDependentFn(0, 0) { 
            IRQNoFlags(){12} 
        }
        EndDependentFn()
    })

_SRS:采用method 来修改设备资源

三. 设备插入和移除对象

ObjectDescription
_EDLObject that evaluates to a package of namespace references of device objects that depend on the
device containing _EDL.
_EJDObject that evaluates to the name of a device object on which a device depends. Whenever the
named device is ejected, the dependent device must receive an ejection notification.
_EJxControl method that ejects a device.
_LCKControl method that locks or unlocks a device.
_OSTControl method invoked by OSPM to convey processing status to the platform.
_RMVObject that indicates that the given device is removable.
_STAControl method that returns a device’s status.

        最常用的就是_STA,来返回设备状态:enabled, disabled, or removed,返回值定义如下:

• Bit [0] - Set if the device is present.
• Bit [1] - Set if the device is enabled and decoding its resources.
• Bit [2] - Set if the device should be shown in the UI.
• Bit [3] - Set if the device is functioning properly (cleared if device failed its diagnostics).
• Bit [4] - Set if the battery is present.
• Bits [31:5] - Reserved (must be cleared)
 


 

  • 22
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
The Advanced Configuration and Power Interface (ACPI) specification was developed to establish industry common interfaces enabling robust operating system (OS)-directed motherboard device configuration and power management of both devices and entire systems. ACPI is the key element in Operating System-directed configuration and Power Management (OSPM). ACPI evolved the existing pre-ACPI collection of power management BIOS code, Advanced Power Management (APM) application programming interfaces (APIs, PNPBIOS APIs, Multiprocessor Specification (MPS) tables and so on into a well-defined power management and configuration interface specification. ACPI provides the means for an orderly transition from existing (legacy) hardware to ACPI hardware, and it allows for both ACPI and legacy mechanisms to exist in a single machine and to be used as needed. Further, system architectures being built at the time of the original ACPI specification’s inception, stretched the limits of historical “Plug and Play” interfaces. ACPI evolved existing motherboard configuration interfaces to support advanced architectures in a more robust, and potentially more efficient manner. The interfaces and OSPM concepts defined within this specification are suitable to all classes of computers including (but not limited to) desktop, mobile, workstation, and server machines. From a power management perspective, OSPM/ACPI promotes the concept that systems should conserve energy by transitioning unused devices into lower power states including placing the entire system in a low-power state (sleeping state) when possible. This document describes ACPI hardware interfaces, ACPI software interfaces and ACPI data structures that, when implemented, enable support for robust OS-directed configuration and power management (OSPM)

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值