This is an automated email from Gerrit. Tomas Vanek ([email protected]) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/4470
-- gerrit commit b7d3eac00ef951db5f37027b84698be86e0bfb80 Author: Tomas Vanek <[email protected]> Date: Thu Mar 15 20:05:39 2018 +0100 target: hla target for unfracked DAP [WIP] Change-Id: Ib8319941f5cd27a7acf6e28a346f30999632ed4d Signed-off-by: Tomas Vanek <[email protected]> diff --git a/src/target/arm_dap.c b/src/target/arm_dap.c index cccc1c7..0e7defb 100644 --- a/src/target/arm_dap.c +++ b/src/target/arm_dap.c @@ -26,6 +26,7 @@ #include "target/arm_adi_v5.h" #include "helper/list.h" #include "helper/command.h" +#include "transport/transport.h" #include "jtag/swd.h" static LIST_HEAD(all_dap); @@ -91,9 +92,11 @@ static int dap_init_all(void) return retval; } - retval = dap_dp_init(dap); - if (retval != ERROR_OK) - return retval; + if (!transport_is_hla()) { + retval = dap_dp_init(dap); + if (retval != ERROR_OK) + return retval; + } } return ERROR_OK; diff --git a/src/target/hla_target.c b/src/target/hla_target.c index ba88248..0502ad4 100644 --- a/src/target/hla_target.c +++ b/src/target/hla_target.c @@ -376,6 +376,62 @@ static int adapter_target_create(struct target *target, return ERROR_OK; } +enum adiv5_cfg_param { + CFG_DAP, +}; + +static const Jim_Nvp nvp_config_opts[] = { + { .name = "-dap", .value = CFG_DAP }, + { .name = NULL, .value = -1 } +}; + +static int dummy_adiv5_jim_configure(struct target *target, Jim_GetOptInfo *goi) +{ + int e; + + while (goi->argc > 0) { + Jim_Nvp *n; + + Jim_SetEmptyResult(goi->interp); + + /* check first if topmost item is for us */ + e = Jim_Nvp_name2value_obj(goi->interp, nvp_config_opts, + goi->argv[0], &n); + if (e != JIM_OK) + return JIM_CONTINUE; + + e = Jim_GetOpt_Obj(goi, NULL); + if (e != JIM_OK) + return e; + + switch (n->value) { + case CFG_DAP: + if (goi->isconfigure) { + Jim_Obj *o_t; + e = Jim_GetOpt_Obj(goi, &o_t); + if (e != JIM_OK) + return e; + struct adiv5_dap *dap; + dap = dap_instance_by_jim_obj(goi->interp, o_t); + if (dap == NULL) + return JIM_ERR; + target->tap = dap->tap; + } else { + if (goi->argc != 0) { + Jim_WrongNumArgs(goi->interp, goi->argc, goi->argv, + "NO PARAMS"); + return JIM_ERR; + } + Jim_SetResultString(goi->interp, "DAP not configured", -1); + return JIM_ERR; + } + break; + } + } + + return JIM_OK; +} + static int adapter_load_context(struct target *target) { struct armv7m_common *armv7m = target_to_armv7m(target); @@ -801,6 +857,7 @@ struct target_type hla_target = { .init_target = adapter_init_target, .deinit_target = cortex_m_deinit_target, .target_create = adapter_target_create, + .target_jim_configure = dummy_adiv5_jim_configure, .examine = cortex_m_examine, .commands = adapter_command_handlers, -- ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
