summaryrefslogtreecommitdiff
path: root/src/flash
diff options
context:
space:
mode:
authorntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-02-14 10:02:51 +0000
committerntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-02-14 10:02:51 +0000
commitc65f7cf2fa8f3fac1d8caba5129fb78993c21125 (patch)
tree98c4bd51f516b819c1a6c45eb36c300747242395 /src/flash
parent2a0317e6f40a4f2d5d20ccdaae82100f0ad4340a (diff)
downloadopenocd_libswd-c65f7cf2fa8f3fac1d8caba5129fb78993c21125.tar.gz
openocd_libswd-c65f7cf2fa8f3fac1d8caba5129fb78993c21125.tar.bz2
openocd_libswd-c65f7cf2fa8f3fac1d8caba5129fb78993c21125.tar.xz
openocd_libswd-c65f7cf2fa8f3fac1d8caba5129fb78993c21125.zip
- added check for revA silicon in stm32 flash driver
git-svn-id: svn://svn.berlios.de/openocd/trunk@294 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/flash')
-rw-r--r--src/flash/stm32x.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/flash/stm32x.c b/src/flash/stm32x.c
index 7039a3d4..8363039f 100644
--- a/src/flash/stm32x.c
+++ b/src/flash/stm32x.c
@@ -660,6 +660,15 @@ int stm32x_probe(struct flash_bank_s *bank)
/* get flash size from target */
target_read_u16(target, 0x1FFFF7E0, &num_sectors);
+
+ /* check for early silicon rev A */
+ if ((device_id >> 16) == 0 )
+ {
+ /* number of sectors incorrect on revA */
+ WARNING( "STM32 Rev A Silicon detected, probe inaccurate - assuming 128k flash" );
+ num_sectors = 128;
+ }
+
INFO( "flash size = %dkbytes", num_sectors );
bank->base = 0x08000000;