Change-Id: I18c1501918d40453fea6aeeb6f035e46d41fc524
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5366
Tested-by: jenkins
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
uint32_t halfword_count = DIV_ROUND_UP(byte_count, 2);
uint32_t result;
unsigned i;
uint32_t halfword_count = DIV_ROUND_UP(byte_count, 2);
uint32_t result;
unsigned i;
+ int retval, retval2 = ERROR_OK;
const uint8_t write_block_code[] = {
#include "../../../contrib/loaders/flash/fm4/write.inc"
};
const uint8_t write_block_code[] = {
#include "../../../contrib/loaders/flash/fm4/write.inc"
};
err_run_ret:
err_run:
err_write_data:
err_run_ret:
err_run:
err_write_data:
- retval = fm4_enter_flash_cpu_rom_mode(target);
+ retval2 = fm4_enter_flash_cpu_rom_mode(target);
err_flash_mode:
for (i = 0; i < ARRAY_SIZE(reg_params); i++)
err_flash_mode:
for (i = 0; i < ARRAY_SIZE(reg_params); i++)
err_write_code:
target_free_working_area(target, code_workarea);
err_write_code:
target_free_working_area(target, code_workarea);
+ if (retval != ERROR_OK)
+ return retval;
+ return retval2;
}
static int mb9bf_probe(struct flash_bank *bank)
}
static int mb9bf_probe(struct flash_bank *bank)
* Select one or more bits in FMBSEA or FMBSEB to disable Level 1
* protection for the particular sector to be erased/written.
*/
* Select one or more bits in FMBSEA or FMBSEB to disable Level 1
* protection for the particular sector to be erased/written.
*/
if (sector < 16) {
target_read_u32(target, 0xFFE88008, &fmbsea);
target_write_u32(target, 0xFFE88008, fmbsea | (1 << sector));
if (sector < 16) {
target_read_u32(target, 0xFFE88008, &fmbsea);
target_write_u32(target, 0xFFE88008, fmbsea | (1 << sector));