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 />

OperationRegion(TOP1, GenericSerialBus, 0x00, 0x100)<br />

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

{<br />

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

AccessAs(BufferAcc, AttribRawBytes (4))<br />

TFK1, 8<br />

}<br />

// Create the GenericSerialBus data buffer<br />

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

// Create SerialBus buf as BUFF<br />

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

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

CreateWordField(BUFF, 0x02, DATW) // DATW = Data (Word - Bytes 2 & 3, or 16 bits)<br />

CreateField(BUFF, 16, 256, DBUF) // DBUF = Data (Bytes 2-34)<br />

CreateField(BUFF, 16, 32, DATD) // DATD = Data (DWord)<br />

Store(0x0B,DATW)<br />

//Store appropriate reference data for driver to interpret<br />

//Read from TFK1<br />

Store(TFK1, BUFF)<br />

If(LNotEqual(STAT, 0x00)) {<br />

Return(0)<br />

}<br />

//Write to TFK1<br />

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

If(LNotEqual(STAT, 0x00)) {<br />

Return(0)<br />

}<br />

Access to any field elements will cause a GenericSerialBus transaction to occur to the device of the<br />

length specified in the AccessAttributes.<br />

Raw accesses assume that the writer has knowledge of the bus that the access is made over <strong>and</strong> the<br />

device that is being accessed. The protocol may only ensure that the buffer is transmitted to the<br />

appropriate driver, but the driver must be able to interpret the buffer to communicate to a register.<br />

5.5.2.4.5.3.10 Raw Block Process Call (AttribRawProcessBytes)<br />

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

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

atomic transaction). The initial comm<strong>and</strong> value specified in the operation region definition is<br />

ignored by Raw accesses.<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, AttribRawProcessBytes) // Use the Raw Bytes Process Call protocol<br />

FLD0, 8<br />

}<br />

240 April, 2015 Version 6.0

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

Saved successfully!

Ooh no, something went wrong!