diff options
author | drath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2007-03-28 16:31:55 +0000 |
---|---|---|
committer | drath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2007-03-28 16:31:55 +0000 |
commit | 4a5f45e87d593d6911da680cb92ffbc9b43c9486 (patch) | |
tree | d41ddb8594b5fab03c12075cbc4d3888d59ed027 /src/flash/str7x.c | |
parent | 5ed126c4f90948fbf53d186dc4ef49018fb5ecfc (diff) | |
download | riscv-openocd-4a5f45e87d593d6911da680cb92ffbc9b43c9486.zip riscv-openocd-4a5f45e87d593d6911da680cb92ffbc9b43c9486.tar.gz riscv-openocd-4a5f45e87d593d6911da680cb92ffbc9b43c9486.tar.bz2 |
- merged XScale branch back into trunk
- fixed some compiler warnigns in amt_jtagaccel.c, bitbang.c, parport.c
- free working area and register stuff if str7x block write algorithm failed
- check PC after exiting a target algorithm in armv4_5.c
git-svn-id: svn://svn.berlios.de/openocd/trunk@135 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/flash/str7x.c')
-rw-r--r-- | src/flash/str7x.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/flash/str7x.c b/src/flash/str7x.c index 62acba3..0fa2f6c 100644 --- a/src/flash/str7x.c +++ b/src/flash/str7x.c @@ -451,7 +451,7 @@ int str7x_write_block(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 cou u32 address = bank->base + offset; reg_param_t reg_params[5]; armv4_5_algorithm_t armv4_5_info; - int retval; + int retval = ERROR_OK; u32 str7x_flash_write_code[] = { /* write: */ @@ -537,12 +537,13 @@ int str7x_write_block(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 cou if ((retval = target->type->run_algorithm(target, 0, NULL, 5, reg_params, str7x_info->write_algorithm->address, str7x_info->write_algorithm->address + (19 * 4), 10000, &armv4_5_info)) != ERROR_OK) { ERROR("error executing str7x flash write algorithm"); - return ERROR_FLASH_OPERATION_FAILED; + break; } if (buf_get_u32(reg_params[4].value, 0, 32) != 0x00) { - return ERROR_FLASH_OPERATION_FAILED; + retval = ERROR_FLASH_OPERATION_FAILED; + break; } buffer += thisrun_count * 8; @@ -558,7 +559,7 @@ int str7x_write_block(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 cou destroy_reg_param(®_params[3]); destroy_reg_param(®_params[4]); - return ERROR_OK; + return retval; } int str7x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) |