ACPI 5.0/ASLTS: Add tests for new resource descriptors.

Initial implementation of new tests; more test cases to be
added later.
This commit is contained in:
Robert Moore 2011-10-06 14:52:17 -07:00 committed by Lin Ming
parent ff775a2336
commit 9d537381e4
10 changed files with 645 additions and 0 deletions

View File

@ -1657,6 +1657,14 @@ Name(TFN0, Package() {
"I2MS_ns4.asl",
"I2MS_ns5.asl",
"I2MS_ns6.asl",
// ACPI 5.0
"fixeddma.asl", // 177
"gpioint.asl",
"gpioio.asl",
"i2cserialbus.asl",
"spiserialbus.asl",
"uartserialbus.asl",
})
/*

View File

@ -26,6 +26,8 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
External (_ERR, MethodObj)
/*
* Exceptional conditions support
*/

View File

@ -62,3 +62,12 @@ Include("../../../../runtime/collections/functional/descriptor/interrupt.asl")
Include("../../../../runtime/collections/functional/descriptor/register.asl")
Include("../../../../runtime/collections/functional/descriptor/resourcetemplate.asl")
Include("../../../../runtime/collections/functional/descriptor/concatenaterestemplate.asl")
/* ACPI 5.0 Resource Descriptors */
Include("../../../../runtime/collections/functional/descriptor/fixeddma.asl")
Include("../../../../runtime/collections/functional/descriptor/gpioint.asl")
Include("../../../../runtime/collections/functional/descriptor/gpioio.asl")
Include("../../../../runtime/collections/functional/descriptor/i2cserialbus.asl")
Include("../../../../runtime/collections/functional/descriptor/spiserialbus.asl")
Include("../../../../runtime/collections/functional/descriptor/uartserialbus.asl")

View File

@ -84,5 +84,18 @@ if (STTT("Resource Descriptor macros", TCLF, 4, W004)) {
RT1b()
SRMT("RT1c")
RT1c()
SRMT("RT20")
RT20()
SRMT("RT21")
RT21()
SRMT("RT22")
RT22()
SRMT("RT23")
RT23()
SRMT("RT24")
RT24()
SRMT("RT25")
RT25()
}
FTTT()

View File

@ -0,0 +1,99 @@
/*
* Some or all of this work - Copyright (c) 2006 - 2011, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Resource Descriptor macros
*
* FixedDma Resource Descriptor Macro
*/
Name (p450, Package() {
ResourceTemplate () {
FixedDma (0xf1f2, 0x1234, Width8Bit)
},
ResourceTemplate () {
FixedDma (0xe1e2, 0x000F, Width16Bit)
},
ResourceTemplate () {
FixedDma (0xd1d2, 0x00F0, Width32Bit)
},
ResourceTemplate () {
FixedDma (0xc1c2, 0x0F00, Width64Bit)
},
ResourceTemplate () {
FixedDma (0xb1b2, 0xF000, Width128Bit)
},
ResourceTemplate () {
FixedDma (0xa1a2, 0xFFFF, Width256Bit)
},
// Default DMA width is Width32Bit
ResourceTemplate () {
FixedDma (0x9192, 4567)
},
ResourceTemplate () {
FixedDma (0x8182, 4567, , TDMA)
},
})
Name (p451, Package() {
Buffer () {0x55, 0xF2, 0xF1, 0x34, 0x12, 0x00, 0x79, 0x00},
Buffer () {0x55, 0xE2, 0xE1, 0x0F, 0x00, 0x01, 0x79, 0x00},
Buffer () {0x55, 0xD2, 0xD1, 0xF0, 0x00, 0x02, 0x79, 0x00},
Buffer () {0x55, 0xC2, 0xC1, 0x00, 0x0F, 0x03, 0x79, 0x00},
Buffer () {0x55, 0xB2, 0xB1, 0x00, 0xF0, 0x04, 0x79, 0x00},
Buffer () {0x55, 0xA2, 0xA1, 0xFF, 0xFF, 0x05, 0x79, 0x00},
Buffer () {0x55, 0x92, 0x91, 0xD7, 0x11, 0x02, 0x79, 0x00},
Buffer () {0x55, 0x82, 0x81, 0xD7, 0x11, 0x02, 0x79, 0x00},
})
Method(RT20)
{
Name(ts, "RT20")
Store("TEST: RT20, Fixed DMA Resource Descriptor Macro", Debug)
m330(ts, 8, "p450", p450, p451)
// Check resource descriptor tag offsets
Store (
ResourceTemplate () {
FixedDma (0xe1e2, 0x000F, Width16Bit, DMA0)
FixedDma (0xd1d2, 0x00F0, Width32Bit, DMA1)
}, Local0)
m331(ts, 1, DMA0._DMA, 0x08, DMA1._DMA, 0x38, "_DMA")
m331(ts, 2, DMA0._TYP, 0x18, DMA1._TYP, 0x48, "_TYP")
m331(ts, 3, DMA0._SIZ, 0x28, DMA1._SIZ, 0x58, "_SIZ")
}

View File

@ -0,0 +1,102 @@
/*
* Some or all of this work - Copyright (c) 2006 - 2011, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Resource Descriptor macros
*
* GpioInt Resource Descriptor Macro
*/
Device (GPII) {}
Name (p452, Package() {
ResourceTemplate () {
GpioInt (Edge, ActiveHigh, Exclusive, PullUp, 0x1234,
"\\GPII", 0xBB, ResourceConsumer, GINX,
RawDataBuffer () {0x11, 0x22, 0x33, 0x44})
{0x00A3}
},
// Minimal invocation
ResourceTemplate () {
GpioInt (Edge, ActiveHigh, , PullUp, , "\\GPII", , , ,)
{0xF1F2}
},
})
Name (p453, Package() {
Buffer () {
0x8C, 0x20, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
0x00, 0x01, 0x00, 0x00, 0x34, 0x12, 0x17, 0x00,
0xBB, 0x19, 0x00, 0x1F, 0x00, 0x04, 0x00, 0xA3,
0x00, 0x5C, 0x47, 0x50, 0x49, 0x49, 0x00, 0x11,
0x22, 0x33, 0x44,
0x79, 0x00
},
Buffer () {
0x8C,0x1C,0x00,0x01,0x00,0x01,0x00,
0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x17,
0x00,0x00,0x19,0x00,0x1F,0x00,0x00,0x00,
0xF2,0xF1,0x5C,0x47,0x50,0x49,0x49,0x00,
0x79,0x00
}
})
Method(RT21)
{
Name(ts, "RT21")
Store("TEST: RT21, GpioInt Resource Descriptor Macro", Debug)
m330(ts, 2, "p452", p452, p453)
// Check resource descriptor tag offsets
Store (
ResourceTemplate () {
GpioInt (Edge, ActiveHigh, Exclusive, PullUp, 0x1234,
"\\GPII", 0xBB, ResourceConsumer, GIN0,
RawDataBuffer () {0x11, 0x22, 0x33, 0x44})
{0x00A3}
GpioInt (Edge, ActiveHigh, Exclusive, PullUp, 0x1234,
"\\GPII", 0xBB, ResourceConsumer, GIN1,
RawDataBuffer () {0x11, 0x22, 0x33, 0x44})
{0x00A3}
}, Local0)
m331(ts, 1, GIN0._MOD, 0x38, GIN1._MOD, 0x150, "_MOD")
m331(ts, 2, GIN0._POL, 0x39, GIN1._POL, 0x151, "_POL")
m331(ts, 3, GIN0._SHR, 0x3b, GIN1._SHR, 0x153, "_SHR")
m331(ts, 4, GIN0._PPI, 0x48, GIN1._PPI, 0x160, "_PPI")
m331(ts, 5, GIN0._DBT, 0x60, GIN1._DBT, 0x178, "_DBT")
m331(ts, 6, GIN0._PIN, 0xB8, GIN1._PIN, 0x1d0, "_PIN")
m331(ts, 7, GIN0._VEN, 0xF8, GIN1._VEN, 0x210, "_VEN")
}

View File

@ -0,0 +1,103 @@
/*
* Some or all of this work - Copyright (c) 2006 - 2011, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Resource Descriptor macros
*
* GpioIO Resource Descriptor Macro
*/
Device (GPIO) {}
Name (p454, Package() {
ResourceTemplate () {
GpioIo (Exclusive, PullUp, 0x0DEB, 0xAAAA, IoRestrictionOutputOnly,
"\\GPIO", 0xEE, ResourceConsumer, GIOX,
RawDataBuffer (0x04) {0xC1, 0xC2, 0xC3, 0xC4})
{0x11E1, 0x22E2, 0x33E3}
},
// Minimal invocation
ResourceTemplate () {
GpioIo (, PullUp, , , , "\\GPIO", , ,)
{0x11E1, 0x22E2, 0x33E3}
}
})
Name (p455, Package() {
Buffer () {
0x8C,0x24,0x00,0x01,
0x01,0x01,0x00,0x02,0x00,0x01,0xAA,0xAA,
0xEB,0x0D,0x17,0x00,0xEE,0x1D,0x00,0x23,
0x00,0x04,0x00,0xE1,0x11,0xE2,0x22,0xE3,
0x33,0x5C,0x47,0x50,0x49,0x4F,0x00,0xC1,
0xC2,0xC3,0xC4,0x79,0x00
},
Buffer () {
0x8C,0x20,0x00,0x01,0x01,
0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
0x00,0x17,0x00,0x00,0x1D,0x00,0x23,0x00,
0x00,0x00,0xE1,0x11,0xE2,0x22,0xE3,0x33,
0x5C,0x47,0x50,0x49,0x4F,0x00,0x79,0x00
}
})
Method(RT22)
{
Name(ts, "RT22")
Store("TEST: RT22, GpioIO Resource Descriptor Macro", Debug)
m330(ts, 2, "p454", p454, p455)
// Check resource descriptor tag offsets
Store (
ResourceTemplate () {
GpioIo (Exclusive, PullUp, 0x0DEB, 0xAAAA, IoRestrictionOutputOnly,
"\\GPIO", 0xEE, ResourceConsumer, GIO0,
RawDataBuffer (0x04) {0xC1, 0xC2, 0xC3, 0xC4})
{0x11E1, 0x22E2, 0x33E3}
GpioIo (Exclusive, PullUp, 0x0DEB, 0xAAAA, IoRestrictionOutputOnly,
"\\GPIO", 0xEE, ResourceConsumer, GIO1,
RawDataBuffer (0x04) {0xC1, 0xC2, 0xC3, 0xC4})
{0x11E1, 0x22E2, 0x33E3}
}, Local0)
m331(ts, 1, GIO0._SHR, 0x3b, GIO1._SHR, 0x173, "_SHR")
m331(ts, 2, GIO0._PPI, 0x48, GIO1._PPI, 0x180, "_PPI")
m331(ts, 3, GIO0._DBT, 0x60, GIO1._DBT, 0x198, "_DBT")
m331(ts, 4, GIO0._DRS, 0x50, GIO1._DRS, 0x188, "_DRS")
m331(ts, 5, GIO0._IOR, 0x38, GIO1._IOR, 0x170, "_IOR")
m331(ts, 6, GIO0._PIN, 0xB8, GIO1._PIN, 0x1f0, "_PIN")
m331(ts, 7, GIO0._VEN, 0x118, GIO1._VEN, 0x250, "_VEN")
}

View File

@ -0,0 +1,96 @@
/*
* Some or all of this work - Copyright (c) 2006 - 2011, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Resource Descriptor macros
*
* I2cSerialBus Resource Descriptor Macro
*/
Device (I2C) {}
Name (p456, Package() {
ResourceTemplate () {
I2cSerialBus (0x1234, DeviceInitiated, 0x88775544,
AddressingMode10Bit, "\\I2C",
0xEE, ResourceConsumer, I2Cx,
RawDataBuffer (4) {0xB1, 0xB2, 0xB3, 0xB4})
},
// Minimal invocation
ResourceTemplate () {
I2cSerialBus (0x1234, , 0x88775544, , "\\I2C", , , ,)
}
})
Name (p457, Package() {
Buffer () {
0x8E,0x18,0x00,0x01,0xEE,
0x01,0x03,0x01,0x00,0x01,0x0A,0x00,0x44,
0x55,0x77,0x88,0x34,0x12,0xB1,0xB2,0xB3,
0xB4,0x5C,0x49,0x32,0x43,0x00,0x79,0x00
},
Buffer () {
0x8E,0x14,
0x00,0x01,0x00,0x01,0x02,0x00,0x00,0x01,
0x06,0x00,0x44,0x55,0x77,0x88,0x34,0x12,
0x5C,0x49,0x32,0x43,0x00,0x79,0x00
}
})
Method(RT23)
{
Name(ts, "RT23")
Store("TEST: RT23, I2cSerialBus Resource Descriptor Macro", Debug)
m330(ts, 2, "p456", p456, p457)
// Check resource descriptor tag offsets
Store (
ResourceTemplate () {
I2cSerialBus (0x1234, DeviceInitiated, 0x88775544,
AddressingMode10Bit, "\\I2C",
0xEE, ResourceConsumer, I2C0,
RawDataBuffer (4) {0xB1, 0xB2, 0xB3, 0xB4})
I2cSerialBus (0x1234, DeviceInitiated, 0x88775544,
AddressingMode10Bit, "\\I2C",
0xEE, ResourceConsumer, I2C1,
RawDataBuffer (4) {0xB1, 0xB2, 0xB3, 0xB4})
}, Local0)
m331(ts, 1, I2C0._SLV, 0x30, I2C1._SLV, 0x108, "_SLV")
m331(ts, 2, I2C0._MOD, 0x38, I2C1._MOD, 0x110, "_MOD")
m331(ts, 3, I2C0._SPE, 0x60, I2C1._SPE, 0x138, "_SPE")
m331(ts, 4, I2C0._ADR, 0x80, I2C1._ADR, 0x158, "_ADR")
m331(ts, 5, I2C0._VEN, 0x90, I2C1._VEN, 0x168, "_VEN")
}

View File

@ -0,0 +1,106 @@
/*
* Some or all of this work - Copyright (c) 2006 - 2011, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Resource Descriptor macros
*
* SpiSerialBus Resource Descriptor Macro
*/
Device (SPI) {}
Name (p458, Package() {
ResourceTemplate () {
SpiSerialBus (0x6789, PolarityHigh, FourWireMode, 0x07,
DeviceInitiated, 0xAABBCCDD, ClockPolarityLow,
ClockPhaseSecond, "\\SPI",
0xEE, ResourceConsumer, SPIx,
RawDataBuffer (0x05) {0xF0, 0xF1, 0xF2, 0xF3, 0xF4})
},
// Minimal invocation
ResourceTemplate () {
SpiSerialBus (0x6789, , , 0x07, , 0xAABBCCDD, ClockPolarityLow,
ClockPhaseSecond, "\\SPI", , , ,)
}
})
Name (p459, Package() {
Buffer () {
0x8E,0x1C,0x00,0x01,0xEE,0x02,0x03,0x02,
0x00,0x01,0x0E,0x00,0xDD,0xCC,0xBB,0xAA,
0x07,0x01,0x00,0x89,0x67,0xF0,0xF1,0xF2,
0xF3,0xF4,0x5C,0x53,0x50,0x49,0x00,0x79,
0x00
},
Buffer () {
0x8E,0x17,0x00,0x01,0x00,0x02,0x02,0x00,
0x00,0x01,0x09,0x00,0xDD,0xCC,0xBB,0xAA,
0x07,0x01,0x00,0x89,0x67,0x5C,0x53,0x50,
0x49,0x00,0x79,0x00
}
})
Method(RT24)
{
Name(ts, "RT24")
Store("TEST: RT24, SpiSerialBus Resource Descriptor Macro", Debug)
m330(ts, 2, "p458", p458, p459)
// Check resource descriptor tag offsets
Store (
ResourceTemplate () {
SpiSerialBus (0x6789, PolarityHigh, FourWireMode, 0x07,
DeviceInitiated, 0xAABBCCDD, ClockPolarityLow,
ClockPhaseSecond, "\\SPI",
0xEE, ResourceConsumer, SPI0,
RawDataBuffer (0x05) {0xF0, 0xF1, 0xF2, 0xF3, 0xF4})
SpiSerialBus (0x6789, PolarityHigh, FourWireMode, 0x07,
DeviceInitiated, 0xAABBCCDD, ClockPolarityLow,
ClockPhaseSecond, "\\SPI",
0xEE, ResourceConsumer, SPI1,
RawDataBuffer (0x05) {0xF0, 0xF1, 0xF2, 0xF3, 0xF4})
}, Local0)
m331(ts, 1, SPI0._SLV, 0x30, SPI1._SLV, 0x128, "_SLV")
m331(ts, 2, SPI0._MOD, 0x38, SPI1._MOD, 0x130, "_MOD")
m331(ts, 3, SPI0._DPL, 0x39, SPI1._DPL, 0x131, "_DPL")
m331(ts, 4, SPI0._SPE, 0x60, SPI1._SPE, 0x158, "_SPE")
m331(ts, 5, SPI0._LEN, 0x80, SPI1._LEN, 0x178, "_LEN")
m331(ts, 6, SPI0._PHA, 0x88, SPI1._PHA, 0x180, "_PHA")
m331(ts, 7, SPI0._POL, 0x90, SPI1._POL, 0x188, "_POL")
m331(ts, 8, SPI0._ADR, 0x98, SPI1._ADR, 0x190, "_ADR")
m331(ts, 9, SPI0._VEN, 0xA8, SPI1._VEN, 0x1A0, "_VEN")
}

View File

@ -0,0 +1,107 @@
/*
* Some or all of this work - Copyright (c) 2006 - 2011, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Resource Descriptor macros
*
* UartSerialBus Resource Descriptor Macro
*/
Device (UART) {}
Name (p45A, Package() {
ResourceTemplate () {
UartSerialBus (0xFFEEDDCC, DataBitsEight, StopBitsTwo,
0xA5, BigEndian, ParityTypeEven, FlowControlNone,
0x3300, 0x4400, "\\UART",
0xEE, ResourceConsumer, UARx,
RawDataBuffer (0x07) {0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6})
},
// Minimal invocation
ResourceTemplate () {
UartSerialBus (0xFFEEDDCC, , , 0xA5, , , ,
0x3300, 0x4400, "\\UART", , , ,)
}
})
Name (p45B, Package() {
Buffer () {
0x8E,0x20,0x00,0x01,0xEE,0x03,0x02,
0xBC,0x00,0x01,0x11,0x00,0xCC,0xDD,0xEE,
0xFF,0x00,0x33,0x00,0x44,0x01,0xA5,0xF0,
0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0x5C,0x55,
0x41,0x52,0x54,0x00,0x79,0x00
},
Buffer () {
0x8E,0x19,0x00,0x01,0x00,0x03,0x02,
0x34,0x00,0x01,0x0A,0x00,0xCC,0xDD,0xEE,
0xFF,0x00,0x33,0x00,0x44,0x00,0xA5,0x5C,
0x55,0x41,0x52,0x54,0x00,0x79,0x00
}
})
Method(RT25)
{
Name(ts, "RT25")
Store("TEST: RT25, UartSerialBus Resource Descriptor Macro", Debug)
Store(__FILE__, Debug)
m330(ts, 2, "p45A", p45A, p45B)
// Check resource descriptor tag offsets
Store (
ResourceTemplate () {
UartSerialBus (0xFFEEDDCC, DataBitsEight, StopBitsTwo,
0xA5, BigEndian, ParityTypeEven, FlowControlNone,
0x3300, 0x4400, "\\UART",
0xEE, ResourceConsumer, UAR0,
RawDataBuffer (0x07) {0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6})
UartSerialBus (0xFFEEDDCC, DataBitsEight, StopBitsTwo,
0xA5, BigEndian, ParityTypeEven, FlowControlNone,
0x3300, 0x4400, "\\UART",
0xEE, ResourceConsumer, UAR1,
RawDataBuffer (0x07) {0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6})
}, Local0)
m331(ts, 1, UAR0._FLC, 0x38, UAR1._FLC, 0x150, "_FLC")
m331(ts, 2, UAR0._STB, 0x3A, UAR1._STB, 0x152, "_STB")
m331(ts, 3, UAR0._LEN, 0x3C, UAR1._LEN, 0x154, "_LEN")
m331(ts, 4, UAR0._END, 0x3F, UAR1._END, 0x157, "_END")
m331(ts, 5, UAR0._SPE, 0x60, UAR1._SPE, 0x178, "_SPE")
m331(ts, 6, UAR0._RXL, 0x80, UAR1._RXL, 0x198, "_RXL")
m331(ts, 7, UAR0._TXL, 0x90, UAR1._TXL, 0x1A8, "_TXL")
m331(ts, 8, UAR0._PAR, 0xA0, UAR1._PAR, 0x1B8, "_PAR")
m331(ts, 9, UAR0._LIN, 0xA8, UAR1._LIN, 0x1C0, "_LIN")
m331(ts, 10, UAR0._VEN, 0xB0, UAR1._VEN, 0x1C8, "_VEN")
}