aboutsummaryrefslogtreecommitdiff
path: root/src/target/cortex_m.c
diff options
context:
space:
mode:
authorMathias K <kesmtp@freenet.de>2012-03-12 11:28:49 +0100
committerSpencer Oliver <spen@spen-soft.co.uk>2012-03-14 20:35:59 +0000
commite2073cc18ae1380a7f6d0f61f49aab42de01b732 (patch)
treecf2b9803704eac2a9ab83ad14ebddf60d45920a3 /src/target/cortex_m.c
parent6f5b9e9304c7f7625f1af04bac6e8cd0a67e649d (diff)
stm32: determine all cpu types and use common examine
This patch determine all cpu types and not only the cortex M3 and the stm32 target use the common target examine function from the cortex_m sources. Change-Id: If689dd994b3855284b927fc4b206f420cf32b6c7 Signed-off-by: Mathias K <kesmtp@freenet.de> Reviewed-on: http://openocd.zylin.com/511 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src/target/cortex_m.c')
-rw-r--r--src/target/cortex_m.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c
index 5ab120f2..76e197c1 100644
--- a/src/target/cortex_m.c
+++ b/src/target/cortex_m.c
@@ -1756,7 +1756,7 @@ fail1:
*/
}
-static int cortex_m3_examine(struct target *target)
+int cortex_m3_examine(struct target *target)
{
int retval;
uint32_t cpuid, fpcr;
@@ -1776,9 +1776,11 @@ static int cortex_m3_examine(struct target *target)
if (retval != ERROR_OK)
return retval;
- if (((cpuid >> 4) & 0xc3f) == 0xc23)
- LOG_DEBUG("Cortex-M3 r%" PRId8 "p%" PRId8 " processor detected",
- (uint8_t)((cpuid >> 20) & 0xf), (uint8_t)((cpuid >> 0) & 0xf));
+ /* Get CPU Type */
+ i = (cpuid >> 4) & 0xf;
+
+ LOG_DEBUG("Cortex-M%d r%" PRId8 "p%" PRId8 " processor detected",
+ i, (uint8_t)((cpuid >> 20) & 0xf), (uint8_t)((cpuid >> 0) & 0xf));
LOG_DEBUG("cpuid: 0x%8.8" PRIx32 "", cpuid);
/* NOTE: FPB and DWT are both optional. */