X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Ftarget%2Farm720t.c;h=d6aa28fb53a80f7fd52dd5c098f1a5c38a10d295;hb=86173cdbddde781b19ac630602f2d450a59b32b5;hp=60c4dec79191a1053afa68921fe22c56183910b4;hpb=4d88c124b1262a738b4a9f107ef62404a45bf323;p=openocd.git diff --git a/src/target/arm720t.c b/src/target/arm720t.c index 60c4dec791..d6aa28fb53 100644 --- a/src/target/arm720t.c +++ b/src/target/arm720t.c @@ -22,12 +22,9 @@ #endif #include "arm720t.h" -#include "jtag.h" -#include "log.h" #include "time_support.h" +#include "target_type.h" -#include -#include #if 0 #define _DEBUG_INSTRUCTION_EXECUTION_ @@ -46,8 +43,8 @@ int arm720t_target_create(struct target_s *target,Jim_Interp *interp); int arm720t_init_target(struct command_context_s *cmd_ctx, struct target_s *target); int arm720t_quit(void); int arm720t_arch_state(struct target_s *target); -int arm720t_read_memory(struct target_s *target, u32 address, u32 size, u32 count, u8 *buffer); -int arm720t_write_memory(struct target_s *target, u32 address, u32 size, u32 count, u8 *buffer); +int arm720t_read_memory(struct target_s *target, u32 address, u32 size, u32 count, uint8_t *buffer); +int arm720t_write_memory(struct target_s *target, u32 address, u32 size, u32 count, uint8_t *buffer); int arm720t_soft_reset_halt(struct target_s *target); target_type_t arm720t_target = @@ -94,12 +91,12 @@ int arm720t_scan_cp15(target_t *target, u32 out, u32 *in, int instruction, int c arm7_9_common_t *arm7_9 = armv4_5->arch_info; arm_jtag_t *jtag_info = &arm7_9->jtag_info; scan_field_t fields[2]; - u8 out_buf[4]; - u8 instruction_buf = instruction; + uint8_t out_buf[4]; + uint8_t instruction_buf = instruction; buf_set_u32(out_buf, 0, 32, flip_u32(out, 32)); - jtag_add_end_state(TAP_DRPAUSE); + jtag_set_end_state(TAP_DRPAUSE); if((retval = arm_jtag_scann(jtag_info, 0xf)) != ERROR_OK) { return retval; @@ -112,34 +109,25 @@ int arm720t_scan_cp15(target_t *target, u32 out, u32 *in, int instruction, int c fields[0].tap = jtag_info->tap; fields[0].num_bits = 1; fields[0].out_value = &instruction_buf; - fields[0].in_value = NULL; - fields[0].in_check_value = NULL; - fields[0].in_check_mask = NULL; - fields[0].in_handler = NULL; - fields[0].in_handler_priv = NULL; fields[1].tap = jtag_info->tap; fields[1].num_bits = 32; fields[1].out_value = out_buf; - fields[1].in_value = NULL; + if (in) { - fields[1].in_handler = arm_jtag_buf_to_u32_flip; /* deprecated! invoke this from user code! */ - fields[1].in_handler_priv = in; + fields[1].in_value = (uint8_t *)in; + jtag_add_dr_scan(2, fields, jtag_get_end_state()); + jtag_add_callback(arm7flip32, (uint8_t *)in); } else { - fields[1].in_handler = NULL; - fields[1].in_handler_priv = NULL; + jtag_add_dr_scan(2, fields, jtag_get_end_state()); } - fields[1].in_check_value = NULL; - fields[1].in_check_mask = NULL; - - jtag_add_dr_scan(2, fields, TAP_INVALID); if (clock) - jtag_add_runtest(0, TAP_INVALID); + jtag_add_runtest(0, jtag_get_end_state()); #ifdef _DEBUG_INSTRUCTION_EXECUTION_ if((retval = jtag_execute_queue()) != ERROR_OK) @@ -341,7 +329,7 @@ int arm720t_arch_state(struct target_s *target) return ERROR_OK; } -int arm720t_read_memory(struct target_s *target, u32 address, u32 size, u32 count, u8 *buffer) +int arm720t_read_memory(struct target_s *target, u32 address, u32 size, u32 count, uint8_t *buffer) { int retval; armv4_5_common_t *armv4_5 = target->arch_info; @@ -361,7 +349,7 @@ int arm720t_read_memory(struct target_s *target, u32 address, u32 size, u32 coun return retval; } -int arm720t_write_memory(struct target_s *target, u32 address, u32 size, u32 count, u8 *buffer) +int arm720t_write_memory(struct target_s *target, u32 address, u32 size, u32 count, uint8_t *buffer) { int retval;