summaryrefslogtreecommitdiff
path: root/src/flash/nor/stellaris.c
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-12-16 14:17:31 -0800
committerDavid Brownell <dbrownell@users.sourceforge.net>2009-12-16 14:17:31 -0800
commitd265c219b90bfe9454991bed6b41f790f085d230 (patch)
tree3c179d8f0d8a0755a21ea394e5012ff212b0e705 /src/flash/nor/stellaris.c
parent1cd7b3b49b33860a5652b9dd2829e9ed71ac6289 (diff)
downloadopenocd+libswd-d265c219b90bfe9454991bed6b41f790f085d230.tar.gz
openocd+libswd-d265c219b90bfe9454991bed6b41f790f085d230.tar.bz2
openocd+libswd-d265c219b90bfe9454991bed6b41f790f085d230.tar.xz
openocd+libswd-d265c219b90bfe9454991bed6b41f790f085d230.zip
stellaris: comments
Someday revisit various issues: Tempest parts support writing more than one word at a time; for some target firmware it might be necessary to save and restore flash IRQ configuration. (The safest policy is likely to always reset after flash updates.) Plus swap some undesirable TAB characters with SPACE. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'src/flash/nor/stellaris.c')
-rw-r--r--src/flash/nor/stellaris.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/flash/nor/stellaris.c b/src/flash/nor/stellaris.c
index 34649fca..4183cba8 100644
--- a/src/flash/nor/stellaris.c
+++ b/src/flash/nor/stellaris.c
@@ -553,6 +553,11 @@ static int stellaris_read_part_info(struct flash_bank *bank)
stellaris_info->pagesize = 1024;
stellaris_info->pages_in_lockregion = 2;
+ /* REVISIT for at least Tempest parts, read NVMSTAT.FWB too.
+ * That exposes a 32-word Flash Write Buffer ... enabling
+ * writes of more than one word at a time.
+ */
+
return ERROR_OK;
}
@@ -640,6 +645,10 @@ static int stellaris_erase(struct flash_bank *bank, int first, int last)
target_write_u32(target, FLASH_CIM, 0);
target_write_u32(target, FLASH_MISC, PMISC | AMISC);
+ /* REVISIT this clobbers state set by any halted firmware ...
+ * it might want to process those IRQs.
+ */
+
for (banknr = first; banknr <= last; banknr++)
{
/* Address is first word in page */
@@ -726,6 +735,10 @@ static int stellaris_protect(struct flash_bank *bank, int set, int first, int la
target_write_u32(target, FLASH_CIM, 0);
target_write_u32(target, FLASH_MISC, PMISC | AMISC);
+ /* REVISIT this clobbers state set by any halted firmware ...
+ * it might want to process those IRQs.
+ */
+
LOG_DEBUG("fmppe 0x%" PRIx32 "",fmppe);
target_write_u32(target, SCB_BASE | FMPPE, fmppe);
@@ -921,6 +934,10 @@ static int stellaris_write(struct flash_bank *bank, uint8_t *buffer, uint32_t of
target_write_u32(target, FLASH_CIM, 0);
target_write_u32(target, FLASH_MISC, PMISC | AMISC);
+ /* REVISIT this clobbers state set by any halted firmware ...
+ * it might want to process those IRQs.
+ */
+
/* multiple words to be programmed? */
if (words_remaining > 0)
{
@@ -1068,6 +1085,10 @@ static int stellaris_mass_erase(struct flash_bank *bank)
target_write_u32(target, FLASH_CIM, 0);
target_write_u32(target, FLASH_MISC, PMISC | AMISC);
+ /* REVISIT this clobbers state set by any halted firmware ...
+ * it might want to process those IRQs.
+ */
+
target_write_u32(target, FLASH_FMA, 0);
target_write_u32(target, FLASH_FMC, FMC_WRKEY | FMC_MERASE);
/* Wait until erase complete */