Michael Bruck: fixed warnings

git-svn-id: svn://svn.berlios.de/openocd/trunk@471 b42882b7-edfa-0310-969c-e2dbd0fdcd60
__archive__
oharboe 2008-03-07 16:18:56 +00:00
parent 081bc06112
commit d3f3f61498
8 changed files with 28 additions and 16 deletions

View File

@ -1729,7 +1729,9 @@ int cfi_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
if (retval == ERROR_TARGET_RESOURCE_NOT_AVAILABLE) if (retval == ERROR_TARGET_RESOURCE_NOT_AVAILABLE)
{ {
u32 buffersize = 1UL << cfi_info->max_buf_write_size; u32 buffersize = 1UL << cfi_info->max_buf_write_size;
#if 0
u32 buffermask = buffersize-1; u32 buffermask = buffersize-1;
#endif
u32 bufferwsize; u32 bufferwsize;
switch(bank->chip_width) switch(bank->chip_width)

View File

@ -21,6 +21,8 @@
#include "config.h" #include "config.h"
#endif #endif
#include <string.h>
#include "replacements.h" #include "replacements.h"
@ -342,7 +344,7 @@ int eCosBoard_flash(ecosflash_flash_bank_t *info, void *data, u32 address, u32 l
} }
int retval; int retval;
retval=target_write_buffer(target, buffer, t, ((char *)data)+i); retval=target_write_buffer(target, buffer, t, ((u8 *)data)+i);
if (retval != ERROR_OK) if (retval != ERROR_OK)
return retval; return retval;

View File

@ -271,12 +271,12 @@ int stellaris_info(struct flash_bank_s *bank, char *buf, int buf_size)
} }
printed = snprintf(buf, buf_size, "\nLMI Stellaris information: Chip is class %i(%s) %s v%c.%i\n", printed = snprintf(buf, buf_size, "\nLMI Stellaris information: Chip is class %i(%s) %s v%c.%i\n",
device_class, StellarisClassname[device_class], stellaris_info->target_name, device_class, StellarisClassname[device_class], stellaris_info->target_name,
'A' + (stellaris_info->did0>>8)&0xFF, (stellaris_info->did0)&0xFF); 'A' + ((stellaris_info->did0>>8)&0xFF), (stellaris_info->did0)&0xFF);
buf += printed; buf += printed;
buf_size -= printed; buf_size -= printed;
printed = snprintf(buf, buf_size, "did1: 0x%8.8x, arch: 0x%4.4x, eproc: %s, ramsize:%ik, flashsize: %ik\n", printed = snprintf(buf, buf_size, "did1: 0x%8.8x, arch: 0x%4.4x, eproc: %s, ramsize:%ik, flashsize: %ik\n",
stellaris_info->did1, stellaris_info->did1, "ARMV7M", (1+(stellaris_info->dc0>>16)&0xFFFF)/4, (1+stellaris_info->dc0&0xFFFF)*2); stellaris_info->did1, stellaris_info->did1, "ARMV7M", (1+((stellaris_info->dc0>>16)&0xFFFF))/4, (1+(stellaris_info->dc0&0xFFFF))*2);
buf += printed; buf += printed;
buf_size -= printed; buf_size -= printed;
@ -341,6 +341,10 @@ void stellaris_read_clock_info(flash_bank_t *bank)
WARNING("Invalid oscsrc (3) in rcc register"); WARNING("Invalid oscsrc (3) in rcc register");
mainfreq = 6000000; mainfreq = 6000000;
break; break;
default: /* NOTREACHED */
mainfreq = 0;
break;
} }
if (!bypass) if (!bypass)
@ -448,8 +452,8 @@ int stellaris_read_part_info(struct flash_bank_s *bank)
stellaris_info->did0 = did0; stellaris_info->did0 = did0;
stellaris_info->did1 = did1; stellaris_info->did1 = did1;
stellaris_info->num_lockbits = 1+stellaris_info->dc0&0xFFFF; stellaris_info->num_lockbits = 1+(stellaris_info->dc0&0xFFFF);
stellaris_info->num_pages = 2*(1+stellaris_info->dc0&0xFFFF); stellaris_info->num_pages = 2*(1+(stellaris_info->dc0&0xFFFF));
stellaris_info->pagesize = 1024; stellaris_info->pagesize = 1024;
bank->size = 1024*stellaris_info->num_pages; bank->size = 1024*stellaris_info->num_pages;
stellaris_info->pages_in_lockregion = 2; stellaris_info->pages_in_lockregion = 2;
@ -722,8 +726,8 @@ int stellaris_write_block(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32
armv7m_algorithm_t armv7m_info; armv7m_algorithm_t armv7m_info;
int retval; int retval;
DEBUG("(bank=%08X buffer=%08X offset=%08X wcount=%08X)", DEBUG("(bank=%p buffer=%p offset=%08X wcount=%08X)",
(unsigned int)bank, (unsigned int)buffer, offset, wcount); bank, buffer, offset, wcount);
/* flash write code */ /* flash write code */
if (target_alloc_working_area(target, sizeof(stellaris_write_code), &write_algorithm) != ERROR_OK) if (target_alloc_working_area(target, sizeof(stellaris_write_code), &write_algorithm) != ERROR_OK)
@ -737,8 +741,8 @@ int stellaris_write_block(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32
/* memory buffer */ /* memory buffer */
while (target_alloc_working_area(target, buffer_size, &source) != ERROR_OK) while (target_alloc_working_area(target, buffer_size, &source) != ERROR_OK)
{ {
DEBUG("called target_alloc_working_area(target=%08X buffer_size=%08X source=%08X)", DEBUG("called target_alloc_working_area(target=%p buffer_size=%08X source=%p)",
(unsigned int)target, buffer_size, (unsigned int)source); target, buffer_size, source);
buffer_size /= 2; buffer_size /= 2;
if (buffer_size <= 256) if (buffer_size <= 256)
{ {
@ -819,8 +823,8 @@ int stellaris_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count
return ERROR_TARGET_NOT_HALTED; return ERROR_TARGET_NOT_HALTED;
} }
DEBUG("(bank=%08X buffer=%08X offset=%08X count=%08X)", DEBUG("(bank=%p buffer=%p offset=%08X count=%08X)",
(unsigned int)bank, (unsigned int)buffer, offset, count); bank, buffer, offset, count);
if (stellaris_info->did1 == 0) if (stellaris_info->did1 == 0)
{ {

View File

@ -866,7 +866,6 @@ int tms470_protect(struct flash_bank_s *bank, int set, int first, int last)
int tms470_write(struct flash_bank_s *bank, u8 * buffer, u32 offset, u32 count) int tms470_write(struct flash_bank_s *bank, u8 * buffer, u32 offset, u32 count)
{ {
target_t *target = bank->target; target_t *target = bank->target;
tms470_flash_bank_t *tms470_info = bank->driver_priv;
u32 glbctrl, fmbac2, orig_fmregopt, fmbsea, fmbseb, fmmaxpp, fmmstat; u32 glbctrl, fmbac2, orig_fmregopt, fmbsea, fmbseb, fmmaxpp, fmmstat;
int i, result = ERROR_OK; int i, result = ERROR_OK;

View File

@ -189,7 +189,7 @@ int fileio_read_u32(fileio_t *fileio, u32 *data)
return ERROR_OK; return ERROR_OK;
} }
int fileio_local_fgets(fileio_t *fileio, u32 size, u8 *buffer) int fileio_local_fgets(fileio_t *fileio, u32 size, char *buffer)
{ {
if( fgets(buffer, size, fileio->file) == NULL) if( fgets(buffer, size, fileio->file) == NULL)
return ERROR_FILEIO_OPERATION_FAILED; return ERROR_FILEIO_OPERATION_FAILED;
@ -197,7 +197,7 @@ int fileio_local_fgets(fileio_t *fileio, u32 size, u8 *buffer)
return ERROR_OK; return ERROR_OK;
} }
int fileio_fgets(fileio_t *fileio, u32 size, u8 *buffer) int fileio_fgets(fileio_t *fileio, u32 size, char *buffer)
{ {
return fileio_local_fgets(fileio, size, buffer); return fileio_local_fgets(fileio, size, buffer);
} }

View File

@ -59,7 +59,7 @@ typedef struct fileio_s
extern int fileio_write(fileio_t *fileio, u32 size, u8 *buffer, u32 *size_written); extern int fileio_write(fileio_t *fileio, u32 size, u8 *buffer, u32 *size_written);
extern int fileio_read(fileio_t *fileio, u32 size, u8 *buffer, u32 *size_read); extern int fileio_read(fileio_t *fileio, u32 size, u8 *buffer, u32 *size_read);
extern int fileio_fgets(fileio_t *fileio, u32 size, u8 *buffer); extern int fileio_fgets(fileio_t *fileio, u32 size, char *buffer);
extern int fileio_seek(fileio_t *fileio, u32 position); extern int fileio_seek(fileio_t *fileio, u32 position);
extern int fileio_close(fileio_t *fileio); extern int fileio_close(fileio_t *fileio);
extern int fileio_open(fileio_t *fileio, char *url, enum fileio_access access, enum fileio_type type); extern int fileio_open(fileio_t *fileio, char *url, enum fileio_access access, enum fileio_type type);

View File

@ -709,7 +709,7 @@ void MINIDRIVER(interface_jtag_add_dr_out)(int device_num,
#endif #endif
for (j = 0; j < num_fields; j++) for (j = 0; j < num_fields; j++)
{ {
char out_value[4]; u8 out_value[4];
scan_size = num_bits[j]; scan_size = num_bits[j];
buf_set_u32(out_value, 0, scan_size, value[j]); buf_set_u32(out_value, 0, scan_size, value[j]);
(*last_cmd)->cmd.scan->fields[field_count].num_bits = scan_size; (*last_cmd)->cmd.scan->fields[field_count].num_bits = scan_size;

View File

@ -723,13 +723,18 @@ int etmv1_data(etm_context_t *ctx, int size, u32 *data)
} }
if (size == 8) if (size == 8)
{
ERROR("TODO: add support for 64-bit values"); ERROR("TODO: add support for 64-bit values");
return -1;
}
else if (size == 4) else if (size == 4)
*data = target_buffer_get_u32(ctx->target, buf); *data = target_buffer_get_u32(ctx->target, buf);
else if (size == 2) else if (size == 2)
*data = target_buffer_get_u16(ctx->target, buf); *data = target_buffer_get_u16(ctx->target, buf);
else if (size == 1) else if (size == 1)
*data = buf[0]; *data = buf[0];
else
return -1;
return 0; return 0;
} }