diff options
Diffstat (limited to 'src/target/cortex_a.c')
-rw-r--r-- | src/target/cortex_a.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c index 4f351f04..22cbc3d0 100644 --- a/src/target/cortex_a.c +++ b/src/target/cortex_a.c @@ -2678,7 +2678,7 @@ static int cortex_a_examine_first(struct target *target) int i; int retval = ERROR_OK; - uint32_t didr, cpuid, dbg_osreg; + uint32_t didr, cpuid, dbg_osreg, dbg_idpfr1; /* Search for the APB-AP - it is needed for access to debug registers */ retval = dap_find_ap(swjdp, AP_TYPE_APB_AP, &armv7a->debug_ap); @@ -2787,7 +2787,16 @@ static int cortex_a_examine_first(struct target *target) } } - armv7a->arm.core_type = ARM_CORE_TYPE_SEC_EXT; + retval = mem_ap_read_atomic_u32(armv7a->debug_ap, + armv7a->debug_base + CPUDBG_ID_PFR1, &dbg_idpfr1); + if (retval != ERROR_OK) + return retval; + + if (dbg_idpfr1 & 0x000000f0) { + LOG_DEBUG("target->coreid %" PRId32 " has security extensions", + target->coreid); + armv7a->arm.core_type = ARM_CORE_TYPE_SEC_EXT; + } /* Avoid recreating the registers cache */ if (!target_was_examined(target)) { |