Eran Mitrani has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/71645 )
Change subject: src/drivers/spi: add HID over SPI ACPI driver - WIP ......................................................................
src/drivers/spi: add HID over SPI ACPI driver - WIP
Add driver to support ELAN touchscreen using SPI
Signed-off-by: Eran Mitrani mitrani@google.com Change-Id: Ided6c20da7e5489b9fa32c622f1424e3aba14dd3 --- A src/drivers/spi/hid/elan/elan7b18uh.asl 1 file changed, 114 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/71645/1
diff --git a/src/drivers/spi/hid/elan/elan7b18uh.asl b/src/drivers/spi/hid/elan/elan7b18uh.asl new file mode 100644 index 0000000..d91f7c3 --- /dev/null +++ b/src/drivers/spi/hid/elan/elan7b18uh.asl @@ -0,0 +1,102 @@ +// ELAN7B18UH - HID over SPI +// - see "HID Over SPI Protocol Specification" section 5.2 - ACPI enum +// https://www.microsoft.com/en-us/download/details.aspx?id=103325 + +// FIXME - WIP - most fields need to be updated based on ENAN spec +Scope (_SB) { + Device(TCSC) { + Name (_HID, "ELAN7B18UH”) // FIXME VendorID + DeviceID - <VVVVdddd> + Name (_CID, "PNP0C51") // Compatible ID - PNP0C50 or PNP0C51 ? + Name (_SUB, "???") // SubVendorID + SubSystemID - <VVVVssss> + Name (_HRV, 0x0000) // Hardware Revision Number - 2 bytes + + Name (_CRS, ResourceTemplate () { + SpiSerialBusV2 ( + 0, // DeviceSelection + PolarityLow, // DeviceSelectionPolarity + FourWireMode, // WireMode + 8, // DataBitLength + ControllerInitiated, // SlaveMode + 1000000, // ConnectionSpeed (1MHz) + ClockPolarityLow, // ClockPolarity + ClockPhaseFirst, // ClockPhase + "\_SB.PCI0.SPI0", // ResourceSource + 0, // ResourceSourceIndex + ResourceConsumer, // ResourceUsage + ) + GpioInt ( + Level, // InterruptType + ActiveLow, // InterruptLevel + Exclusive, // ShareType + PullUp, // PinConfig + 0x0000, // DeBounceTime + "\_SB.GPO0", // ResourceSource + 0x00, // ResourceSourceIndex + ResourceConsumer, // ResourceUsage + ) + { + 00 // Which INT#? + } + } + // _DSM - Device-Specific Method + // + // Arg0: UUID Unique function identifier + // Arg1: Integer Revision ID – Will be 3 for HidSpi V1 + // Arg2: Integer Function Index (0 = Return Supported Functions) + // Arg3: Package Parameters + // + Function(_DSM,{BuffObj, IntObj},{BuffObj, IntObj, IntObj, PkgObj}){ + // HIDSPI UUID + If(LEqual(Arg0,ToUUID("6E2AC436-0FCF-41AF-A265-B32A220DCFAB"))) { + + // Switch on the function index + switch(Arg2) { + case(0) { + // Switch on the revision level + switch(ToInteger(Arg1)) { + case (3) { + // HidSpi v1 : Functions 0-6 inclusive are supported (0b01111111) + Return(Buffer(One) { 0x7F }) + } + default { + // Unsupported revision + Return(Buffer(One) { 0x00 }) + } + } + } + case(1) { + // Input Report Header address + Return (0x1000) + } + case(2) { + // Input Report Body address + Return (0x1004) + } + case(3) { + // Output Report Header address + Return (0x2000) + } + case(4) { + // Read opcode + Return (Buffer(1) {0x0B}) + } + case(5) { + // Write opcode + Return (Buffer(1) {0x02}) + } + case(6) { + // Flags + Return (0x0000) + } + default { + // Unsupported function index + } + } + } + else { + // No functions are supported for this UUID. + return (Buffer() {0}) + } + } + Function(_RST) {} // Placeholder for function-level device reset +}