[openfirmware] r1364 - cpu/x86/pc/olpc/via

svn at openfirmware.info svn at openfirmware.info
Fri Sep 18 03:10:26 CEST 2009


Author: wmb
Date: 2009-09-18 03:10:26 +0200 (Fri, 18 Sep 2009)
New Revision: 1364

Modified:
   cpu/x86/pc/olpc/via/dsdt.dsl
Log:
OLPC Via DSDT - Fixes for lid, ebook, and power switches, thanks to Paul Fox.


Modified: cpu/x86/pc/olpc/via/dsdt.dsl
===================================================================
--- cpu/x86/pc/olpc/via/dsdt.dsl	2009-09-18 01:04:26 UTC (rev 1363)
+++ cpu/x86/pc/olpc/via/dsdt.dsl	2009-09-18 01:10:26 UTC (rev 1364)
@@ -118,6 +118,12 @@
     DBG1, 8,
 }
 
+// PMIO_RX04
+OperationRegion(\SCIE, SystemIO, 0x0404, 0x2)   // Genernal Purpose SCI Enable
+Field(\SCIE, ByteAcc, NoLock, Preserve) {
+    SCIZ,   1,                                  // SCI / SMI enable
+}
+
 OperationRegion(\GPST, SystemIO, 0x0420, 0x2)
 Field(\GPST, ByteAcc, NoLock, Preserve) {
     GS00,1,     // GPI0
@@ -138,6 +144,15 @@
     GS15,1,     // north module SERR#
 }   
 
+OperationRegion(GPIO, SystemIO, 0x0448, 0x4)
+Field(GPIO, ByteAcc, NoLock, Preserve) {
+        ,7,
+    GPI7,1,
+        ,1,
+    GPI9,1,
+        ,22,
+}   
+
 // PMIO_RX22/3
 OperationRegion(\GPSE, SystemIO, 0x0422, 0x2)   // Genernal Purpose SCI Enable
 Field(\GPSE, ByteAcc, NoLock, Preserve) {
@@ -176,31 +191,22 @@
 }
 
 // from BIOS porting guide, section 13.2.2
-OperationRegion(\EDGE, SystemIO, 0x042c, 0x1)   // SMI enable, lid edge polarity
+OperationRegion(\EDGE, SystemIO, 0x042c, 1)   // SMI enable, lid edge polarity
 Field(\EDGE, ByteAcc, NoLock, Preserve) {
         , 1,                                    // SMI enable (1 == enable)
         , 1,                                    //
-        , 1,                                    // power button polarity (1 == falling)
+    PPOL, 1,                                    // power button polarity (1 == falling)
         , 1,                                    //
         , 1,                                    //
         , 1,                                    // battery low enable (0 == enable)
     TPOL, 1,                                    // therm polarity (1 == falling)
     LPOL, 1,                                    // lid polarity (1 == falling)
 }
-    
-// from BIOS porting guide, section 13.2.2.4
-OperationRegion(\ENB, SystemIO, 0x048c, 0x1)   // SMI enable, lid edge polarity
-Field(\ENB, ByteAcc, NoLock, Preserve) {
-        , 3,
-    TENB, 1,                                    // therm enable (1 == enabled)
-        , 4,
 
-}
-    
 OperationRegion(\Stus, SystemIO, 0x0430, 0x1)   // Global Status
 Field(\Stus, ByteAcc, NoLock, Preserve) {
     PADS, 8,
- } 
+} 
 
 OperationRegion(\Prie, SystemIO, 0x0434, 0x1)
 Field(\Prie, ByteAcc, NoLock, Preserve) {
@@ -234,11 +240,6 @@
         Notify(\_SB.PCI0,0x2)
     }
 
-    Method(_L08) {          // A-series EBOOK event (RING)  (will go away)
-        UPUT (0x64)         // d
-        Notify(\_SB.PCI0.EBKA, 0x80)
-    }
-
     Method(_L09) {
         UPUT (0x39)         // 9
         Notify(\_SB.PCI0.VT86.PS2M, 0x02)       //Internal Mouse Controller PME Status
@@ -247,6 +248,7 @@
     Method(_L0A) {          // EBOOK event (THRM#)
         UPUT (0x65)         // e
         Not(TPOL, TPOL)     // Flip the therm polarity bit
+        Store (One, GS10)   // clear interrupt caused by polarity flip
         Notify(\_SB.PCI0.EBK, 0x80)
     }
 
@@ -283,6 +285,8 @@
     Notify(\_SB.PCI0.USB3, 0x00)
     Notify(\_SB.PCI0.EHCI, 0x00)
     
+    Store(One, SCIZ)
+
     If (LEqual (Arg0, 1))       //S1
     {
         Notify (\_SB.SLPB, 0x02)
@@ -379,7 +383,11 @@
 Scope(\_SB)
 {
 
-    // define Sleeping button as mentioned in ACPI spec 2.0
+    Method(_INI, 0)
+    {
+        Store(One, SCIZ)
+    }
+
     Device (SLPB)
     {
         Name (_HID, EISAID("PNP0C0E"))  // Hardware Device ID SLEEPBTN
@@ -2284,68 +2292,56 @@
             }
         }   // Device(P2PB)
         
-        Device (EBK) {
-            Name (_PRW, Package (0x02) {  0x0A, 0x04 })     // Event 0A, wakes from S4
+        Device (EC) {
+            Name (_PRW, Package (0x02) {  0x01, 0x04 })     // Event 01, wakes from S4
 
             Method(_INI, 0)
             {
-                UPUT (0x6b)  // k
-                Store (One, TENB)            // Enable ebook (THERM#)
-                Store (One, THRM)
+                UPUT (0x49)  // I
+                Store (One, GPWK)            // Enable gpwake
             }
 
-            Method(EBK) {
-                If (TPOL) {                   // ebook is "open"
-                    UPUT (0x65)                   // e
-                } Else {
-                    UPUT (0x45)                   // E
-                }
-                Return(TPOL)
-            }
-        }  // Device(EBK)
+        }  // Device(EC)
 
-        // RING-based ebook support, on A-series boards
-        Device (EBKA) {
-            Name (_PRW, Package (0x02) {  0x08, 0x04 })     // Event 08, wakes from S4
+        Device (EBK) {
+            Name (_HID, "XO15EBK")
+            Name (_PRW, Package (0x02) {  0x0A, 0x04 })     // Event 0A, wakes from S4
 
             Method(_INI, 0)
             {
-                UPUT (0x69)  // i
-                Store (One, RING)
+                Store (One, THRM)
+                Store (GPI9, TPOL)  // init edge detect from current state
             }
 
             Method(EBK) {
-                If (TPOL) {                   // ebook is "open"
+                If (TPOL) {
+                    // non-zero means waiting for fall, so switch is open
                     UPUT (0x65)                   // e
                 } Else {
                     UPUT (0x45)                   // E
                 }
                 Return(TPOL)
             }
-        }  // Device(EBKA)
+        }  // Device(EBK)
 
-        Device (EC) {
-            Name (_PRW, Package (0x02) {  0x01, 0x04 })     // Event 01, wakes from S4
+        Device (LID) {
+            Name (_HID, EisaId ("PNP0C0D"))
+            Name (_PRW, Package (0x02) {  0x0B, 0x04 })     // Event 0B, wakes from S4
 
             Method(_INI, 0)
             {
-                UPUT (0x49)  // I
-                Store (One, GPWK)            // Enable gpwake
+                Store (GPI7, LPOL)  // init edge detect from current state
             }
 
-        }  // Device(EC)
 
-        Device (LID) {
-            Name (_HID, EisaId ("PNP0C0D"))
-            Name (_PRW, Package (0x02) {  0x0B, 0x04 })     // Event 0B, wakes from S4
-
             Method(_LID) {
-                If (LPOL) {                   // Lid is open
+                If (LPOL) {
+                    // non-zero means waiting for fall, so switch is open
                     UPUT (0x6c)                   // l
                 } Else {
                     UPUT (0x4c)                   // L
                 }
-                Return(LNot(LPOL))   // pgf is unclear on why this polarity is correct
+                Return(LPOL)
             }
 
         }  // Device(LID)




More information about the openfirmware mailing list