aice: support batch commands
Change-Id: I6846362d98374c93f45f339fb1279fc71721e696 Signed-off-by: Hsiangkai Wang <hsiangkai@gmail.com> Reviewed-on: http://openocd.zylin.com/1584 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
This commit is contained in:
committed by
Spencer Oliver
parent
afb7cb7398
commit
4be6e26825
@@ -95,14 +95,15 @@ int aice_program_edm(struct aice_port_s *aice, char *command_sequence)
|
||||
return aice->port->api->program_edm(command_sequence);
|
||||
}
|
||||
|
||||
int aice_pack_command(struct aice_port_s *aice, bool enable_pack_command)
|
||||
int aice_set_command_mode(struct aice_port_s *aice,
|
||||
enum aice_command_mode command_mode)
|
||||
{
|
||||
if (aice->port->api->pack_command == NULL) {
|
||||
if (aice->port->api->set_command_mode == NULL) {
|
||||
LOG_WARNING("Not implemented: %s", __func__);
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
||||
return aice->port->api->pack_command(enable_pack_command);
|
||||
return aice->port->api->set_command_mode(command_mode);
|
||||
}
|
||||
|
||||
int aice_execute(struct aice_port_s *aice, uint32_t *instructions,
|
||||
|
||||
@@ -30,7 +30,8 @@ int aice_read_tlb(struct aice_port_s *aice, uint32_t virtual_address,
|
||||
int aice_cache_ctl(struct aice_port_s *aice, uint32_t subtype, uint32_t address);
|
||||
int aice_set_retry_times(struct aice_port_s *aice, uint32_t a_retry_times);
|
||||
int aice_program_edm(struct aice_port_s *aice, char *command_sequence);
|
||||
int aice_pack_command(struct aice_port_s *aice, bool enable_pack_command);
|
||||
int aice_set_command_mode(struct aice_port_s *aice,
|
||||
enum aice_command_mode command_mode);
|
||||
int aice_execute(struct aice_port_s *aice, uint32_t *instructions,
|
||||
uint32_t instruction_num);
|
||||
int aice_set_custom_srst_script(struct aice_port_s *aice, const char *script);
|
||||
|
||||
@@ -738,7 +738,7 @@ static int jim_nds32_multi_write(Jim_Interp *interp, int argc, Jim_Obj * const *
|
||||
uint32_t data;
|
||||
jim_wide i;
|
||||
|
||||
aice_pack_command(aice, true);
|
||||
aice_set_command_mode(aice, AICE_COMMAND_MODE_PACK);
|
||||
for (i = 0; i < num_of_pairs; i++) {
|
||||
jim_wide tmp;
|
||||
e = Jim_GetOpt_Wide(&goi, &tmp);
|
||||
@@ -755,7 +755,7 @@ static int jim_nds32_multi_write(Jim_Interp *interp, int argc, Jim_Obj * const *
|
||||
if (result != ERROR_OK)
|
||||
break;
|
||||
}
|
||||
aice_pack_command(aice, false);
|
||||
aice_set_command_mode(aice, AICE_COMMAND_MODE_NORMAL);
|
||||
|
||||
/* all args must be consumed */
|
||||
if (goi.argc != 0)
|
||||
|
||||
Reference in New Issue
Block a user