[OpenBIOS] r792 - cpu/x86/pc/biosload

svn at openbios.org svn at openbios.org
Mon Jan 28 05:17:35 CET 2008


Author: wmb
Date: 2008-01-28 05:17:34 +0100 (Mon, 28 Jan 2008)
New Revision: 792

Modified:
   cpu/x86/pc/biosload/usb.fth
Log:
BIOSload version - Removed hardcoded PCI device numbers from the USB probing code.




Modified: cpu/x86/pc/biosload/usb.fth
===================================================================
--- cpu/x86/pc/biosload/usb.fth	2008-01-24 23:27:35 UTC (rev 791)
+++ cpu/x86/pc/biosload/usb.fth	2008-01-28 04:17:34 UTC (rev 792)
@@ -12,20 +12,38 @@
    r> to exit?
 ;
 
+: (probe-usb2)  ( -- )
+   " device_type" get-property  if  exit  then
+   get-encoded-string  " ehci" $=  if
+      pwd$ open-dev  ?dup  if  close-dev  then
+   then
+;
+: (show-usb2)  ( -- )
+   " device_type" get-property  if  exit  then
+   get-encoded-string  " ehci" $=  if
+      pwd$ $nopage-show-devs
+   then
+;
+: (probe-usb1)  ( -- )
+   " device_type" get-property  if  exit  then
+   get-encoded-string  2dup " uhci" $= >r  " ohci" $= r> or  if
+      pwd$ open-dev  ?dup  if  close-dev  then
+   then
+;
+: (show-usb1)  ( -- )
+   " device_type" get-property  if  exit  then
+   get-encoded-string  2dup " uhci" $= >r  " ohci" $= r> or  if
+      pwd$ $nopage-show-devs
+   then
+;
 : probe-usb  ( -- )
    ." USB2 devices:" cr
-   " /usb at 1d,7" open-dev  ?dup  if  close-dev  then
-   " /usb" $nopage-show-devs
+   " /" ['] (probe-usb2) scan-subtree
+   " /" ['] (show-usb2) scan-subtree
 
    ." USB1 devices:" cr
-   " /usb at 1d,3" open-dev  ?dup  if  close-dev  then
-   " /usb at 1d,3" $nopage-show-devs
-   " /usb at 1d,2" open-dev  ?dup  if  close-dev  then
-   " /usb at 1d,2" $nopage-show-devs
-   " /usb at 1d,1" open-dev  ?dup  if  close-dev  then
-   " /usb at 1d,1" $nopage-show-devs
-   " /usb at 1d,0" open-dev  ?dup  if  close-dev  then
-   " /usb at 1d,0" $nopage-show-devs
+   " /" ['] (probe-usb1) scan-subtree
+   " /" ['] (show-usb1) scan-subtree
 ;
 alias p2 probe-usb
 




More information about the OpenBIOS mailing list