flash: remove algorithm exit_point address for supported targets
authorSpencer Oliver <ntfreak@users.sourceforge.net>
Mon, 19 Jul 2010 19:33:04 +0000 (20:33 +0100)
committerSpencer Oliver <ntfreak@users.sourceforge.net>
Tue, 20 Jul 2010 08:02:42 +0000 (09:02 +0100)
For the above targets the exit_point is
optional when used with run_algorithm, so remove it.

This makes updating the algorithm less error prone.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
src/flash/nor/lpc2000.c
src/flash/nor/pic32mx.c
src/flash/nor/stellaris.c
src/flash/nor/stm32x.c

index 866be509e34fe6704dfd5c1fa2274e10e358f731..0930d62d5c91e39cab13dbcab2a64116662585dc 100644 (file)
@@ -346,7 +346,7 @@ static int lpc2000_iap_call(struct flash_bank *bank, int code, uint32_t param_ta
                        init_reg_param(&reg_params[4], "lr", 32, PARAM_OUT);
                        buf_set_u32(reg_params[4].value, 0, 32, (lpc2000_info->iap_working_area->address + 0x04) | 1); /* bit0 of LR = 1 to return in Thumb mode */
 
-                       target_run_algorithm(target, 2, mem_params, 5, reg_params, lpc2000_info->iap_working_area->address, lpc2000_info->iap_working_area->address + 0x4, 10000, &armv7m_info);
+                       target_run_algorithm(target, 2, mem_params, 5, reg_params, lpc2000_info->iap_working_area->address, 0, 10000, &armv7m_info);
                        break;
                case lpc2000_v1:
                case lpc2000_v2:
index 2fe864d4f0fbf592d05b76164e28a3ad1a7b6cc7..363f49e84a84f670643cd91fc7b588ce7b8274b3 100644 (file)
@@ -360,7 +360,7 @@ static int pic32mx_write_block(struct flash_bank *bank, uint8_t *buffer,
 
                if ((retval = target_run_algorithm(target, 0, NULL, 3, reg_params,
                                pic32mx_info->write_algorithm->address,
-                               pic32mx_info->write_algorithm->address + (sizeof(pic32mx_flash_write_code) - 76),
+                               0,
                                10000, &mips32_info)) != ERROR_OK)
                {
                        LOG_ERROR("error executing pic32mx flash write algorithm");
index ff1c2e48fc94f1da478680f5b1456c6aa6c1e493..69e2f10713188c936b995a38bc174e4c65ff5223 100644 (file)
@@ -884,8 +884,7 @@ static int stellaris_write_block(struct flash_bank *bank,
                                (unsigned) (wcount - thisrun_count));
                retval = target_run_algorithm(target, 0, NULL, 3, reg_params,
                                write_algorithm->address,
-                               write_algorithm->address +
-                                       sizeof(stellaris_write_code) - 10,
+                               0,
                                10000, &armv7m_info);
                if (retval != ERROR_OK)
                {
index 5ce5d455f4f91ec6372ac66875f3376de83702e3..4ec777dd8270393f86ea577a76e27f2d91e4076c 100644 (file)
@@ -519,7 +519,7 @@ static int stm32x_write_block(struct flash_bank *bank, uint8_t *buffer,
 
                if ((retval = target_run_algorithm(target, 0, NULL, 4, reg_params,
                                stm32x_info->write_algorithm->address,
-                               stm32x_info->write_algorithm->address + (sizeof(stm32x_flash_write_code) - 10),
+                               0,
                                10000, &armv7m_info)) != ERROR_OK)
                {
                        LOG_ERROR("error executing stm32x flash write algorithm");