Author: wmb Date: 2008-01-05 01:43:59 +0100 (Sat, 05 Jan 2008) New Revision: 766
Modified: dev/mmc/sdhci/selftest.fth ofw/core/ofwcore.fth Log: OLPC trac 5853 - Improved messages from test-all diagnostics.
Modified: dev/mmc/sdhci/selftest.fth =================================================================== --- dev/mmc/sdhci/selftest.fth 2008-01-05 00:39:52 UTC (rev 765) +++ dev/mmc/sdhci/selftest.fth 2008-01-05 00:43:59 UTC (rev 766) @@ -26,15 +26,18 @@ ibuf obuf /block comp ;
+: (selftest) ( -- error? ) + sbuf 0 read-block if true exit then + 0 h# 5a test-block if true exit then + 0 h# a5 test-block if true exit then + sbuf 0 write-block \ Restore original content +; external : selftest ( -- error? ) open 0= if ." Open /sd failed" cr true exit then attach-card 0= if ." No card inserted" cr close false exit then alloc-test-bufs - sbuf 0 read-block if free-test-bufs close true exit then - 0 h# 5a test-block if free-test-bufs close true exit then - 0 h# a5 test-block if free-test-bufs close true exit then - sbuf 0 write-block \ Restore original content + ['] (selftest) catch if true then free-test-bufs close ;
Modified: ofw/core/ofwcore.fth =================================================================== --- ofw/core/ofwcore.fth 2008-01-05 00:39:52 UTC (rev 765) +++ ofw/core/ofwcore.fth 2008-01-05 00:43:59 UTC (rev 766) @@ -3209,15 +3209,23 @@
??cr ." Testing " pwd method-name 2@ current-device ( method-adr,len phandle ) - execute-phandle-method drop ( result ) - - ?dup if + execute-phandle-method if ( result ) + ?dup if + red-letters + ??cr ." Selftest failed. Return code = " .d cr cr + d# 10000 ms + black-letters + else + green-letters + ." Okay" cr cr d# 3000 ms + black-letters + then + else red-letters - ??cr ." Selftest failed. Return code = " .d cr + ." Selftest failed due to abort" cr d# 10000 ms black-letters then - then ( ) ;