cortex_m: enhance core and arch detection
authorTarek BOCHKATI <tarek.bouchkati@gmail.com>
Tue, 11 May 2021 13:03:47 +0000 (14:03 +0100)
committerAntonio Borneo <borneo.antonio@gmail.com>
Fri, 18 Jun 2021 22:13:18 +0000 (23:13 +0100)
commit11857607293e1b27b43c307c3f6fba6ebbce90a8
tree5a5b41b80e85907392bdcf33ecf6ff33adfeb09d
parentf69adafb3dd252eaf6b269b7993b29d3c78a91c8
cortex_m: enhance core and arch detection

Rework core detection by adding cortex_m_partno enum to detect all CPUs
using the same method.

Instead of checking the core PARTNO then assign the arch, use the stored
information within cortex_m parts[] with the flags inside which can help
simplifying a bit the cortex_m_examine code.

This change fixes:
 - the Cortex-M1 detection as ARMv6-M Core (was managed as ARMv7-M)
 - the displayed CPU name for Cortex-M0+ (was displayed Cortex-M0)

Change-Id: I40b6e03f7cf3664c85e297adfc25323196dfe90b
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/6233
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
src/target/cortex_m.c
src/target/cortex_m.h