summaryrefslogtreecommitdiff
path: root/src/flash/nor
diff options
context:
space:
mode:
authorPiotr Esden-Tempski <piotr@esden.net>2009-12-28 16:43:51 +0100
committerDavid Brownell <dbrownell@users.sourceforge.net>2009-12-28 12:31:47 -0800
commitcba1813d5c017e2d20969bb419a856fe15c5ceef (patch)
treeb1663f2bc1e6299f52ea64a1453ebd1e20e6df97 /src/flash/nor
parent3ace333663628d00795fd0b5ab80c91e6025b4dc (diff)
downloadopenocd+libswd-cba1813d5c017e2d20969bb419a856fe15c5ceef.tar.gz
openocd+libswd-cba1813d5c017e2d20969bb419a856fe15c5ceef.tar.bz2
openocd+libswd-cba1813d5c017e2d20969bb419a856fe15c5ceef.tar.xz
openocd+libswd-cba1813d5c017e2d20969bb419a856fe15c5ceef.zip
NOR: last_addr also needs correction when checking alignment
Otherwise the new alignment checking algorithm thinks that the address is not aligned, because it is way beyond the last sector. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'src/flash/nor')
-rw-r--r--src/flash/nor/core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/flash/nor/core.c b/src/flash/nor/core.c
index 5eb51cd2..01088f3c 100644
--- a/src/flash/nor/core.c
+++ b/src/flash/nor/core.c
@@ -316,6 +316,7 @@ static int flash_iterate_address_range(struct target *target,
/** @todo: handle erasures that cross into adjacent banks */
addr -= c->base;
+ last_addr -= c->base;
for (i = 0; i < c->num_sectors; i++)
{