Author: quozl Date: Tue Aug 2 01:56:30 2011 New Revision: 2398 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2398
Log: OLPC XO-1.75 - change final function USB test order for CL2 to match CL1B, remove test mask, implement a test sequence property.
Modified: cpu/arm/olpc/1.75/usb.fth dev/usb2/hcd/probehub.fth
Modified: cpu/arm/olpc/1.75/usb.fth ============================================================================== --- cpu/arm/olpc/1.75/usb.fth Mon Aug 1 21:11:37 2011 (r2397) +++ cpu/arm/olpc/1.75/usb.fth Tue Aug 2 01:56:30 2011 (r2398) @@ -16,11 +16,15 @@ : otg-set-host-mode 3 h# a8 ehci-reg! ; \ Force host mode ' otg-set-host-mode to set-host-mode
- \ Port 1 on the hub (bit 0) is connected to unused pins on the - \ WLAN connector, so testing it is confusing - h# e " hub-port-mask" integer-property + \ Port 1 on the hub is connected to unused pins on the WLAN connector, + \ so testing it is confusing + \ Port 2 is right upper + \ Port 3 is left + \ Port 4 is right lower + h# 03.04.02.00 " hub-port-seq" integer-property + end-package - + d# 300 config-int usb-delay \ Milliseconds to wait before probing hub ports
devalias u /usb/disk
Modified: dev/usb2/hcd/probehub.fth ============================================================================== --- dev/usb2/hcd/probehub.fth Mon Aug 1 21:11:37 2011 (r2397) +++ dev/usb2/hcd/probehub.fth Tue Aug 2 01:56:30 2011 (r2398) @@ -188,46 +188,57 @@ probe-teardown ( error? ) ;
-0 value hub-test-mask +: (hub-selftest) ( port -- stop? ) + >r + hub-dev parent-set-target ( ) + r@ get-port-status if ( ) + ." Get-port-status failed for hub port " r@ u. cr + r> drop true exit ( -- true ) + then ( ) + hub-buf c@ 8 and if \ Connected ( ) + ." Hub port " r@ u. ." in over current" cr + r> drop true exit ( -- true ) + then ( ) + hub-buf c@ 1 and if \ Connected ( ) + ." Hub port " r@ u. ." in use" cr ( ) + else ( ) + diagnostic-mode? if ( ) + ." Please connect a device to USB hub port " r@ u. cr ( ) + r@ wait-hub-connect if r> drop true exit then ( ) + else ( ) + ." Fisheye pattern out to USB hub port " r@ u. cr ( ) + r@ 4 test-hub-port ( ) + d# 2,000 ms ( ) + r@ untest-hub-port ( ) + r@ reset-hub-port r@ power-hub-port ( ) + then ( ) + then ( ) + r> drop false +; + : hub-selftest ( hub-dev -- error? ) - to hub-dev ( ) + to hub-dev ( ) + + " hub-port-seq" get-inherited-property if ( ) + hub-#ports 1+ 1 ?do ( ) + i (hub-selftest) if true unloop exit then + loop ( ) + else ( propval$ ) + decode-int nip nip ( seq ) + + 4 0 do + dup h# ff000000 and d# 24 rshift h# ff and ( seq port ) + dup if ( seq port ) + (hub-selftest) if true exit then + else + drop + then ( seq ) + d# 8 lshift ( seq' ) + loop + then
- " hub-port-mask" get-inherited-property if ( ) - -1 ( mask ) - else ( propval$ ) - decode-int nip nip ( mask ) - then ( mask ) - to hub-test-mask ( ) - - hub-#ports 1+ 1 ?do ( ) - 1 i 1- lshift hub-test-mask and if - hub-dev parent-set-target ( ) - i get-port-status if ( ) - ." Get-port-status failed for hub port " i u. cr - true unloop exit ( -- true ) - then ( ) - hub-buf c@ 8 and if \ Connected ( ) - ." Hub port " i u. ." in over current" cr - true unloop exit ( -- true ) - then ( ) - hub-buf c@ 1 and if \ Connected ( ) - ." Hub port " i u. ." in use" cr ( ) - else ( ) - diagnostic-mode? if ( ) - ." Please connect a device to USB hub port " i u. cr ( ) - i wait-hub-connect if true unloop exit then ( ) - else ( ) - ." Fisheye pattern out to USB hub port " i u. cr ( ) - i 4 test-hub-port ( ) - d# 2,000 ms ( ) - i untest-hub-port ( ) - i reset-hub-port i power-hub-port ( ) - then ( ) - then ( ) - then ( ) - loop ( ) - \ Mabye need to reset the entire hub here - false ( false ) + \ Maybe need to reset the entire hub here + false ( false ) ; : hub-selftest-xt ( -- xt ) ['] hub-selftest ;