From patchwork Wed Sep 30 10:18:49 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 34581 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CEB01B7BB4 for ; Wed, 30 Sep 2009 23:15:07 +1000 (EST) Received: from localhost ([127.0.0.1]:38303 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Msz1L-0001B6-TS for incoming@patchwork.ozlabs.org; Wed, 30 Sep 2009 09:15:03 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MswIs-0004sy-D3 for qemu-devel@nongnu.org; Wed, 30 Sep 2009 06:20:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MswIR-0004ck-BL for qemu-devel@nongnu.org; Wed, 30 Sep 2009 06:20:51 -0400 Received: from [199.232.76.173] (port=43919 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MswIQ-0004cY-VM for qemu-devel@nongnu.org; Wed, 30 Sep 2009 06:20:31 -0400 Received: from mail.valinux.co.jp ([210.128.90.3]:55869) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MswIQ-0005pj-4d for qemu-devel@nongnu.org; Wed, 30 Sep 2009 06:20:30 -0400 Received: from nm.local.valinux.co.jp (vagw.valinux.co.jp [210.128.90.14]) by mail.valinux.co.jp (Postfix) with ESMTP id E291949C1C; Wed, 30 Sep 2009 19:20:26 +0900 (JST) Received: from yamahata by nm.local.valinux.co.jp with local (Exim 4.69) (envelope-from ) id 1MswGn-0003up-Ig; Wed, 30 Sep 2009 19:18:49 +0900 From: Isaku Yamahata To: qemu-devel@nongnu.org, anthony@codemonkey.ws Date: Wed, 30 Sep 2009 19:18:49 +0900 Message-Id: <1254305929-14993-15-git-send-email-yamahata@valinux.co.jp> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1254305929-14993-1-git-send-email-yamahata@valinux.co.jp> References: <1254305929-14993-1-git-send-email-yamahata@valinux.co.jp> X-Virus-Scanned: clamav-milter 0.95.2 at va-mail.local.valinux.co.jp X-Virus-Status: Clean X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: yamahata@valinux.co.jp Subject: [Qemu-devel] [PATCH 14/14] pcibos/acpi dsdt: APIC mode support for q35 chipset X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org APIC mode support for q35 chipset. Currently gsi 16-19 are used. Signed-off-by: Isaku Yamahata --- acpi-dsdt.dsl | 181 +++++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 130 insertions(+), 51 deletions(-) diff --git a/acpi-dsdt.dsl b/acpi-dsdt.dsl index d75927b..19743bc 100644 --- a/acpi-dsdt.dsl +++ b/acpi-dsdt.dsl @@ -72,65 +72,142 @@ DefinitionBlock ( } } + /* Zero => PIC mode, One => APIC Mode */ + Name (\PICF, Zero) + Method (\_PIC, 1, NotSerialized) + { + Store (Arg0, \PICF) + } + /* PCI Bus definition */ Scope(\_SB) { + Device(PCI0) { Name (_HID, EisaId ("PNP0A08")) Name (_CID, EisaId ("PNP0A03")) Name (_ADR, 0x00) Name (_UID, 1) - Name(_PRT, Package() { + +#define prt_slot_lnk(nr, lnk0, lnk1, lnk2, lnk3) \ + Package() { nr##ffff, 0, lnk0, 0 }, \ + Package() { nr##ffff, 1, lnk1, 0 }, \ + Package() { nr##ffff, 2, lnk2, 0 }, \ + Package() { nr##ffff, 3, lnk3, 0 } + +#define prt_slot_lnkD(nr) prt_slot_lnk(nr, LNKD, LNKA, LNKB, LNKC) +#define prt_slot_lnkA(nr) prt_slot_lnk(nr, LNKA, LNKB, LNKC, LNKD) +#define prt_slot_lnkB(nr) prt_slot_lnk(nr, LNKB, LNKC, LNKD, LNKA) +#define prt_slot_lnkC(nr) prt_slot_lnk(nr, LNKC, LNKD, LNKA, LNKB) + +#define prt_slot_lnk_all(w, x, y, z) \ + prt_slot_lnk##w(0x0000), \ + prt_slot_lnk##x(0x0001), \ + prt_slot_lnk##y(0x0002), \ + prt_slot_lnk##z(0x0003), \ + prt_slot_lnk##w(0x0004), \ + prt_slot_lnk##x(0x0005), \ + prt_slot_lnk##y(0x0006), \ + prt_slot_lnk##z(0x0007), \ + prt_slot_lnk##w(0x0008), \ + prt_slot_lnk##x(0x0009), \ + prt_slot_lnk##y(0x000a), \ + prt_slot_lnk##z(0x000b), \ + prt_slot_lnk##w(0x000c), \ + prt_slot_lnk##x(0x000d), \ + prt_slot_lnk##y(0x000e), \ + prt_slot_lnk##z(0x000f), \ + prt_slot_lnk##w(0x0010), \ + prt_slot_lnk##x(0x0011), \ + prt_slot_lnk##y(0x0012), \ + prt_slot_lnk##z(0x0013), \ + prt_slot_lnk##w(0x0014), \ + prt_slot_lnk##x(0x0015), \ + prt_slot_lnk##y(0x0016), \ + prt_slot_lnk##z(0x0017), \ + prt_slot_lnk##w(0x0018), \ + prt_slot_lnk##x(0x0019), \ + prt_slot_lnk##y(0x001a), \ + prt_slot_lnk##z(0x001b), \ + prt_slot_lnk##w(0x001c), \ + prt_slot_lnk##x(0x001d), \ + prt_slot_lnk##y(0x001e), \ + prt_slot_lnk##z(0x001f), \ + +#define prt_slot_gsi(nr, gsi0, gsi1, gsi2, gsi3) \ + Package() { nr##ffff, 0, 0, gsi0 }, \ + Package() { nr##ffff, 1, 0, gsi1 }, \ + Package() { nr##ffff, 2, 0, gsi2 }, \ + Package() { nr##ffff, 3, 0, gsi3 } + +#define GSIA 0x10 +#define GSIB 0x11 +#define GSIC 0x12 +#define GSID 0x13 +#define GSIE 0x14 +#define GSIF 0x15 +#define GSIG 0x16 +#define GSIH 0x17 + +#define prt_slot_gsiD(nr) prt_slot_gsi(nr, GSID, GSIA, GSIB, GSIC) +#define prt_slot_gsiA(nr) prt_slot_gsi(nr, GSIA, GSIB, GSIC, GSID) +#define prt_slot_gsiB(nr) prt_slot_gsi(nr, GSIB, GSIC, GSID, GSIA) +#define prt_slot_gsiC(nr) prt_slot_gsi(nr, GSIC, GSID, GSIA, GSIB) + +#define prt_slot_gsi_all(w, x, y, z) \ + prt_slot_gsi##w(0x0000), \ + prt_slot_gsi##x(0x0001), \ + prt_slot_gsi##y(0x0002), \ + prt_slot_gsi##z(0x0003), \ + prt_slot_gsi##w(0x0004), \ + prt_slot_gsi##x(0x0005), \ + prt_slot_gsi##y(0x0006), \ + prt_slot_gsi##z(0x0007), \ + prt_slot_gsi##w(0x0008), \ + prt_slot_gsi##x(0x0009), \ + prt_slot_gsi##y(0x000a), \ + prt_slot_gsi##z(0x000b), \ + prt_slot_gsi##w(0x000c), \ + prt_slot_gsi##x(0x000d), \ + prt_slot_gsi##y(0x000e), \ + prt_slot_gsi##z(0x000f), \ + prt_slot_gsi##w(0x0010), \ + prt_slot_gsi##x(0x0011), \ + prt_slot_gsi##y(0x0012), \ + prt_slot_gsi##z(0x0013), \ + prt_slot_gsi##w(0x0014), \ + prt_slot_gsi##x(0x0015), \ + prt_slot_gsi##y(0x0016), \ + prt_slot_gsi##z(0x0017), \ + prt_slot_gsi##w(0x0018), \ + prt_slot_gsi##x(0x0019), \ + prt_slot_gsi##y(0x001a), \ + prt_slot_gsi##z(0x001b), \ + prt_slot_gsi##w(0x001c), \ + prt_slot_gsi##x(0x001d), \ + prt_slot_gsi##y(0x001e), \ + prt_slot_gsi##z(0x001f), \ + +#define prt_slots(w, x, y, z) \ + If (LEqual (\PICF, Zero)) \ + { \ + Return (Package() { \ + prt_slot_lnk_all(w, x, y, z) \ + }) \ + } \ + Else \ + { \ + Return (Package() { \ + prt_slot_gsi_all(w, x, y, z) \ + }) \ + } + Method(_PRT, 0, NotSerialized) + { /* PCI IRQ routing table, example from ACPI 2.0a specification, section 6.2.8.1 */ /* Note: we provide the same info as the PCI routing table of the Bochs BIOS */ -#define prt_slot(nr, lnk0, lnk1, lnk2, lnk3) \ - Package() { nr##ffff, 0, lnk0, 0 }, \ - Package() { nr##ffff, 1, lnk1, 0 }, \ - Package() { nr##ffff, 2, lnk2, 0 }, \ - Package() { nr##ffff, 3, lnk3, 0 } - -#define prt_slotD(nr) prt_slot(nr, LNKD, LNKA, LNKB, LNKC) -#define prt_slotA(nr) prt_slot(nr, LNKA, LNKB, LNKC, LNKD) -#define prt_slotB(nr) prt_slot(nr, LNKB, LNKC, LNKD, LNKA) -#define prt_slotC(nr) prt_slot(nr, LNKC, LNKD, LNKA, LNKB) - -#define prt_slots(w, x, y, z) \ - prt_slot##w(0x0000), \ - prt_slot##x(0x0001), \ - prt_slot##y(0x0002), \ - prt_slot##z(0x0003), \ - prt_slot##w(0x0004), \ - prt_slot##x(0x0005), \ - prt_slot##y(0x0006), \ - prt_slot##z(0x0007), \ - prt_slot##w(0x0008), \ - prt_slot##x(0x0009), \ - prt_slot##y(0x000a), \ - prt_slot##z(0x000b), \ - prt_slot##w(0x000c), \ - prt_slot##x(0x000d), \ - prt_slot##y(0x000e), \ - prt_slot##z(0x000f), \ - prt_slot##w(0x0010), \ - prt_slot##x(0x0011), \ - prt_slot##y(0x0012), \ - prt_slot##z(0x0013), \ - prt_slot##w(0x0014), \ - prt_slot##x(0x0015), \ - prt_slot##y(0x0016), \ - prt_slot##z(0x0017), \ - prt_slot##w(0x0018), \ - prt_slot##x(0x0019), \ - prt_slot##y(0x001a), \ - prt_slot##z(0x001b), \ - prt_slot##w(0x001c), \ - prt_slot##x(0x001d), \ - prt_slot##y(0x001e), \ - prt_slot##z(0x001f), - prt_slots(D, A, B, C) - }) + } #define hotplug_slot(name, nr, bus) \ Device (S##name) { \ @@ -489,9 +566,10 @@ DefinitionBlock ( Device (PCI6) { Name (_ADR, 0x1e0000) /* 0:1e.00 */ Name (_UID, 6) - Name (_PRT, Package() { + Method(_PRT, 0, NotSerialized) + { prt_slots(A, B, C, D) - }) + } hotplug_slots(6) } } @@ -501,9 +579,10 @@ DefinitionBlock ( Device (PCI##uid) { \ Name (_ADR, 0x##dev##0000) \ Name (_UID, uid) \ - Name (_PRT, Package() { \ + Method(_PRT, 0, NotSerialized) \ + { \ prt_slots(w, x, y, z) \ - }) \ + } \ hotplug_slots(bus) \ } \ }