Changeset 2192
- Timestamp:
- Apr 27, 2011 9:14:27 AM (2 years ago)
- Files:
-
- 2 edited
-
cpu/x86/pc/olpc/via/fsupdate.fth (modified) (4 diffs)
-
dev/mmc/sdhci/sdhci.fth (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cpu/x86/pc/olpc/via/fsupdate.fth
r2191 r2192 9 9 ; 10 10 11 0 value #eblocks-written 11 0 value min-eblock# 12 0 value max-eblock# 13 14 : written ( eblock# -- ) 15 dup 16 max-eblock# max to max-eblock# ( eblock# ) 17 min-eblock# min to min-eblock# 18 ; 12 19 13 20 : ?all-written ( -- ) 14 #eblocks-written#image-eblocks <> if21 max-eblock# 1+ #image-eblocks <> if 15 22 cr 16 23 red-letters 17 ." WARNING: The file specified " #image-eblocks .d 18 ." chunks but wrote only " #eblocks-written .d ." chunks" cr 24 ." WARNING: The file said highest block " #image-eblocks .d 25 ." but wrote only as high as block " max-eblock# .d cr 26 black-letters 27 then 28 min-eblock# 0 <> if 29 cr 30 red-letters 31 ." WARNING: The file did not write a zero block, " 32 ." but wrote only as low as block " min-eblock# .d cr 19 33 black-letters 20 34 then … … 53 67 also nand-commands definitions 54 68 69 \ some cards do not respond in a reasonable time, 70 \ some cards lock up and cause a command timeout in get-status, 71 \ so split the erase into many parts. 72 : erase-blocks 73 [char] ~ emit \ visual hint of erase delay 74 #image-eblocks /nand-block h# 200 */ ( #blocks ) 75 dup d# 16 / swap ( /part #blocks ) 76 0 do ( /part ) 77 i over " erase-blocks" $call-nand 78 hdd-led-toggle \ visual hint of progress 79 dup +loop ( /part ) 80 drop 81 bs emit space bs emit hdd-led-off \ visual hint remove 82 ; 83 84 \ : erase-blocks 85 \ 0 #image-eblocks /nand-block h# 200 */ " erase-blocks" $call-nand ; 86 55 87 : zblocks: ( "eblock-size" "#eblocks" ... -- ) 56 88 hdd-led-toggle … … 58 90 get-hex# to /nand-block 59 91 get-hex# to #image-eblocks 92 #image-eblocks to min-eblock# 93 0 to max-eblock# 60 94 " size" $call-nand #image-eblocks /nand-block um* d< 61 95 " Image size is larger than output device" ?nand-abort 62 96 #image-eblocks show-init 63 0 #image-eblocks /nand-block h# 200 */ " erase-blocks" $call-nand97 erase-blocks 64 98 get-inflater 65 99 \ Separate the two buffers by enough space for both the compressed … … 201 235 \ then 202 236 237 dup written ( eblock# ) 203 238 show-written ( ) 204 #eblocks-written 1+ to #eblocks-written ( )205 239 show-temperature 206 240 hdd-led-toggle -
dev/mmc/sdhci/sdhci.fth
r2174 r2192 285 285 286 286 allow-timeout? if ( isr esr ) 287 dup 1 = if true to timeout? 2drop exit then287 dup 1 = over h# 10 = or if true to timeout? 2drop exit then 288 288 then ( isr esr ) 289 289 … … 489 489 490 490 0 instance value writing? 491 492 : erase-blocks ( block# #blocks -- ) \ UNTESTED493 intstat-on494 dup 0= if 2drop exit then495 1- bounds ( last first )496 h# 201a 0 cmd ( last ) \ CMD32 - R1497 h# 211a 0 cmd ( ) \ CMD33 - R1498 0 h# 261b 0 cmd \ CMD38 - R1b (wait for busy)499 intstat-off500 ;501 491 502 492 \ CMD40 is MMC … … 1033 1023 1034 1024 : detach-sdio-card ( -- ) 1025 ; 1026 1027 : erase-blocks ( block# #blocks -- ) 1028 intstat-on 1029 dup 0= if 2drop exit then 1030 1- bounds ( last first ) 1031 h# 201a 0 cmd ( last ) \ CMD32 - R1 1032 h# 211a 0 cmd ( ) \ CMD33 - R1 1033 0 h# 261b 0 cmd \ CMD38 - R1b (wait for busy) 1034 true to writing? ( ) 1035 true to allow-timeout? 1036 false to timeout? 1037 wait-write-done drop 1038 false to allow-timeout? 1039 intstat-off 1035 1040 ; 1036 1041
Note: See TracChangeset
for help on using the changeset viewer.
