+ command_print(CMD, "0x%08"PRIx32, value);
+
+ return ERROR_OK;
+}
+
+COMMAND_HANDLER(handle_cti_ack)
+{
+ struct arm_cti *cti = CMD_DATA;
+ 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 *cti = CMD_DATA;
+ 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;