1================================================== 2QEMU and ACPI BIOS Generic Event Device interface 3================================================== 4 5The ACPI *Generic Event Device* (GED) is a HW reduced platform 6specific device introduced in ACPI v6.1 that handles all platform 7events, including the hotplug ones. GED is modelled as a device 8in the namespace with a _HID defined to be ACPI0013. This document 9describes the interface between QEMU and the ACPI BIOS. 10 11GED allows HW reduced platforms to handle interrupts in ACPI ASL 12statements. It follows a very similar approach to the _EVT method 13from GPIO events. All interrupts are listed in _CRS and the handler 14is written in _EVT method. However, the QEMU implementation uses a 15single interrupt for the GED device, relying on an IO memory region 16to communicate the type of device affected by the interrupt. This way, 17we can support up to 32 events with a unique interrupt. 18 19**Here is an example,** 20 21:: 22 23 Device (\_SB.GED) 24 { 25 Name (_HID, "ACPI0013") 26 Name (_UID, Zero) 27 Name (_CRS, ResourceTemplate () 28 { 29 Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclusive, ,, ) 30 { 31 0x00000029, 32 } 33 }) 34 OperationRegion (EREG, SystemMemory, 0x09080000, 0x04) 35 Field (EREG, DWordAcc, NoLock, WriteAsZeros) 36 { 37 ESEL, 32 38 } 39 Method (_EVT, 1, Serialized) 40 { 41 Local0 = ESEL // ESEL = IO memory region which specifies the 42 // device type. 43 If (((Local0 & One) == One)) 44 { 45 MethodEvent1() 46 } 47 If ((Local0 & 0x2) == 0x2) 48 { 49 MethodEvent2() 50 } 51 ... 52 } 53 } 54 55GED IO interface (4 byte access) 56-------------------------------- 57**read access:** 58 59:: 60 61 [0x0-0x3] Event selector bit field (32 bit) set by QEMU. 62 63 bits: 64 0: Memory hotplug event 65 1: System power down event 66 2: NVDIMM hotplug event 67 3-31: Reserved 68 69**write_access:** 70 71Nothing is expected to be written into GED IO memory 72