Changeset 2233
- Timestamp:
- May 27, 2011 4:16:25 AM (2 years ago)
- Files:
-
- 7 edited
-
cpu/arm/olpc/1.75/usb.fth (modified) (1 diff)
-
dev/usb2/device/hub/hub.fth (modified) (1 diff)
-
dev/usb2/hcd/ehci/probe.fth (modified) (2 diffs)
-
dev/usb2/hcd/ehci/qhtd.fth (modified) (1 diff)
-
dev/usb2/hcd/hcd-call.fth (modified) (1 diff)
-
dev/usb2/hcd/probehub.fth (modified) (2 diffs)
-
dev/usb2/pkt-data.fth (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cpu/arm/olpc/1.75/usb.fth
r2075 r2233 17 17 ' otg-set-host-mode to set-host-mode 18 18 19 \ Port 1 on the hub (bit 0) is connected to unused pins on the 20 \ WLAN connector, so testing it is confusing 21 h# e " hub-port-mask" integer-property 19 22 end-package 20 23 -
dev/usb2/device/hub/hub.fth
r2152 r2233 54 54 then 55 55 ; 56 : selftest ( -- ) 57 ['] hub-id catch 0= if 58 hub-selftest-xt execute 59 then 60 ; 56 61 57 62 probe-hub -
dev/usb2/hcd/ehci/probe.fth
r2209 r2233 61 61 ; 62 62 63 : port-connected? ( port# -- flag ) portsc@ h# 2001 and ; 63 64 : wait-connect ( port# -- error? ) 64 65 begin ( port# ) 65 dup port sc@ h# 2001 and 0=( port# unconnected? )66 dup port-connected? 0= ( port# unconnected? ) 66 67 while ( port# ) 67 68 key? if ( port# ) … … 157 158 158 159 #testable-ports 0 ?do 159 i port sc@ h# 2001 andif \ Port owned by usb 1.1 controller (2000) or device is present (1)160 i port-connected? if \ Port owned by usb 1.1 controller (2000) or device is present (1) 160 161 ." USB 2.0 port " i u. ." in use" cr 161 162 else 162 163 diagnostic-mode? if 163 ." Please connect a device to USB port " i u. " !"cr164 ." Please connect a device to USB port " i u. cr 164 165 i wait-connect if true unloop exit then 165 166 else -
dev/usb2/hcd/ehci/qhtd.fth
r1987 r2233 550 550 551 551 true value delay? 552 : poll-delay ( -- ) d# 100 " us" evaluate ;552 : poll-delay ( -- ) d# 300 " us" evaluate ; 553 553 : done? ( qh -- usberr ) 554 554 delay? if poll-delay then -
dev/usb2/hcd/hcd-call.fth
r2152 r2233 14 14 : set-target ( device -- ) 15 15 " set-target" $call-parent 16 ;16 ; 17 17 : probe-hub-xt ( -- adr ) 18 " probe-hub-xt" $call-parent18 " probe-hub-xt" $call-parent 19 19 ; 20 20 : reprobe-hub-xt ( -- adr ) 21 " reprobe-hub-xt" $call-parent 21 " reprobe-hub-xt" $call-parent 22 ; 23 : hub-selftest-xt ( -- adr ) 24 " hub-selftest-xt" $call-parent 22 25 ; 23 26 : set-pipe-maxpayload ( size len -- ) -
dev/usb2/hcd/probehub.fth
r2209 r2233 12 12 : power-hub-port ( port -- ) PORT_POWER DR_PORT " set-feature" $call-parent drop ; 13 13 : reset-hub-port ( port -- ) PORT_RESET DR_PORT " set-feature" $call-parent drop d# 20 ms ; 14 \ Test modes: 1:J 2:K 3:SE0_NAK 4:Packet 5:ForceEnable 15 : test-hub-port ( port test-mode -- ) wljoin PORT_TEST DR_PORT " set-feature" $call-parent drop ; 16 : untest-hub-port ( port -- ) PORT_TEST DR_PORT " clear-feature" $call-parent drop ; 14 17 : clear-status-change ( port -- ) C_PORT_CONNECTION DR_PORT " clear-feature" $call-parent drop ; 15 18 : parent-set-target ( dev -- ) " set-target" $call-parent ; … … 155 158 156 159 : reprobe-hub-xt ( -- adr ) ['] do-reprobe-hub ; 160 161 : hub-port-connected? ( port# -- flag ) 162 get-port-status if false exit then 163 hub-buf c@ 1 and 0<> 164 ; 165 0 value hub-dev 166 : wait-hub-connect ( port# -- error? ) 167 begin ( port# ) 168 dup hub-port-connected? 0= ( port# unconnected? ) 169 while ( port# ) 170 key? if ( port# ) 171 key h# 1b = if ( port# ) \ ESC aborts 172 drop true exit ( -- true ) 173 then ( port# ) 174 then ( port# ) 175 repeat ( port# ) 176 ." Device connected - probing ... " 177 probe-setup ( port# ) 178 hub-dev swap ['] probe-hub-port catch if ( x x ) 179 2drop ( ) 180 ." Failed" cr ( ) 181 true ( true ) 182 else ( ) 183 ." Done" cr ( ) 184 false ( false ) 185 then ( error? ) 186 probe-teardown ( error? ) 187 ; 188 189 0 value hub-test-mask 190 : hub-selftest ( hub-dev -- error? ) 191 to hub-dev ( ) 192 193 " hub-port-mask" get-inherited-property if ( ) 194 -1 ( mask ) 195 else ( propval$ ) 196 get-encoded-int ( mask ) 197 then ( mask ) 198 to hub-test-mask ( ) 199 200 hub-#ports 1+ 1 ?do ( ) 201 1 i 1- lshift hub-test-mask and if 202 hub-dev parent-set-target ( ) 203 i get-port-status if ( ) 204 ." Get-port-status failed for hub port " i u. cr 205 true unloop exit ( -- true ) 206 then ( ) 207 hub-buf c@ 8 and if \ Connected ( ) 208 ." Hub port " i u. ." in over current" cr 209 true unloop exit ( -- true ) 210 then ( ) 211 hub-buf c@ 1 and if \ Connected ( ) 212 ." Hub port " i u. ." in use" cr ( ) 213 else ( ) 214 diagnostic-mode? if ( ) 215 ." Please connect a device to USB hub port " i u. cr ( ) 216 i wait-hub-connect if true unloop exit then ( ) 217 else ( ) 218 ." Fisheye pattern out to USB hub port " i u. cr ( ) 219 i 4 test-hub-port ( ) 220 d# 2,000 ms ( ) 221 i untest-hub-port ( ) 222 i reset-hub-port i power-hub-port ( ) 223 then ( ) 224 then ( ) 225 then ( ) 226 loop ( ) 227 \ Mabye need to reset the entire hub here 228 false ( false ) 229 ; 230 : hub-selftest-xt ( -- xt ) ['] hub-selftest ; 157 231 158 232 headers -
dev/usb2/pkt-data.fth
r2152 r2233 73 73 08 constant PORT_POWER 74 74 09 constant PORT_LOW_SPEED 75 10 constant C_PORT_CONNECTION 76 11 constant C_PORT_ENABLE 77 12 constant C_PORT_SUSPEND 78 13 constant C_PORT_OVER_CURRENT 79 14 constant C_PORT_RESET 75 d# 16 constant C_PORT_CONNECTION 76 d# 17 constant C_PORT_ENABLE 77 d# 18 constant C_PORT_SUSPEND 78 d# 19 constant C_PORT_OVER_CURRENT 79 d# 20 constant C_PORT_RESET 80 d# 21 constant PORT_TEST 81 d# 22 constant PORT_INDICATOR 80 82 81 83 \ Use tmp-l to make sure that le-l! and le-w! are atomic writes
Note: See TracChangeset
for help on using the changeset viewer.
