[openfirmware] r863 - cpu/x86/pc/olpc

svn at openfirmware.info svn at openfirmware.info
Wed Jul 30 12:19:39 CEST 2008


Author: wmb
Date: 2008-07-30 12:19:38 +0200 (Wed, 30 Jul 2008)
New Revision: 863

Modified:
   cpu/x86/pc/olpc/dsdt.dsl
   cpu/x86/pc/olpc/versions.fth
Log:
OLPC - Added retries to ACPI EC commands to prevent blue screens.



Modified: cpu/x86/pc/olpc/dsdt.dsl
===================================================================
--- cpu/x86/pc/olpc/dsdt.dsl	2008-07-30 09:51:22 UTC (rev 862)
+++ cpu/x86/pc/olpc/dsdt.dsl	2008-07-30 10:19:38 UTC (rev 863)
@@ -132,7 +132,7 @@
         {
            if (LEqual (Subtract(Local0, One, Local0), Zero))
            {
-               Fatal(1, 1, 0)
+               Return (One)
            }
            Sleep(1)
         }
@@ -142,10 +142,11 @@
         {
            if (LEqual (Subtract(Local0, One, Local0), Zero))
            {
-               Fatal(1, 1, 1)
+               Return (2)
            }
            Sleep(1)
         }
+        Return (Zero)
     }
 
     Method (ECRB, 0, NotSerialized)  // EC Read Byte after command -> byte
@@ -153,15 +154,34 @@
         Store (200, Local0)
         While (LNot (And (ECCM, 1)))  // Wait for OBF != 0
         {
-           if (LEqual (Subtract(Local0, One, Local0), Zero))
+           If (LEqual (Subtract(Local0, One, Local0), Zero))
            {
-               Fatal(1, 1, 2)
+               Return (0xffffffff)
            }
            Sleep(1)
         }
         Return (ECDA)
     }
 
+    Method (ECC1, 1, NotSerialized)  // EC Command returning 1 byte
+    {
+        Store (10, Local0)                     // Ten retries
+        While (Subtract(Local0, One, Local0))  // While more tries left
+        {
+            If (ECCO (Arg0))
+            {
+                Continue                        // Command timeout
+            }
+            Store (ECRB (), Local1)
+            If (LNotEqual (Local1, 0xffffffff))
+            {
+                Return (Local1)                 // Success
+            }
+        }
+        Return (Zero)
+
+    }
+
     Scope (_PR) {
         Processor (CPU0, 0x01, 0x00000000, 0x00) {}
 //        Processor (CPU0, 0x01, 0x00009E00, 0x06) {
@@ -267,8 +287,7 @@
             Store (One, Local0)
             While (Local0)
             {
-                ECCO(0x84)               // Read SCI Queue
-                Store (ECRB(), Local0)
+                Store (ECC1(0x84), Local0)  // Read SCI Queue
 //                UDOT (Local0)
                 If (And(Local0, 0x40))
                 {

Modified: cpu/x86/pc/olpc/versions.fth
===================================================================
--- cpu/x86/pc/olpc/versions.fth	2008-07-30 09:51:22 UTC (rev 862)
+++ cpu/x86/pc/olpc/versions.fth	2008-07-30 10:19:38 UTC (rev 863)
@@ -2,7 +2,7 @@
 
 \ The overall firmware revision
 macro: FW_MAJOR E
-macro: FW_MINOR 12b
+macro: FW_MINOR 12c
 
 \ The EC microcode
 macro: EC_VERSION e11




More information about the openfirmware mailing list