A DAP may also provide optional @var{configparams}:
@itemize @bullet
+@item @code{-adiv5}
+Specify that it's an ADIv5 DAP. This is the default if not specified.
+@item @code{-adiv6}
+Specify that it's an ADIv6 DAP.
@item @code{-ignore-syspwrupack}
-@*Specify this to ignore the CSYSPWRUPACK bit in the ARM DAP DP CTRL/STAT
+Specify this to ignore the CSYSPWRUPACK bit in the ARM DAP DP CTRL/STAT
register during initial examination and when checking the sticky error bit.
This bit is normally checked after setting the CSYSPWRUPREQ bit, but some
devices do not set the ack bit until sometime later.
* Record if enter in SWD required passing through DORMANT
*/
bool switch_through_dormant;
+
+ /** Indicates ADI version (5, 6 or 0 for unknown) being used */
+ unsigned int adi_version;
};
/**
return (ap->cfg_reg & MEM_AP_REG_CFG_LA) != 0;
}
+/**
+ * Check if DAP is ADIv6
+ *
+ * @param dap The DAP to test
+ *
+ * @return true for ADIv6, false for either ADIv5 or unknown version
+ */
+static inline bool is_adiv6(const struct adiv5_dap *dap)
+{
+ return dap->adi_version == 6;
+}
+
/**
* Send an adi-v5 sequence to the DAP.
*
} else
dap->ops = &jtag_dp_ops;
+ if (dap->adi_version == 0) {
+ LOG_DEBUG("DAP %s configured by default to use ADIv5 protocol", jtag_tap_name(dap->tap));
+ dap->adi_version = 5;
+ } else {
+ LOG_DEBUG("DAP %s configured to use %s protocol by user cfg file", jtag_tap_name(dap->tap),
+ is_adiv6(dap) ? "ADIv6" : "ADIv5");
+ }
+
retval = dap->ops->connect(dap);
if (retval != ERROR_OK)
return retval;
CFG_IGNORE_SYSPWRUPACK,
CFG_DP_ID,
CFG_INSTANCE_ID,
+ CFG_ADIV6,
+ CFG_ADIV5,
};
static const struct jim_nvp nvp_config_opts[] = {
{ .name = "-ignore-syspwrupack", .value = CFG_IGNORE_SYSPWRUPACK },
{ .name = "-dp-id", .value = CFG_DP_ID },
{ .name = "-instance-id", .value = CFG_INSTANCE_ID },
+ { .name = "-adiv6", .value = CFG_ADIV6 },
+ { .name = "-adiv5", .value = CFG_ADIV5 },
{ .name = NULL, .value = -1 }
};
dap->dap.multidrop_instance_id_valid = true;
break;
}
+ case CFG_ADIV6:
+ dap->dap.adi_version = 6;
+ break;
+ case CFG_ADIV5:
+ dap->dap.adi_version = 5;
+ break;
default:
break;
}