[SeaBIOS] (no subject)

Jason Baron jbaron at redhat.com
Thu Sep 13 22:12:19 CEST 2012


jan.kiszka at siemens.com, juzhang at redhat.com, agraf at suse.de, yamahata at valinux.co.jp, mkletzan at redhat.com, afaerber at suse.de, armbru at redhat.com, lcapitulino at redhat.com, alex.williamson at redhat.com
Message-Id: <491ff0e77a2359c098540aa24fbbfeec573bea91.1347565443.git.jbaron at redhat.com>
In-Reply-To: <cover.1347565443.git.jbaron at redhat.com>
References: <cover.1347565443.git.jbaron at redhat.com>
Subject: [PATCH 9/9] seabios: q35: add basic hotplug support

Add support for acpi hotplug to q35. Copied from the piix acpi table.

Signed-off-by: Jason Baron <jbaron at redhat.com>
---
 src/q35-acpi-dsdt.dsl |   61 +++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 56 insertions(+), 5 deletions(-)

diff --git a/src/q35-acpi-dsdt.dsl b/src/q35-acpi-dsdt.dsl
index 3180624..a6cca0e 100644
--- a/src/q35-acpi-dsdt.dsl
+++ b/src/q35-acpi-dsdt.dsl
@@ -83,6 +83,21 @@ DefinitionBlock (
             Name (_ADR, 0x00)
             Name (_UID, 1)
 
+
+            OperationRegion(PCST, SystemIO, 0xae00, 0x08)
+            Field (PCST, DWordAcc, NoLock, WriteAsZeros)
+            {
+                PCIU, 32,
+                PCID, 32,
+            }
+
+            OperationRegion(SEJ, SystemIO, 0xae08, 0x04)
+            Field (SEJ, DWordAcc, NoLock, WriteAsZeros)
+            {
+                B0EJ, 32,
+            }
+
+
             // _OSC: based on sample of ACPI3.0b spec
             Name(SUPP,0) // PCI _OSC Support Field value
             Name(CTRL,0) // PCI _OSC Control Field value
@@ -812,6 +827,41 @@ DefinitionBlock (
         }
     }
 
+/****************************************************************
+ * PCI hotplug
+ ****************************************************************/
+
+    Scope(\_SB.PCI0) {
+        /* Methods called by bulk generated PCI devices below */
+
+        /* Methods called by hotplug devices */
+        Method (PCEJ, 1, NotSerialized) {
+            // _EJ0 method - eject callback
+            Store(ShiftLeft(1, Arg0), B0EJ)
+            Return (0x0)
+        }
+
+    /* Hotplug notification method supplied by SSDT */
+    External (\_SB.PCI0.PCNT, MethodObj)
+
+        /* PCI hotplug notify method */
+        Method(PCNF, 0) {
+            // Local0 = iterator
+            Store (Zero, Local0)
+            While (LLess(Local0, 31)) {
+                Increment(Local0)
+                If (And(PCIU, ShiftLeft(1, Local0))) {
+                    PCNT(Local0, 1)
+                }
+                If (And(PCID, ShiftLeft(1, Local0))) {
+                    PCNT(Local0, 3)
+                }
+            }
+            Return(One)
+        }
+
+    }
+
     Scope (\_GPE)
     {
         Name(_HID, "ACPI0006")
@@ -819,12 +869,13 @@ DefinitionBlock (
         Method(_L00) {
             Return(0x01)
         }
-        Method(_L01) {
-             // CPU hotplug event
-	     Return(\_SB.PRSC())
+        Method(_E01) {
+            // PCI hotplug event
+            Return(\_SB.PCI0.PCNF())
         }
-        Method(_L02) {
-            Return(0x01)
+        Method(_E02) {
+            // CPU hotplug event
+            Return(\_SB.PRSC())
         }
         Method(_L03) {
             Return(0x01)
-- 
1.7.1




More information about the SeaBIOS mailing list