All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: seabios@seabios.org
Cc: qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [seabios patch 3/5] acpi: update pci io windows according to fw_cfg info
Date: Fri,  4 May 2012 10:21:25 +0200	[thread overview]
Message-ID: <1336119687-6295-4-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1336119687-6295-1-git-send-email-kraxel@redhat.com>

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 <kraxel@redhat.com>
---
 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)
+	    }
         }
     }
 
-- 
1.7.1

  parent reply	other threads:[~2012-05-04  8:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-04  8:21 [Qemu-devel] [seabios patch 0/5] dynamic pci i/o windows Gerd Hoffmann
2012-05-04  8:21 ` [Qemu-devel] [seabios patch 1/5] pci: init all devices Gerd Hoffmann
2012-05-04 13:15   ` [Qemu-devel] [SeaBIOS] " Kevin O'Connor
2012-05-04 15:35     ` Gerd Hoffmann
2012-05-05  0:10       ` Kevin O'Connor
2012-05-12 18:16       ` Kevin O'Connor
2012-05-04  8:21 ` [Qemu-devel] [seabios patch 2/5] acpi: add qemu fwcfg driver Gerd Hoffmann
2012-05-04  8:21 ` Gerd Hoffmann [this message]
2012-05-04  8:21 ` [Qemu-devel] [seabios patch 4/5] pciinit: make pci ressources configurable Gerd Hoffmann
2012-05-04  8:21 ` [Qemu-devel] [seabios patch 5/5] update src/acpi-dsdt.hex Gerd Hoffmann
2012-05-04  9:04   ` [Qemu-devel] [SeaBIOS] " Gerd Hoffmann
2012-05-04  9:24     ` Michael Tokarev
2012-05-04 13:18 ` [Qemu-devel] [SeaBIOS] [seabios patch 0/5] dynamic pci i/o windows Kevin O'Connor
2012-05-04 14:01   ` Gerd Hoffmann
2012-05-04 14:46     ` Kevin O'Connor
2012-05-04 15:37       ` Kevin O'Connor
2012-05-06  8:50         ` Gleb Natapov
2012-05-07  1:58 ` Alexey Korolev
2012-05-07  2:43   ` Kevin O'Connor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1336119687-6295-4-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=seabios@seabios.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.