mark usage of in_handler that can be converted into user code
[fw/openocd] / src / target / feroceon.c
index 92d2aa00968bd9d6606dcc58453f6585bd1edd4e..8ef74c1dab6485e21b23020387dbd4fd8c9d87fa 100644 (file)
@@ -22,7 +22,7 @@
  ***************************************************************************/
 
 /*
- * Marvell Feroceon (88F5182, 88F5281) support.
+ * Marvell Feroceon support, including Orion and Kirkwood SOCs.
  *
  * The Feroceon core mimics the ARM926 ICE interface with the following
  * differences:
@@ -162,9 +162,9 @@ int feroceon_dummy_clock_out(arm_jtag_t *jtag_info, u32 instr)
        fields[2].in_handler = NULL;
        fields[2].in_handler_priv = NULL;
 
-       jtag_add_dr_scan(3, fields, -1);
+       jtag_add_dr_scan(3, fields, TAP_INVALID);
 
-       /* no jtag_add_runtest(0, -1) here */
+       /* no jtag_add_runtest(0, TAP_INVALID) here */
 
        return ERROR_OK;
 }
@@ -517,7 +517,7 @@ int feroceon_bulk_write_memory(target_t *target, u32 address, u32 count, u8 *buf
        arm7_9_common_t *arm7_9 = armv4_5->arch_info;
        enum armv4_5_state core_state = armv4_5->core_state;
        u32 x, flip, shift, save[7];
-       int i;
+       u32 i;
 
        /*
         * We can't use the dcc flow control bits, so let's transfer data
@@ -547,7 +547,7 @@ int feroceon_bulk_write_memory(target_t *target, u32 address, u32 count, u8 *buf
                0xeafffff3,     /*      b       3b                      */
        };
 
-       int dcc_size = sizeof(dcc_code);
+       u32 dcc_size = sizeof(dcc_code);
 
        if (!arm7_9->dcc_downloads)
                return target->type->write_memory(target, address, 4, count, buffer);
@@ -569,7 +569,7 @@ int feroceon_bulk_write_memory(target_t *target, u32 address, u32 count, u8 *buf
                        target_buffer_set_u32(target, dcc_code_buf + i*4, dcc_code[i]);
 
                /* write DCC code to working area */
-               if((retval = target->type->write_memory(target, arm7_9->dcc_working_area->address, 4, dcc_size, dcc_code_buf)) != ERROR_OK)
+               if((retval = target->type->write_memory(target, arm7_9->dcc_working_area->address, 4, dcc_size/4, dcc_code_buf)) != ERROR_OK)
                {
                        return retval;
                }
@@ -645,7 +645,7 @@ int feroceon_target_create(struct target_s *target, Jim_Interp *interp)
        arm7_9_common_t *arm7_9;
        arm926ejs_common_t *arm926ejs = calloc(1,sizeof(arm926ejs_common_t));
 
-       arm926ejs_init_arch_info(target, arm926ejs, target->tap, target->variant);
+       arm926ejs_init_arch_info(target, arm926ejs, target->tap);
 
        armv4_5 = target->arch_info;
        arm7_9 = armv4_5->arch_info;
@@ -684,7 +684,6 @@ int feroceon_target_create(struct target_s *target, Jim_Interp *interp)
        return ERROR_OK;
 }
 
-
 int feroceon_examine(struct target_s *target)
 {
        armv4_5_common_t *armv4_5;