1 \ *****************************************************************************
2 \ * Copyright (c) 2004, 2011, 2013 IBM Corporation
3 \ * All rights reserved.
4 \ * This program and the accompanying materials
5 \ * are made available under the terms of the BSD License
6 \ * which accompanies this distribution, and is available at
7 \ * http://www.opensource.org/licenses/bsd-license.php
10 \ * IBM Corporation - initial implementation
11 \ ****************************************************************************/
14 : load-dev-hci ( num name-str name-len )
15 s" dev-hci.fs" INCLUDED
24 usb-alias-num dup 1+ to usb-alias-num
27 \ create a new ohci device alias for the current node
28 : set-ohci-alias ( -- )
30 get-usb-alias-num ( num )
31 s" ohci" 1 load-dev-hci
34 \ create a new ehci device alias for the current node
35 : set-ehci-alias ( -- )
37 get-usb-alias-num ( num )
38 s" ehci" 2 load-dev-hci
41 \ create a new xhci device alias for the current node
42 : set-xhci-alias ( -- )
44 get-usb-alias-num ( num )
45 s" xhci" 3 load-dev-hci
48 : usb-enumerate ( hcidev -- )
54 ohci-init 1 = IF USB-OHCI-REGISTER THEN
55 ehci-init 1 = IF USB-EHCI-REGISTER THEN
56 xhci-init 1 = IF USB-XHCI-REGISTER THEN
59 " usb" i $cathex find-device
60 " get-hci-dev" get-node find-method
64 ." get-base-address method not found for usb@" i .
66 " device_type" get-node get-property 0= IF decode-string type cr 2drop THEN
69 0 set-node \ FIXME Setting it back