diff options
author | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-04-08 18:55:39 +0000 |
---|---|---|
committer | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-04-08 18:55:39 +0000 |
commit | de330ca55946d11fc3b1b19c3b808ed96afa0acd (patch) | |
tree | dbb27e795e602e694861e321076e5f04bfccc287 | |
parent | 30cda620cba6751b341d74a14790824d3f48f9c8 (diff) | |
download | openocd+libswd-de330ca55946d11fc3b1b19c3b808ed96afa0acd.tar.gz openocd+libswd-de330ca55946d11fc3b1b19c3b808ed96afa0acd.tar.bz2 openocd+libswd-de330ca55946d11fc3b1b19c3b808ed96afa0acd.tar.xz openocd+libswd-de330ca55946d11fc3b1b19c3b808ed96afa0acd.zip |
Edwin Olson found bug & tested fix for flash write_image for stellaris.
git-svn-id: svn://svn.berlios.de/openocd/trunk@550 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r-- | src/flash/stellaris.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/flash/stellaris.c b/src/flash/stellaris.c index 727a5d30..502659e3 100644 --- a/src/flash/stellaris.c +++ b/src/flash/stellaris.c @@ -459,6 +459,17 @@ int stellaris_read_part_info(struct flash_bank_s *bank) stellaris_info->pages_in_lockregion = 2; target_read_u32(target, SCB_BASE|FMPPE, &stellaris_info->lockbits); + /* provide this for the benefit of the higher flash driver layers */ + bank->num_sectors = stellaris_info->num_pages; + bank->sectors = malloc(sizeof(flash_sector_t) * bank->num_sectors); + for (i = 0; i < bank->num_sectors; i++) + { + bank->sectors[i].offset = i*stellaris_info->pagesize; + bank->sectors[i].size = stellaris_info->pagesize; + bank->sectors[i].is_erased = -1; + bank->sectors[i].is_protected = -1; + } + /* Read main and master clock freqency register */ stellaris_read_clock_info(bank); |