This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Strata flash lock bits fix
- From: Jonathan Larmour <jlarmour at jifvik dot org>
- To: ecos-patches at ecos dot sourceware dot org
- Date: Wed, 29 Oct 2003 17:21:04 GMT
- Subject: Strata flash lock bits fix
Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/intel/strata/current/ChangeLog,v
retrieving revision 1.18
diff -u -5 -p -r1.18 ChangeLog
--- ChangeLog 11 Sep 2003 13:21:39 -0000 1.18
+++ ChangeLog 29 Oct 2003 17:21:03 -0000
@@ -1,5 +1,11 @@
+2003-10-29 Jonathan Larmour <jifl@eCosCentric.com>
+
+ * 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 <jani@iv.ro>
* src/flash_erase_block.c (flash_erase_block):
* src/flash_program_buf.c (flash_program_buf): Fix bootblock handling
in erase. Fix erase and word-program for Synchronous Strata and later
Index: src/flash_unlock_block.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/intel/strata/current/src/flash_unlock_block.c,v
retrieving revision 1.6
diff -u -5 -p -r1.6 flash_unlock_block.c
--- src/flash_unlock_block.c 10 Sep 2003 20:52:53 -0000 1.6
+++ src/flash_unlock_block.c 29 Oct 2003 17:21:04 -0000
@@ -60,10 +60,11 @@
// the locks in the device at once. This routine will use that approach and
// then reset the regions which are known to be locked.
//
#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)
__attribute__ ((section (".2ram.flash_unlock_block")));
int
@@ -101,13 +102,13 @@ flash_unlock_block(volatile flash_t *blo
*bpv = FLASH_Read_Query;
if (bpv == block) {
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);
}