Author: wmb Date: Tue Aug 2 06:10:48 2011 New Revision: 2401 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2401
Log: OLPC trac #11098 - Sped up fs-update on XO-1.75 by using software sha-256 instead of the slower hardware "accelerated" version. OS31 now fs-update's in 4:00 (4 minutes) instead of 5:30.
Modified: cpu/arm/olpc/1.75/fw.bth cpu/x86/pc/olpc/via/fsupdate.fth cpu/x86/pc/olpc/via/fsverify.fth cpu/x86/pc/olpc/via/fw.bth
Modified: cpu/arm/olpc/1.75/fw.bth ============================================================================== --- cpu/arm/olpc/1.75/fw.bth Tue Aug 2 05:55:57 2011 (r2400) +++ cpu/arm/olpc/1.75/fw.bth Tue Aug 2 06:10:48 2011 (r2401) @@ -327,6 +327,7 @@ : hdd-led-on ( -- ) d# 10 gpio-set ; : hdd-led-toggle ( -- ) d# 10 gpio-pin@ if hdd-led-off else hdd-led-on then ;
+alias fast-hash crypto-hash \ fast-hash uses acceleration when available fload ${BP}/cpu/x86/pc/olpc/via/fsupdate.fth fload ${BP}/cpu/x86/pc/olpc/via/fsverify.fth devalias fsdisk int:0
Modified: cpu/x86/pc/olpc/via/fsupdate.fth ============================================================================== --- cpu/x86/pc/olpc/via/fsupdate.fth Tue Aug 2 05:55:57 2011 (r2400) +++ cpu/x86/pc/olpc/via/fsupdate.fth Tue Aug 2 06:10:48 2011 (r2401) @@ -151,11 +151,7 @@ : check-hash ( -- ) 2>r ( eblock# hashname$ r: hash$ ) data-buffer /nand-block 2swap ( eblock# data$ hashname$ r: hash$ ) - 2dup " sha256" $= if ( eblock# hashname$ r: hash$ ) - 2drop sha-256 ( eblock# calc-hash$ r: hash$ ) - else - crypto-hash ( eblock# calc-hash$ r: hash$ ) - then + fast-hash ( eblock# r: hash$ ) 2r> $= 0= if ( eblock# ) ." Bad hash for eblock# " .x cr cr ." Your USB key may be bad. Please try a different one." cr
Modified: cpu/x86/pc/olpc/via/fsverify.fth ============================================================================== --- cpu/x86/pc/olpc/via/fsverify.fth Tue Aug 2 05:55:57 2011 (r2400) +++ cpu/x86/pc/olpc/via/fsverify.fth Tue Aug 2 06:10:48 2011 (r2401) @@ -33,11 +33,7 @@ : verify-hash ( hashname$ hash$ -- okay? ) 2swap ( hash$ hashname$ ) data-buffer /nand-block 2swap ( hash$ data$ hashname$ ) - 2dup " sha256" $= if ( hash$ hashname$ ) - 2drop sha-256 ( hash$ calc-hash$ ) - else ( hash$ hashname$ ) - crypto-hash ( hash$ calc-hash$ ) - then ( hash$ calc-hash$ ) + fast-hash ( hash$ calc-hash$ ) $= ( okay? ) ;
Modified: cpu/x86/pc/olpc/via/fw.bth ============================================================================== --- cpu/x86/pc/olpc/via/fw.bth Tue Aug 2 05:55:57 2011 (r2400) +++ cpu/x86/pc/olpc/via/fw.bth Tue Aug 2 06:10:48 2011 (r2401) @@ -498,6 +498,13 @@ fload ${BP}/cpu/x86/pc/olpc/via/blockfifo.fth : hdd-led-toggle ( -- ) h# 4c acpi-l@ h# 400000 xor h# 4c acpi-l! ; : hdd-led-off ( -- ) h# 4c acpi-l@ h# 400000 or h# 4c acpi-l! ; +: fast-hash ( adr len hashname$ -- ) + 2dup " sha256" $= if ( eblock# hashname$ r: hash$ ) + 2drop sha-256 ( eblock# calc-hash$ r: hash$ ) + else + crypto-hash ( eblock# calc-hash$ r: hash$ ) + then +; fload ${BP}/cpu/x86/pc/olpc/via/fsupdate.fth fload ${BP}/cpu/x86/pc/olpc/via/fsverify.fth devalias fsdisk int:0