Author: wmb Date: 2010-01-24 23:46:17 +0100 (Sun, 24 Jan 2010) New Revision: 1694
Modified: cpu/x86/pc/olpc/via/copynand.fth Log: XO-1.5 copynand - deleted more dead code.
Modified: cpu/x86/pc/olpc/via/copynand.fth =================================================================== --- cpu/x86/pc/olpc/via/copynand.fth 2010-01-23 09:31:44 UTC (rev 1693) +++ cpu/x86/pc/olpc/via/copynand.fth 2010-01-24 22:46:17 UTC (rev 1694) @@ -47,27 +47,6 @@ defer show-init ( #eblocks -- ) ' drop to show-init
-defer show-erasing ( #blocks -- ) -: (show-erasing) ( #blocks -- ) ." Erasing " . ." blocks" cr ; -' (show-erasing) to show-erasing - -defer show-erased ( block# -- ) -: (show-erased) ( block# -- ) (cr . ; -' (show-erased) to show-erased - -defer show-bad ( block# -- ) -' drop to show-bad - -defer show-bbt-block ( block# -- ) -' drop to show-bbt-block - -defer show-clean ( block# -- ) -' drop to show-clean - -defer show-cleaning ( -- ) -: (show-cleaning) ( -- ) cr ." Cleanmarkers" ; -' (show-cleaning) to show-cleaning - defer show-writing ( #blocks -- ) : (show-writing) ." Writing " . ." blocks" cr ; ' (show-writing) to show-writing @@ -87,10 +66,6 @@
: written? ( adr len -- flag ) h# ffffffff lskip 0<> ;
-h# 80 h# 80 h# 80 rgb>565 constant bbt-color \ gray - 0 0 0 rgb>565 constant erased-color \ black -h# ff 0 0 rgb>565 constant bad-color \ red - 0 0 h# ff rgb>565 constant clean-color \ blue h# ff 0 h# ff rgb>565 constant partial-color \ magenta h# ff h# ff 0 rgb>565 constant pending-color \ yellow 0 h# ff 0 rgb>565 constant written-color \ green @@ -110,15 +85,8 @@ ." Blocks/square: " scale-factor .d ." Total blocks: " .d ;
-: gshow-erasing ( #eblocks -- ) drop ." Erasing " ; - -: gshow-erased ( eblock# -- ) erased-color show-state ; -: gshow-bad ( eblock# -- ) bad-color show-state ; -: gshow-bbt-block ( eblock# -- ) bbt-color show-state ; -: gshow-clean ( eblock# -- ) clean-color show-state ; : gshow-strange ( eblock# -- ) strange-color show-state ;
-: gshow-cleaning ( -- ) 7 status-line at-xy ." Cleanmarkers" cr ; : gshow-done ( -- ) cursor-on ;
: gshow-pending ( eblock# -- ) pending-color show-state ; @@ -141,12 +109,6 @@
: gshow ['] gshow-init to show-init - ['] gshow-erasing to show-erasing - ['] gshow-erased to show-erased - ['] gshow-bad to show-bad - ['] gshow-bbt-block to show-bbt-block - ['] gshow-clean to show-clean - ['] gshow-cleaning to show-cleaning ['] gshow-pending to show-pending ['] gshow-writing to show-writing ['] gshow-written to show-written @@ -156,52 +118,6 @@
gshow
-\ 0 - marked bad block : show-bad -\ 1 - unreadable block : show-bad -\ 2 - jffs2 w/ summary: show-written -\ 3 - jffs2 w/o summary: show-pending -\ 4 - clean : show-clean -\ 5 - non-jffs2 data : show-strange -\ 6 - erased : show-erased -\ 7 - primary bad-block-table : show-bbt-block -\ 8 - secondary bad-block-table : show-bbt-block -: show-block-type ( status eblock# -- ) - swap case - 0 of show-bad endof - 1 of show-bad endof - 2 of show-written endof - 3 of show-pending endof - 4 of show-clean endof - 5 of show-strange endof - 6 of show-erased endof - 7 of show-bbt-block endof - 8 of show-bbt-block endof - endcase -; - -0 value nand-map -0 value working-page -: classify-block ( page# -- status ) - to working-page - - working-page /nand-page um* " seek" $call-nand drop - - \ Try to read the first few bytes - load-base /l " read" $call-nand - - \ Check for non-erased, non-JFFS2 data - load-base l@ h# ffff.ffff <> if 5 exit then - - \ See if the whole thing is really completely erased - load-base /l + /nand-block /l - " read" $call-nand /nand-block /l - <> if 1 exit then - - \ Not completely erased - load-base /nand-block written? if 5 exit then - - \ Erased - 6 -; - 0 value current-block
: cell-border ( block# color -- )