27.10.2015 Views

Advanced Configuration and Power Interface Specification

ACPI_6.0

ACPI_6.0

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ACPI Software Programming Model<br />

OperationRegion (<br />

RegionName,<br />

RegionSpace,<br />

Offset,<br />

Length<br />

)<br />

Where:<br />

// NameString<br />

// RegionSpaceKeyword<br />

// TermArg=>Integer<br />

// TermArg=>Integer<br />

• RegionName specifies a name for this region (for example, TOP1).<br />

• RegionSpace must be set to GenericSerialBus (operation region type value 0x09).<br />

• Offset specifies the initial comm<strong>and</strong> value offset for the target device. For example, the value<br />

0x00 refers to a comm<strong>and</strong> value offset of zero (0). Raw protocols ignore this value.<br />

• Length is set to the 0x100 (256), representing the maximum number of possible comm<strong>and</strong><br />

values.<br />

Note: The Operation Region must be declared within the scope of the Serial Bus controller device.<br />

The following ASL code shows the use of the OperationRegion, Field, <strong>and</strong> Offset terms as they<br />

apply to SPB space.<br />

Scope(\_SB.I2C){<br />

OperationRegion(TOP1, GenericSerialBus, 0x00, 0x100) // GenericSerialBus device at comm<strong>and</strong><br />

// offset 0x00<br />

Name (SDB0, ResourceTemplate() {<br />

I2CSerialBus(0x4a,,100000,,”\_SB.I2C”,,,,RawDataBuffer(){1,2,3,4,5,6})<br />

})<br />

Field(TOP1, BufferAcc, NoLock, Preserve)<br />

{<br />

Connection(SDB0) // Use the Resource Descriptor defined above<br />

AccessAs(BufferAcc, AttribWord)<br />

// Use the GenericSerialBus Read/Write Word protocol<br />

FLD0, 8, // Virtual register at comm<strong>and</strong> value 0.<br />

FLD1, 8 // Virtual register at comm<strong>and</strong> value 1.<br />

}<br />

Field(TOP1, BufferAcc, NoLock, Preserve)<br />

{<br />

Connection(I2CSerialBus(0x5a,,100000,,”\_SB.I2C”,,,,RawDataBuffer(){1,6}))<br />

AccessAs(BufferAcc, AttribBytes (16))<br />

FLD2, 8 // Virtual register at comm<strong>and</strong> value 0.<br />

}<br />

// Create the GenericSerialBus data buffer<br />

Name(BUFF, Buffer(34){})<br />

CreateByteField(BUFF, 0x00, STAT)<br />

CreateWordField(BUFF, 0x02, DATA)<br />

}<br />

// Create GenericSerialBus data buffer as BUFF<br />

// STAT = Status (Byte)<br />

// DATA = Data (Word)<br />

The Operation Region in this example is defined within the scope of the target controller device,<br />

I2C.<br />

GenericSerialBus regions are only accessible via the Field term (see Section 19.6.46 “Field (Declare<br />

Field Objects)) GenericSerialBus protocols are assigned to field elements using the AccessAs term<br />

(see Section 19.3.4 “ASL Macros”) within the field definition.<br />

Version 6.0 229

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!