@@ -445,6 +445,49 @@ DefinitionBlock (
Return (BUF0)
}
}
+
+ /* qemu firmware config interface */
+ Device (FWC)
+ {
+ Name (_HID, EisaId ("FWC0510"))
+ OperationRegion (FWCD, SystemIO, 0x0510, 0x02)
+ Field (FWCD, WordAcc, NoLock, Preserve)
+ {
+ FWCS, 16, /* select */
+ }
+ Field (FWCD, ByteAcc, NoLock, Preserve)
+ {
+ FWCW, 8, /* write */
+ FWCR, 8, /* read */
+ }
+ Name (_CRS, ResourceTemplate ()
+ {
+ IO (Decode16, 0x0510, 0x0510, 0x01, 0x02)
+ })
+
+ /* fetch fw_cfg entry, args: entry nr, length */
+ Method (FWCB, 2) {
+ Name (RETB, Buffer(Arg1) { })
+ Store (Arg0, FWCS)
+ Store (Zero, Local0)
+ While (LLess(Local0, Arg1)) {
+ Store (FWCR, Index(RETB, Local0))
+ Increment(Local0)
+ }
+ Return (RETB)
+ }
+
+ /* fetch signature & verify */
+ Method (_STA, 0, NotSerialized)
+ {
+ Store(ToString(FWCB(0, 4)), Local0)
+ If (LEqual (Local0, "QEMU")) {
+ Return (0x0f)
+ } Else {
+ Return (0x00)
+ }
+ }
+ }
}
Add a acpi driver for the qemu firmware config interface. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> --- src/acpi-dsdt.dsl | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 deletions(-)