target/arm_cti: add new 'ack' and 'channel' commands
these commands have been introduced to ease the manipulation of CTI trough script files, these commands are: - $cti_name ack $event : to acknowledge a CTI event - $cti_name channel $channel_number $operation: to perform an operation on a specific channel, the possible operations are: gate, ungate, set, clear and pulse Change-Id: I35463867a3c85072f3776c3aeb1e5788953ec435 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/5315 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
This commit is contained in:
parent
bc0667c237
commit
0750a7c085
|
@ -8436,6 +8436,15 @@ Write @var{value} to the CTI register with the symbolic name @var{reg_name}.
|
||||||
Print the value read from the CTI register with the symbolic name @var{reg_name}.
|
Print the value read from the CTI register with the symbolic name @var{reg_name}.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
|
@deffn Command {$cti_name ack} @var{event}
|
||||||
|
Acknowledge a CTI @var{event}.
|
||||||
|
@end deffn
|
||||||
|
|
||||||
|
@deffn Command {$cti_name channel} @var{channel_number} @var{operation}
|
||||||
|
Perform a specific channel operation, the possible operations are:
|
||||||
|
gate, ungate, set, clear and pulse
|
||||||
|
@end deffn
|
||||||
|
|
||||||
@deffn Command {$cti_name testmode} @option{on|off}
|
@deffn Command {$cti_name testmode} @option{on|off}
|
||||||
Enable (@option{on}) or disable (@option{off}) the integration test mode
|
Enable (@option{on}) or disable (@option{off}) the integration test mode
|
||||||
of the CTI.
|
of the CTI.
|
||||||
|
|
|
@ -341,6 +341,59 @@ COMMAND_HANDLER(handle_cti_read)
|
||||||
return ERROR_OK;
|
return ERROR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
COMMAND_HANDLER(handle_cti_ack)
|
||||||
|
{
|
||||||
|
struct arm_cti_object *obj = CMD_DATA;
|
||||||
|
struct arm_cti *cti = &obj->cti;
|
||||||
|
uint32_t event;
|
||||||
|
|
||||||
|
if (CMD_ARGC != 1)
|
||||||
|
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||||
|
|
||||||
|
COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], event);
|
||||||
|
|
||||||
|
int retval = arm_cti_ack_events(cti, 1 << event);
|
||||||
|
|
||||||
|
|
||||||
|
if (retval != ERROR_OK)
|
||||||
|
return retval;
|
||||||
|
|
||||||
|
return ERROR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
COMMAND_HANDLER(handle_cti_channel)
|
||||||
|
{
|
||||||
|
struct arm_cti_object *obj = CMD_DATA;
|
||||||
|
struct arm_cti *cti = &obj->cti;
|
||||||
|
int retval = ERROR_OK;
|
||||||
|
uint32_t ch_num;
|
||||||
|
|
||||||
|
if (CMD_ARGC != 2)
|
||||||
|
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||||
|
|
||||||
|
COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], ch_num);
|
||||||
|
|
||||||
|
if (!strcmp(CMD_ARGV[1], "gate"))
|
||||||
|
retval = arm_cti_gate_channel(cti, ch_num);
|
||||||
|
else if (!strcmp(CMD_ARGV[1], "ungate"))
|
||||||
|
retval = arm_cti_ungate_channel(cti, ch_num);
|
||||||
|
else if (!strcmp(CMD_ARGV[1], "pulse"))
|
||||||
|
retval = arm_cti_pulse_channel(cti, ch_num);
|
||||||
|
else if (!strcmp(CMD_ARGV[1], "set"))
|
||||||
|
retval = arm_cti_set_channel(cti, ch_num);
|
||||||
|
else if (!strcmp(CMD_ARGV[1], "clear"))
|
||||||
|
retval = arm_cti_clear_channel(cti, ch_num);
|
||||||
|
else {
|
||||||
|
command_print(CMD, "Possible channel operations: gate|ungate|set|clear|pulse");
|
||||||
|
return ERROR_COMMAND_ARGUMENT_INVALID;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (retval != ERROR_OK)
|
||||||
|
return retval;
|
||||||
|
|
||||||
|
return ERROR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct command_registration cti_instance_command_handlers[] = {
|
static const struct command_registration cti_instance_command_handlers[] = {
|
||||||
{
|
{
|
||||||
.name = "dump",
|
.name = "dump",
|
||||||
|
@ -377,6 +430,21 @@ static const struct command_registration cti_instance_command_handlers[] = {
|
||||||
.help = "read a CTI register",
|
.help = "read a CTI register",
|
||||||
.usage = "register_name",
|
.usage = "register_name",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.name = "ack",
|
||||||
|
.mode = COMMAND_EXEC,
|
||||||
|
.handler = handle_cti_ack,
|
||||||
|
.help = "acknowledge a CTI event",
|
||||||
|
.usage = "event",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = "channel",
|
||||||
|
.mode = COMMAND_EXEC,
|
||||||
|
.handler = handle_cti_channel,
|
||||||
|
.help = "do an operation on one CTI channel, possible operations: "
|
||||||
|
"gate, ungate, set, clear and pulse",
|
||||||
|
.usage = "channel_number operation",
|
||||||
|
},
|
||||||
COMMAND_REGISTRATION_DONE
|
COMMAND_REGISTRATION_DONE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue