From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQDld-0007uj-L5 for qemu-devel@nongnu.org; Fri, 04 May 2012 04:21:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SQDla-00028g-Oe for qemu-devel@nongnu.org; Fri, 04 May 2012 04:21:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQDla-00027h-HJ for qemu-devel@nongnu.org; Fri, 04 May 2012 04:21:30 -0400 From: Gerd Hoffmann Date: Fri, 4 May 2012 10:21:24 +0200 Message-Id: <1336119687-6295-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1336119687-6295-1-git-send-email-kraxel@redhat.com> References: <1336119687-6295-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [seabios patch 2/5] acpi: add qemu fwcfg driver List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: seabios@seabios.org Cc: qemu-devel@nongnu.org, Gerd Hoffmann Add a acpi driver for the qemu firmware config interface. Signed-off-by: Gerd Hoffmann --- src/acpi-dsdt.dsl | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/src/acpi-dsdt.dsl b/src/acpi-dsdt.dsl index 4a18617..d71b783 100644 --- a/src/acpi-dsdt.dsl +++ b/src/acpi-dsdt.dsl @@ -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) + } + } + } } -- 1.7.1