From patchwork Fri May 4 08:21:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 156816 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 77AA6B6FCA for ; Fri, 4 May 2012 18:40:48 +1000 (EST) Received: from localhost ([::1]:33692 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQDmF-00010f-29 for incoming@patchwork.ozlabs.org; Fri, 04 May 2012 04:22:11 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQDlf-0007uo-A7 for qemu-devel@nongnu.org; Fri, 04 May 2012 04:21:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SQDlb-00029S-Tl for qemu-devel@nongnu.org; Fri, 04 May 2012 04:21:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQDlb-00028Q-MC for qemu-devel@nongnu.org; Fri, 04 May 2012 04:21:31 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q448LTHx014108 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 4 May 2012 04:21:29 -0400 Received: from rincewind.home.kraxel.org (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q448LSXE018762; Fri, 4 May 2012 04:21:28 -0400 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id 2019C42942; Fri, 4 May 2012 10:21:28 +0200 (CEST) From: Gerd Hoffmann To: seabios@seabios.org Date: Fri, 4 May 2012 10:21:25 +0200 Message-Id: <1336119687-6295-4-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> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org, Gerd Hoffmann Subject: [Qemu-devel] [seabios patch 3/5] acpi: update pci io windows according to fw_cfg info 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 This patch makes the pci ressources runtime configurable. The patch fetches the pci window information from the qemu firmware config interface and in case valid data is found there the ressource entries are updated accordingly. Signed-off-by: Gerd Hoffmann --- src/acpi-dsdt.dsl | 38 +++++++++++++++++++++++++++++++++++--- 1 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/acpi-dsdt.dsl b/src/acpi-dsdt.dsl index d71b783..4e6c2ad 100644 --- a/src/acpi-dsdt.dsl +++ b/src/acpi-dsdt.dsl @@ -132,7 +132,7 @@ DefinitionBlock ( B0EJ, 32, } - Name (_CRS, ResourceTemplate () + Name (CRES, ResourceTemplate () { WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode, 0x0000, // Address Space Granularity @@ -174,15 +174,47 @@ DefinitionBlock ( 0xFEBFFFFF, // Address Range Maximum 0x00000000, // Address Translation Offset 0x1EC00000, // Address Length - ,, , AddressRangeMemory, TypeStatic) + ,, PW32, AddressRangeMemory, TypeStatic) QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite, 0x00000000, // Address Space Granularity 0x8000000000, // Address Range Minimum 0xFFFFFFFFFF, // Address Range Maximum 0x00000000, // Address Translation Offset 0x8000000000, // Address Length - ,, , AddressRangeMemory, TypeStatic) + ,, PW64, AddressRangeMemory, TypeStatic) }) + Method (_INI, 0) + { + Store (\_SB.PCI0.ISA.FWC.FWCB(0x1a, 64), Local0) + CreateQWordField (Local0, 0, QW0) + CreateQWordField (Local0, 8, QW1) + CreateQWordField (Local0, 16, QW2) + CreateQWordField (Local0, 24, QW3) + + /* 32bit pci io window */ + If (LAnd (LNotEqual(QW0, 0), LNotEqual(QW1, 0))) { + CreateDWordField (CRES,\_SB.PCI0.PW32._MIN, PS32) + CreateDWordField (CRES,\_SB.PCI0.PW32._MAX, PE32) + CreateDWordField (CRES,\_SB.PCI0.PW32._LEN, PL32) + Store (QW0, PS32) + Store (QW1, PE32) + Subtract (QW1, QW0, PL32) + } + + /* 64bit pci io window */ + If (LAnd (LNotEqual(QW2, 0), LNotEqual(QW3, 0))) { + CreateQWordField (CRES,\_SB.PCI0.PW64._MIN, PS64) + CreateQWordField (CRES,\_SB.PCI0.PW64._MAX, PE64) + CreateQWordField (CRES,\_SB.PCI0.PW64._LEN, PL64) + Store (QW2, PS64) + Store (QW3, PE64) + Subtract (QW3, QW2, PL64) + } + } + Method (_CRS, 0) + { + Return (CRES) + } } }