+ if ((mvfr0 & MVFR0_DP_MASK) == MVFR0_DP) {
+ if ((mvfr1 & MVFR1_MVE_MASK) == MVFR1_MVE_F) {
+ LOG_TARGET_DEBUG(target, "%s floating point feature FPv5_DP + MVE-F found",
+ cortex_m->core_info->name);
+ armv7m->fp_feature = FPV5_MVE_F;
+ } else {
+ LOG_TARGET_DEBUG(target, "%s floating point feature FPv5_DP found",
+ cortex_m->core_info->name);
+ armv7m->fp_feature = FPV5_DP;
+ }
+ } else if ((mvfr0 & MVFR0_SP_MASK) == MVFR0_SP) {
+ LOG_TARGET_DEBUG(target, "%s floating point feature FPv5_SP found",
+ cortex_m->core_info->name);
+ armv7m->fp_feature = FPV5_SP;
+ } else if ((mvfr1 & MVFR1_MVE_MASK) == MVFR1_MVE_I) {
+ LOG_TARGET_DEBUG(target, "%s floating point feature MVE-I found",
+ cortex_m->core_info->name);
+ armv7m->fp_feature = FPV5_MVE_I;
+ }
+ }
+
+ /* VECTRESET is supported only on ARMv7-M cores */
+ cortex_m->vectreset_supported = armv7m->arm.arch == ARM_ARCH_V7M;
+
+ /* Check for FPU, otherwise mark FPU register as non-existent */
+ if (armv7m->fp_feature == FP_NONE)
+ for (size_t idx = ARMV7M_FPU_FIRST_REG; idx <= ARMV7M_FPU_LAST_REG; idx++)
+ armv7m->arm.core_cache->reg_list[idx].exist = false;
+
+ if (!cortex_m_has_tz(target))
+ for (size_t idx = ARMV8M_FIRST_REG; idx <= ARMV8M_LAST_REG; idx++)
+ armv7m->arm.core_cache->reg_list[idx].exist = false;
+
+ if (!armv7m->is_hla_target) {
+ if (cortex_m->core_info->flags & CORTEX_M_F_TAR_AUTOINCR_BLOCK_4K)
+ /* Cortex-M3/M4 have 4096 bytes autoincrement range,
+ * s. ARM IHI 0031C: MEM-AP 7.2.2 */
+ armv7m->debug_ap->tar_autoincr_block = (1 << 12);
+ }
+
+ retval = target_read_u32(target, DCB_DHCSR, &cortex_m->dcb_dhcsr);
+ if (retval != ERROR_OK)
+ return retval;
+
+ /* Don't cumulate sticky S_RESET_ST at the very first read of DHCSR
+ * as S_RESET_ST may indicate a reset that happened long time ago
+ * (most probably the power-on reset before OpenOCD was started).
+ * As we are just initializing the debug system we do not need
+ * to call cortex_m_endreset_event() in the following poll.
+ */
+ if (!cortex_m->dcb_dhcsr_sticky_is_recent) {
+ cortex_m->dcb_dhcsr_sticky_is_recent = true;
+ if (cortex_m->dcb_dhcsr & S_RESET_ST) {
+ LOG_TARGET_DEBUG(target, "reset happened some time ago, ignore");
+ cortex_m->dcb_dhcsr &= ~S_RESET_ST;