From patchwork Thu Apr 19 14:08:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasilis Liaskovitis X-Patchwork-Id: 153822 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 9AF92B7003 for ; Fri, 20 Apr 2012 01:49:02 +1000 (EST) Received: from localhost ([::1]:36114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKs4T-0001bZ-0w for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2012 10:10:53 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKs3h-0008CF-4A for qemu-devel@nongnu.org; Thu, 19 Apr 2012 10:10:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SKs3a-0005uN-Ay for qemu-devel@nongnu.org; Thu, 19 Apr 2012 10:10:04 -0400 Received: from mail-bk0-f45.google.com ([209.85.214.45]:48024) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKs3a-0005r3-3d for qemu-devel@nongnu.org; Thu, 19 Apr 2012 10:09:58 -0400 Received: by bkcji1 with SMTP id ji1so416421bkc.4 for ; Thu, 19 Apr 2012 07:09:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=6L/3uqVEUpjG54ethe6ayAzero0MnUDSLK54S68xyuE=; b=aWEtK/74GiB7Qc80JywP9Rg/X4oU83cbuyuZL+txRkGWbsryZBkRIq0+xYMOOpWhvo DPay3P4UvEEqKRVr4S0cWNvYtqATqv7P1veD1K5e4F0JuQAMqxp9NCBqmO+I1vXQFuJ8 7SUujJI2mhdmeVRa/byEXM3DzR2+RWwmTHARkKtUgjm+tEKguiR4Xyuy6MscbEjwVptP ydHMCcb9PJylt4w/7KWjZJuhlWANIrdbDhb00yNdhFgaQcN5GZIToNMP2cvlPfI0dZxX 6OYAA1kbdM8h+MSWHSvce0QLqkyaaue1EhnQbvLPpIq34e56GvnHKCmLTn+P1h5+y2Za xlqw== Received: by 10.204.153.3 with SMTP id i3mr711581bkw.45.1334844595933; Thu, 19 Apr 2012 07:09:55 -0700 (PDT) Received: from dhcp-192-168-178-175.ri.profitbricks.localdomain ([62.217.45.26]) by mx.google.com with ESMTPS id gu12sm4434954bkc.1.2012.04.19.07.09.53 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 Apr 2012 07:09:53 -0700 (PDT) From: Vasilis Liaskovitis To: qemu-devel@nongnu.org, kvm@vger.kernel.org, seabios@seabios.org Date: Thu, 19 Apr 2012 16:08:39 +0200 Message-Id: <1334844527-18869-2-git-send-email-vasilis.liaskovitis@profitbricks.com> X-Mailer: git-send-email 1.7.9 In-Reply-To: <1334844527-18869-1-git-send-email-vasilis.liaskovitis@profitbricks.com> References: <1334844527-18869-1-git-send-email-vasilis.liaskovitis@profitbricks.com> X-Gm-Message-State: ALoCoQnQQHZabG6STT28YKHCIvvgUndNgY3zls7tPFJ9tT4B0gKGHE0TCDmloKFg3i3bJxoBdoFg X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.214.45 Cc: Vasilis Liaskovitis , avi@redhat.com, gleb@redhat.com Subject: [Qemu-devel] [RFC PATCH 1/9][SeaBIOS] Add SSDT memory device support 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 Define SSDT hotplug-able memory devices in _SB namespace. The dynamically generated SSDT includes per memory device hotplug methods. These methods just call methods defined in the DSDT. Also dynamically generate a MTFY method and a MEON array of the online/available memory devices. Add file src/ssdt-mem.dsl with directions for generating the per-memory device processor object AML code. The design is taken from SSDT cpu generation. Signed-off-by: Vasilis Liaskovitis --- src/ssdt-mem.dsl | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 66 insertions(+), 0 deletions(-) create mode 100644 src/ssdt-mem.dsl diff --git a/src/ssdt-mem.dsl b/src/ssdt-mem.dsl new file mode 100644 index 0000000..9586643 --- /dev/null +++ b/src/ssdt-mem.dsl @@ -0,0 +1,66 @@ +/* This file is the basis for the ssdt_mem[] variable in src/acpi.c. + * It is similar in design to the ssdt_proc variable. + * It defines the contents of the per-cpu Processor() object. At + * runtime, a dynamically generated SSDT will contain one copy of this + * AML snippet for every possible memory device in the system. The + * objects will * be placed in the \_SB_ namespace. + * + * To generate a new ssdt_memc[], run the commands: + * cpp -P src/ssdt-mem.dsl > out/ssdt-mem.dsl.i + * iasl -ta -p out/ssdt-mem out/ssdt-mem.dsl.i + * tail -c +37 < out/ssdt-mem.aml | hexdump -e '" " 8/1 "0x%02x," "\n"' + * and then cut-and-paste the output into the src/acpi.c ssdt_mem[] + * array. + * + * In addition to the aml code generated from this file, the + * src/acpi.c file creates a MEMNTFY method with an entry for each memdevice: + * Method(MTFY, 2) { + * If (LEqual(Arg0, 0x00)) { Notify(MP00, Arg1) } + * If (LEqual(Arg0, 0x01)) { Notify(MP01, Arg1) } + * ... + * } + * and a MEON array with the list of active and inactive memory devices: + * Name(MEON, Package() { One, One, ..., Zero, Zero, ... }) + */ +DefinitionBlock ("ssdt-mem.aml", "SSDT", 0x02, "BXPC", "CSSDT", 0x1) +/* v------------------ DO NOT EDIT ------------------v */ +{ + Device(MPAA) { + Name(ID, 0xAA) +/* ^------------------ DO NOT EDIT ------------------^ + * + * The src/acpi.c code requires the above layout so that it can update + * MPAA and 0xAA with the appropriate MEMDEVICE id (see + * SD_OFFSET_MEMHEX/MEMID1/MEMID2). Don't change the above without + * also updating the C code. + */ + Name(_HID, EISAID("PNP0C80")) + Name(_PXM, 0xAA) + + External(CMST, MethodObj) + External(MPEJ, MethodObj) + + Name(_CRS, ResourceTemplate() { + QwordMemory( + ResourceConsumer, + , + MinFixed, + MaxFixed, + Cacheable, + ReadWrite, + 0x0, + 0xDEADBEEF, + 0xE6ADBEEE, + 0x00000000, + 0x08000000, + ) + }) + Method (_STA, 0) { + Return(CMST(ID)) + } + Method (_EJ0, 1, NotSerialized) { + MPEJ(ID, Arg0) + } + } +} +