Commit 310be8a8 authored by zwelch's avatar zwelch
Browse files

Transform 'u8' to 'uint8_t' in src/flash

- Replace '\([^_]\)u8' with '\1uint8_t'.
- Replace '^u8' with 'uint8_t'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2275 b42882b7-edfa-0310-969c-e2dbd0fdcd60
parent 86173cdb
......@@ -33,9 +33,9 @@ static int aduc702x_flash_bank_command(struct command_context_s *cmd_ctx, char *
static int aduc702x_register_commands(struct command_context_s *cmd_ctx);
static int aduc702x_erase(struct flash_bank_s *bank, int first, int last);
static int aduc702x_protect(struct flash_bank_s *bank, int set, int first, int last);
static int aduc702x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count);
static int aduc702x_write_single(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count);
static int aduc702x_write_block(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count);
static int aduc702x_write(struct flash_bank_s *bank, uint8_t *buffer, u32 offset, u32 count);
static int aduc702x_write_single(struct flash_bank_s *bank, uint8_t *buffer, u32 offset, u32 count);
static int aduc702x_write_block(struct flash_bank_s *bank, uint8_t *buffer, u32 offset, u32 count);
static int aduc702x_probe(struct flash_bank_s *bank);
static int aduc702x_info(struct flash_bank_s *bank, char *buf, int buf_size);
static int aduc702x_protect_check(struct flash_bank_s *bank);
......@@ -193,7 +193,7 @@ static int aduc702x_protect(struct flash_bank_s *bank, int set, int first, int l
return ERROR_FLASH_OPERATION_FAILED;
}
static int aduc702x_write_block(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
static int aduc702x_write_block(struct flash_bank_s *bank, uint8_t *buffer, u32 offset, u32 count)
{
aduc702x_flash_bank_t *aduc702x_info = bank->driver_priv;
target_t *target = bank->target;
......@@ -250,7 +250,7 @@ static int aduc702x_write_block(struct flash_bank_s *bank, u8 *buffer, u32 offse
};
target_write_buffer(target, aduc702x_info->write_algorithm->address,
sizeof(aduc702x_flash_write_code), (u8*)aduc702x_flash_write_code);
sizeof(aduc702x_flash_write_code), (uint8_t*)aduc702x_flash_write_code);
/* memory buffer */
while (target_alloc_working_area(target, buffer_size, &source) != ERROR_OK)
......@@ -322,10 +322,10 @@ static int aduc702x_write_block(struct flash_bank_s *bank, u8 *buffer, u32 offse
/* All-JTAG, single-access method. Very slow. Used only if there is no
* working area available. */
static int aduc702x_write_single(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
static int aduc702x_write_single(struct flash_bank_s *bank, uint8_t *buffer, u32 offset, u32 count)
{
u32 x;
u8 b;
uint8_t b;
target_t *target = bank->target;
aduc702x_set_write_enable(target, 1);
......@@ -363,7 +363,7 @@ static int aduc702x_write_single(struct flash_bank_s *bank, u8 *buffer, u32 offs
return ERROR_OK;
}
int aduc702x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
int aduc702x_write(struct flash_bank_s *bank, uint8_t *buffer, u32 offset, u32 count)
{
int retval;
......@@ -420,7 +420,7 @@ static int aduc702x_set_write_enable(target_t *target, int enable)
* so in some cases may slow things down without a usleep after the first read */
static int aduc702x_check_flash_completion(target_t* target, unsigned int timeout_ms)
{
u8 v = 4;
uint8_t v = 4;
long long endtime = timeval_ms() + timeout_ms;
while (1) {
......
......@@ -47,7 +47,7 @@ static int at91sam7_register_commands(struct command_context_s *cmd_ctx);
static int at91sam7_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank);
static int at91sam7_erase(struct flash_bank_s *bank, int first, int last);
static int at91sam7_protect(struct flash_bank_s *bank, int set, int first, int last);
static int at91sam7_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count);
static int at91sam7_write(struct flash_bank_s *bank, uint8_t *buffer, u32 offset, u32 count);
static int at91sam7_probe(struct flash_bank_s *bank);
//static int at91sam7_auto_probe(struct flash_bank_s *bank);
static int at91sam7_erase_check(struct flash_bank_s *bank);
......@@ -57,7 +57,7 @@ static int at91sam7_info(struct flash_bank_s *bank, char *buf, int buf_size);
static u32 at91sam7_get_flash_status(target_t *target, int bank_number);
static void at91sam7_set_flash_mode(flash_bank_t *bank, int mode);
static u32 at91sam7_wait_status_busy(flash_bank_t *bank, u32 waitbits, int timeout);
static int at91sam7_flash_command(struct flash_bank_s *bank, u8 cmd, u16 pagen);
static int at91sam7_flash_command(struct flash_bank_s *bank, uint8_t cmd, u16 pagen);
static int at91sam7_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
flash_driver_t at91sam7_flash =
......@@ -274,7 +274,7 @@ static u32 at91sam7_wait_status_busy(flash_bank_t *bank, u32 waitbits, int timeo
}
/* Send one command to the AT91SAM flash controller */
static int at91sam7_flash_command(struct flash_bank_s *bank, u8 cmd, u16 pagen)
static int at91sam7_flash_command(struct flash_bank_s *bank, uint8_t cmd, u16 pagen)
{
u32 fcr;
at91sam7_flash_bank_t *at91sam7_info = bank->driver_priv;
......@@ -312,7 +312,7 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank)
u16 bnk, sec;
u16 arch;
u32 cidr;
u8 banks_num = 0;
uint8_t banks_num = 0;
u16 num_nvmbits = 0;
u16 sectors_num = 0;
u16 pages_per_sector = 0;
......@@ -624,7 +624,7 @@ static int at91sam7_erase_check(struct flash_bank_s *bank)
u16 retval;
u32 blank;
u16 fast_check;
u8 *buffer;
uint8_t *buffer;
u16 nSector;
u16 nByte;
......@@ -686,7 +686,7 @@ static int at91sam7_erase_check(struct flash_bank_s *bank)
static int at91sam7_protect_check(struct flash_bank_s *bank)
{
u8 lock_pos, gpnvm_pos;
uint8_t lock_pos, gpnvm_pos;
u32 status;
at91sam7_flash_bank_t *at91sam7_info = bank->driver_priv;
......@@ -861,8 +861,8 @@ static int at91sam7_erase(struct flash_bank_s *bank, int first, int last)
at91sam7_flash_bank_t *at91sam7_info = bank->driver_priv;
int sec;
u32 nbytes, pos;
u8 *buffer;
u8 erase_all;
uint8_t *buffer;
uint8_t erase_all;
if (at91sam7_info->cidr == 0)
{
......@@ -901,7 +901,7 @@ static int at91sam7_erase(struct flash_bank_s *bank, int first, int last)
{
/* allocate and clean buffer */
nbytes = (last - first + 1) * bank->sectors[first].size;
buffer = malloc(nbytes * sizeof(u8));
buffer = malloc(nbytes * sizeof(uint8_t));
for (pos=0; pos<nbytes; pos++)
{
buffer[pos] = 0xFF;
......@@ -974,7 +974,7 @@ static int at91sam7_protect(struct flash_bank_s *bank, int set, int first, int l
return ERROR_OK;
}
static int at91sam7_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
static int at91sam7_write(struct flash_bank_s *bank, uint8_t *buffer, u32 offset, u32 count)
{
int retval;
at91sam7_flash_bank_t *at91sam7_info = bank->driver_priv;
......@@ -1127,7 +1127,7 @@ static int at91sam7_handle_gpnvm_command(struct command_context_s *cmd_ctx, char
{
flash_bank_t *bank;
int bit;
u8 flashcmd;
uint8_t flashcmd;
u32 status;
at91sam7_flash_bank_t *at91sam7_info;
int retval;
......
......@@ -40,7 +40,7 @@ typedef struct at91sam7_flash_bank_s
char *target_name;
/* flash auto-detection */
u8 flash_autodetection;
uint8_t flash_autodetection;
/* flash geometry */
u16 pages_per_sector;
......@@ -53,15 +53,15 @@ typedef struct at91sam7_flash_bank_s
u16 num_nvmbits;
u16 num_nvmbits_on;
u16 nvmbits;
u8 securitybit;
uint8_t securitybit;
/* 0: not init
* 1: fmcn for nvbits (1uS)
* 2: fmcn for flash (1.5uS) */
u8 flashmode;
uint8_t flashmode;
/* main clock status */
u8 mck_valid;
uint8_t mck_valid;
u32 mck_freq;
/* external clock frequency */
......
......@@ -60,7 +60,7 @@ static int avrf_register_commands(struct command_context_s *cmd_ctx);
static int avrf_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank);
static int avrf_erase(struct flash_bank_s *bank, int first, int last);
static int avrf_protect(struct flash_bank_s *bank, int set, int first, int last);
static int avrf_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count);
static int avrf_write(struct flash_bank_s *bank, uint8_t *buffer, u32 offset, u32 count);
static int avrf_probe(struct flash_bank_s *bank);
static int avrf_auto_probe(struct flash_bank_s *bank);
//static int avrf_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
......@@ -69,13 +69,13 @@ static int avrf_info(struct flash_bank_s *bank, char *buf, int buf_size);
static int avrf_handle_mass_erase_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
extern int avr_jtag_sendinstr(jtag_tap_t *tap, u8 *ir_in, u8 ir_out);
extern int avr_jtag_sendinstr(jtag_tap_t *tap, uint8_t *ir_in, uint8_t ir_out);
extern int avr_jtag_senddat(jtag_tap_t *tap, u32 *dr_in, u32 dr_out, int len);
extern int mcu_write_ir(jtag_tap_t *tap, u8 *ir_in, u8 *ir_out, int ir_len, int rti);
extern int mcu_write_dr(jtag_tap_t *tap, u8 *ir_in, u8 *ir_out, int dr_len, int rti);
extern int mcu_write_ir_u8(jtag_tap_t *tap, u8 *ir_in, u8 ir_out, int ir_len, int rti);
extern int mcu_write_dr_u8(jtag_tap_t *tap, u8 *ir_in, u8 ir_out, int dr_len, int rti);
extern int mcu_write_ir(jtag_tap_t *tap, uint8_t *ir_in, uint8_t *ir_out, int ir_len, int rti);
extern int mcu_write_dr(jtag_tap_t *tap, uint8_t *ir_in, uint8_t *ir_out, int dr_len, int rti);
extern int mcu_write_ir_u8(jtag_tap_t *tap, uint8_t *ir_in, uint8_t ir_out, int ir_len, int rti);
extern int mcu_write_dr_u8(jtag_tap_t *tap, uint8_t *ir_in, uint8_t ir_out, int dr_len, int rti);
extern int mcu_write_ir_u16(jtag_tap_t *tap, u16 *ir_in, u16 ir_out, int ir_len, int rti);
extern int mcu_write_dr_u16(jtag_tap_t *tap, u16 *ir_in, u16 ir_out, int dr_len, int rti);
extern int mcu_write_ir_u32(jtag_tap_t *tap, u32 *ir_in, u32 ir_out, int ir_len, int rti);
......@@ -161,7 +161,7 @@ static int avr_jtagprg_chiperase(avr_common_t *avr)
return ERROR_OK;
}
static int avr_jtagprg_writeflashpage(avr_common_t *avr, u8 *page_buf, u32 buf_size, u32 addr, u32 page_size)
static int avr_jtagprg_writeflashpage(avr_common_t *avr, uint8_t *page_buf, u32 buf_size, u32 addr, u32 page_size)
{
u32 i, poll_value;
......@@ -249,7 +249,7 @@ static int avrf_protect(struct flash_bank_s *bank, int set, int first, int last)
return ERROR_OK;
}
static int avrf_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
static int avrf_write(struct flash_bank_s *bank, uint8_t *buffer, u32 offset, u32 count)
{
target_t *target = bank->target;
avr_common_t *avr = target->arch_info;
......
......@@ -33,7 +33,7 @@ static int cfi_register_commands(struct command_context_s *cmd_ctx);
static int cfi_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank);
static int cfi_erase(struct flash_bank_s *bank, int first, int last);
static int cfi_protect(struct flash_bank_s *bank, int set, int first, int last);
static int cfi_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count);
static int cfi_write(struct flash_bank_s *bank, uint8_t *buffer, u32 offset, u32 count);
static int cfi_probe(struct flash_bank_s *bank);
static int cfi_auto_probe(struct flash_bank_s *bank);
static int cfi_protect_check(struct flash_bank_s *bank);
......@@ -131,7 +131,7 @@ static __inline__ u32 flash_address(flash_bank_t *bank, int sector, u32 offset)
}
static void cfi_command(flash_bank_t *bank, u8 cmd, u8 *cmd_buf)
static void cfi_command(flash_bank_t *bank, uint8_t cmd, uint8_t *cmd_buf)
{
int i;
......@@ -161,10 +161,10 @@ static void cfi_command(flash_bank_t *bank, u8 cmd, u8 *cmd_buf)
* flash banks are expected to be made of similar chips
* the query result should be the same for all
*/
static u8 cfi_query_u8(flash_bank_t *bank, int sector, u32 offset)
static uint8_t cfi_query_u8(flash_bank_t *bank, int sector, u32 offset)
{
target_t *target = bank->target;
u8 data[CFI_MAX_BUS_WIDTH];
uint8_t data[CFI_MAX_BUS_WIDTH];
target_read_memory(target, flash_address(bank, sector, offset), bank->bus_width, 1, data);
......@@ -178,10 +178,10 @@ static u8 cfi_query_u8(flash_bank_t *bank, int sector, u32 offset)
* in case of a bank made of multiple chips,
* the individual values are ORed
*/
static u8 cfi_get_u8(flash_bank_t *bank, int sector, u32 offset)
static uint8_t cfi_get_u8(flash_bank_t *bank, int sector, u32 offset)
{
target_t *target = bank->target;
u8 data[CFI_MAX_BUS_WIDTH];
uint8_t data[CFI_MAX_BUS_WIDTH];
int i;
target_read_memory(target, flash_address(bank, sector, offset), bank->bus_width, 1, data);
......@@ -195,7 +195,7 @@ static u8 cfi_get_u8(flash_bank_t *bank, int sector, u32 offset)
}
else
{
u8 value = 0;
uint8_t value = 0;
for (i = 0; i < bank->bus_width / bank->chip_width; i++)
value |= data[bank->bus_width - 1 - i];
......@@ -207,11 +207,11 @@ static u16 cfi_query_u16(flash_bank_t *bank, int sector, u32 offset)
{
target_t *target = bank->target;
cfi_flash_bank_t *cfi_info = bank->driver_priv;
u8 data[CFI_MAX_BUS_WIDTH * 2];
uint8_t data[CFI_MAX_BUS_WIDTH * 2];
if(cfi_info->x16_as_x8)
{
u8 i;
uint8_t i;
for(i=0;i<2;i++)
target_read_memory(target, flash_address(bank, sector, offset+i), bank->bus_width, 1,
&data[i*bank->bus_width] );
......@@ -229,11 +229,11 @@ static u32 cfi_query_u32(flash_bank_t *bank, int sector, u32 offset)
{
target_t *target = bank->target;
cfi_flash_bank_t *cfi_info = bank->driver_priv;
u8 data[CFI_MAX_BUS_WIDTH * 4];
uint8_t data[CFI_MAX_BUS_WIDTH * 4];
if(cfi_info->x16_as_x8)
{
u8 i;
uint8_t i;
for(i=0;i<4;i++)
target_read_memory(target, flash_address(bank, sector, offset+i), bank->bus_width, 1,
&data[i*bank->bus_width] );
......@@ -251,7 +251,7 @@ static u32 cfi_query_u32(flash_bank_t *bank, int sector, u32 offset)
static void cfi_intel_clear_status_register(flash_bank_t *bank)
{
target_t *target = bank->target;
u8 command[8];
uint8_t command[8];
if (target->state != TARGET_HALTED)
{
......@@ -263,9 +263,9 @@ static void cfi_intel_clear_status_register(flash_bank_t *bank)
target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command);
}
u8 cfi_intel_wait_status_busy(flash_bank_t *bank, int timeout)
uint8_t cfi_intel_wait_status_busy(flash_bank_t *bank, int timeout)
{
u8 status;
uint8_t status;
while ((!((status = cfi_get_u8(bank, 0, 0x0)) & 0x80)) && (timeout-- > 0))
{
......@@ -306,7 +306,7 @@ u8 cfi_intel_wait_status_busy(flash_bank_t *bank, int timeout)
int cfi_spansion_wait_status_busy(flash_bank_t *bank, int timeout)
{
u8 status, oldstatus;
uint8_t status, oldstatus;
cfi_flash_bank_t *cfi_info = bank->driver_priv;
oldstatus = cfi_get_u8(bank, 0, 0x0);
......@@ -345,7 +345,7 @@ static int cfi_read_intel_pri_ext(flash_bank_t *bank)
cfi_flash_bank_t *cfi_info = bank->driver_priv;
cfi_intel_pri_ext_t *pri_ext = malloc(sizeof(cfi_intel_pri_ext_t));
target_t *target = bank->target;
u8 command[8];
uint8_t command[8];
cfi_info->pri_ext = pri_ext;
......@@ -408,7 +408,7 @@ static int cfi_read_spansion_pri_ext(flash_bank_t *bank)
cfi_flash_bank_t *cfi_info = bank->driver_priv;
cfi_spansion_pri_ext_t *pri_ext = malloc(sizeof(cfi_spansion_pri_ext_t));
target_t *target = bank->target;
u8 command[8];
uint8_t command[8];
cfi_info->pri_ext = pri_ext;
......@@ -474,7 +474,7 @@ static int cfi_read_atmel_pri_ext(flash_bank_t *bank)
cfi_flash_bank_t *cfi_info = bank->driver_priv;
cfi_spansion_pri_ext_t *pri_ext = malloc(sizeof(cfi_spansion_pri_ext_t));
target_t *target = bank->target;
u8 command[8];
uint8_t command[8];
/* ATMEL devices use the same CFI primary command set (0x2) as AMD/Spansion,
* but a different primary extended query table.
......@@ -680,7 +680,7 @@ static int cfi_intel_erase(struct flash_bank_s *bank, int first, int last)
int retval;
cfi_flash_bank_t *cfi_info = bank->driver_priv;
target_t *target = bank->target;
u8 command[8];
uint8_t command[8];
int i;
cfi_intel_clear_status_register(bank);
......@@ -725,7 +725,7 @@ static int cfi_spansion_erase(struct flash_bank_s *bank, int first, int last)
cfi_flash_bank_t *cfi_info = bank->driver_priv;
cfi_spansion_pri_ext_t *pri_ext = cfi_info->pri_ext;
target_t *target = bank->target;
u8 command[8];
uint8_t command[8];
int i;
for (i = first; i <= last; i++)
......@@ -826,7 +826,7 @@ static int cfi_intel_protect(struct flash_bank_s *bank, int set, int first, int
cfi_flash_bank_t *cfi_info = bank->driver_priv;
cfi_intel_pri_ext_t *pri_ext = cfi_info->pri_ext;
target_t *target = bank->target;
u8 command[8];
uint8_t command[8];
int retry = 0;
int i;
......@@ -875,7 +875,7 @@ static int cfi_intel_protect(struct flash_bank_s *bank, int set, int first, int
}
else
{
u8 block_status;
uint8_t block_status;
/* read block lock bit, to verify status */
cfi_command(bank, 0x90, command);
if((retval = target_write_memory(target, flash_address(bank, 0, 0x55), bank->bus_width, 1, command)) != ERROR_OK)
......@@ -970,7 +970,7 @@ static int cfi_protect(struct flash_bank_s *bank, int set, int first, int last)
}
/* FIXME Replace this by a simple memcpy() - still unsure about sideeffects */
static void cfi_add_byte(struct flash_bank_s *bank, u8 *word, u8 byte)
static void cfi_add_byte(struct flash_bank_s *bank, uint8_t *word, uint8_t byte)
{
/* target_t *target = bank->target; */
......@@ -1005,7 +1005,7 @@ static void cfi_add_byte(struct flash_bank_s *bank, u8 *word, u8 byte)
/* Convert code image to target endian */
/* FIXME create general block conversion fcts in target.c?) */
static void cfi_fix_code_endian(target_t *target, u8 *dest, const u32 *src, u32 count)
static void cfi_fix_code_endian(target_t *target, uint8_t *dest, const u32 *src, u32 count)
{
u32 i;
for (i=0; i< count; i++)
......@@ -1016,11 +1016,11 @@ static void cfi_fix_code_endian(target_t *target, u8 *dest, const u32 *src, u32
}
}
static u32 cfi_command_val(flash_bank_t *bank, u8 cmd)
static u32 cfi_command_val(flash_bank_t *bank, uint8_t cmd)
{
target_t *target = bank->target;
u8 buf[CFI_MAX_BUS_WIDTH];
uint8_t buf[CFI_MAX_BUS_WIDTH];
cfi_command(bank, cmd, buf);
switch (bank->bus_width)
{
......@@ -1039,7 +1039,7 @@ static u32 cfi_command_val(flash_bank_t *bank, u8 cmd)
}
}
static int cfi_intel_write_block(struct flash_bank_s *bank, u8 *buffer, u32 address, u32 count)
static int cfi_intel_write_block(struct flash_bank_s *bank, uint8_t *buffer, u32 address, u32 count)
{
cfi_flash_bank_t *cfi_info = bank->driver_priv;
target_t *target = bank->target;
......@@ -1109,7 +1109,7 @@ static int cfi_intel_write_block(struct flash_bank_s *bank, u8 *buffer, u32 addr
0xeafffff2, /* b loop */
0xeafffffe /* done: b -2 */
};
u8 target_code[4*CFI_MAX_INTEL_CODESIZE];
uint8_t target_code[4*CFI_MAX_INTEL_CODESIZE];
const u32 *target_code_src;
u32 target_code_size;
int retval = ERROR_OK;
......@@ -1283,7 +1283,7 @@ cleanup:
return retval;
}
static int cfi_spansion_write_block(struct flash_bank_s *bank, u8 *buffer, u32 address, u32 count)
static int cfi_spansion_write_block(struct flash_bank_s *bank, uint8_t *buffer, u32 address, u32 count)
{
cfi_flash_bank_t *cfi_info = bank->driver_priv;
cfi_spansion_pri_ext_t *pri_ext = cfi_info->pri_ext;
......@@ -1422,7 +1422,7 @@ static int cfi_spansion_write_block(struct flash_bank_s *bank, u8 *buffer, u32 a
/* flash write code */
if (!cfi_info->write_algorithm)
{
u8 *target_code;
uint8_t *target_code;
int target_code_size;
const u32 *src;
......@@ -1545,12 +1545,12 @@ static int cfi_spansion_write_block(struct flash_bank_s *bank, u8 *buffer, u32 a
return exit_code;
}
static int cfi_intel_write_word(struct flash_bank_s *bank, u8 *word, u32 address)
static int cfi_intel_write_word(struct flash_bank_s *bank, uint8_t *word, u32 address)
{
int retval;
cfi_flash_bank_t *cfi_info = bank->driver_priv;
target_t *target = bank->target;
u8 command[8];
uint8_t command[8];
cfi_intel_clear_status_register(bank);
cfi_command(bank, 0x40, command);
......@@ -1579,12 +1579,12 @@ static int cfi_intel_write_word(struct flash_bank_s *bank, u8 *word, u32 address
return ERROR_OK;
}
static int cfi_intel_write_words(struct flash_bank_s *bank, u8 *word, u32 wordcount, u32 address)
static int cfi_intel_write_words(struct flash_bank_s *bank, uint8_t *word, u32 wordcount, u32 address)
{
int retval;
cfi_flash_bank_t *cfi_info = bank->driver_priv;
target_t *target = bank->target;
u8 command[8];
uint8_t command[8];
/* Calculate buffer size and boundary mask */
u32 buffersize = (1UL << cfi_info->max_buf_write_size) * (bank->bus_width / bank->chip_width);
......@@ -1671,13 +1671,13 @@ static int cfi_intel_write_words(struct flash_bank_s *bank, u8 *word, u32 wordco
return ERROR_OK;
}
static int cfi_spansion_write_word(struct flash_bank_s *bank, u8 *word, u32 address)
static int cfi_spansion_write_word(struct flash_bank_s *bank, uint8_t *word, u32 address)
{
int retval;
cfi_flash_bank_t *cfi_info = bank->driver_priv;
cfi_spansion_pri_ext_t *pri_ext = cfi_info->pri_ext;
target_t *target = bank->target;
u8 command[8];
uint8_t command[8];
cfi_command(bank, 0xaa, command);
if((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock1), bank->bus_width, 1, command)) != ERROR_OK)
......@@ -1717,12 +1717,12 @@ static int cfi_spansion_write_word(struct flash_bank_s *bank, u8 *word, u32 addr
return ERROR_OK;
}
static int cfi_spansion_write_words(struct flash_bank_s *bank, u8 *word, u32 wordcount, u32 address)
static int cfi_spansion_write_words(struct flash_bank_s *bank, uint8_t *word, u32 wordcount, u32 address)
{
int retval;
cfi_flash_bank_t *cfi_info = bank->driver_priv;
target_t *target = bank->target;
u8 command[8];
uint8_t command[8];
cfi_spansion_pri_ext_t *pri_ext = cfi_info->pri_ext;
/* Calculate buffer size and boundary mask */
......@@ -1809,7 +1809,7 @@ static int cfi_spansion_write_words(struct flash_bank_s *bank, u8 *word, u32 wor
return ERROR_OK;
}
static int cfi_write_word(struct flash_bank_s *bank, u8 *word, u32 address)
static int cfi_write_word(struct flash_bank_s *bank, uint8_t *word, u32 address)
{
cfi_flash_bank_t *cfi_info = bank->driver_priv;
......@@ -1830,7 +1830,7 @@ static int cfi_write_word(struct flash_bank_s *bank, u8 *word, u32 address)
return ERROR_FLASH_OPERATION_FAILED;
}
static int cfi_write_words(struct flash_bank_s *bank, u8 *word, u32 wordcount, u32 address)
static int cfi_write_words(struct flash_bank_s *bank, uint8_t *word, u32 wordcount, u32 address)
{
cfi_flash_bank_t *cfi_info = bank->driver_priv;
......@@ -1851,7 +1851,7 @@ static int cfi_write_words(struct flash_bank_s *bank, u8 *word, u32 wordcount, u
return ERROR_FLASH_OPERATION_FAILED;
}
int cfi_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
int cfi_write(struct flash_bank_s *bank, uint8_t *buffer, u32 offset, u32 count)
{
cfi_flash_bank_t *cfi_info = bank->driver_priv;
target_t *target = bank->target;
......@@ -1859,7 +1859,7 @@ int cfi_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
u32 write_p, copy_p;
int align; /* number of unaligned bytes */
int blk_count; /* number of bus_width bytes for block copy */
u8 current_word[CFI_MAX_BUS_WIDTH * 4]; /* word (bus_width size) currently being programmed */
uint8_t current_word[CFI_MAX_BUS_WIDTH * 4]; /* word (bus_width size) currently being programmed */
int i;
int retval;
......@@ -1888,7 +1888,7 @@ int cfi_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
/* copy bytes before the first write address */
for (i = 0; i < align; ++i, ++copy_p)
{
u8 byte;
uint8_t byte;
if((retval = target_read_memory(target, copy_p, 1, 1, &byte)) != ERROR_OK)
{
return retval;
......@@ -1907,7 +1907,7 @@ int cfi_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
/* if the buffer is already finished, copy bytes after the last write address */
for (; (count == 0) && (i < bank->bus_width); ++i, ++copy_p)
{
u8 byte;
uint8_t byte;
if((retval = target_read_memory(target, copy_p, 1, 1, &byte)) != ERROR_OK)
{
return retval;
......@@ -2038,7 +2038,7 @@ int cfi_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
}
for (; i < bank->bus_width; ++i, ++copy_p)
{
u8 byte;
uint8_t byte;
if((retval = target_read_memory(target, copy_p, 1, 1, &byte)) != ERROR_OK)
{
return retval;
......@@ -2106,7 +2106,7 @@ static int cfi_probe(struct flash_bank_s *bank)
{
cfi_flash_bank_t *cfi_info = bank->driver_priv;
target_t *target = bank->target;
u8 command[8];
uint8_t command[8];
int num_sectors = 0;
int i;
int sector = 0;
......@@ -2150,7 +2150,7 @@ static int cfi_probe(struct flash_bank_s *bank)
if (bank->chip_width == 1)
{
u8 manufacturer, device_id;
uint8_t manufacturer, device_id;
if((retval = target_read_u8(target, flash_address(bank, 0, 0x00), &manufacturer)) != ERROR_OK)
{
return retval;
......@@ -2402,7 +2402,7 @@ static int cfi_intel_protect_check(struct flash_bank_s *bank)
cfi_flash_bank_t *cfi_info = bank->driver_priv;
cfi_intel_pri_ext_t *pri_ext = cfi_info->pri_ext;
target_t *target = bank->target;
u8 command[CFI_MAX_BUS_WIDTH];
uint8_t command[CFI_MAX_BUS_WIDTH];
int i;
/* check if block lock bits are supported on this device */
......@@ -2417,7 +2417,7 @@ static int cfi_intel_protect_check(struct flash_bank_s *bank)
for (i = 0; i < bank->num_sectors; i++)
{
u8 block_status = cfi_get_u8(bank, i, 0x2);
uint8_t block_status = cfi_get_u8(bank, i, 0x2);
if (block_status & 1)
bank->sectors[i].is_protected = 1;
......@@ -2435,7 +2435,7 @@ static int cfi_spansion_protect_check(struct flash_bank_s *bank)
cfi_flash_bank_t *cfi_info = bank->driver_priv;
cfi_spansion_pri_ext_t *pri_ext = cfi_info->pri_ext;
target_t *target = bank->target;
u8 command[8];
uint8_t command[8];
int i;
cfi_command(bank, 0xaa,