summaryrefslogtreecommitdiff
path: root/src/flash
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-31 09:38:20 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-31 09:38:20 +0000
commitfbe8cf72a5e6c80fed5fba8754d790ca63ad2b65 (patch)
treeb700b797a4a505e7926703e85724b1477712e5d4 /src/flash
parent95e13054cafeeb13163d85822e4202e12007e1a7 (diff)
downloadopenocd+libswd-fbe8cf72a5e6c80fed5fba8754d790ca63ad2b65.tar.gz
openocd+libswd-fbe8cf72a5e6c80fed5fba8754d790ca63ad2b65.tar.bz2
openocd+libswd-fbe8cf72a5e6c80fed5fba8754d790ca63ad2b65.tar.xz
openocd+libswd-fbe8cf72a5e6c80fed5fba8754d790ca63ad2b65.zip
Add target_run_algorithm wrapper:
- replaces all calls to target->type->run_algorithm. - add documentation in target_s to warn not to invoke callback directly. git-svn-id: svn://svn.berlios.de/openocd/trunk@1961 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/flash')
-rw-r--r--src/flash/aduc702x.c2
-rw-r--r--src/flash/cfi.c4
-rw-r--r--src/flash/ecos.c2
-rw-r--r--src/flash/lpc2000.c2
-rw-r--r--src/flash/orion_nand.c2
-rw-r--r--src/flash/pic32mx.c2
-rw-r--r--src/flash/stellaris.c2
-rw-r--r--src/flash/stm32x.c2
-rw-r--r--src/flash/str7x.c2
-rw-r--r--src/flash/str9x.c2
10 files changed, 11 insertions, 11 deletions
diff --git a/src/flash/aduc702x.c b/src/flash/aduc702x.c
index 2a9c1c26..6268b1cd 100644
--- a/src/flash/aduc702x.c
+++ b/src/flash/aduc702x.c
@@ -288,7 +288,7 @@ static int aduc702x_write_block(struct flash_bank_s *bank, u8 *buffer, u32 offse
buf_set_u32(reg_params[2].value, 0, 32, address);
buf_set_u32(reg_params[4].value, 0, 32, 0xFFFFF800);
- if ((retval = target->type->run_algorithm(target, 0, NULL, 5,
+ if ((retval = target_run_algorithm(target, 0, NULL, 5,
reg_params, aduc702x_info->write_algorithm->address,
aduc702x_info->write_algorithm->address + sizeof(aduc702x_flash_write_code) - 4,
10000, &armv4_5_info)) != ERROR_OK)
diff --git a/src/flash/cfi.c b/src/flash/cfi.c
index ba6c7a80..432c8cc4 100644
--- a/src/flash/cfi.c
+++ b/src/flash/cfi.c
@@ -1227,7 +1227,7 @@ static int cfi_intel_write_block(struct flash_bank_s *bank, u8 *buffer, u32 addr
LOG_INFO("Write 0x%04x bytes to flash at 0x%08x", thisrun_count, address );
/* Execute algorithm, assume breakpoint for last instruction */
- retval = target->type->run_algorithm(target, 0, NULL, 7, reg_params,
+ retval = target_run_algorithm(target, 0, NULL, 7, reg_params,
cfi_info->write_algorithm->address,
cfi_info->write_algorithm->address + target_code_size - sizeof(u32),
10000, /* 10s should be enough for max. 32k of data */
@@ -1510,7 +1510,7 @@ static int cfi_spansion_write_block(struct flash_bank_s *bank, u8 *buffer, u32 a
buf_set_u32(reg_params[8].value, 0, 32, flash_address(bank, 0, pri_ext->_unlock2));
buf_set_u32(reg_params[9].value, 0, 32, 0x55555555);
- retval = target->type->run_algorithm(target, 0, NULL, 10, reg_params,
+ retval = target_run_algorithm(target, 0, NULL, 10, reg_params,
cfi_info->write_algorithm->address,
cfi_info->write_algorithm->address + ((24 * 4) - 4),
10000, &armv4_5_info);
diff --git a/src/flash/ecos.c b/src/flash/ecos.c
index e1fa2d66..2d03edb9 100644
--- a/src/flash/ecos.c
+++ b/src/flash/ecos.c
@@ -245,7 +245,7 @@ static int runCode(ecosflash_flash_bank_t *info,
buf_set_u32(reg_params[2].value, 0, 32, r2);
int retval;
- if ((retval = target->type->run_algorithm(target, 0, NULL, 3, reg_params,
+ if ((retval = target_run_algorithm(target, 0, NULL, 3, reg_params,
codeStart,
codeStop, timeout,
&armv4_5_info)) != ERROR_OK)
diff --git a/src/flash/lpc2000.c b/src/flash/lpc2000.c
index dbbc3748..c3299bcd 100644
--- a/src/flash/lpc2000.c
+++ b/src/flash/lpc2000.c
@@ -298,7 +298,7 @@ static int lpc2000_iap_call(flash_bank_t *bank, int code, u32 param_table[5], u3
init_reg_param(&reg_params[4], "lr_svc", 32, PARAM_OUT);
buf_set_u32(reg_params[4].value, 0, 32, lpc2000_info->iap_working_area->address + 0x4);
- target->type->run_algorithm(target, 2, mem_params, 5, reg_params, lpc2000_info->iap_working_area->address, lpc2000_info->iap_working_area->address + 0x4, 10000, &armv4_5_info);
+ target_run_algorithm(target, 2, mem_params, 5, reg_params, lpc2000_info->iap_working_area->address, lpc2000_info->iap_working_area->address + 0x4, 10000, &armv4_5_info);
status_code = buf_get_u32(mem_params[1].value, 0, 32);
result_table[0] = target_buffer_get_u32(target, mem_params[1].value);
diff --git a/src/flash/orion_nand.c b/src/flash/orion_nand.c
index cf26568d..5ec1c25c 100644
--- a/src/flash/orion_nand.c
+++ b/src/flash/orion_nand.c
@@ -162,7 +162,7 @@ static int orion_nand_fast_block_write(struct nand_device_s *device, u8 *data, i
buf_set_u32(reg_params[1].value, 0, 32, target_buf);
buf_set_u32(reg_params[2].value, 0, 32, size);
- retval = target->type->run_algorithm(target, 0, NULL, 3, reg_params,
+ retval = target_run_algorithm(target, 0, NULL, 3, reg_params,
hw->copy_area->address,
hw->copy_area->address + code_size - 4,
1000, &algo);
diff --git a/src/flash/pic32mx.c b/src/flash/pic32mx.c
index 2a5ce641..b45902cd 100644
--- a/src/flash/pic32mx.c
+++ b/src/flash/pic32mx.c
@@ -419,7 +419,7 @@ static int pic32mx_write_block(struct flash_bank_s *bank, u8 *buffer, u32 offset
buf_set_u32(reg_params[1].value, 0, 32, address);
buf_set_u32(reg_params[2].value, 0, 32, buffer_size/4);
- if ((retval = target->type->run_algorithm(target, 0, NULL, 4, reg_params, pic32mx_info->write_algorithm->address, \
+ if ((retval = target_run_algorithm(target, 0, NULL, 4, reg_params, pic32mx_info->write_algorithm->address, \
pic32mx_info->write_algorithm->address + (sizeof(pic32mx_flash_write_code) - 10), 10000, &armv7m_info)) != ERROR_OK)
{
LOG_ERROR("error executing pic32mx flash write algorithm");
diff --git a/src/flash/stellaris.c b/src/flash/stellaris.c
index 38ded4f1..001b0176 100644
--- a/src/flash/stellaris.c
+++ b/src/flash/stellaris.c
@@ -779,7 +779,7 @@ static int stellaris_write_block(struct flash_bank_s *bank, u8 *buffer, u32 offs
buf_set_u32(reg_params[2].value, 0, 32, 4*thisrun_count);
LOG_INFO("Algorithm flash write %i words to 0x%x, %i remaining", thisrun_count, address, wcount);
LOG_DEBUG("Algorithm flash write %i words to 0x%x, %i remaining", thisrun_count, address, wcount);
- if ((retval = target->type->run_algorithm(target, 0, NULL, 3, reg_params, write_algorithm->address, write_algorithm->address + sizeof(stellaris_write_code)-10, 10000, &armv7m_info)) != ERROR_OK)
+ if ((retval = target_run_algorithm(target, 0, NULL, 3, reg_params, write_algorithm->address, write_algorithm->address + sizeof(stellaris_write_code)-10, 10000, &armv7m_info)) != ERROR_OK)
{
LOG_ERROR("error executing stellaris flash write algorithm");
retval = ERROR_FLASH_OPERATION_FAILED;
diff --git a/src/flash/stm32x.c b/src/flash/stm32x.c
index 2a3b764c..1f3460b1 100644
--- a/src/flash/stm32x.c
+++ b/src/flash/stm32x.c
@@ -554,7 +554,7 @@ static int stm32x_write_block(struct flash_bank_s *bank, u8 *buffer, u32 offset,
buf_set_u32(reg_params[1].value, 0, 32, address);
buf_set_u32(reg_params[2].value, 0, 32, thisrun_count);
- if ((retval = target->type->run_algorithm(target, 0, NULL, 4, reg_params, stm32x_info->write_algorithm->address, \
+ 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), 10000, &armv7m_info)) != ERROR_OK)
{
LOG_ERROR("error executing stm32x flash write algorithm");
diff --git a/src/flash/str7x.c b/src/flash/str7x.c
index a1cb9636..88f4f9eb 100644
--- a/src/flash/str7x.c
+++ b/src/flash/str7x.c
@@ -429,7 +429,7 @@ static int str7x_write_block(struct flash_bank_s *bank, u8 *buffer, u32 offset,
buf_set_u32(reg_params[3].value, 0, 32, thisrun_count);
buf_set_u32(reg_params[5].value, 0, 32, str7x_info->busy_bits);
- if ((retval = target->type->run_algorithm(target, 0, NULL, 6, reg_params, str7x_info->write_algorithm->address, str7x_info->write_algorithm->address + (19 * 4), 10000, &armv4_5_info)) != ERROR_OK)
+ if ((retval = target_run_algorithm(target, 0, NULL, 6, reg_params, str7x_info->write_algorithm->address, str7x_info->write_algorithm->address + (19 * 4), 10000, &armv4_5_info)) != ERROR_OK)
{
LOG_ERROR("error executing str7x flash write algorithm");
retval = ERROR_FLASH_OPERATION_FAILED;
diff --git a/src/flash/str9x.c b/src/flash/str9x.c
index 7de98b12..3566bf9c 100644
--- a/src/flash/str9x.c
+++ b/src/flash/str9x.c
@@ -463,7 +463,7 @@ static int str9x_write_block(struct flash_bank_s *bank,
buf_set_u32(reg_params[1].value, 0, 32, address);
buf_set_u32(reg_params[2].value, 0, 32, thisrun_count);
- if ((retval = target->type->run_algorithm(target, 0, NULL, 4, reg_params, str9x_info->write_algorithm->address, str9x_info->write_algorithm->address + (18 * 4), 10000, &armv4_5_info)) != ERROR_OK)
+ if ((retval = target_run_algorithm(target, 0, NULL, 4, reg_params, str9x_info->write_algorithm->address, str9x_info->write_algorithm->address + (18 * 4), 10000, &armv4_5_info)) != ERROR_OK)
{
LOG_ERROR("error executing str9x flash write algorithm");
retval = ERROR_FLASH_OPERATION_FAILED;