|
@@ -446,7 +446,7 @@ static int mips32_pracc_read_mem16(struct mips_ejtag *ejtag_info, uint32_t addr, |
|
|
uint32_t *param_out = malloc(count * sizeof(uint32_t)); |
|
|
uint32_t *param_out = malloc(count * sizeof(uint32_t)); |
|
|
int i; |
|
|
int i; |
|
|
|
|
|
|
|
|
// int retval; |
|
|
|
|
|
|
|
|
int retval = ERROR_OK; |
|
|
int blocksize; |
|
|
int blocksize; |
|
|
int bytesread; |
|
|
int bytesread; |
|
|
uint32_t param_in[2]; |
|
|
uint32_t param_in[2]; |
|
@@ -462,7 +462,7 @@ static int mips32_pracc_read_mem16(struct mips_ejtag *ejtag_info, uint32_t addr, |
|
|
param_in[0] = addr; |
|
|
param_in[0] = addr; |
|
|
param_in[1] = blocksize; |
|
|
param_in[1] = blocksize; |
|
|
|
|
|
|
|
|
mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \ |
|
|
|
|
|
|
|
|
retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, |
|
|
ARRAY_SIZE(param_in), param_in, count, param_out, 1); |
|
|
ARRAY_SIZE(param_in), param_in, count, param_out, 1); |
|
|
|
|
|
|
|
|
// count -= blocksize; |
|
|
// count -= blocksize; |
|
@@ -477,7 +477,7 @@ static int mips32_pracc_read_mem16(struct mips_ejtag *ejtag_info, uint32_t addr, |
|
|
|
|
|
|
|
|
free(param_out); |
|
|
free(param_out); |
|
|
|
|
|
|
|
|
return ERROR_OK; |
|
|
|
|
|
|
|
|
return retval; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static int mips32_pracc_read_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, int count, uint8_t *buf) |
|
|
static int mips32_pracc_read_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, int count, uint8_t *buf) |
|
@@ -523,7 +523,7 @@ static int mips32_pracc_read_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, |
|
|
uint32_t *param_out = malloc(count * sizeof(uint32_t)); |
|
|
uint32_t *param_out = malloc(count * sizeof(uint32_t)); |
|
|
int i; |
|
|
int i; |
|
|
|
|
|
|
|
|
// int retval; |
|
|
|
|
|
|
|
|
int retval = ERROR_OK; |
|
|
int blocksize; |
|
|
int blocksize; |
|
|
int bytesread; |
|
|
int bytesread; |
|
|
uint32_t param_in[2]; |
|
|
uint32_t param_in[2]; |
|
@@ -539,7 +539,7 @@ static int mips32_pracc_read_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, |
|
|
param_in[0] = addr; |
|
|
param_in[0] = addr; |
|
|
param_in[1] = blocksize; |
|
|
param_in[1] = blocksize; |
|
|
|
|
|
|
|
|
mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \ |
|
|
|
|
|
|
|
|
retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, |
|
|
ARRAY_SIZE(param_in), param_in, count, param_out, 1); |
|
|
ARRAY_SIZE(param_in), param_in, count, param_out, 1); |
|
|
|
|
|
|
|
|
// count -= blocksize; |
|
|
// count -= blocksize; |
|
@@ -554,7 +554,7 @@ static int mips32_pracc_read_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, |
|
|
|
|
|
|
|
|
free(param_out); |
|
|
free(param_out); |
|
|
|
|
|
|
|
|
return ERROR_OK; |
|
|
|
|
|
|
|
|
return retval; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
int mips32_pracc_write_mem(struct mips_ejtag *ejtag_info, uint32_t addr, int size, int count, void *buf) |
|
|
int mips32_pracc_write_mem(struct mips_ejtag *ejtag_info, uint32_t addr, int size, int count, void *buf) |
|
@@ -616,12 +616,13 @@ static int mips32_pracc_write_mem32(struct mips_ejtag *ejtag_info, uint32_t addr |
|
|
|
|
|
|
|
|
memcpy(¶m_in[2], buf, count * sizeof(uint32_t)); |
|
|
memcpy(¶m_in[2], buf, count * sizeof(uint32_t)); |
|
|
|
|
|
|
|
|
mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \ |
|
|
|
|
|
|
|
|
int retval; |
|
|
|
|
|
retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, |
|
|
count + 2, param_in, 0, NULL, 1); |
|
|
count + 2, param_in, 0, NULL, 1); |
|
|
|
|
|
|
|
|
free(param_in); |
|
|
free(param_in); |
|
|
|
|
|
|
|
|
return ERROR_OK; |
|
|
|
|
|
|
|
|
return retval; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static int mips32_pracc_write_u32(struct mips_ejtag *ejtag_info, uint32_t addr, uint32_t *buf) |
|
|
static int mips32_pracc_write_u32(struct mips_ejtag *ejtag_info, uint32_t addr, uint32_t *buf) |
|
@@ -650,10 +651,8 @@ static int mips32_pracc_write_u32(struct mips_ejtag *ejtag_info, uint32_t addr, |
|
|
param_in[0] = addr; |
|
|
param_in[0] = addr; |
|
|
param_in[1] = *buf; |
|
|
param_in[1] = *buf; |
|
|
|
|
|
|
|
|
mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \ |
|
|
|
|
|
|
|
|
return mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, |
|
|
ARRAY_SIZE(param_in), param_in, 0, NULL, 1); |
|
|
ARRAY_SIZE(param_in), param_in, 0, NULL, 1); |
|
|
|
|
|
|
|
|
return ERROR_OK; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static int mips32_pracc_write_mem16(struct mips_ejtag *ejtag_info, uint32_t addr, int count, uint16_t *buf) |
|
|
static int mips32_pracc_write_mem16(struct mips_ejtag *ejtag_info, uint32_t addr, int count, uint16_t *buf) |
|
@@ -706,12 +705,13 @@ static int mips32_pracc_write_mem16(struct mips_ejtag *ejtag_info, uint32_t addr |
|
|
param_in[i + 2] = buf[i]; |
|
|
param_in[i + 2] = buf[i]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \ |
|
|
|
|
|
|
|
|
int retval; |
|
|
|
|
|
retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, |
|
|
count + 2, param_in, 0, NULL, 1); |
|
|
count + 2, param_in, 0, NULL, 1); |
|
|
|
|
|
|
|
|
free(param_in); |
|
|
free(param_in); |
|
|
|
|
|
|
|
|
return ERROR_OK; |
|
|
|
|
|
|
|
|
return retval; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static int mips32_pracc_write_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, int count, uint8_t *buf) |
|
|
static int mips32_pracc_write_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, int count, uint8_t *buf) |
|
@@ -765,7 +765,7 @@ static int mips32_pracc_write_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, |
|
|
param_in[i + 2] = buf[i]; |
|
|
param_in[i + 2] = buf[i]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \ |
|
|
|
|
|
|
|
|
retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, |
|
|
count + 2, param_in, 0, NULL, 1); |
|
|
count + 2, param_in, 0, NULL, 1); |
|
|
|
|
|
|
|
|
free(param_in); |
|
|
free(param_in); |
|
@@ -837,7 +837,7 @@ int mips32_pracc_write_regs(struct mips_ejtag *ejtag_info, uint32_t *regs) |
|
|
|
|
|
|
|
|
int retval; |
|
|
int retval; |
|
|
|
|
|
|
|
|
retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \ |
|
|
|
|
|
|
|
|
retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, |
|
|
MIPS32NUMCOREREGS, regs, 0, NULL, 1); |
|
|
MIPS32NUMCOREREGS, regs, 0, NULL, 1); |
|
|
|
|
|
|
|
|
return retval; |
|
|
return retval; |
|
@@ -912,7 +912,7 @@ int mips32_pracc_read_regs(struct mips_ejtag *ejtag_info, uint32_t *regs) |
|
|
|
|
|
|
|
|
int retval; |
|
|
int retval; |
|
|
|
|
|
|
|
|
retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \ |
|
|
|
|
|
|
|
|
retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, |
|
|
0, NULL, MIPS32NUMCOREREGS, regs, 1); |
|
|
0, NULL, MIPS32NUMCOREREGS, regs, 1); |
|
|
|
|
|
|
|
|
return retval; |
|
|
return retval; |
|
|