[openfirmware] [commit] r2000 - cpu/x86/pc/olpc/via

repository service svn at openfirmware.info
Wed Nov 3 00:38:12 CET 2010


Author: quozl
Date: Wed Nov  3 00:38:12 2010
New Revision: 2000
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2000

Log:
OLPC XO-1.5 - dual boot, enable third SD slot for Windows sometimes.

During Windows boot preparation, determine which SD slot is being used
for the boot, and disable the internal slot only if the external is
being used.

Modified:
   cpu/x86/pc/olpc/via/acpi.fth
   cpu/x86/pc/olpc/via/addrs.fth
   cpu/x86/pc/olpc/via/startpcirestore.fth

Modified: cpu/x86/pc/olpc/via/acpi.fth
==============================================================================
--- cpu/x86/pc/olpc/via/acpi.fth	Tue Nov  2 07:23:07 2010	(r1999)
+++ cpu/x86/pc/olpc/via/acpi.fth	Wed Nov  3 00:38:12 2010	(r2000)
@@ -315,10 +315,31 @@
 
 \ Geode h# 6000 constant xp-smbus-base
 
+: loaded-from-external-sd?  ( -- flag )
+   " /chosen" find-package drop                ( phandle )
+   " bootpath" rot get-package-property  abort" No bootpath property"
+                                               ( adr len )
+   [char] : left-parse-string 2nip             ( devname$ )
+   find-package 0= abort" Can't find bootpath device node"
+                                               ( phandle )
+   " slot-name" rot get-package-property  if   ( )
+      false    \ If no slot-name, say false    ( flag )
+   else                                        ( adr len )
+      " external" $=                           ( flag )
+   then
+;
+
 defer more-platform-fixup  ' noop to more-platform-fixup
 : rm-platform-fixup  ( -- )
-   \ Disable the internal SD to prevent Windows from making it C:
-   h# f9 h# 6099 config-b!
+   loaded-from-external-sd?  if
+      \ Disable the internal SD to prevent Windows from making it C:
+      h# f9 h# 6099 config-b!
+      2
+   else
+      3
+   then
+   windows-#sd-slots !
+
    h# 80 h# 6088 config-b!  \ Set timeout clock 0:33Mhz
    h# 00 h# 6089 config-b!  \ Set max clock to 33Mhz
 

Modified: cpu/x86/pc/olpc/via/addrs.fth
==============================================================================
--- cpu/x86/pc/olpc/via/addrs.fth	Tue Nov  2 07:23:07 2010	(r1999)
+++ cpu/x86/pc/olpc/via/addrs.fth	Wed Nov  3 00:38:12 2010	(r2000)
@@ -89,7 +89,8 @@
 h# fff40 constant rm-buf     \ 8-byte buffer used by BIOS INT 15 AH=C0 for returning config info
 h# fff48 constant video-mode-adr    \ Saves display mode for resume code
 h# fff4c constant windows-mode-adr  \ Flag to control Windows-specific resume fixups
-\ h# fff50 Next address available for resume variables
+h# fff50 constant windows-#sd-slots \ Number of SD slots to enable
+\ h# fff54 Next address available for resume variables
 
 h# fff80 constant 'int10-dispatch
 

Modified: cpu/x86/pc/olpc/via/startpcirestore.fth
==============================================================================
--- cpu/x86/pc/olpc/via/startpcirestore.fth	Tue Nov  2 07:23:07 2010	(r1999)
+++ cpu/x86/pc/olpc/via/startpcirestore.fth	Wed Nov  3 00:38:12 2010	(r2000)
@@ -28,7 +28,9 @@
              al 8000.1029 #) mov
              al 8000.2029 #) mov
 
-        f9 6099 config-wb  \ Two SD slots (correct for XP, wrong for Linux)
+        2 #  windows-#sd-slots #)  cmp  =  if
+            f9 6099 config-wb  \ Two SD slots (correct for XP, wrong for Linux)
+        then
         d# 10000 wait-us   \ 10 ms delay to let power come on
         80 6088 config-wb  \ Set timeout clock 0:33Mhz
         00 6089 config-wb  \ Set max clock to 33Mhz



More information about the openfirmware mailing list