mips32: add fastdata loader working area
[fw/openocd] / src / target / mips32.c
index 0923a79293c28db7b7b164b72e52f6455498e0be..e48a040cec6c9228adc30bfae344af79eb3edab5 100644 (file)
@@ -309,6 +309,7 @@ int mips32_init_arch_info(struct target *target, struct mips32_common *mips32, s
 {
        target->arch_info = mips32;
        mips32->common_magic = MIPS32_COMMON_MAGIC;
+       mips32->fast_data_area = NULL;
 
        /* has breakpoint/watchpint unit been scanned */
        mips32->bp_scanned = 0;
@@ -348,7 +349,7 @@ static int mips32_run_and_wait(struct target *target, uint32_t entry_point,
        }
 
        pc = buf_get_u32(mips32->core_cache->reg_list[MIPS32_PC].value, 0, 32);
-       if (pc != exit_point)
+       if (exit_point && (pc != exit_point))
        {
                LOG_DEBUG("failed algoritm halted at 0x%" PRIx32 " ", pc);
                return ERROR_TARGET_TIMEOUT;
@@ -388,7 +389,7 @@ int mips32_run_algorithm(struct target *target, int num_mem_params,
        }
 
        /* refresh core register cache */
-       for (unsigned i = 0; i < MIPS32NUMCOREREGS; i++)
+       for (i = 0; i < MIPS32NUMCOREREGS; i++)
        {
                if (!mips32->core_cache->reg_list[i].valid)
                        mips32->read_core_reg(target, i);
@@ -404,7 +405,7 @@ int mips32_run_algorithm(struct target *target, int num_mem_params,
                }
        }
 
-       for (int i = 0; i < num_reg_params; i++)
+       for (i = 0; i < num_reg_params; i++)
        {
                struct reg *reg = register_get_by_name(mips32->core_cache, reg_params[i].reg_name, 0);
 
@@ -613,6 +614,8 @@ int mips32_checksum_memory(struct target *target, uint32_t address,
        int retval;
        uint32_t i;
 
+       /* see contib/loaders/checksum/mips32.s for src */
+
        static const uint32_t mips_crc_code[] =
        {
                0x248C0000,             /* addiu        $t4, $a0, 0 */