]> xenbits.xensource.com Git - seabios.git/commitdiff
acpi: reintroduce LNKS
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 13 Dec 2012 07:42:02 +0000 (08:42 +0100)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 15 Dec 2012 14:26:48 +0000 (09:26 -0500)
Commit 4540409 (acpi: LNKS is not needed, 2012-08-07) removed LNKS because
it basically worked by chance: _CRS returns something else then one of the
possible resources from _PRS, _DIS would not really disable the interrupt,
and there was no _SRS method.  It just happened to work because all OSes
have some kind of special-casing for SCI.

Unfortunately, the code after the patch is also against the spec, and it
breaks FreeBSD because it treats IRQ 9 polarity as active low without
the Interrupt() entry.  Actually, numeric _PRT entries are handled the
same in Linux and FreeBSD (as active-low).  However, under Linux it just
happens to trigger another special casing of SCI which sets SCI up from
its override entry in the MADT, ignoring the DSDT completely.

This patch adds back the LNKS, but without using the PIIX register for
LNKA in its methods.

Tested-by: Luigi Rizzo <rizzo@iet.unipi.it>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
src/acpi-dsdt.dsl

index 8019b71bf57150aeb284c8f95f19b6440d32795b..b58ef629cde05ba1fd1c696bf12b148509d630a6 100644 (file)
@@ -187,7 +187,7 @@ DefinitionBlock (
 
                 prt_slot0(0x0000),
                 /* Device 1 is power mgmt device, and can only use irq 9 */
-                Package() { 0x1ffff, 0,    0, 9 },
+                Package() { 0x1ffff, 0, LNKS, 0 },
                 Package() { 0x1ffff, 1, LNKB, 0 },
                 Package() { 0x1ffff, 2, LNKC, 0 },
                 Package() { 0x1ffff, 3, LNKD, 0 },
@@ -278,6 +278,22 @@ DefinitionBlock (
         define_link(LNKB, 1, PRQ1)
         define_link(LNKC, 2, PRQ2)
         define_link(LNKD, 3, PRQ3)
+
+        Device(LNKS) {
+            Name(_HID, EISAID("PNP0C0F"))
+            Name(_UID, 4)
+            Name(_PRS, ResourceTemplate() {
+                Interrupt(, Level, ActiveHigh, Shared) { 9 }
+            })
+
+            // The SCI cannot be disabled and is always attached to GSI 9,
+            // so these are no-ops.  We only need this link to override the
+            // polarity to active high and match the content of the MADT.
+            Method(_STA, 0, NotSerialized) { Return (0x0b) }
+            Method(_DIS, 0, NotSerialized) { }
+            Method(_CRS, 0, NotSerialized) { Return (_PRS) }
+            Method(_SRS, 1, NotSerialized) { }
+        }
     }
 
 #include "acpi-dsdt-cpu-hotplug.dsl"