This is an automated email from Gerrit.

"Antonio Borneo <borneo.anto...@gmail.com>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/8316

-- gerrit

commit ba8faf2478abe61c6b965e3027864afb34db6984
Author: Antonio Borneo <borneo.anto...@gmail.com>
Date:   Tue Jun 4 10:30:20 2024 +0200

    target: cortex_m: fix detection of STAR-MC1 device
    
    The detection of Cortex-M STAR-MC1 was introduced with [1], at a
    time when OpenOCD was only checking the field PartNo of the CPUID
    register.
    Later-on [2], OpenOCD extended the check to the field implementer
    of CPUID register. The value for ARM (0x41) implementer was used
    to all the Cortex-M, but no feedback for STAR-MC1 was available. A
    comment reporting the possible mismatch was added.
    
    As reported on OpenOCD mailing-list, the tecnical reference manual
    for STAR-MC1 is now available [3] and it reports the implementer
    as ARM China (0x63) [3].
    
    Fix the STAR-MC1 implementer accordingly.
    
    Reported-by: Joseph Yiu <joseph....@arm.com>
    Change-Id: I8ed1064a847b73065528ee7032be967b5c58b431
    Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com>
    Link: [1] 7dc4be3157d6 ("target/arm: Add support with identify STAR-MC1")
    Fixes: [2] 05ee88915520 ("target/cortex_m: check core implementor field")
    Link: [3] 
https://www.armchina.com/download/Documents/Application-Notes/Technical-Reference-Manual?infoId=160

diff --git a/src/target/arm.h b/src/target/arm.h
index 486666b5c6..999dc9ae7f 100644
--- a/src/target/arm.h
+++ b/src/target/arm.h
@@ -62,6 +62,7 @@ enum arm_arch {
 enum arm_implementor {
        ARM_IMPLEMENTOR_ARM = 0x41,
        ARM_IMPLEMENTOR_INFINEON = 0x49,
+       ARM_IMPLEMENTOR_ARM_CHINA = 0x63,
        ARM_IMPLEMENTOR_REALTEK = 0x72,
 };
 
diff --git a/src/target/cortex_m.h b/src/target/cortex_m.h
index a585b786b9..aabdb90c9e 100644
--- a/src/target/cortex_m.h
+++ b/src/target/cortex_m.h
@@ -45,7 +45,7 @@
  */
 enum cortex_m_impl_part {
        CORTEX_M_PARTNO_INVALID,
-       STAR_MC1_PARTNO      = ARM_MAKE_CPUID(ARM_IMPLEMENTOR_ARM, 0x132), /* 
FIXME - confirm implementor! */
+       STAR_MC1_PARTNO      = ARM_MAKE_CPUID(ARM_IMPLEMENTOR_ARM_CHINA, 0x132),
        CORTEX_M0_PARTNO     = ARM_MAKE_CPUID(ARM_IMPLEMENTOR_ARM, 0xC20),
        CORTEX_M1_PARTNO     = ARM_MAKE_CPUID(ARM_IMPLEMENTOR_ARM, 0xC21),
        CORTEX_M3_PARTNO     = ARM_MAKE_CPUID(ARM_IMPLEMENTOR_ARM, 0xC23),

-- 

Reply via email to