Commit 84df52f9 authored by zwelch's avatar zwelch
Browse files

- Fixes '=' whitespace

- Replace ')\(=\)\(\w\)' with ') \1 \2'.
- Replace '\(\w\)\(=\)(' with '\1 \2 ('.
- Replace '\(\w\)\(=\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2372 b42882b7-edfa-0310-969c-e2dbd0fdcd60
parent 3813fda4
...@@ -975,13 +975,13 @@ int main(int argc, char *argv[]) ...@@ -975,13 +975,13 @@ int main(int argc, char *argv[])
} }
mkdir(zylin_config_dir, 0777); mkdir(zylin_config_dir, 0777);
char *dirname=alloc_printf("%s/target", zylin_config_dir); char *dirname = alloc_printf("%s/target", zylin_config_dir);
mkdir(dirname, 0777); mkdir(dirname, 0777);
free(dirname); free(dirname);
dirname=alloc_printf("%s/board", zylin_config_dir); dirname = alloc_printf("%s/board", zylin_config_dir);
mkdir(dirname, 0777); mkdir(dirname, 0777);
free(dirname); free(dirname);
dirname=alloc_printf("%s/event", zylin_config_dir); dirname = alloc_printf("%s/event", zylin_config_dir);
mkdir(dirname, 0777); mkdir(dirname, 0777);
free(dirname); free(dirname);
...@@ -1036,7 +1036,7 @@ int main(int argc, char *argv[]) ...@@ -1036,7 +1036,7 @@ int main(int argc, char *argv[])
if (logAllToSerial) if (logAllToSerial)
{ {
diag_printf( diag_printf(
"%s/logserial=1 => sending log output to serial port using \"debug_level 3\" as default.\n", zylin_config_dir); "%s/logserial = 1 => sending log output to serial port using \"debug_level 3\" as default.\n", zylin_config_dir);
command_run_line(cmd_ctx, "debug_level 3"); command_run_line(cmd_ctx, "debug_level 3");
} }
......
...@@ -232,10 +232,10 @@ static void at91sam7_set_flash_mode(flash_bank_t *bank, int mode) ...@@ -232,10 +232,10 @@ static void at91sam7_set_flash_mode(flash_bank_t *bank, int mode)
if (fmcn > 0xFF) if (fmcn > 0xFF)
fmcn = 0xFF; fmcn = 0xFF;
/* Only allow fmcn=0 if clock period is > 30 us = 33kHz. */ /* Only allow fmcn = 0 if clock period is > 30 us = 33kHz. */
if (at91sam7_info->mck_freq <= 33333ul) if (at91sam7_info->mck_freq <= 33333ul)
fmcn = 0; fmcn = 0;
/* Only allow fws=0 if clock frequency is < 30 MHz. */ /* Only allow fws = 0 if clock frequency is < 30 MHz. */
if (at91sam7_info->mck_freq > 30000000ul) if (at91sam7_info->mck_freq > 30000000ul)
fws = 1; fws = 1;
...@@ -550,7 +550,7 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank) ...@@ -550,7 +550,7 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank)
/* calculate bank size */ /* calculate bank size */
bank_size = sectors_num * pages_per_sector * page_size; bank_size = sectors_num * pages_per_sector * page_size;
for (bnk=0; bnk<banks_num; bnk++) for (bnk = 0; bnk<banks_num; bnk++)
{ {
if (bnk > 0) if (bnk > 0)
{ {
...@@ -575,7 +575,7 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank) ...@@ -575,7 +575,7 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank)
/* allocate sectors */ /* allocate sectors */
t_bank->sectors = malloc(sectors_num * sizeof(flash_sector_t)); t_bank->sectors = malloc(sectors_num * sizeof(flash_sector_t));
for (sec=0; sec<sectors_num; sec++) for (sec = 0; sec<sectors_num; sec++)
{ {
t_bank->sectors[sec].offset = sec * pages_per_sector * page_size; t_bank->sectors[sec].offset = sec * pages_per_sector * page_size;
t_bank->sectors[sec].size = pages_per_sector * page_size; t_bank->sectors[sec].size = pages_per_sector * page_size;
...@@ -639,7 +639,7 @@ static int at91sam7_erase_check(struct flash_bank_s *bank) ...@@ -639,7 +639,7 @@ static int at91sam7_erase_check(struct flash_bank_s *bank)
at91sam7_set_flash_mode(bank, FMR_TIMING_FLASH); at91sam7_set_flash_mode(bank, FMR_TIMING_FLASH);
fast_check = 1; fast_check = 1;
for (nSector=0; nSector<bank->num_sectors; nSector++) for (nSector = 0; nSector<bank->num_sectors; nSector++)
{ {
retval = target_blank_check_memory(target, bank->base+bank->sectors[nSector].offset, retval = target_blank_check_memory(target, bank->base+bank->sectors[nSector].offset,
bank->sectors[nSector].size, &blank); bank->sectors[nSector].size, &blank);
...@@ -662,7 +662,7 @@ static int at91sam7_erase_check(struct flash_bank_s *bank) ...@@ -662,7 +662,7 @@ static int at91sam7_erase_check(struct flash_bank_s *bank)
LOG_USER("Running slow fallback erase check - add working memory"); LOG_USER("Running slow fallback erase check - add working memory");
buffer = malloc(bank->sectors[0].size); buffer = malloc(bank->sectors[0].size);
for (nSector=0; nSector<bank->num_sectors; nSector++) for (nSector = 0; nSector<bank->num_sectors; nSector++)
{ {
bank->sectors[nSector].is_erased = 1; bank->sectors[nSector].is_erased = 1;
retval = target_read_memory(target, bank->base+bank->sectors[nSector].offset, 4, retval = target_read_memory(target, bank->base+bank->sectors[nSector].offset, 4,
...@@ -670,7 +670,7 @@ static int at91sam7_erase_check(struct flash_bank_s *bank) ...@@ -670,7 +670,7 @@ static int at91sam7_erase_check(struct flash_bank_s *bank)
if (retval != ERROR_OK) if (retval != ERROR_OK)
return retval; return retval;
for (nByte=0; nByte<bank->sectors[nSector].size; nByte++) for (nByte = 0; nByte<bank->sectors[nSector].size; nByte++)
{ {
if (buffer[nByte] != 0xFF) if (buffer[nByte] != 0xFF)
{ {
...@@ -705,7 +705,7 @@ static int at91sam7_protect_check(struct flash_bank_s *bank) ...@@ -705,7 +705,7 @@ static int at91sam7_protect_check(struct flash_bank_s *bank)
at91sam7_info->lockbits = (status >> 16); at91sam7_info->lockbits = (status >> 16);
at91sam7_info->num_lockbits_on = 0; at91sam7_info->num_lockbits_on = 0;
for (lock_pos=0; lock_pos<bank->num_sectors; lock_pos++) for (lock_pos = 0; lock_pos<bank->num_sectors; lock_pos++)
{ {
if ( ((status >> (16+lock_pos))&(0x0001)) == 1) if ( ((status >> (16+lock_pos))&(0x0001)) == 1)
{ {
...@@ -723,7 +723,7 @@ static int at91sam7_protect_check(struct flash_bank_s *bank) ...@@ -723,7 +723,7 @@ static int at91sam7_protect_check(struct flash_bank_s *bank)
at91sam7_info->nvmbits = (status >> 8)&0xFF; at91sam7_info->nvmbits = (status >> 8)&0xFF;
at91sam7_info->num_nvmbits_on = 0; at91sam7_info->num_nvmbits_on = 0;
for (gpnvm_pos=0; gpnvm_pos<at91sam7_info->num_nvmbits; gpnvm_pos++) for (gpnvm_pos = 0; gpnvm_pos<at91sam7_info->num_nvmbits; gpnvm_pos++)
{ {
if ( ((status >> (8+gpnvm_pos))&(0x01)) == 1) if ( ((status >> (8+gpnvm_pos))&(0x01)) == 1)
{ {
...@@ -809,7 +809,7 @@ static int at91sam7_flash_bank_command(struct command_context_s *cmd_ctx, char * ...@@ -809,7 +809,7 @@ static int at91sam7_flash_bank_command(struct command_context_s *cmd_ctx, char *
/* calculate bank size */ /* calculate bank size */
bank_size = num_sectors * pages_per_sector * page_size; bank_size = num_sectors * pages_per_sector * page_size;
for (bnk=0; bnk<banks_num; bnk++) for (bnk = 0; bnk<banks_num; bnk++)
{ {
if (bnk > 0) if (bnk > 0)
{ {
...@@ -834,7 +834,7 @@ static int at91sam7_flash_bank_command(struct command_context_s *cmd_ctx, char * ...@@ -834,7 +834,7 @@ static int at91sam7_flash_bank_command(struct command_context_s *cmd_ctx, char *
/* allocate sectors */ /* allocate sectors */
t_bank->sectors = malloc(num_sectors * sizeof(flash_sector_t)); t_bank->sectors = malloc(num_sectors * sizeof(flash_sector_t));
for (sec=0; sec<num_sectors; sec++) for (sec = 0; sec<num_sectors; sec++)
{ {
t_bank->sectors[sec].offset = sec * pages_per_sector * page_size; t_bank->sectors[sec].offset = sec * pages_per_sector * page_size;
t_bank->sectors[sec].size = pages_per_sector * page_size; t_bank->sectors[sec].size = pages_per_sector * page_size;
...@@ -902,7 +902,7 @@ static int at91sam7_erase(struct flash_bank_s *bank, int first, int last) ...@@ -902,7 +902,7 @@ static int at91sam7_erase(struct flash_bank_s *bank, int first, int last)
/* allocate and clean buffer */ /* allocate and clean buffer */
nbytes = (last - first + 1) * bank->sectors[first].size; nbytes = (last - first + 1) * bank->sectors[first].size;
buffer = malloc(nbytes * sizeof(uint8_t)); buffer = malloc(nbytes * sizeof(uint8_t));
for (pos=0; pos<nbytes; pos++) for (pos = 0; pos<nbytes; pos++)
{ {
buffer[pos] = 0xFF; buffer[pos] = 0xFF;
} }
...@@ -916,7 +916,7 @@ static int at91sam7_erase(struct flash_bank_s *bank, int first, int last) ...@@ -916,7 +916,7 @@ static int at91sam7_erase(struct flash_bank_s *bank, int first, int last)
} }
/* mark erased sectors */ /* mark erased sectors */
for (sec=first; sec <= last; sec++) for (sec = first; sec <= last; sec++)
{ {
bank->sectors[sec].is_erased = 1; bank->sectors[sec].is_erased = 1;
} }
...@@ -952,7 +952,7 @@ static int at91sam7_protect(struct flash_bank_s *bank, int set, int first, int l ...@@ -952,7 +952,7 @@ static int at91sam7_protect(struct flash_bank_s *bank, int set, int first, int l
at91sam7_read_clock_info(bank); at91sam7_read_clock_info(bank);
at91sam7_set_flash_mode(bank, FMR_TIMING_NVBITS); at91sam7_set_flash_mode(bank, FMR_TIMING_NVBITS);
for (sector=first; sector <= last; sector++) for (sector = first; sector <= last; sector++)
{ {
if (set) if (set)
cmd = SLB; cmd = SLB;
...@@ -1016,7 +1016,7 @@ static int at91sam7_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t o ...@@ -1016,7 +1016,7 @@ static int at91sam7_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t o
at91sam7_read_clock_info(bank); at91sam7_read_clock_info(bank);
at91sam7_set_flash_mode(bank, FMR_TIMING_FLASH); at91sam7_set_flash_mode(bank, FMR_TIMING_FLASH);
for (pagen=first_page; pagen<last_page; pagen++) for (pagen = first_page; pagen<last_page; pagen++)
{ {
if (bytes_remaining<dst_min_alignment) if (bytes_remaining<dst_min_alignment)
count = bytes_remaining; count = bytes_remaining;
......
...@@ -212,7 +212,7 @@ static uint16_t cfi_query_u16(flash_bank_t *bank, int sector, uint32_t offset) ...@@ -212,7 +212,7 @@ static uint16_t cfi_query_u16(flash_bank_t *bank, int sector, uint32_t offset)
if (cfi_info->x16_as_x8) if (cfi_info->x16_as_x8)
{ {
uint8_t i; uint8_t i;
for (i=0;i<2;i++) for (i = 0;i<2;i++)
target_read_memory(target, flash_address(bank, sector, offset+i), bank->bus_width, 1, target_read_memory(target, flash_address(bank, sector, offset+i), bank->bus_width, 1,
&data[i*bank->bus_width] ); &data[i*bank->bus_width] );
} }
...@@ -234,7 +234,7 @@ static uint32_t cfi_query_u32(flash_bank_t *bank, int sector, uint32_t offset) ...@@ -234,7 +234,7 @@ static uint32_t cfi_query_u32(flash_bank_t *bank, int sector, uint32_t offset)
if (cfi_info->x16_as_x8) if (cfi_info->x16_as_x8)
{ {
uint8_t i; uint8_t i;
for (i=0;i<4;i++) for (i = 0;i<4;i++)
target_read_memory(target, flash_address(bank, sector, offset+i), bank->bus_width, 1, target_read_memory(target, flash_address(bank, sector, offset+i), bank->bus_width, 1,
&data[i*bank->bus_width] ); &data[i*bank->bus_width] );
} }
...@@ -1011,7 +1011,7 @@ static void cfi_add_byte(struct flash_bank_s *bank, uint8_t *word, uint8_t byte) ...@@ -1011,7 +1011,7 @@ static void cfi_add_byte(struct flash_bank_s *bank, uint8_t *word, uint8_t byte)
static void cfi_fix_code_endian(target_t *target, uint8_t *dest, const uint32_t *src, uint32_t count) static void cfi_fix_code_endian(target_t *target, uint8_t *dest, const uint32_t *src, uint32_t count)
{ {
uint32_t i; uint32_t i;
for (i=0; i< count; i++) for (i = 0; i< count; i++)
{ {
target_buffer_set_u32(target, dest, *src); target_buffer_set_u32(target, dest, *src);
dest += 4; dest += 4;
...@@ -1452,7 +1452,7 @@ static int cfi_spansion_write_block(struct flash_bank_s *bank, uint8_t *buffer, ...@@ -1452,7 +1452,7 @@ static int cfi_spansion_write_block(struct flash_bank_s *bank, uint8_t *buffer,
cfi_fix_code_endian(target, target_code, src, target_code_size / 4); cfi_fix_code_endian(target, target_code, src, target_code_size / 4);
/* allocate working area */ /* allocate working area */
retval=target_alloc_working_area(target, target_code_size, retval = target_alloc_working_area(target, target_code_size,
&cfi_info->write_algorithm); &cfi_info->write_algorithm);
if (retval != ERROR_OK) if (retval != ERROR_OK)
{ {
...@@ -1987,7 +1987,7 @@ int cfi_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint3 ...@@ -1987,7 +1987,7 @@ int cfi_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint3
buffer += buffersize; buffer += buffersize;
write_p += buffersize; write_p += buffersize;
count -= buffersize; count -= buffersize;
fallback=0; fallback = 0;
} }
} }
/* try the slow way? */ /* try the slow way? */
......
...@@ -66,7 +66,7 @@ typedef struct ecosflash_flash_bank_s ...@@ -66,7 +66,7 @@ typedef struct ecosflash_flash_bank_s
uint32_t start_address; uint32_t start_address;
} ecosflash_flash_bank_t; } ecosflash_flash_bank_t;
static const int sectorSize=0x10000; static const int sectorSize = 0x10000;
char * char *
flash_errmsg(int err); flash_errmsg(int err);
...@@ -145,7 +145,7 @@ static int ecosflash_flash_bank_command(struct command_context_s *cmd_ctx, char ...@@ -145,7 +145,7 @@ static int ecosflash_flash_bank_command(struct command_context_s *cmd_ctx, char
exit(-1); exit(-1);
} }
bank->driver_priv = info; bank->driver_priv = info;
info->driverPath=strdup(args[6]); info->driverPath = strdup(args[6]);
/* eCos flash sector sizes are not exposed to OpenOCD, use 0x10000 as /* eCos flash sector sizes are not exposed to OpenOCD, use 0x10000 as
* a way to improve impeadance matach between OpenOCD and eCos flash * a way to improve impeadance matach between OpenOCD and eCos flash
...@@ -153,7 +153,7 @@ static int ecosflash_flash_bank_command(struct command_context_s *cmd_ctx, char ...@@ -153,7 +153,7 @@ static int ecosflash_flash_bank_command(struct command_context_s *cmd_ctx, char
*/ */
int i = 0; int i = 0;
uint32_t offset = 0; uint32_t offset = 0;
bank->num_sectors=bank->size/sectorSize; bank->num_sectors = bank->size/sectorSize;
bank->sectors = malloc(sizeof(flash_sector_t) * bank->num_sectors); bank->sectors = malloc(sizeof(flash_sector_t) * bank->num_sectors);
for (i = 0; i < bank->num_sectors; i++) for (i = 0; i < bank->num_sectors; i++)
{ {
...@@ -181,15 +181,15 @@ static int loadDriver(ecosflash_flash_bank_t *info) ...@@ -181,15 +181,15 @@ static int loadDriver(ecosflash_flash_bank_t *info)
image.base_address_set = 0; image.base_address_set = 0;
image.start_address_set = 0; image.start_address_set = 0;
target_t *target=info->target; target_t *target = info->target;
int retval; int retval;
if ((retval=image_open(&image, info->driverPath, NULL)) != ERROR_OK) if ((retval = image_open(&image, info->driverPath, NULL)) != ERROR_OK)
{ {
return retval; return retval;
} }
info->start_address=image.start_address; info->start_address = image.start_address;
image_size = 0x0; image_size = 0x0;
int i; int i;
...@@ -215,12 +215,12 @@ static int loadDriver(ecosflash_flash_bank_t *info) ...@@ -215,12 +215,12 @@ static int loadDriver(ecosflash_flash_bank_t *info)
return ERROR_OK; return ERROR_OK;
} }
static int const OFFSET_ERASE=0x0; static int const OFFSET_ERASE = 0x0;
static int const OFFSET_ERASE_SIZE=0x8; static int const OFFSET_ERASE_SIZE = 0x8;
static int const OFFSET_FLASH=0xc; static int const OFFSET_FLASH = 0xc;
static int const OFFSET_FLASH_SIZE=0x8; static int const OFFSET_FLASH_SIZE = 0x8;
static int const OFFSET_GET_WORKAREA=0x18; static int const OFFSET_GET_WORKAREA = 0x18;
static int const OFFSET_GET_WORKAREA_SIZE=0x4; static int const OFFSET_GET_WORKAREA_SIZE = 0x4;
static int runCode(ecosflash_flash_bank_t *info, static int runCode(ecosflash_flash_bank_t *info,
uint32_t codeStart, uint32_t codeStop, uint32_t r0, uint32_t r1, uint32_t r2, uint32_t codeStart, uint32_t codeStop, uint32_t r0, uint32_t r1, uint32_t r2,
...@@ -228,7 +228,7 @@ static int runCode(ecosflash_flash_bank_t *info, ...@@ -228,7 +228,7 @@ static int runCode(ecosflash_flash_bank_t *info,
/* timeout in ms */ /* timeout in ms */
int timeout) int timeout)
{ {
target_t *target=info->target; target_t *target = info->target;
reg_param_t reg_params[3]; reg_param_t reg_params[3];
armv4_5_algorithm_t armv4_5_info; armv4_5_algorithm_t armv4_5_info;
...@@ -254,7 +254,7 @@ static int runCode(ecosflash_flash_bank_t *info, ...@@ -254,7 +254,7 @@ static int runCode(ecosflash_flash_bank_t *info,
return retval; return retval;
} }
*result=buf_get_u32(reg_params[0].value, 0, 32); *result = buf_get_u32(reg_params[0].value, 0, 32);
destroy_reg_param(&reg_params[0]); destroy_reg_param(&reg_params[0]);
destroy_reg_param(&reg_params[1]); destroy_reg_param(&reg_params[1]);
...@@ -268,12 +268,12 @@ static int eCosBoard_erase(ecosflash_flash_bank_t *info, uint32_t address, uint3 ...@@ -268,12 +268,12 @@ static int eCosBoard_erase(ecosflash_flash_bank_t *info, uint32_t address, uint3
int retval; int retval;
int timeout = (len / 20480 + 1) * 1000; /*asume 20 KB/s*/ int timeout = (len / 20480 + 1) * 1000; /*asume 20 KB/s*/
retval=loadDriver(info); retval = loadDriver(info);
if (retval != ERROR_OK) if (retval != ERROR_OK)
return retval; return retval;
uint32_t flashErr; uint32_t flashErr;
retval=runCode(info, retval = runCode(info,
info->start_address+OFFSET_ERASE, info->start_address+OFFSET_ERASE,
info->start_address+OFFSET_ERASE+OFFSET_ERASE_SIZE, info->start_address+OFFSET_ERASE+OFFSET_ERASE_SIZE,
address, address,
...@@ -296,17 +296,17 @@ static int eCosBoard_erase(ecosflash_flash_bank_t *info, uint32_t address, uint3 ...@@ -296,17 +296,17 @@ static int eCosBoard_erase(ecosflash_flash_bank_t *info, uint32_t address, uint3
static int eCosBoard_flash(ecosflash_flash_bank_t *info, void *data, uint32_t address, uint32_t len) static int eCosBoard_flash(ecosflash_flash_bank_t *info, void *data, uint32_t address, uint32_t len)
{ {
target_t *target=info->target; target_t *target = info->target;
const int chunk=8192; const int chunk = 8192;
int retval=ERROR_OK; int retval = ERROR_OK;
int timeout = (chunk / 20480 + 1) * 1000; /*asume 20 KB/s + 1 second*/ int timeout = (chunk / 20480 + 1) * 1000; /*asume 20 KB/s + 1 second*/
retval=loadDriver(info); retval = loadDriver(info);
if (retval != ERROR_OK) if (retval != ERROR_OK)
return retval; return retval;
uint32_t buffer; uint32_t buffer;
retval=runCode(info, retval = runCode(info,
info->start_address+OFFSET_GET_WORKAREA, info->start_address+OFFSET_GET_WORKAREA,
info->start_address+OFFSET_GET_WORKAREA+OFFSET_GET_WORKAREA_SIZE, info->start_address+OFFSET_GET_WORKAREA+OFFSET_GET_WORKAREA_SIZE,
0, 0,
...@@ -319,21 +319,21 @@ static int eCosBoard_flash(ecosflash_flash_bank_t *info, void *data, uint32_t ad ...@@ -319,21 +319,21 @@ static int eCosBoard_flash(ecosflash_flash_bank_t *info, void *data, uint32_t ad
uint32_t i; uint32_t i;
for (i=0; i<len; i += chunk) for (i = 0; i<len; i += chunk)
{ {
int t=len-i; int t = len-i;
if (t>chunk) if (t>chunk)
{ {
t=chunk; t = chunk;
} }
int retval; int retval;
retval=target_write_buffer(target, buffer, t, ((uint8_t *)data)+i); retval = target_write_buffer(target, buffer, t, ((uint8_t *)data)+i);
if (retval != ERROR_OK) if (retval != ERROR_OK)
return retval; return retval;
uint32_t flashErr; uint32_t flashErr;
retval=runCode(info, retval = runCode(info,
info->start_address+OFFSET_FLASH, info->start_address+OFFSET_FLASH,
info->start_address+OFFSET_FLASH+OFFSET_FLASH_SIZE, info->start_address+OFFSET_FLASH+OFFSET_FLASH_SIZE,
buffer, buffer,
...@@ -408,7 +408,7 @@ static uint32_t ecosflash_address(struct flash_bank_s *bank, uint32_t address) ...@@ -408,7 +408,7 @@ static uint32_t ecosflash_address(struct flash_bank_s *bank, uint32_t address)
static int ecosflash_erase(struct flash_bank_s *bank, int first, int last) static int ecosflash_erase(struct flash_bank_s *bank, int first, int last)
{ {
struct flash_bank_s *c=bank; struct flash_bank_s *c = bank;
ecosflash_flash_bank_t *info = bank->driver_priv; ecosflash_flash_bank_t *info = bank->driver_priv;
return eCosBoard_erase(info, c->base+first*sectorSize, sectorSize*(last-first+1)); return eCosBoard_erase(info, c->base+first*sectorSize, sectorSize*(last-first+1));
} }
...@@ -421,7 +421,7 @@ static int ecosflash_protect(struct flash_bank_s *bank, int set, int first, int ...@@ -421,7 +421,7 @@ static int ecosflash_protect(struct flash_bank_s *bank, int set, int first, int
static int ecosflash_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) static int ecosflash_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
{ {
ecosflash_flash_bank_t *info = bank->driver_priv; ecosflash_flash_bank_t *info = bank->driver_priv;
struct flash_bank_s *c=bank; struct flash_bank_s *c = bank;
return eCosBoard_flash(info, buffer, c->base+offset, count); return eCosBoard_flash(info, buffer, c->base+offset, count);
} }
......
...@@ -89,7 +89,7 @@ static int flash_driver_write(struct flash_bank_s *bank, uint8_t *buffer, uint32 ...@@ -89,7 +89,7 @@ static int flash_driver_write(struct flash_bank_s *bank, uint8_t *buffer, uint32
{ {
int retval; int retval;
retval=bank->driver->write(bank, buffer, offset, count); retval = bank->driver->write(bank, buffer, offset, count);
if (retval != ERROR_OK) if (retval != ERROR_OK)
{ {
LOG_ERROR("error writing to flash at address 0x%08" PRIx32 " at offset 0x%8.8" PRIx32 " (%d)", LOG_ERROR("error writing to flash at address 0x%08" PRIx32 " at offset 0x%8.8" PRIx32 " (%d)",
...@@ -103,7 +103,7 @@ static int flash_driver_erase(struct flash_bank_s *bank, int first, int last) ...@@ -103,7 +103,7 @@ static int flash_driver_erase(struct flash_bank_s *bank, int first, int last)
{ {
int retval; int retval;
retval=bank->driver->erase(bank, first, last); retval = bank->driver->erase(bank, first, last);
if (retval != ERROR_OK) if (retval != ERROR_OK)
{ {
LOG_ERROR("failed erasing sectors %d to %d (%d)", first, last, retval); LOG_ERROR("failed erasing sectors %d to %d (%d)", first, last, retval);
...@@ -116,7 +116,7 @@ int flash_driver_protect(struct flash_bank_s *bank, int set, int first, int last ...@@ -116,7 +116,7 @@ int flash_driver_protect(struct flash_bank_s *bank, int set, int first, int last
{ {
int retval; int retval;
retval=bank->driver->protect(bank, set, first, last); retval = bank->driver->protect(bank, set, first, last);
if (retval != ERROR_OK) if (retval != ERROR_OK)
{ {
LOG_ERROR("failed setting protection for areas %d to %d (%d)", first, last, retval); LOG_ERROR("failed setting protection for areas %d to %d (%d)", first, last, retval);
...@@ -142,10 +142,10 @@ static int jim_flash_banks(Jim_Interp *interp, int argc, Jim_Obj *const *argv) ...@@ -142,10 +142,10 @@ static int jim_flash_banks(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
return JIM_ERR; return JIM_ERR;
} }
Jim_Obj *list=Jim_NewListObj(interp, NULL, 0); Jim_Obj *list = Jim_NewListObj(interp, NULL, 0);
for (p = flash_banks; p; p = p->next) for (p = flash_banks; p; p = p->next)
{ {
Jim_Obj *elem=Jim_NewListObj(interp, NULL, 0); Jim_Obj *elem = Jim_NewListObj(interp, NULL, 0);
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "name", -1)); Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "name", -1));
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, p->driver->name, -1)); Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, p->driver->name, -1));
...@@ -291,7 +291,7 @@ static int handle_flash_bank_command(struct command_context_s *cmd_ctx, char *cm ...@@ -291,7 +291,7 @@ static int handle_flash_bank_command(struct command_context_s *cmd_ctx, char *cm
c->sectors = NULL; c->sectors = NULL;
c->next = NULL; c->next = NULL;
if ((retval=flash_drivers[i]->flash_bank_command(cmd_ctx, cmd, args, argc, c)) != ERROR_OK) if ((retval = flash_drivers[i]->flash_bank_command(cmd_ctx, cmd, args, argc, c)) != ERROR_OK)
{ {
LOG_ERROR("'%s' driver rejected flash bank at 0x%8.8" PRIx32 , args[0], c->base); LOG_ERROR("'%s' driver rejected flash bank at 0x%8.8" PRIx32 , args[0], c->base);
free(c); free(c);
...@@ -754,13 +754,13 @@ static int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cm ...@@ -754,13 +754,13 @@ static int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cm
switch (cmd