Author: wmb Date: 2007-07-26 03:14:50 +0200 (Thu, 26 Jul 2007) New Revision: 496
Modified: cpu/x86/pc/olpc/copynand.fth dev/olpc/cafenand/badblock.fth Log: OLPC NAND driver/copy-nand - Added JFFS2 cleanmarkers to erased blocks to speed up startup time on the first boot of the OS after copy-nand.
Modified: cpu/x86/pc/olpc/copynand.fth =================================================================== --- cpu/x86/pc/olpc/copynand.fth 2007-07-25 01:58:15 UTC (rev 495) +++ cpu/x86/pc/olpc/copynand.fth 2007-07-26 01:14:50 UTC (rev 496) @@ -150,6 +150,10 @@ i ?check-crc load-base " copy-block" nandih $call-method loop + + cr ." Filling with cleanmarkers ..." + " put-cleanmarkers" nandih $call-method cr + close-nand-ihs ;
Modified: dev/olpc/cafenand/badblock.fth =================================================================== --- dev/olpc/cafenand/badblock.fth 2007-07-25 01:58:15 UTC (rev 495) +++ dev/olpc/cafenand/badblock.fth 2007-07-26 01:14:50 UTC (rev 496) @@ -341,11 +341,18 @@
headers
-: find-good-block ( -- ) - scan-page# ( page# ) - begin pages/eblock + dup block-bad? 0= until - to scan-page# +: (next-page#) ( -- true | page# false ) + usable-page-limit scan-page# pages/eblock + ?do + i block-bad? 0= if + i to scan-page# + scan-page# false unloop exit + then + pages/eblock +loop + true ; +: next-page# ( -- page# ) + (next-page#) if ." No more good NAND blocks" cr abort then +;
0 value test-page
@@ -358,17 +365,22 @@
\ Must erase all (wipe) first : copy-block ( adr -- ) - find-good-block - scan-page# pages/eblock bounds ?do ( adr ) + next-page# pages/eblock bounds ?do ( adr ) dup i write-page ( adr ) /page + ( adr' ) loop ( adr ) drop ( ) ;
+: put-cleanmarkers ( -- ) + begin (next-page#) 0= while ( page# ) + " "(85 19 03 20 08 00 00 00 00 00 00 00)" ( page# adr len ) + rot /page /ecc + write-bytes ( ) + repeat ( ) +; + : read-next-block ( adr -- ) - find-good-block - scan-page# pages/eblock bounds ?do ( adr ) + next-page# pages/eblock bounds ?do ( adr ) dup i read-page if ( adr ) ." Uncorrectable error in page 0x" i .x cr then