Author: wmb Date: Sun Oct 16 02:26:37 2011 New Revision: 2617 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2617
Log: lpcflash.fth - write-enable the block if necessary.
Modified: dev/lpcflash.fth
Modified: dev/lpcflash.fth ============================================================================== --- dev/lpcflash.fth Sun Oct 16 02:24:57 2011 (r2616) +++ dev/lpcflash.fth Sun Oct 16 02:26:37 2011 (r2617) @@ -78,10 +78,17 @@ \ software locking, while SST47LF080A (LPC version) does not. Writing \ the lock register addresses is innocuous on the ones without locking.
-: write-enable-block ( offset -- ) +: (write-enable-block) ( offset -- ) h# ffff invert and 2 or ( we-offset ) regs-adr + 0 swap c! ; +: write-enable-block ( offset -- ) + regs-adr if + (write-enable-block) + else + map-regs (write-enable-block) unmap-regs + then +;
: write-setup ( -- ) h# aa jedec! h# 55 h# 2aaa >lpc-adr c! ;
@@ -125,6 +132,7 @@ ;
: flash-write ( adr len offset -- ) + dup write-enable-block ( adr len offset ) -rot bounds ?do ( offset ) i c@ over lpc! 1+ ( offset' ) loop ( offset )
openfirmware@openfirmware.info