[openfirmware] r1313 - in cpu/x86/pc/olpc: . via

svn at openfirmware.info svn at openfirmware.info
Fri Aug 21 11:25:46 CEST 2009


Author: wmb
Date: 2009-08-21 11:25:46 +0200 (Fri, 21 Aug 2009)
New Revision: 1313

Modified:
   cpu/x86/pc/olpc/security.fth
   cpu/x86/pc/olpc/via/devices.fth
   cpu/x86/pc/olpc/via/fw.bth
   cpu/x86/pc/olpc/via/usb.fth
Log:
Via - fixed devalias creation.


Modified: cpu/x86/pc/olpc/security.fth
===================================================================
--- cpu/x86/pc/olpc/security.fth	2009-08-20 17:14:17 UTC (rev 1312)
+++ cpu/x86/pc/olpc/security.fth	2009-08-21 09:25:46 UTC (rev 1313)
@@ -914,7 +914,7 @@
    set-alternate
 
 \    button-rotate game-key?  if  show-warnings  then
-   show-child
+\   show-child
 
    button-check game-key?  if
       unfreeze  visible  banner

Modified: cpu/x86/pc/olpc/via/devices.fth
===================================================================
--- cpu/x86/pc/olpc/via/devices.fth	2009-08-20 17:14:17 UTC (rev 1312)
+++ cpu/x86/pc/olpc/via/devices.fth	2009-08-21 09:25:46 UTC (rev 1313)
@@ -124,12 +124,6 @@
 \ We don't need a serial selftest because the serial port is internal only
 \ and the selftest turns off the diag device
 dev /serial  warning @ warning off  : selftest false ;  warning !  device-end
-devalias com1 /isa/serial at i3f8:115200
-devalias mouse /isa/8042/mouse
-devalias d disk
-devalias n nand
-devalias sd /sd/disk
-devalias c /ide at 0/disk
 
 [ifndef] demo-board
 .( Removing ctlr-selftest from 8042 open !!!) cr
@@ -196,40 +190,6 @@
 ;
 [then]
 
-\ Create the alias unless it already exists
-: $?devalias  ( alias$ value$ -- )
-   2over  not-alias?  if  $devalias exit  then  ( alias$ value$ alias$ )
-   2drop 4drop
-;
-
-: report-disk  ( -- )
-   " /usb/disk" locate-device  0=  if
-      drop
-      " disk"  " /usb/disk"   $devalias
-      exit
-   then
-   " /usb at f,4/disk" locate-device  0=  if
-      ." Found USB 1.1 disk!" cr
-      drop
-      " disk"  " /usb at f,4/disk" $devalias
-      exit
-   then
-;
-
-: report-keyboard  ( -- )
-   " /usb at f,4/keyboard" locate-device  0=  if
-      drop
-      " keyboard"  " /usb at f,4/keyboard"  $devalias
-      exit
-   then
-
-   \ In case the keyboard is behind a USB 2 hub
-   " /usb at f,5/keyboard" locate-device  0=  if
-      drop
-      " keyboard"  " /usb at f,5/keyboard"  $devalias
-   then
-;
-
 fload ${BP}/cpu/x86/inoutstr.fth	\ Multiple I/O port read/write
 fload ${BP}/dev/isa/diaguart.fth	\ ISA COM port driver
 \ : inituarts ascii G uemit  ascii o uemit  ;  \ They are already on
@@ -344,6 +304,51 @@
 ;
 warning !
 
+devalias com1 /isa/serial at i3f8:115200
+devalias mouse /isa/8042/mouse
+devalias c int
+devalias d disk
+devalias n int
+devalias ide /ide at 0/disk
+devalias sd  /sd/disk at 2
+devalias ext /sd/disk at 2
+
+\ The "int" devalias is defined in report-disk at runtime, since it
+\ varies between A-test and later boards.
+
+\ Create the alias unless it already exists
+: $?devalias  ( alias$ value$ -- )
+   2over  not-alias?  if  $devalias exit  then  ( alias$ value$ alias$ )
+   2drop 4drop
+;
+
+: ?report-device  ( alias$ pathname$ -- )
+   2dup  locate-device  0=  if  ( alias$ pathname$ phandle )
+      drop                      ( alias$ pathname$ )
+      2over 2over $?devalias    ( alias$ pathname$ )
+   then                         ( alias$ pathname$ )
+   4drop                        ( )
+;
+
+: report-disk  ( -- )
+   " disk"  " /usb/@10,4/disk" ?report-device  \ USB 2
+   " disk"  " /usb/@10,2/disk" ?report-device  \ USB 1.1
+   " disk"  " /usb/@10,1/disk" ?report-device  \ USB 1.1
+   " disk"  " /usb/@10,0/disk" ?report-device  \ USB 1.1
+
+   " int"
+   atest?  if  " /ide at 0/disk"  else  " /sd/disk at 1"  then
+   $devalias
+;
+
+: report-keyboard  ( -- )
+   \ Prefer direct-attached
+   " usb-keyboard"  " /usb at 10,2/keyboard" ?report-device  \ USB 1.1
+   " usb-keyboard"  " /usb at 10,1/keyboard" ?report-device  \ USB 1.1
+   " usb-keyboard"  " /usb at 10,0/keyboard" ?report-device  \ USB 1.1
+   " usb-keyboard"  " /usb at 10,4/keyboard" ?report-device  \ USB 2   (keyboard behind a hub)
+;
+
 [ifdef] Later
 \ Add support for DC-couple microphone input
 [then]

Modified: cpu/x86/pc/olpc/via/fw.bth
===================================================================
--- cpu/x86/pc/olpc/via/fw.bth	2009-08-20 17:14:17 UTC (rev 1312)
+++ cpu/x86/pc/olpc/via/fw.bth	2009-08-21 09:25:46 UTC (rev 1313)
@@ -330,6 +330,7 @@
 : text-on   ( -- )
    text-on? 0=  if
       screen-ih add-mux
+      cursor-on
       true to text-on?
    then
 ;
@@ -380,7 +381,7 @@
 
 fload ${BP}/cpu/x86/pc/olpc/rtcwake.fth
 
-" /xp u:\boot\olpc.fth sd:\boot\olpc.fth c:\boot\olpc.fth nand:\boot\olpc.fth /prober /usb/ethernet /usb/wlan"
+" /xp u:\boot\olpc.fth ext:\boot\olpc.fth int:\boot\olpc.fth /prober /usb/ethernet /usb/wlan"
    ' boot-device  set-config-string-default
 
 \needs ramdisk  " " d# 128 config-string ramdisk
@@ -531,8 +532,10 @@
    then
 
    install-mux-io
+   cursor-off
    true to text-on?
 
+
    " //null" open-dev to null-ih  \ For text-off state
 
    ?gui-banner
@@ -567,7 +570,7 @@
 [then]
    then                     ( in-factory? )
    if                       ( )
-      " /prober /usb/ethernet disk:\boot\olpc.fth nand:\boot\olpc.fth /xp sd:\boot\olpc.fth /usb/wlan"
+      " /prober /usb/ethernet disk:\boot\olpc.fth int:\boot\olpc.fth /xp ext:\boot\olpc.fth /usb/wlan"
       to boot-device
    then                     ( )
 ;
@@ -636,11 +639,16 @@
    " probe-" do-drop-in
 
    probe-pci
+   show-child
    sound
    ?games
+   \ XXX we should put up the splash screen here
+   
    ['] false to interrupt-auto-boot?
    probe-usb
    " probe+" do-drop-in
+   report-disk
+   report-keyboard
 
    setup-smbios  \ Must be done after build-date is defined via do-drop-in
 

Modified: cpu/x86/pc/olpc/via/usb.fth
===================================================================
--- cpu/x86/pc/olpc/via/usb.fth	2009-08-20 17:14:17 UTC (rev 1312)
+++ cpu/x86/pc/olpc/via/usb.fth	2009-08-21 09:25:46 UTC (rev 1313)
@@ -53,10 +53,10 @@
 alias p2 probe-usb
 
 : ?usb-keyboard  ( -- )
-   " keyboard" expand-alias  if   ( devspec$ )
-      drop " /usb"  comp  0=  if  ( )
+   " usb-keyboard" expand-alias  if   ( devspec$ )
+      drop " /usb"  comp  0=  if      ( )
          red-letters  ." Using USB keyboard." cr  black-letters
-         " keyboard" open-dev add-mux
+         " usb-keyboard" open-dev add-mux
          exit
       then
    then




More information about the openfirmware mailing list