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.

<strong>Advanced</strong> <strong>Configuration</strong> <strong>and</strong> <strong>Power</strong> <strong>Interface</strong> <strong>Specification</strong><br />

// Process Call with input value ‘0x5416’ to the device using comm<strong>and</strong> value 1<br />

Store(0x5416, DATA)<br />

// Save 0x5416 into the data buffer<br />

Store(Store(BUFF, FLD1), BUFF) // Invoke a Process Call transaction<br />

If(LEqual(STAT, 0x00))<br />

// Successful?<br />

{<br />

// DATA = Word returned from FLD1…<br />

}<br />

In this example, three field elements (FLD0, FLD1, <strong>and</strong> FLD2) are defined to represent the virtual<br />

registers for comm<strong>and</strong> values 0, 1, <strong>and</strong> 2. Access to any of the field elements will cause a<br />

GenericSerialBus transaction to occur to the device. Reading or writing FLD1 results in a Process<br />

Call with a comm<strong>and</strong> value of 1. Notice that unlike other protocols, Process Call involves both a<br />

write <strong>and</strong> read operation in a single atomic transaction. This means that the Data element of the<br />

GenericSerialBus data buffer is set with an input value before the transaction is invoked, <strong>and</strong> holds<br />

the output value following the successful completion of the transaction.<br />

5.5.2.4.5.3.7 Block Process Call (AttribBlockProcessCall)<br />

The GenericSerialBus Block Write-Read Block Process Call protocol (AttribBlockProcessCall)<br />

transfers a block of data bi-directionally (performs a Write Block followed by a Read Block as an<br />

atomic transaction). This protocol uses a comm<strong>and</strong> value to reference up to 256 block-sized virtual<br />

registers.<br />

The following ASL code illustrates how a device supporting the Process Call protocol should be<br />

accessed:<br />

OperationRegion(TOP1, GenericSerialBus, 0x00, 0x100) // GenericSerialBus device at slave address<br />

0x42<br />

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

{<br />

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

AccessAs(BufferAcc, AttribBlockProcessCall) // Use the Block Process Call protocol<br />

FLD0, 8, // Virtual register representing a comm<strong>and</strong> value of 0<br />

FLD1, 8 // Virtual register representing a comm<strong>and</strong> value of 1<br />

}<br />

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

Name(BUFF, Buffer(35)())<br />

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

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

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

CreateByteField(BUFF, 0x01, LEN)<br />

// LEN = Length (Byte)<br />

CreateField(BUFF, 0x10, 256, DATA)<br />

// Data (Block)<br />

// Process Call with input value "ACPI" to the device using comm<strong>and</strong> value 1<br />

Store("ACPI", DATA)<br />

// Fill in outgoing data<br />

Store(8, LEN)<br />

// Length of the valid data<br />

Store(Store(BUFF, FLD1), BUFF)<br />

// Execute the PC<br />

if (LEqual(STAT, 0x00))<br />

// Test the status<br />

{<br />

// BUFF now contains information returned from PC<br />

// LEN now equals size of data returned<br />

}<br />

5.5.2.4.5.3.8 Read/Write N Bytes (AttribBytes)<br />

The GenericSerialBus Read/Write N Bytes protocol (AttribBytes) transfers variable-sized data. The<br />

actual number of bytes to read or write is specified as part of the AccessAs attribute.<br />

238 April, 2015 Version 6.0

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

Saved successfully!

Ooh no, something went wrong!