# HG changeset patch # User jlarmour # Date 1067448071 0 # Node ID 4abdcd2f65a98a26a1838c221a3ca5ef92ec4914 # Parent 564441705fa6eb2c536738d89523086460f5741c * src/flash_unlock_block.c (flash_unlock_block): test lock bit explicitly - newer flash parts use the reserved bits in the returned data. diff --git a/packages/devs/flash/intel/strata/current/ChangeLog b/packages/devs/flash/intel/strata/current/ChangeLog --- a/packages/devs/flash/intel/strata/current/ChangeLog +++ b/packages/devs/flash/intel/strata/current/ChangeLog @@ -1,3 +1,9 @@ +2003-10-29 Jonathan Larmour + + * src/flash_unlock_block.c (flash_unlock_block): test lock bit + explicitly - newer flash parts use the reserved bits in the + returned data. + 2003-09-11 Jani Monoses * src/flash_erase_block.c (flash_erase_block): diff --git a/packages/devs/flash/intel/strata/current/src/flash_unlock_block.c b/packages/devs/flash/intel/strata/current/src/flash_unlock_block.c --- a/packages/devs/flash/intel/strata/current/src/flash_unlock_block.c +++ b/packages/devs/flash/intel/strata/current/src/flash_unlock_block.c @@ -62,6 +62,7 @@ // #define MAX_FLASH_BLOCKS 128 +#define FLASH_LOCK_MASK 0x1 // which bit of the read query has the lock bit int flash_unlock_block(volatile flash_t *block, int block_size, int blocks) @@ -103,9 +104,9 @@ flash_unlock_block(volatile flash_t *blo is_locked[i] = 0; } else { #if 8 == CYGNUM_FLASH_WIDTH - is_locked[i] = bpv[4]; + is_locked[i] = bpv[4] & FLASH_LOCK_MASK; #else - is_locked[i] = bpv[2]; + is_locked[i] = bpv[2] & FLASH_LOCK_MASK; # endif } bp += block_size / sizeof(*bp);