flash: use correct device_id mask

The stm32 drivers have been using 0x7ff as the DEV_ID mask, this should
have been 0xfff.

Change-Id: I232469620969d6dd1b9a2a2aa15ec18b947dbb05
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/352
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
This commit is contained in:
Spencer Oliver
2012-01-09 12:42:31 +00:00
parent afe95871c5
commit ad0847ca38
3 changed files with 20 additions and 49 deletions

View File

@@ -605,14 +605,14 @@ static int stm32x_probe(struct flash_bank *bank)
flash_size_in_kb = 0xffff;
}
if ((device_id & 0x7ff) == 0x411) {
if ((device_id & 0xfff) == 0x411) {
/* check for early silicon */
if (flash_size_in_kb == 0xffff) {
/* number of sectors may be incorrrect on early silicon */
LOG_WARNING("STM32 flash size failed, probe inaccurate - assuming 512k flash");
flash_size_in_kb = 512;
}
} else if ((device_id & 0x7ff) == 0x413) {
} else if ((device_id & 0xfff) == 0x413) {
/* check for early silicon */
if (flash_size_in_kb == 0xffff) {
/* number of sectors may be incorrrect on early silicon */
@@ -681,7 +681,7 @@ static int get_stm32x_info(struct flash_bank *bank, char *buf, int buf_size)
if (retval != ERROR_OK)
return retval;
if ((device_id & 0x7ff) == 0x411) {
if ((device_id & 0xfff) == 0x411) {
printed = snprintf(buf, buf_size, "stm32f2x - Rev: ");
buf += printed;
buf_size -= printed;
@@ -707,7 +707,7 @@ static int get_stm32x_info(struct flash_bank *bank, char *buf, int buf_size)
snprintf(buf, buf_size, "unknown");
break;
}
} else if ((device_id & 0x7ff) == 0x413) {
} else if ((device_id & 0xfff) == 0x413) {
printed = snprintf(buf, buf_size, "stm32f4x - Rev: ");
buf += printed;
buf_size -= printed;