From patchwork Wed May 22 03:46:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liguang X-Patchwork-Id: 245499 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 125822C0079 for ; Wed, 22 May 2013 13:51:09 +1000 (EST) Received: from localhost ([::1]:47874 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf04x-0005BL-Bu for incoming@patchwork.ozlabs.org; Tue, 21 May 2013 23:51:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf03H-0003Qa-OB for qemu-devel@nongnu.org; Tue, 21 May 2013 23:49:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uf038-00018F-Ju for qemu-devel@nongnu.org; Tue, 21 May 2013 23:49:23 -0400 Received: from [222.73.24.84] (port=11978 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf038-00010i-8w for qemu-devel@nongnu.org; Tue, 21 May 2013 23:49:14 -0400 X-IronPort-AV: E=Sophos;i="4.87,718,1363104000"; d="scan'208";a="7330109" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 22 May 2013 11:46:03 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id r4M3mqdC015987; Wed, 22 May 2013 11:48:52 +0800 Received: from liguang.fnst.cn.fujitsu.com ([10.167.233.147]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2013052211473465-1419847 ; Wed, 22 May 2013 11:47:34 +0800 From: liguang To: qemu-devel@nongnu.org Date: Wed, 22 May 2013 11:46:37 +0800 Message-Id: <1369194397-608-5-git-send-email-lig.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1369194397-608-1-git-send-email-lig.fnst@cn.fujitsu.com> References: <1369194397-608-1-git-send-email-lig.fnst@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/05/22 11:47:34, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/05/22 11:47:34, Serialize complete at 2013/05/22 11:47:34 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 222.73.24.84 Cc: Anthony Liguori , Stefan Berger , "Michael S. Tsirkin" , Bruce Rogers , Joel Schopp , Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Andreas=20F=C3=A4rber?= , liguang , Isaku Yamahata Subject: [Qemu-devel] [PATCH 4/4][seabios] ec: add ASL for ACPI Embedded Controller X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: liguang --- src/acpi-dsdt.dsl | 1 + src/ec.dsl | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ src/q35-acpi-dsdt.dsl | 1 + 3 files changed, 53 insertions(+), 0 deletions(-) create mode 100644 src/ec.dsl diff --git a/src/acpi-dsdt.dsl b/src/acpi-dsdt.dsl index 158f6b4..4fa2b9a 100644 --- a/src/acpi-dsdt.dsl +++ b/src/acpi-dsdt.dsl @@ -112,6 +112,7 @@ DefinitionBlock ( } Name(FDEN, 1) } +#include "ec.dsl" } #include "acpi-dsdt-isa.dsl" diff --git a/src/ec.dsl b/src/ec.dsl new file mode 100644 index 0000000..c8be420 --- /dev/null +++ b/src/ec.dsl @@ -0,0 +1,51 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +Device (EC0) +{ + Name(_HID, EISAID ("PNP0C09")) + Name(_UID, 1) + + Method(_CRS, 0) + { + Name(BFFR, ResourceTemplate() + { + IO(Decode16, 0x62, 0x62, 0, 1) // ACPI DATA IN/OUT + IO(Decode16, 0x66, 0x66, 0, 1) // CMD/STS + }) + Return(BFFR) + } + + OperationRegion(ECFD, EmbeddedControl, 0, 0xFF) + Field(ECFD, ByteAcc, Lock, Preserve) + { Offset(1), + CPUS, 8, // 1, CPU status + CPUN, 8, // 2, CPU index + } + + Name(_GPE, 17) + + Method(_Q01) + { + If(LEqual(1, CPUS)) + { + Store(0, CPUS) + } + Else + { + Store(1, CPUS) + } + } +} diff --git a/src/q35-acpi-dsdt.dsl b/src/q35-acpi-dsdt.dsl index c031d83..056b4f8 100644 --- a/src/q35-acpi-dsdt.dsl +++ b/src/q35-acpi-dsdt.dsl @@ -167,6 +167,7 @@ DefinitionBlock ( FDEN, 1 } } +#include "ec.dsl" } #include "acpi-dsdt-isa.dsl"