From: Paul Fertser Date: Fri, 15 Jan 2016 10:22:28 +0000 (+0300) Subject: flash: nor: {pic32mx,cfi}: fix register names X-Git-Tag: v0.10.0-rc1~277 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=61493083bcf02071ff95d0e7c95de0133f53dc0d;p=openocd flash: nor: {pic32mx,cfi}: fix register names Commit fd43be07265b5f3cf3146f2bb80c1c2fc0a44fcf introduced a regression: since the register names were changed from those traditional for MIPS to common GDB scheme the code that makes use of them needs to be changed accordingly. This commit restores pic32mx flash driver functionality. Change-Id: Id18c739390fae36737a02dc30c363d0444f53b96 Reported-by: Louis Rannou Signed-off-by: Paul Fertser Reviewed-on: http://openocd.zylin.com/3206 Tested-by: jenkins Reviewed-by: Spencer Oliver --- diff --git a/src/flash/nor/cfi.c b/src/flash/nor/cfi.c index 90d7d83d..efa0aeec 100644 --- a/src/flash/nor/cfi.c +++ b/src/flash/nor/cfi.c @@ -1529,16 +1529,16 @@ static int cfi_spansion_write_block_mips(struct flash_bank *bank, const uint8_t } ; - init_reg_param(®_params[0], "a0", 32, PARAM_OUT); - init_reg_param(®_params[1], "a1", 32, PARAM_OUT); - init_reg_param(®_params[2], "a2", 32, PARAM_OUT); - init_reg_param(®_params[3], "a3", 32, PARAM_OUT); - init_reg_param(®_params[4], "t0", 32, PARAM_OUT); - init_reg_param(®_params[5], "t1", 32, PARAM_IN); - init_reg_param(®_params[6], "t4", 32, PARAM_OUT); - init_reg_param(®_params[7], "t5", 32, PARAM_OUT); - init_reg_param(®_params[8], "t6", 32, PARAM_OUT); - init_reg_param(®_params[9], "t7", 32, PARAM_OUT); + init_reg_param(®_params[0], "r4", 32, PARAM_OUT); + init_reg_param(®_params[1], "r5", 32, PARAM_OUT); + init_reg_param(®_params[2], "r6", 32, PARAM_OUT); + init_reg_param(®_params[3], "r7", 32, PARAM_OUT); + init_reg_param(®_params[4], "r8", 32, PARAM_OUT); + init_reg_param(®_params[5], "r9", 32, PARAM_IN); + init_reg_param(®_params[6], "r12", 32, PARAM_OUT); + init_reg_param(®_params[7], "r13", 32, PARAM_OUT); + init_reg_param(®_params[8], "r14", 32, PARAM_OUT); + init_reg_param(®_params[9], "r15", 32, PARAM_OUT); while (count > 0) { uint32_t thisrun_count = (count > buffer_size) ? buffer_size : count; diff --git a/src/flash/nor/pic32mx.c b/src/flash/nor/pic32mx.c index 5e82ba63..70a66fa1 100644 --- a/src/flash/nor/pic32mx.c +++ b/src/flash/nor/pic32mx.c @@ -472,9 +472,9 @@ static int pic32mx_write_block(struct flash_bank *bank, const uint8_t *buffer, mips32_info.common_magic = MIPS32_COMMON_MAGIC; mips32_info.isa_mode = MIPS32_ISA_MIPS32; - init_reg_param(®_params[0], "a0", 32, PARAM_IN_OUT); - init_reg_param(®_params[1], "a1", 32, PARAM_OUT); - init_reg_param(®_params[2], "a2", 32, PARAM_OUT); + init_reg_param(®_params[0], "r4", 32, PARAM_IN_OUT); + init_reg_param(®_params[1], "r5", 32, PARAM_OUT); + init_reg_param(®_params[2], "r6", 32, PARAM_OUT); int row_offset = offset % row_size; uint8_t *new_buffer = NULL;