diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/flash/aduc702x.c | 22 | ||||
-rw-r--r-- | src/flash/at91sam3.c | 24 | ||||
-rw-r--r-- | src/flash/at91sam7.c | 48 | ||||
-rw-r--r-- | src/flash/avrf.c | 18 | ||||
-rw-r--r-- | src/flash/cfi.c | 92 | ||||
-rw-r--r-- | src/flash/cfi.h | 2 | ||||
-rw-r--r-- | src/flash/ecos.c | 32 | ||||
-rw-r--r-- | src/flash/faux.c | 12 | ||||
-rw-r--r-- | src/flash/flash.c | 62 | ||||
-rw-r--r-- | src/flash/flash.h | 46 | ||||
-rw-r--r-- | src/flash/lpc2000.c | 22 | ||||
-rw-r--r-- | src/flash/lpc288x.c | 28 | ||||
-rw-r--r-- | src/flash/lpc2900.c | 52 | ||||
-rw-r--r-- | src/flash/non_cfi.c | 2 | ||||
-rw-r--r-- | src/flash/non_cfi.h | 2 | ||||
-rw-r--r-- | src/flash/ocl.c | 16 | ||||
-rw-r--r-- | src/flash/pic32mx.c | 40 | ||||
-rw-r--r-- | src/flash/stellaris.c | 42 | ||||
-rw-r--r-- | src/flash/stm32x.c | 40 | ||||
-rw-r--r-- | src/flash/str7x.c | 24 | ||||
-rw-r--r-- | src/flash/str9x.c | 18 | ||||
-rw-r--r-- | src/flash/str9xpec.c | 62 | ||||
-rw-r--r-- | src/flash/tms470.c | 26 | ||||
-rw-r--r-- | src/server/gdb_server.c | 14 |
24 files changed, 373 insertions, 373 deletions
diff --git a/src/flash/aduc702x.c b/src/flash/aduc702x.c index 76f38b56..c2a18848 100644 --- a/src/flash/aduc702x.c +++ b/src/flash/aduc702x.c @@ -29,7 +29,7 @@ #include "time_support.h" -static int aduc702x_build_sector_list(struct flash_bank_s *bank); +static int aduc702x_build_sector_list(struct flash_bank *bank); static int aduc702x_check_flash_completion(struct target* target, unsigned int timeout_ms); static int aduc702x_set_write_enable(struct target *target, int enable); @@ -64,9 +64,9 @@ FLASH_BANK_COMMAND_HANDLER(aduc702x_flash_bank_command) return ERROR_OK; } -static int aduc702x_build_sector_list(struct flash_bank_s *bank) +static int aduc702x_build_sector_list(struct flash_bank *bank) { - //aduc7026_flash_bank_t *aduc7026_info = bank->driver_priv; + //aduc7026_struct flash_bank *aduc7026_info = bank->driver_priv; int i = 0; uint32_t offset = 0; @@ -86,13 +86,13 @@ static int aduc702x_build_sector_list(struct flash_bank_s *bank) return ERROR_OK; } -static int aduc702x_protect_check(struct flash_bank_s *bank) +static int aduc702x_protect_check(struct flash_bank *bank) { printf("aduc702x_protect_check not implemented yet.\n"); return ERROR_OK; } -static int aduc702x_erase(struct flash_bank_s *bank, int first, int last) +static int aduc702x_erase(struct flash_bank *bank, int first, int last) { //int res; int x; @@ -145,7 +145,7 @@ static int aduc702x_erase(struct flash_bank_s *bank, int first, int last) return ERROR_OK; } -static int aduc702x_protect(struct flash_bank_s *bank, int set, int first, int last) +static int aduc702x_protect(struct flash_bank *bank, int set, int first, int last) { printf("aduc702x_protect not implemented yet.\n"); return ERROR_FLASH_OPERATION_FAILED; @@ -156,7 +156,7 @@ static int aduc702x_protect(struct flash_bank_s *bank, int set, int first, int l * * Caller should not check for other return values specifically */ -static int aduc702x_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int aduc702x_write_block(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct aduc702x_flash_bank *aduc702x_info = bank->driver_priv; struct target *target = bank->target; @@ -301,7 +301,7 @@ static int aduc702x_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint /* 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, uint8_t *buffer, uint32_t offset, uint32_t count) +static int aduc702x_write_single(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { uint32_t x; uint8_t b; @@ -342,7 +342,7 @@ static int aduc702x_write_single(struct flash_bank_s *bank, uint8_t *buffer, uin return ERROR_OK; } -int aduc702x_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +int aduc702x_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { int retval; @@ -366,12 +366,12 @@ int aduc702x_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, return retval; } -static int aduc702x_probe(struct flash_bank_s *bank) +static int aduc702x_probe(struct flash_bank *bank) { return ERROR_OK; } -static int aduc702x_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int aduc702x_info(struct flash_bank *bank, char *buf, int buf_size) { snprintf(buf, buf_size, "aduc702x flash driver info"); return ERROR_OK; diff --git a/src/flash/at91sam3.c b/src/flash/at91sam3.c index 3caf96c8..b756e48f 100644 --- a/src/flash/at91sam3.c +++ b/src/flash/at91sam3.c @@ -175,7 +175,7 @@ struct sam3_bank_private { // so we can find the chip we belong to struct sam3_chip *pChip; // so we can find the orginal bank pointer - flash_bank_t *pBank; + struct flash_bank *pBank; unsigned bank_number; uint32_t controller_address; uint32_t base_address; @@ -1456,7 +1456,7 @@ static const struct sam3_reg_list sam3_all_regs[] = { static struct sam3_bank_private * -get_sam3_bank_private(flash_bank_t *bank) +get_sam3_bank_private(struct flash_bank *bank) { return (struct sam3_bank_private *)(bank->driver_priv); } @@ -1582,7 +1582,7 @@ sam3_GetInfo(struct sam3_chip *pChip) static int -sam3_erase_check(struct flash_bank_s *bank) +sam3_erase_check(struct flash_bank *bank) { int x; @@ -1606,7 +1606,7 @@ sam3_erase_check(struct flash_bank_s *bank) } static int -sam3_protect_check(struct flash_bank_s *bank) +sam3_protect_check(struct flash_bank *bank) { int r; uint32_t v=0; @@ -1709,7 +1709,7 @@ sam3_GetDetails(struct sam3_bank_private *pPrivate) const struct sam3_chip_details *pDetails; struct sam3_chip *pChip; void *vp; - flash_bank_t *saved_banks[SAM3_MAX_FLASH_BANKS]; + struct flash_bank *saved_banks[SAM3_MAX_FLASH_BANKS]; unsigned x; const char *cp; @@ -1777,7 +1777,7 @@ sam3_GetDetails(struct sam3_bank_private *pPrivate) static int -_sam3_probe(struct flash_bank_s *bank, int noise) +_sam3_probe(struct flash_bank *bank, int noise) { unsigned x; int r; @@ -1861,13 +1861,13 @@ _sam3_probe(struct flash_bank_s *bank, int noise) } static int -sam3_probe(struct flash_bank_s *bank) +sam3_probe(struct flash_bank *bank) { return _sam3_probe(bank, 1); } static int -sam3_auto_probe(struct flash_bank_s *bank) +sam3_auto_probe(struct flash_bank *bank) { return _sam3_probe(bank, 0); } @@ -1875,7 +1875,7 @@ sam3_auto_probe(struct flash_bank_s *bank) static int -sam3_erase(struct flash_bank_s *bank, int first, int last) +sam3_erase(struct flash_bank *bank, int first, int last) { struct sam3_bank_private *pPrivate; int r; @@ -1907,7 +1907,7 @@ sam3_erase(struct flash_bank_s *bank, int first, int last) } static int -sam3_protect(struct flash_bank_s *bank, int set, int first, int last) +sam3_protect(struct flash_bank *bank, int set, int first, int last) { struct sam3_bank_private *pPrivate; int r; @@ -1936,7 +1936,7 @@ sam3_protect(struct flash_bank_s *bank, int set, int first, int last) static int -sam3_info(flash_bank_t *bank, char *buf, int buf_size) +sam3_info(struct flash_bank *bank, char *buf, int buf_size) { if (bank->target->state != TARGET_HALTED) { LOG_ERROR("Target not halted"); @@ -2104,7 +2104,7 @@ sam3_page_write(struct sam3_bank_private *pPrivate, unsigned pagenum, uint8_t *b static int -sam3_write(struct flash_bank_s *bank, +sam3_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) diff --git a/src/flash/at91sam7.c b/src/flash/at91sam7.c index 6c98953d..8f870bc0 100644 --- a/src/flash/at91sam7.c +++ b/src/flash/at91sam7.c @@ -52,13 +52,13 @@ #include "at91sam7.h" #include "binarybuffer.h" -static int at91sam7_protect_check(struct flash_bank_s *bank); -static int at91sam7_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count); +static int at91sam7_protect_check(struct flash_bank *bank); +static int at91sam7_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count); static uint32_t at91sam7_get_flash_status(struct target *target, int bank_number); -static void at91sam7_set_flash_mode(struct flash_bank_s *bank, int mode); -static uint32_t at91sam7_wait_status_busy(struct flash_bank_s *bank, uint32_t waitbits, int timeout); -static int at91sam7_flash_command(struct flash_bank_s *bank, uint8_t cmd, uint16_t pagen); +static void at91sam7_set_flash_mode(struct flash_bank *bank, int mode); +static uint32_t at91sam7_wait_status_busy(struct flash_bank *bank, uint32_t waitbits, int timeout); +static int at91sam7_flash_command(struct flash_bank *bank, uint8_t cmd, uint16_t pagen); static uint32_t MC_FMR[4] = { 0xFFFFFF60, 0xFFFFFF70, 0xFFFFFF80, 0xFFFFFF90 }; static uint32_t MC_FCR[4] = { 0xFFFFFF64, 0xFFFFFF74, 0xFFFFFF84, 0xFFFFFF94 }; @@ -97,7 +97,7 @@ static uint32_t at91sam7_get_flash_status(struct target *target, int bank_number } /* Read clock configuration and set at91sam7_info->mck_freq */ -static void at91sam7_read_clock_info(flash_bank_t *bank) +static void at91sam7_read_clock_info(struct flash_bank *bank) { struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv; struct target *target = bank->target; @@ -176,7 +176,7 @@ static void at91sam7_read_clock_info(flash_bank_t *bank) } /* Setup the timimg registers for nvbits or normal flash */ -static void at91sam7_set_flash_mode(flash_bank_t *bank, int mode) +static void at91sam7_set_flash_mode(struct flash_bank *bank, int mode) { uint32_t fmr, fmcn = 0, fws = 0; struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv; @@ -224,7 +224,7 @@ static void at91sam7_set_flash_mode(flash_bank_t *bank, int mode) at91sam7_info->flashmode = mode; } -static uint32_t at91sam7_wait_status_busy(flash_bank_t *bank, uint32_t waitbits, int timeout) +static uint32_t at91sam7_wait_status_busy(struct flash_bank *bank, uint32_t waitbits, int timeout) { uint32_t status; @@ -251,7 +251,7 @@ static uint32_t at91sam7_wait_status_busy(flash_bank_t *bank, uint32_t waitbits, } /* Send one command to the AT91SAM flash controller */ -static int at91sam7_flash_command(struct flash_bank_s *bank, uint8_t cmd, uint16_t pagen) +static int at91sam7_flash_command(struct flash_bank *bank, uint8_t cmd, uint16_t pagen) { uint32_t fcr; struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv; @@ -280,9 +280,9 @@ static int at91sam7_flash_command(struct flash_bank_s *bank, uint8_t cmd, uint16 } /* Read device id register, main clock frequency register and fill in driver info structure */ -static int at91sam7_read_part_info(struct flash_bank_s *bank) +static int at91sam7_read_part_info(struct flash_bank *bank) { - flash_bank_t *t_bank = bank; + struct flash_bank *t_bank = bank; struct at91sam7_flash_bank *at91sam7_info; struct target *target = t_bank->target; @@ -304,7 +304,7 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank) if (at91sam7_info->cidr != 0) { /* flash already configured, update clock and check for protected sectors */ - flash_bank_t *fb = bank; + struct flash_bank *fb = bank; t_bank = fb; while (t_bank) @@ -336,7 +336,7 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank) if (at91sam7_info->flash_autodetection == 0) { /* banks and sectors are already created, based on data from input file */ - flash_bank_t *fb = bank; + struct flash_bank *fb = bank; t_bank = fb; while (t_bank) { @@ -532,7 +532,7 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank) if (bnk > 0) { /* create a new flash bank element */ - flash_bank_t *fb = malloc(sizeof(flash_bank_t)); + struct flash_bank *fb = malloc(sizeof(struct flash_bank)); fb->target = target; fb->driver = bank->driver; fb->driver_priv = malloc(sizeof(struct at91sam7_flash_bank)); @@ -595,7 +595,7 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank) return ERROR_OK; } -static int at91sam7_erase_check(struct flash_bank_s *bank) +static int at91sam7_erase_check(struct flash_bank *bank) { struct target *target = bank->target; uint16_t retval; @@ -661,7 +661,7 @@ static int at91sam7_erase_check(struct flash_bank_s *bank) return ERROR_OK; } -static int at91sam7_protect_check(struct flash_bank_s *bank) +static int at91sam7_protect_check(struct flash_bank *bank) { uint8_t lock_pos, gpnvm_pos; uint32_t status; @@ -713,7 +713,7 @@ static int at91sam7_protect_check(struct flash_bank_s *bank) FLASH_BANK_COMMAND_HANDLER(at91sam7_flash_bank_command) { - flash_bank_t *t_bank = bank; + struct flash_bank *t_bank = bank; struct at91sam7_flash_bank *at91sam7_info; struct target *target = t_bank->target; @@ -785,7 +785,7 @@ FLASH_BANK_COMMAND_HANDLER(at91sam7_flash_bank_command) if (bnk > 0) { /* create a new bank element */ - flash_bank_t *fb = malloc(sizeof(flash_bank_t)); + struct flash_bank *fb = malloc(sizeof(struct flash_bank)); fb->target = target; fb->driver = bank->driver; fb->driver_priv = malloc(sizeof(struct at91sam7_flash_bank)); @@ -827,7 +827,7 @@ FLASH_BANK_COMMAND_HANDLER(at91sam7_flash_bank_command) return ERROR_OK; } -static int at91sam7_erase(struct flash_bank_s *bank, int first, int last) +static int at91sam7_erase(struct flash_bank *bank, int first, int last) { struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv; int sec; @@ -895,7 +895,7 @@ static int at91sam7_erase(struct flash_bank_s *bank, int first, int last) return ERROR_OK; } -static int at91sam7_protect(struct flash_bank_s *bank, int set, int first, int last) +static int at91sam7_protect(struct flash_bank *bank, int set, int first, int last) { uint32_t cmd; int sector; @@ -945,7 +945,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, uint8_t *buffer, uint32_t offset, uint32_t count) +static int at91sam7_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { int retval; struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv; @@ -1014,7 +1014,7 @@ static int at91sam7_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t o return ERROR_OK; } -static int at91sam7_probe(struct flash_bank_s *bank) +static int at91sam7_probe(struct flash_bank *bank) { /* we can't probe on an at91sam7 * if this is an at91sam7, it has the configured flash */ @@ -1033,7 +1033,7 @@ static int at91sam7_probe(struct flash_bank_s *bank) return ERROR_OK; } -static int at91sam7_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int at91sam7_info(struct flash_bank *bank, char *buf, int buf_size) { int printed; struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv; @@ -1100,7 +1100,7 @@ static int at91sam7_info(struct flash_bank_s *bank, char *buf, int buf_size) */ COMMAND_HANDLER(at91sam7_handle_gpnvm_command) { - flash_bank_t *bank; + struct flash_bank *bank; int bit; uint8_t flashcmd; uint32_t status; diff --git a/src/flash/avrf.c b/src/flash/avrf.c index f4a7d721..9df254ea 100644 --- a/src/flash/avrf.c +++ b/src/flash/avrf.c @@ -198,19 +198,19 @@ FLASH_BANK_COMMAND_HANDLER(avrf_flash_bank_command) return ERROR_OK; } -static int avrf_erase(struct flash_bank_s *bank, int first, int last) +static int avrf_erase(struct flash_bank *bank, int first, int last) { LOG_INFO("%s", __FUNCTION__); return ERROR_OK; } -static int avrf_protect(struct flash_bank_s *bank, int set, int first, int last) +static int avrf_protect(struct flash_bank *bank, int set, int first, int last) { LOG_INFO("%s", __FUNCTION__); return ERROR_OK; } -static int avrf_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int avrf_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct target *target = bank->target; struct avr_common *avr = target->arch_info; @@ -261,7 +261,7 @@ static int avrf_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offse #define EXTRACT_MFG(X) (((X) & 0xffe) >> 1) #define EXTRACT_PART(X) (((X) & 0xffff000) >> 12) #define EXTRACT_VER(X) (((X) & 0xf0000000) >> 28) -static int avrf_probe(struct flash_bank_s *bank) +static int avrf_probe(struct flash_bank *bank) { struct target *target = bank->target; struct avrf_flash_bank *avrf_info = bank->driver_priv; @@ -329,7 +329,7 @@ static int avrf_probe(struct flash_bank_s *bank) } } -static int avrf_auto_probe(struct flash_bank_s *bank) +static int avrf_auto_probe(struct flash_bank *bank) { struct avrf_flash_bank *avrf_info = bank->driver_priv; if (avrf_info->probed) @@ -337,13 +337,13 @@ static int avrf_auto_probe(struct flash_bank_s *bank) return avrf_probe(bank); } -static int avrf_protect_check(struct flash_bank_s *bank) +static int avrf_protect_check(struct flash_bank *bank) { LOG_INFO("%s", __FUNCTION__); return ERROR_OK; } -static int avrf_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int avrf_info(struct flash_bank *bank, char *buf, int buf_size) { struct target *target = bank->target; struct avr_common *avr = target->arch_info; @@ -394,7 +394,7 @@ static int avrf_info(struct flash_bank_s *bank, char *buf, int buf_size) } } -static int avrf_mass_erase(struct flash_bank_s *bank) +static int avrf_mass_erase(struct flash_bank *bank) { struct target *target = bank->target; struct avr_common *avr = target->arch_info; @@ -425,7 +425,7 @@ COMMAND_HANDLER(avrf_handle_mass_erase_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; diff --git a/src/flash/cfi.c b/src/flash/cfi.c index 6ab84f1f..dd393de2 100644 --- a/src/flash/cfi.c +++ b/src/flash/cfi.c @@ -42,9 +42,9 @@ static struct cfi_unlock_addresses cfi_unlock_addresses[] = }; /* CFI fixups foward declarations */ -static void cfi_fixup_0002_erase_regions(flash_bank_t *flash, void *param); -static void cfi_fixup_0002_unlock_addresses(flash_bank_t *flash, void *param); -static void cfi_fixup_atmel_reversed_erase_regions(flash_bank_t *flash, void *param); +static void cfi_fixup_0002_erase_regions(struct flash_bank *flash, void *param); +static void cfi_fixup_0002_unlock_addresses(struct flash_bank *flash, void *param); +static void cfi_fixup_atmel_reversed_erase_regions(struct flash_bank *flash, void *param); /* fixup after reading cmdset 0002 primary query table */ static const struct cfi_fixup cfi_0002_fixups[] = { @@ -67,7 +67,7 @@ static const struct cfi_fixup cfi_0001_fixups[] = { {0, 0, NULL, NULL} }; -static void cfi_fixup(flash_bank_t *bank, const struct cfi_fixup *fixups) +static void cfi_fixup(struct flash_bank *bank, const struct cfi_fixup *fixups) { struct cfi_flash_bank *cfi_info = bank->driver_priv; const struct cfi_fixup *f; @@ -82,8 +82,8 @@ static void cfi_fixup(flash_bank_t *bank, const struct cfi_fixup *fixups) } } -/* inline uint32_t flash_address(flash_bank_t *bank, int sector, uint32_t offset) */ -static __inline__ uint32_t flash_address(flash_bank_t *bank, int sector, uint32_t offset) +/* inline uint32_t flash_address(struct flash_bank *bank, int sector, uint32_t offset) */ +static __inline__ uint32_t flash_address(struct flash_bank *bank, int sector, uint32_t offset) { struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -104,7 +104,7 @@ static __inline__ uint32_t flash_address(flash_bank_t *bank, int sector, uint32_ } -static void cfi_command(flash_bank_t *bank, uint8_t cmd, uint8_t *cmd_buf) +static void cfi_command(struct flash_bank *bank, uint8_t cmd, uint8_t *cmd_buf) { int i; @@ -134,7 +134,7 @@ static void cfi_command(flash_bank_t *bank, uint8_t cmd, uint8_t *cmd_buf) * flash banks are expected to be made of similar chips * the query result should be the same for all */ -static uint8_t cfi_query_u8(flash_bank_t *bank, int sector, uint32_t offset) +static uint8_t cfi_query_u8(struct flash_bank *bank, int sector, uint32_t offset) { struct target *target = bank->target; uint8_t data[CFI_MAX_BUS_WIDTH]; @@ -151,7 +151,7 @@ static uint8_t cfi_query_u8(flash_bank_t *bank, int sector, uint32_t offset) * in case of a bank made of multiple chips, * the individual values are ORed */ -static uint8_t cfi_get_u8(flash_bank_t *bank, int sector, uint32_t offset) +static uint8_t cfi_get_u8(struct flash_bank *bank, int sector, uint32_t offset) { struct target *target = bank->target; uint8_t data[CFI_MAX_BUS_WIDTH]; @@ -176,7 +176,7 @@ static uint8_t cfi_get_u8(flash_bank_t *bank, int sector, uint32_t offset) } } -static uint16_t cfi_query_u16(flash_bank_t *bank, int sector, uint32_t offset) +static uint16_t cfi_query_u16(struct flash_bank *bank, int sector, uint32_t offset) { struct target *target = bank->target; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -198,7 +198,7 @@ static uint16_t cfi_query_u16(flash_bank_t *bank, int sector, uint32_t offset) return data[bank->bus_width - 1] | data[(2 * bank->bus_width) - 1] << 8; } -static uint32_t cfi_query_u32(flash_bank_t *bank, int sector, uint32_t offset) +static uint32_t cfi_query_u32(struct flash_bank *bank, int sector, uint32_t offset) { struct target *target = bank->target; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -221,7 +221,7 @@ static uint32_t cfi_query_u32(flash_bank_t *bank, int sector, uint32_t offset) data[(3 * bank->bus_width) - 1] << 16 | data[(4 * bank->bus_width) - 1] << 24; } -static void cfi_intel_clear_status_register(flash_bank_t *bank) +static void cfi_intel_clear_status_register(struct flash_bank *bank) { struct target *target = bank->target; uint8_t command[8]; @@ -236,7 +236,7 @@ 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); } -uint8_t cfi_intel_wait_status_busy(flash_bank_t *bank, int timeout) +uint8_t cfi_intel_wait_status_busy(struct flash_bank *bank, int timeout) { uint8_t status; @@ -277,7 +277,7 @@ uint8_t cfi_intel_wait_status_busy(flash_bank_t *bank, int timeout) return status; } -int cfi_spansion_wait_status_busy(flash_bank_t *bank, int timeout) +int cfi_spansion_wait_status_busy(struct flash_bank *bank, int timeout) { uint8_t status, oldstatus; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -312,7 +312,7 @@ int cfi_spansion_wait_status_busy(flash_bank_t *bank, int timeout) return(ERROR_FLASH_BUSY); } -static int cfi_read_intel_pri_ext(flash_bank_t *bank) +static int cfi_read_intel_pri_ext(struct flash_bank *bank) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -378,7 +378,7 @@ static int cfi_read_intel_pri_ext(flash_bank_t *bank) return ERROR_OK; } -static int cfi_read_spansion_pri_ext(flash_bank_t *bank) +static int cfi_read_spansion_pri_ext(struct flash_bank *bank) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -443,7 +443,7 @@ static int cfi_read_spansion_pri_ext(flash_bank_t *bank) return ERROR_OK; } -static int cfi_read_atmel_pri_ext(flash_bank_t *bank) +static int cfi_read_atmel_pri_ext(struct flash_bank *bank) { int retval; struct cfi_atmel_pri_ext atmel_pri_ext; @@ -510,7 +510,7 @@ static int cfi_read_atmel_pri_ext(flash_bank_t *bank) return ERROR_OK; } -static int cfi_read_0002_pri_ext(flash_bank_t *bank) +static int cfi_read_0002_pri_ext(struct flash_bank *bank) { struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -524,7 +524,7 @@ static int cfi_read_0002_pri_ext(flash_bank_t *bank) } } -static int cfi_spansion_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int cfi_spansion_info(struct flash_bank *bank, char *buf, int buf_size) { int printed; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -559,7 +559,7 @@ static int cfi_spansion_info(struct flash_bank_s *bank, char *buf, int buf_size) return ERROR_OK; } -static int cfi_intel_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int cfi_intel_info(struct flash_bank *bank, char *buf, int buf_size) { int printed; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -652,7 +652,7 @@ FLASH_BANK_COMMAND_HANDLER(cfi_flash_bank_command) return ERROR_OK; } -static int cfi_intel_erase(struct flash_bank_s *bank, int first, int last) +static int cfi_intel_erase(struct flash_bank *bank, int first, int last) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -696,7 +696,7 @@ static int cfi_intel_erase(struct flash_bank_s *bank, int first, int last) } -static int cfi_spansion_erase(struct flash_bank_s *bank, int first, int last) +static int cfi_spansion_erase(struct flash_bank *bank, int first, int last) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -762,7 +762,7 @@ static int cfi_spansion_erase(struct flash_bank_s *bank, int first, int last) return target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command); } -static int cfi_erase(struct flash_bank_s *bank, int first, int last) +static int cfi_erase(struct flash_bank *bank, int first, int last) { struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -797,7 +797,7 @@ static int cfi_erase(struct flash_bank_s *bank, int first, int last) return ERROR_OK; } -static int cfi_intel_protect(struct flash_bank_s *bank, int set, int first, int last) +static int cfi_intel_protect(struct flash_bank *bank, int set, int first, int last) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -914,7 +914,7 @@ static int cfi_intel_protect(struct flash_bank_s *bank, int set, int first, int return target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command); } -static int cfi_protect(struct flash_bank_s *bank, int set, int first, int last) +static int cfi_protect(struct flash_bank *bank, int set, int first, int last) { struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -947,7 +947,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, uint8_t *word, uint8_t byte) +static void cfi_add_byte(struct flash_bank *bank, uint8_t *word, uint8_t byte) { /* struct target *target = bank->target; */ @@ -993,7 +993,7 @@ static void cfi_fix_code_endian(struct target *target, uint8_t *dest, const uint } } -static uint32_t cfi_command_val(flash_bank_t *bank, uint8_t cmd) +static uint32_t cfi_command_val(struct flash_bank *bank, uint8_t cmd) { struct target *target = bank->target; @@ -1016,7 +1016,7 @@ static uint32_t cfi_command_val(flash_bank_t *bank, uint8_t cmd) } } -static int cfi_intel_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint32_t address, uint32_t count) +static int cfi_intel_write_block(struct flash_bank *bank, uint8_t *buffer, uint32_t address, uint32_t count) { struct cfi_flash_bank *cfi_info = bank->driver_priv; struct target *target = bank->target; @@ -1260,7 +1260,7 @@ cleanup: return retval; } -static int cfi_spansion_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint32_t address, uint32_t count) +static int cfi_spansion_write_block(struct flash_bank *bank, uint8_t *buffer, uint32_t address, uint32_t count) { struct cfi_flash_bank *cfi_info = bank->driver_priv; struct cfi_spansion_pri_ext *pri_ext = cfi_info->pri_ext; @@ -1559,7 +1559,7 @@ static int cfi_spansion_write_block(struct flash_bank_s *bank, uint8_t *buffer, return exit_code; } -static int cfi_intel_write_word(struct flash_bank_s *bank, uint8_t *word, uint32_t address) +static int cfi_intel_write_word(struct flash_bank *bank, uint8_t *word, uint32_t address) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -1593,7 +1593,7 @@ static int cfi_intel_write_word(struct flash_bank_s *bank, uint8_t *word, uint32 return ERROR_OK; } -static int cfi_intel_write_words(struct flash_bank_s *bank, uint8_t *word, uint32_t wordcount, uint32_t address) +static int cfi_intel_write_words(struct flash_bank *bank, uint8_t *word, uint32_t wordcount, uint32_t address) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -1686,7 +1686,7 @@ static int cfi_intel_write_words(struct flash_bank_s *bank, uint8_t *word, uint3 return ERROR_OK; } -static int cfi_spansion_write_word(struct flash_bank_s *bank, uint8_t *word, uint32_t address) +static int cfi_spansion_write_word(struct flash_bank *bank, uint8_t *word, uint32_t address) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -1732,7 +1732,7 @@ static int cfi_spansion_write_word(struct flash_bank_s *bank, uint8_t *word, uin return ERROR_OK; } -static int cfi_spansion_write_words(struct flash_bank_s *bank, uint8_t *word, uint32_t wordcount, uint32_t address) +static int cfi_spansion_write_words(struct flash_bank *bank, uint8_t *word, uint32_t wordcount, uint32_t address) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -1824,7 +1824,7 @@ static int cfi_spansion_write_words(struct flash_bank_s *bank, uint8_t *word, ui return ERROR_OK; } -static int cfi_write_word(struct flash_bank_s *bank, uint8_t *word, uint32_t address) +static int cfi_write_word(struct flash_bank *bank, uint8_t *word, uint32_t address) { struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -1845,7 +1845,7 @@ static int cfi_write_word(struct flash_bank_s *bank, uint8_t *word, uint32_t add return ERROR_FLASH_OPERATION_FAILED; } -static int cfi_write_words(struct flash_bank_s *bank, uint8_t *word, uint32_t wordcount, uint32_t address) +static int cfi_write_words(struct flash_bank *bank, uint8_t *word, uint32_t wordcount, uint32_t address) { struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -1866,7 +1866,7 @@ static int cfi_write_words(struct flash_bank_s *bank, uint8_t *word, uint32_t wo return ERROR_FLASH_OPERATION_FAILED; } -int cfi_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +int cfi_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct cfi_flash_bank *cfi_info = bank->driver_priv; struct target *target = bank->target; @@ -2075,7 +2075,7 @@ int cfi_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint3 return target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, current_word); } -static void cfi_fixup_atmel_reversed_erase_regions(flash_bank_t *bank, void *param) +static void cfi_fixup_atmel_reversed_erase_regions(struct flash_bank *bank, void *param) { (void) param; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -2084,7 +2084,7 @@ static void cfi_fixup_atmel_reversed_erase_regions(flash_bank_t *bank, void *par pri_ext->_reversed_geometry = 1; } -static void cfi_fixup_0002_erase_regions(flash_bank_t *bank, void *param) +static void cfi_fixup_0002_erase_regions(struct flash_bank *bank, void *param) { int i; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -2107,7 +2107,7 @@ static void cfi_fixup_0002_erase_regions(flash_bank_t *bank, void *param) } } -static void cfi_fixup_0002_unlock_addresses(flash_bank_t *bank, void *param) +static void cfi_fixup_0002_unlock_addresses(struct flash_bank *bank, void *param) { struct cfi_flash_bank *cfi_info = bank->driver_priv; struct cfi_spansion_pri_ext *pri_ext = cfi_info->pri_ext; @@ -2118,7 +2118,7 @@ static void cfi_fixup_0002_unlock_addresses(flash_bank_t *bank, void *param) } -static int cfi_query_string(struct flash_bank_s *bank, int address) +static int cfi_query_string(struct flash_bank *bank, int address) { struct cfi_flash_bank *cfi_info = bank->driver_priv; struct target *target = bank->target; @@ -2156,7 +2156,7 @@ static int cfi_query_string(struct flash_bank_s *bank, int address) return ERROR_OK; } -static int cfi_probe(struct flash_bank_s *bank) +static int cfi_probe(struct flash_bank *bank) { struct cfi_flash_bank *cfi_info = bank->driver_priv; struct target *target = bank->target; @@ -2435,7 +2435,7 @@ static int cfi_probe(struct flash_bank_s *bank) return ERROR_OK; } -static int cfi_auto_probe(struct flash_bank_s *bank) +static int cfi_auto_probe(struct flash_bank *bank) { struct cfi_flash_bank *cfi_info = bank->driver_priv; if (cfi_info->probed) @@ -2444,7 +2444,7 @@ static int cfi_auto_probe(struct flash_bank_s *bank) } -static int cfi_intel_protect_check(struct flash_bank_s *bank) +static int cfi_intel_protect_check(struct flash_bank *bank) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -2477,7 +2477,7 @@ static int cfi_intel_protect_check(struct flash_bank_s *bank) return target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command); } -static int cfi_spansion_protect_check(struct flash_bank_s *bank) +static int cfi_spansion_protect_check(struct flash_bank *bank) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -2518,7 +2518,7 @@ static int cfi_spansion_protect_check(struct flash_bank_s *bank) return target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command); } -static int cfi_protect_check(struct flash_bank_s *bank) +static int cfi_protect_check(struct flash_bank *bank) { struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -2548,7 +2548,7 @@ static int cfi_protect_check(struct flash_bank_s *bank) return ERROR_OK; } -static int cfi_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int cfi_info(struct flash_bank *bank, char *buf, int buf_size) { int printed; struct cfi_flash_bank *cfi_info = bank->driver_priv; diff --git a/src/flash/cfi.h b/src/flash/cfi.h index deca9163..d55fd34e 100644 --- a/src/flash/cfi.h +++ b/src/flash/cfi.h @@ -146,7 +146,7 @@ struct cfi_fixup { uint16_t mfr; uint16_t id; - void (*fixup)(flash_bank_t *flash, void *param); + void (*fixup)(struct flash_bank *flash, void *param); void *param; }; diff --git a/src/flash/ecos.c b/src/flash/ecos.c index ad27a45d..da354073 100644 --- a/src/flash/ecos.c +++ b/src/flash/ecos.c @@ -27,9 +27,9 @@ #if 0 -static uint32_t ecosflash_get_flash_status(flash_bank_t *bank); -static void ecosflash_set_flash_mode(flash_bank_t *bank,int mode); -static uint32_t ecosflash_wait_status_busy(flash_bank_t *bank, uint32_t waitbits, int timeout); +static uint32_t ecosflash_get_flash_status(struct flash_bank *bank); +static void ecosflash_set_flash_mode(struct flash_bank *bank,int mode); +static uint32_t ecosflash_wait_status_busy(struct flash_bank *bank, uint32_t waitbits, int timeout); static int ecosflash_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); #endif @@ -329,7 +329,7 @@ static int eCosBoard_flash(struct ecosflash_flash_bank *info, void *data, uint32 return ERROR_OK; } -static int ecosflash_probe(struct flash_bank_s *bank) +static int ecosflash_probe(struct flash_bank *bank) { return ERROR_OK; } @@ -342,7 +342,7 @@ static int ecosflash_register_commands(struct command_context_s *cmd_ctx) } #if 0 -static void command(flash_bank_t *bank, uint8_t cmd, uint8_t *cmd_buf) +static void command(struct flash_bank *bank, uint8_t cmd, uint8_t *cmd_buf) { struct ecosflash_flash_bank *info = bank->driver_priv; int i; @@ -365,7 +365,7 @@ static void command(flash_bank_t *bank, uint8_t cmd, uint8_t *cmd_buf) #endif #if 0 -static uint32_t ecosflash_address(struct flash_bank_s *bank, uint32_t address) +static uint32_t ecosflash_address(struct flash_bank *bank, uint32_t address) { uint32_t retval = 0; switch (bank->bus_width) @@ -382,31 +382,31 @@ static uint32_t ecosflash_address(struct flash_bank_s *bank, uint32_t address) } #endif -static int ecosflash_erase(struct flash_bank_s *bank, int first, int last) +static int ecosflash_erase(struct flash_bank *bank, int first, int last) { - struct flash_bank_s *c = bank; + struct flash_bank *c = bank; struct ecosflash_flash_bank *info = bank->driver_priv; return eCosBoard_erase(info, c->base + first*sectorSize, sectorSize*(last-first + 1)); } -static int ecosflash_protect(struct flash_bank_s *bank, int set, int first, int last) +static int ecosflash_protect(struct flash_bank *bank, int set, int first, int last) { return ERROR_OK; } -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 *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct ecosflash_flash_bank *info = bank->driver_priv; - struct flash_bank_s *c = bank; + struct flash_bank *c = bank; return eCosBoard_flash(info, buffer, c->base + offset, count); } -static int ecosflash_protect_check(struct flash_bank_s *bank) +static int ecosflash_protect_check(struct flash_bank *bank) { return ERROR_OK; } -static int ecosflash_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int ecosflash_info(struct flash_bank *bank, char *buf, int buf_size) { struct ecosflash_flash_bank *info = bank->driver_priv; snprintf(buf, buf_size, "eCos flash driver: %s", info->driverPath); @@ -414,17 +414,17 @@ static int ecosflash_info(struct flash_bank_s *bank, char *buf, int buf_size) } #if 0 -static uint32_t ecosflash_get_flash_status(flash_bank_t *bank) +static uint32_t ecosflash_get_flash_status(struct flash_bank *bank) { return ERROR_OK; } -static void ecosflash_set_flash_mode(flash_bank_t *bank,int mode) +static void ecosflash_set_flash_mode(struct flash_bank *bank,int mode) { } -static uint32_t ecosflash_wait_status_busy(flash_bank_t *bank, uint32_t waitbits, int timeout) +static uint32_t ecosflash_wait_status_busy(struct flash_bank *bank, uint32_t waitbits, int timeout) { return ERROR_OK; } diff --git a/src/flash/faux.c b/src/flash/faux.c index 0a52f5f8..55e9892c 100644 --- a/src/flash/faux.c +++ b/src/flash/faux.c @@ -92,38 +92,38 @@ static int faux_register_commands(struct command_context_s *cmd_ctx) return ERROR_OK; } -static int faux_erase(struct flash_bank_s *bank, int first, int last) +static int faux_erase(struct flash_bank *bank, int first, int last) { struct faux_flash_bank *info = bank->driver_priv; memset(info->memory + first*sectorSize, 0xff, sectorSize*(last-first + 1)); return ERROR_OK; } -static int faux_protect(struct flash_bank_s *bank, int set, int first, int last) +static int faux_protect(struct flash_bank *bank, int set, int first, int last) { LOG_USER("set protection sector %d to %d to %s", first, last, set?"on":"off"); return ERROR_OK; } -static int faux_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int faux_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct faux_flash_bank *info = bank->driver_priv; memcpy(info->memory + offset, buffer, count); return ERROR_OK; } -static int faux_protect_check(struct flash_bank_s *bank) +static int faux_protect_check(struct flash_bank *bank) { return ERROR_OK; } -static int faux_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int faux_info(struct flash_bank *bank, char *buf, int buf_size) { snprintf(buf, buf_size, "faux flash driver"); return ERROR_OK; } -static int faux_probe(struct flash_bank_s *bank) +static int faux_probe(struct flash_bank *bank) { return ERROR_OK; } diff --git a/src/flash/flash.c b/src/flash/flash.c index 5374532c..96c63d54 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -76,11 +76,11 @@ struct flash_driver *flash_drivers[] = { NULL, }; -flash_bank_t *flash_banks; +struct flash_bank *flash_banks; static command_t *flash_cmd; /* wafer thin wrapper for invoking the flash driver */ -static int flash_driver_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int flash_driver_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { int retval; @@ -94,7 +94,7 @@ static int flash_driver_write(struct flash_bank_s *bank, uint8_t *buffer, uint32 return retval; } -static int flash_driver_erase(struct flash_bank_s *bank, int first, int last) +static int flash_driver_erase(struct flash_bank *bank, int first, int last) { int retval; @@ -107,7 +107,7 @@ static int flash_driver_erase(struct flash_bank_s *bank, int first, int last) return retval; } -int flash_driver_protect(struct flash_bank_s *bank, int set, int first, int last) +int flash_driver_protect(struct flash_bank *bank, int set, int first, int last) { int retval; @@ -122,7 +122,7 @@ int flash_driver_protect(struct flash_bank_s *bank, int set, int first, int last static int jim_flash_banks(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { - flash_bank_t *p; + struct flash_bank *p; if (argc != 1) { Jim_WrongNumArgs(interp, 1, argv, "no arguments to flash_banks command"); @@ -153,9 +153,9 @@ static int jim_flash_banks(Jim_Interp *interp, int argc, Jim_Obj *const *argv) return JIM_OK; } -flash_bank_t *get_flash_bank_by_num_noprobe(int num) +struct flash_bank *get_flash_bank_by_num_noprobe(int num) { - flash_bank_t *p; + struct flash_bank *p; int i = 0; for (p = flash_banks; p; p = p->next) @@ -171,7 +171,7 @@ flash_bank_t *get_flash_bank_by_num_noprobe(int num) int flash_get_bank_count(void) { - flash_bank_t *p; + struct flash_bank *p; int i = 0; for (p = flash_banks; p; p = p->next) { @@ -180,9 +180,9 @@ int flash_get_bank_count(void) return i; } -flash_bank_t *get_flash_bank_by_num(int num) +struct flash_bank *get_flash_bank_by_num(int num) { - flash_bank_t *p = get_flash_bank_by_num_noprobe(num); + struct flash_bank *p = get_flash_bank_by_num_noprobe(num); int retval; if (p == NULL) @@ -199,7 +199,7 @@ flash_bank_t *get_flash_bank_by_num(int num) } int flash_command_get_bank_by_num( - struct command_context_s *cmd_ctx, const char *str, flash_bank_t **bank) + struct command_context_s *cmd_ctx, const char *str, struct flash_bank **bank) { unsigned bank_num; COMMAND_PARSE_NUMBER(uint, str, bank_num); @@ -238,7 +238,7 @@ COMMAND_HANDLER(handle_flash_bank_command) if (strcmp(args[0], flash_drivers[i]->name) != 0) continue; - flash_bank_t *p, *c; + struct flash_bank *p, *c; /* register flash specific commands */ if (flash_drivers[i]->register_commands(cmd_ctx) != ERROR_OK) @@ -247,7 +247,7 @@ COMMAND_HANDLER(handle_flash_bank_command) return ERROR_FAIL; } - c = malloc(sizeof(flash_bank_t)); + c = malloc(sizeof(struct flash_bank)); c->target = target; c->driver = flash_drivers[i]; c->driver_priv = NULL; @@ -298,7 +298,7 @@ COMMAND_HANDLER(handle_flash_bank_command) COMMAND_HANDLER(handle_flash_info_command) { - flash_bank_t *p; + struct flash_bank *p; uint32_t i = 0; int j = 0; int retval; @@ -369,7 +369,7 @@ COMMAND_HANDLER(handle_flash_probe_command) unsigned bank_nr; COMMAND_PARSE_NUMBER(uint, args[0], bank_nr); - flash_bank_t *p = get_flash_bank_by_num_noprobe(bank_nr); + struct flash_bank *p = get_flash_bank_by_num_noprobe(bank_nr); if (p) { if ((retval = p->driver->probe(p)) == ERROR_OK) @@ -402,7 +402,7 @@ COMMAND_HANDLER(handle_flash_erase_check_command) return ERROR_COMMAND_SYNTAX_ERROR; } - flash_bank_t *p; + struct flash_bank *p; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &p); if (ERROR_OK != retval) return retval; @@ -443,7 +443,7 @@ COMMAND_HANDLER(handle_flash_erase_check_command) COMMAND_HANDLER(handle_flash_erase_address_command) { - flash_bank_t *p; + struct flash_bank *p; int retval; int address; int length; @@ -490,7 +490,7 @@ COMMAND_HANDLER(handle_flash_protect_check_command) if (argc != 1) return ERROR_COMMAND_SYNTAX_ERROR; - flash_bank_t *p; + struct flash_bank *p; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &p); if (ERROR_OK != retval) return retval; @@ -539,7 +539,7 @@ COMMAND_HANDLER(handle_flash_erase_command) uint32_t last; COMMAND_PARSE_NUMBER(u32, args[0], bank_nr); - flash_bank_t *p = get_flash_bank_by_num(bank_nr); + struct flash_bank *p = get_flash_bank_by_num(bank_nr); if (!p) return ERROR_OK; @@ -580,7 +580,7 @@ COMMAND_HANDLER(handle_flash_protect_command) int set; COMMAND_PARSE_NUMBER(u32, args[0], bank_nr); - flash_bank_t *p = get_flash_bank_by_num(bank_nr); + struct flash_bank *p = get_flash_bank_by_num(bank_nr); if (!p) return ERROR_OK; @@ -772,7 +772,7 @@ COMMAND_HANDLER(handle_flash_fill_command) for (wrote = 0; wrote < (count*wordsize); wrote += cur_size) { cur_size = MIN((count*wordsize - wrote), sizeof(chunk)); - flash_bank_t *bank; + struct flash_bank *bank; bank = get_flash_bank_by_addr(target, address); if (bank == NULL) { @@ -820,7 +820,7 @@ COMMAND_HANDLER(handle_flash_write_bank_command) struct duration bench; duration_start(&bench); - flash_bank_t *p; + struct flash_bank *p; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &p); if (ERROR_OK != retval) return retval; @@ -860,7 +860,7 @@ COMMAND_HANDLER(handle_flash_write_bank_command) void flash_set_dirty(void) { - flash_bank_t *c; + struct flash_bank *c; int i; /* set all flash to require erasing */ @@ -874,9 +874,9 @@ void flash_set_dirty(void) } /* lookup flash bank by address */ -struct flash_bank_s *get_flash_bank_by_addr(struct target *target, uint32_t addr) +struct flash_bank *get_flash_bank_by_addr(struct target *target, uint32_t addr) { - flash_bank_t *c; + struct flash_bank *c; /* cycle through bank list */ for (c = flash_banks; c; c = c->next) @@ -899,9 +899,9 @@ struct flash_bank_s *get_flash_bank_by_addr(struct target *target, uint32_t addr /* erase given flash region, selects proper bank according to target and address */ static int flash_iterate_address_range(struct target *target, uint32_t addr, uint32_t length, - int (*callback)(struct flash_bank_s *bank, int first, int last)) + int (*callback)(struct flash_bank *bank, int first, int last)) { - flash_bank_t *c; + struct flash_bank *c; int first = -1; int last = -1; int i; @@ -954,7 +954,7 @@ int flash_erase_address_range(struct target *target, uint32_t addr, uint32_t len return flash_iterate_address_range(target, addr, length, &flash_driver_erase); } -static int flash_driver_unprotect(struct flash_bank_s *bank, int first, int last) +static int flash_driver_unprotect(struct flash_bank *bank, int first, int last) { return flash_driver_protect(bank, 0, first, last); } @@ -972,7 +972,7 @@ static int flash_write_unlock(struct target *target, struct image *image, uint32 int section; uint32_t section_offset; - flash_bank_t *c; + struct flash_bank *c; int *padding; section = 0; @@ -1130,7 +1130,7 @@ int flash_write(struct target *target, struct image *image, uint32_t *written, i return flash_write_unlock(target, image, written, erase, false); } -int default_flash_mem_blank_check(struct flash_bank_s *bank) +int default_flash_mem_blank_check(struct flash_bank *bank) { struct target *target = bank->target; uint8_t buffer[1024]; @@ -1177,7 +1177,7 @@ int default_flash_mem_blank_check(struct flash_bank_s *bank) return ERROR_OK; } -int default_flash_blank_check(struct flash_bank_s *bank) +int default_flash_blank_check(struct flash_bank *bank) { struct target *target = bank->target; int i; diff --git a/src/flash/flash.h b/src/flash/flash.h index b5af7176..202a5e52 100644 --- a/src/flash/flash.h +++ b/src/flash/flash.h @@ -57,10 +57,10 @@ struct flash_sector int is_protected; }; -struct flash_bank_s; +struct flash_bank; #define __FLASH_BANK_COMMAND(name) \ - COMMAND_HELPER(name, struct flash_bank_s *bank) + COMMAND_HELPER(name, struct flash_bank *bank) /** * @brief Provides the implementation-independent structure that defines @@ -103,7 +103,7 @@ struct flash_driver * Finish the "flash bank" command for @a bank. The * @a bank parameter will have been filled in by the core flash * layer when this routine is called, and the driver can store - * additional information in its flash_bank_t::driver_priv field. + * additional information in its struct flash_bank::driver_priv field. * * The args are: @par * @code @@ -136,7 +136,7 @@ struct flash_driver * @param last The number of the last sector to erase, typically N-1. * @returns ERROR_OK if successful; otherwise, an error code. */ - int (*erase)(struct flash_bank_s *bank, int first, int last); + int (*erase)(struct flash_bank *bank, int first, int last); /** * Bank/sector protection routine (target-specific). @@ -150,7 +150,7 @@ struct flash_driver * @param last The last sector to (un)project, typically N-1. * @returns ERROR_OK if successful; otherwise, an error code. */ - int (*protect)(struct flash_bank_s *bank, int set, int first, int last); + int (*protect)(struct flash_bank *bank, int set, int first, int last); /** * Program data into the flash. Note CPU address will be @@ -163,7 +163,7 @@ struct flash_driver * @param count The number of bytes to write. * @returns ERROR_OK if successful; otherwise, an error code. */ - int (*write)(struct flash_bank_s *bank, + int (*write)(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count); /** @@ -173,7 +173,7 @@ struct flash_driver * @param bank The bank to probe * @returns ERROR_OK if successful; otherwise, an error code. */ - int (*probe)(struct flash_bank_s *bank); + int (*probe)(struct flash_bank *bank); /** * Check the erasure status of a flash bank. @@ -184,7 +184,7 @@ struct flash_driver * @param bank The bank to check * @returns ERROR_OK if successful; otherwise, an error code. */ - int (*erase_check)(struct flash_bank_s *bank); + int (*erase_check)(struct flash_bank *bank); /** * Determine if the specific bank is "protected" or not. @@ -196,7 +196,7 @@ struct flash_driver * @param bank - the bank to check * @returns ERROR_OK if successful; otherwise, an error code. */ - int (*protect_check)(struct flash_bank_s *bank); + int (*protect_check)(struct flash_bank *bank); /** * Display human-readable information about the flash @@ -208,7 +208,7 @@ struct flash_driver * @param buf_size - the size of the human buffer. * @returns ERROR_OK if successful; otherwise, an error code. */ - int (*info)(struct flash_bank_s *bank, char *buf, int buf_size); + int (*info)(struct flash_bank *bank, char *buf, int buf_size); /** * A more gentle flavor of filash_driver_s::probe, performing @@ -223,7 +223,7 @@ struct flash_driver * @param bank - the bank to probe * @returns ERROR_OK if successful; otherwise, an error code. */ - int (*auto_probe)(struct flash_bank_s *bank); + int (*auto_probe)(struct flash_bank *bank); }; #define FLASH_BANK_COMMAND_HANDLER(name) static __FLASH_BANK_COMMAND(name) @@ -238,7 +238,7 @@ struct flash_driver * may use the @c driver_priv member to store additional data on a * per-bank basis, if required. */ -typedef struct flash_bank_s +struct flash_bank { struct target *target; /**< Target to which this bank belongs. */ @@ -261,8 +261,8 @@ typedef struct flash_bank_s /// Array of sectors, allocated and initilized by the flash driver struct flash_sector *sectors; - struct flash_bank_s *next; /**< The next flash bank on this chip */ -} flash_bank_t; + struct flash_bank *next; /**< The next flash bank on this chip */ +}; /// Registers the 'flash' subsystem commands int flash_register_commands(struct command_context_s *cmd_ctx); @@ -300,21 +300,21 @@ int flash_get_bank_count(void); * this routine will call default_flash_mem_blank_check() to confirm. * @returns ERROR_OK if successful; otherwise, an error code. */ -int default_flash_blank_check(struct flash_bank_s *bank); +int default_flash_blank_check(struct flash_bank *bank); /** * Provides a default blank flash memory check. Ensures the contents * of the given bank have truly been erased. * @param bank The flash bank. * @returns ERROR_OK if successful; otherwise, an error code. */ -int default_flash_mem_blank_check(struct flash_bank_s *bank); +int default_flash_mem_blank_check(struct flash_bank *bank); /** * Returns a flash bank by the specified flash_bank_s bank_number, @a num. * @param num The flash bank number. - * @returns A flash_bank_t for flash bank @a num, or NULL + * @returns A struct flash_bank for flash bank @a num, or NULL */ -flash_bank_t *get_flash_bank_by_num(int num); +struct flash_bank *get_flash_bank_by_num(int num); /** * Retreives @a bank from a command argument, reporting errors parsing * the bank identifier or retreiving the specified bank. @@ -324,20 +324,20 @@ flash_bank_t *get_flash_bank_by_num(int num); * @returns ERROR_OK on success, or an error indicating the problem. */ int flash_command_get_bank_by_num(struct command_context_s *cmd_ctx, - const char *str, flash_bank_t **bank); + const char *str, struct flash_bank **bank); /** * Returns the flash bank like get_flash_bank_by_num(), without probing. * @param num The flash bank number. - * @returns A flash_bank_t for flash bank @a num, or NULL. + * @returns A struct flash_bank for flash bank @a num, or NULL. */ -flash_bank_t *get_flash_bank_by_num_noprobe(int num); +struct flash_bank *get_flash_bank_by_num_noprobe(int num); /** * Returns the flash bank located at a specified address. * @param target The target, presumed to contain one or more banks. * @param addr An address that is within the range of the bank. - * @returns The flash_bank_t located at @a addr, or NULL. + * @returns The struct flash_bank located at @a addr, or NULL. */ -struct flash_bank_s *get_flash_bank_by_addr(struct target *target, uint32_t addr); +struct flash_bank *get_flash_bank_by_addr(struct target *target, uint32_t addr); #define ERROR_FLASH_BANK_INVALID (-900) #define ERROR_FLASH_SECTOR_INVALID (-901) diff --git a/src/flash/lpc2000.c b/src/flash/lpc2000.c index 20617269..36ebc0ec 100644 --- a/src/flash/lpc2000.c +++ b/src/flash/lpc2000.c @@ -53,7 +53,7 @@ * - 176x (tested with LPC1768) */ -static int lpc2000_build_sector_list(struct flash_bank_s *bank) +static int lpc2000_build_sector_list(struct flash_bank *bank) { struct lpc2000_flash_bank *lpc2000_info = bank->driver_priv; int i; @@ -234,7 +234,7 @@ static int lpc2000_build_sector_list(struct flash_bank_s *bank) * 0x20 to 0x33: command result table (1+4 words) * 0x34 to 0xb3: stack (only 128b needed) */ -static int lpc2000_iap_call(flash_bank_t *bank, int code, uint32_t param_table[5], uint32_t result_table[4]) +static int lpc2000_iap_call(struct flash_bank *bank, int code, uint32_t param_table[5], uint32_t result_table[4]) { int retval; struct lpc2000_flash_bank *lpc2000_info = bank->driver_priv; @@ -375,7 +375,7 @@ static int lpc2000_iap_call(flash_bank_t *bank, int code, uint32_t param_table[5 return status_code; } -static int lpc2000_iap_blank_check(struct flash_bank_s *bank, int first, int last) +static int lpc2000_iap_blank_check(struct flash_bank *bank, int first, int last) { uint32_t param_table[5]; uint32_t result_table[4]; @@ -477,7 +477,7 @@ FLASH_BANK_COMMAND_HANDLER(lpc2000_flash_bank_command) return ERROR_OK; } -static int lpc2000_erase(struct flash_bank_s *bank, int first, int last) +static int lpc2000_erase(struct flash_bank *bank, int first, int last) { struct lpc2000_flash_bank *lpc2000_info = bank->driver_priv; uint32_t param_table[5]; @@ -529,13 +529,13 @@ static int lpc2000_erase(struct flash_bank_s *bank, int first, int last) return ERROR_OK; } -static int lpc2000_protect(struct flash_bank_s *bank, int set, int first, int last) +static int lpc2000_protect(struct flash_bank *bank, int set, int first, int last) { /* can't protect/unprotect on the lpc2000 */ return ERROR_OK; } -static int lpc2000_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int lpc2000_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct lpc2000_flash_bank *lpc2000_info = bank->driver_priv; struct target *target = bank->target; @@ -703,7 +703,7 @@ static int lpc2000_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t of return retval; } -static int lpc2000_probe(struct flash_bank_s *bank) +static int lpc2000_probe(struct flash_bank *bank) { /* we can't probe on an lpc2000 * if this is an lpc2xxx, it has the configured flash @@ -711,7 +711,7 @@ static int lpc2000_probe(struct flash_bank_s *bank) return ERROR_OK; } -static int lpc2000_erase_check(struct flash_bank_s *bank) +static int lpc2000_erase_check(struct flash_bank *bank) { if (bank->target->state != TARGET_HALTED) { @@ -722,13 +722,13 @@ static int lpc2000_erase_check(struct flash_bank_s *bank) return lpc2000_iap_blank_check(bank, 0, bank->num_sectors - 1); } -static int lpc2000_protect_check(struct flash_bank_s *bank) +static int lpc2000_protect_check(struct flash_bank *bank) { /* sectors are always protected */ return ERROR_OK; } -static int lpc2000_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int lpc2000_info(struct flash_bank *bank, char *buf, int buf_size) { struct lpc2000_flash_bank *lpc2000_info = bank->driver_priv; @@ -748,7 +748,7 @@ COMMAND_HANDLER(lpc2000_handle_part_id_command) return ERROR_COMMAND_SYNTAX_ERROR; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; diff --git a/src/flash/lpc288x.c b/src/flash/lpc288x.c index dbd0dab5..eb95b660 100644 --- a/src/flash/lpc288x.c +++ b/src/flash/lpc288x.c @@ -84,12 +84,12 @@ /* F_CLK_TIME */ #define FCT_CLK_DIV_MASK 0x0FFF -static uint32_t lpc288x_wait_status_busy(struct flash_bank_s *bank, int timeout); +static uint32_t lpc288x_wait_status_busy(struct flash_bank *bank, int timeout); static void lpc288x_load_timer(int erase, struct target *target); -static void lpc288x_set_flash_clk(struct flash_bank_s *bank); -static uint32_t lpc288x_system_ready(struct flash_bank_s *bank); +static void lpc288x_set_flash_clk(struct flash_bank *bank); +static uint32_t lpc288x_system_ready(struct flash_bank *bank); -static uint32_t lpc288x_wait_status_busy(flash_bank_t *bank, int timeout) +static uint32_t lpc288x_wait_status_busy(struct flash_bank *bank, int timeout) { uint32_t status; struct target *target = bank->target; @@ -109,7 +109,7 @@ static uint32_t lpc288x_wait_status_busy(flash_bank_t *bank, int timeout) } /* Read device id register and fill in driver info structure */ -static int lpc288x_read_part_info(struct flash_bank_s *bank) +static int lpc288x_read_part_info(struct flash_bank *bank) { struct lpc288x_flash_bank *lpc288x_info = bank->driver_priv; struct target *target = bank->target; @@ -159,7 +159,7 @@ static int lpc288x_read_part_info(struct flash_bank_s *bank) return ERROR_OK; } -static int lpc288x_protect_check(struct flash_bank_s *bank) +static int lpc288x_protect_check(struct flash_bank *bank) { return ERROR_OK; } @@ -190,7 +190,7 @@ FLASH_BANK_COMMAND_HANDLER(lpc288x_flash_bank_command) * AHB = 12 MHz ? * 12000000/66000 = 182 * CLK_DIV = 60 ? */ -static void lpc288x_set_flash_clk(struct flash_bank_s *bank) +static void lpc288x_set_flash_clk(struct flash_bank *bank) { uint32_t clk_time; struct lpc288x_flash_bank *lpc288x_info = bank->driver_priv; @@ -217,7 +217,7 @@ static void lpc288x_load_timer(int erase, struct target *target) } } -static uint32_t lpc288x_system_ready(struct flash_bank_s *bank) +static uint32_t lpc288x_system_ready(struct flash_bank *bank) { struct lpc288x_flash_bank *lpc288x_info = bank->driver_priv; if (lpc288x_info->cidr == 0) @@ -233,7 +233,7 @@ static uint32_t lpc288x_system_ready(struct flash_bank_s *bank) return ERROR_OK; } -static int lpc288x_erase_check(struct flash_bank_s *bank) +static int lpc288x_erase_check(struct flash_bank *bank) { uint32_t status = lpc288x_system_ready(bank); /* probed? halted? */ if (status != ERROR_OK) @@ -245,7 +245,7 @@ static int lpc288x_erase_check(struct flash_bank_s *bank) return ERROR_OK; } -static int lpc288x_erase(struct flash_bank_s *bank, int first, int last) +static int lpc288x_erase(struct flash_bank *bank, int first, int last) { uint32_t status; int sector; @@ -286,7 +286,7 @@ static int lpc288x_erase(struct flash_bank_s *bank, int first, int last) return ERROR_OK; } -static int lpc288x_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int lpc288x_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { uint8_t page_buffer[FLASH_PAGE_SIZE]; uint32_t status, source_offset,dest_offset; @@ -402,7 +402,7 @@ static int lpc288x_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t of return ERROR_OK; } -static int lpc288x_probe(struct flash_bank_s *bank) +static int lpc288x_probe(struct flash_bank *bank) { /* we only deal with LPC2888 so flash config is fixed */ struct lpc288x_flash_bank *lpc288x_info = bank->driver_priv; @@ -425,13 +425,13 @@ static int lpc288x_probe(struct flash_bank_s *bank) return ERROR_OK; } -static int lpc288x_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int lpc288x_info(struct flash_bank *bank, char *buf, int buf_size) { snprintf(buf, buf_size, "lpc288x flash driver"); return ERROR_OK; } -static int lpc288x_protect(struct flash_bank_s *bank, int set, int first, int last) +static int lpc288x_protect(struct flash_bank *bank, int set, int first, int last) { int lockregion, status; uint32_t value; diff --git a/src/flash/lpc2900.c b/src/flash/lpc2900.c index 49d02598..d385a302 100644 --- a/src/flash/lpc2900.c +++ b/src/flash/lpc2900.c @@ -171,14 +171,14 @@ struct lpc2900_flash_bank }; -static uint32_t lpc2900_wait_status(flash_bank_t *bank, uint32_t mask, int timeout); -static void lpc2900_setup(struct flash_bank_s *bank); -static uint32_t lpc2900_is_ready(struct flash_bank_s *bank); -static uint32_t lpc2900_read_security_status(struct flash_bank_s *bank); -static uint32_t lpc2900_run_bist128(struct flash_bank_s *bank, +static uint32_t lpc2900_wait_status(struct flash_bank *bank, uint32_t mask, int timeout); +static void lpc2900_setup(struct flash_bank *bank); +static uint32_t lpc2900_is_ready(struct flash_bank *bank); +static uint32_t lpc2900_read_security_status(struct flash_bank *bank); +static uint32_t lpc2900_run_bist128(struct flash_bank *bank, uint32_t addr_from, uint32_t addr_to, uint32_t (*signature)[4] ); -static uint32_t lpc2900_address2sector(struct flash_bank_s *bank, uint32_t offset); +static uint32_t lpc2900_address2sector(struct flash_bank *bank, uint32_t offset); static uint32_t lpc2900_calc_tr( uint32_t clock, uint32_t time ); @@ -194,7 +194,7 @@ static uint32_t lpc2900_calc_tr( uint32_t clock, uint32_t time ); * @param[in] mask Mask to be used for INT_STATUS * @param[in] timeout Timeout in ms */ -static uint32_t lpc2900_wait_status( flash_bank_t *bank, +static uint32_t lpc2900_wait_status( struct flash_bank *bank, uint32_t mask, int timeout ) { @@ -228,7 +228,7 @@ static uint32_t lpc2900_wait_status( flash_bank_t *bank, * * @param bank Pointer to the flash bank descriptor */ -static void lpc2900_setup( struct flash_bank_s *bank ) +static void lpc2900_setup( struct flash_bank *bank ) { uint32_t fcra; struct lpc2900_flash_bank *lpc2900_info = bank->driver_priv; @@ -251,7 +251,7 @@ static void lpc2900_setup( struct flash_bank_s *bank ) * Must have been successfully probed. * Must be halted. */ -static uint32_t lpc2900_is_ready( struct flash_bank_s *bank ) +static uint32_t lpc2900_is_ready( struct flash_bank *bank ) { struct lpc2900_flash_bank *lpc2900_info = bank->driver_priv; @@ -275,7 +275,7 @@ static uint32_t lpc2900_is_ready( struct flash_bank_s *bank ) * * @param bank Pointer to the flash bank descriptor */ -static uint32_t lpc2900_read_security_status( struct flash_bank_s *bank ) +static uint32_t lpc2900_read_security_status( struct flash_bank *bank ) { uint32_t status; if( (status = lpc2900_is_ready( bank )) != ERROR_OK ) @@ -356,7 +356,7 @@ static uint32_t lpc2900_read_security_status( struct flash_bank_s *bank ) * @param addr_to * @param signature */ -static uint32_t lpc2900_run_bist128(struct flash_bank_s *bank, +static uint32_t lpc2900_run_bist128(struct flash_bank *bank, uint32_t addr_from, uint32_t addr_to, uint32_t (*signature)[4] ) @@ -393,7 +393,7 @@ static uint32_t lpc2900_run_bist128(struct flash_bank_s *bank, * @param bank Pointer to the flash bank descriptor * @param offset Offset address relative to bank start */ -static uint32_t lpc2900_address2sector( struct flash_bank_s *bank, +static uint32_t lpc2900_address2sector( struct flash_bank *bank, uint32_t offset ) { uint32_t address = bank->base + offset; @@ -424,7 +424,7 @@ static uint32_t lpc2900_address2sector( struct flash_bank_s *bank, * @param pagenum Page number (0...7) * @param page Page array (FLASH_PAGE_SIZE bytes) */ -static int lpc2900_write_index_page( struct flash_bank_s *bank, +static int lpc2900_write_index_page( struct flash_bank *bank, int pagenum, uint8_t (*page)[FLASH_PAGE_SIZE] ) { @@ -543,7 +543,7 @@ COMMAND_HANDLER(lpc2900_handle_signature_command) return ERROR_FLASH_BANK_INVALID; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -588,7 +588,7 @@ COMMAND_HANDLER(lpc2900_handle_read_custom_command) return ERROR_COMMAND_SYNTAX_ERROR; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -659,7 +659,7 @@ COMMAND_HANDLER(lpc2900_handle_password_command) return ERROR_COMMAND_SYNTAX_ERROR; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -694,7 +694,7 @@ COMMAND_HANDLER(lpc2900_handle_write_custom_command) return ERROR_COMMAND_SYNTAX_ERROR; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -805,7 +805,7 @@ COMMAND_HANDLER(lpc2900_handle_secure_sector_command) } /* Get the bank descriptor */ - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -904,7 +904,7 @@ COMMAND_HANDLER(lpc2900_handle_secure_jtag_command) } /* Get the bank descriptor */ - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -1070,7 +1070,7 @@ FLASH_BANK_COMMAND_HANDLER(lpc2900_flash_bank_command) * @param first First sector to be erased * @param last Last sector (including) to be erased */ -static int lpc2900_erase(struct flash_bank_s *bank, int first, int last) +static int lpc2900_erase(struct flash_bank *bank, int first, int last) { uint32_t status; int sector; @@ -1177,7 +1177,7 @@ static int lpc2900_erase(struct flash_bank_s *bank, int first, int last) -static int lpc2900_protect(struct flash_bank_s *bank, int set, int first, int last) +static int lpc2900_protect(struct flash_bank *bank, int set, int first, int last) { /* This command is not supported. * "Protection" in LPC2900 terms is handled transparently. Sectors will @@ -1199,7 +1199,7 @@ static int lpc2900_protect(struct flash_bank_s *bank, int set, int first, int la * @param offset Start address (relative to bank start) * @param count Number of bytes to be programmed */ -static int lpc2900_write(struct flash_bank_s *bank, uint8_t *buffer, +static int lpc2900_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { uint8_t page[FLASH_PAGE_SIZE]; @@ -1548,7 +1548,7 @@ static int lpc2900_write(struct flash_bank_s *bank, uint8_t *buffer, * * @param bank Pointer to the flash bank descriptor */ -static int lpc2900_probe(struct flash_bank_s *bank) +static int lpc2900_probe(struct flash_bank *bank) { struct lpc2900_flash_bank *lpc2900_info = bank->driver_priv; struct target *target = bank->target; @@ -1751,7 +1751,7 @@ static int lpc2900_probe(struct flash_bank_s *bank) * * @param bank Pointer to the flash bank descriptor */ -static int lpc2900_erase_check(struct flash_bank_s *bank) +static int lpc2900_erase_check(struct flash_bank *bank) { uint32_t status = lpc2900_is_ready(bank); if (status != ERROR_OK) @@ -1809,7 +1809,7 @@ static int lpc2900_erase_check(struct flash_bank_s *bank) * * @param bank Pointer to the flash bank descriptor */ -static int lpc2900_protect_check(struct flash_bank_s *bank) +static int lpc2900_protect_check(struct flash_bank *bank) { return lpc2900_read_security_status(bank); } @@ -1822,7 +1822,7 @@ static int lpc2900_protect_check(struct flash_bank_s *bank) * @param buf Buffer to take the string * @param buf_size Maximum number of characters that the buffer can take */ -static int lpc2900_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int lpc2900_info(struct flash_bank *bank, char *buf, int buf_size) { snprintf(buf, buf_size, "lpc2900 flash driver"); diff --git a/src/flash/non_cfi.c b/src/flash/non_cfi.c index 808e642e..f98b1080 100644 --- a/src/flash/non_cfi.c +++ b/src/flash/non_cfi.c @@ -403,7 +403,7 @@ static struct non_cfi non_cfi_flashes[] = { } }; -void cfi_fixup_non_cfi(flash_bank_t *bank) +void cfi_fixup_non_cfi(struct flash_bank *bank) { struct cfi_flash_bank *cfi_info = bank->driver_priv; struct non_cfi *non_cfi = non_cfi_flashes; diff --git a/src/flash/non_cfi.h b/src/flash/non_cfi.h index ef50ae5c..44c92db4 100644 --- a/src/flash/non_cfi.h +++ b/src/flash/non_cfi.h @@ -35,6 +35,6 @@ struct non_cfi uint8_t status_poll_mask; }; -void cfi_fixup_non_cfi(flash_bank_t *bank); +void cfi_fixup_non_cfi(struct flash_bank *bank); #endif /* NON_CFI_H */ diff --git a/src/flash/ocl.c b/src/flash/ocl.c index 0a2496da..26d28305 100644 --- a/src/flash/ocl.c +++ b/src/flash/ocl.c @@ -33,12 +33,12 @@ struct ocl_priv unsigned int bufalign; }; -static int ocl_erase_check(struct flash_bank_s *bank) +static int ocl_erase_check(struct flash_bank *bank) { return ERROR_OK; } -static int ocl_protect_check(struct flash_bank_s *bank) +static int ocl_protect_check(struct flash_bank *bank) { return ERROR_OK; } @@ -68,7 +68,7 @@ FLASH_BANK_COMMAND_HANDLER(ocl_flash_bank_command) return ERROR_OK; } -static int ocl_erase(struct flash_bank_s *bank, int first, int last) +static int ocl_erase(struct flash_bank *bank, int first, int last) { struct ocl_priv *ocl = bank->driver_priv; int retval; @@ -123,12 +123,12 @@ static int ocl_erase(struct flash_bank_s *bank, int first, int last) return ERROR_OK; } -static int ocl_protect(struct flash_bank_s *bank, int set, int first, int last) +static int ocl_protect(struct flash_bank *bank, int set, int first, int last) { return ERROR_OK; } -static int ocl_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int ocl_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct ocl_priv *ocl = bank->driver_priv; int retval; @@ -235,7 +235,7 @@ static int ocl_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset return ERROR_OK; } -static int ocl_probe(struct flash_bank_s *bank) +static int ocl_probe(struct flash_bank *bank) { struct ocl_priv *ocl = bank->driver_priv; int retval; @@ -333,12 +333,12 @@ static int ocl_probe(struct flash_bank_s *bank) return ERROR_OK; } -static int ocl_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int ocl_info(struct flash_bank *bank, char *buf, int buf_size) { return ERROR_OK; } -static int ocl_auto_probe(struct flash_bank_s *bank) +static int ocl_auto_probe(struct flash_bank *bank) { struct ocl_priv *ocl = bank->driver_priv; diff --git a/src/flash/pic32mx.c b/src/flash/pic32mx.c index 25f90fd6..e19ee950 100644 --- a/src/flash/pic32mx.c +++ b/src/flash/pic32mx.c @@ -57,8 +57,8 @@ struct pic32mx_devs_s { { 0x00, NULL, 0 } }; -static int pic32mx_write_row(struct flash_bank_s *bank, uint32_t address, uint32_t srcaddr); -static int pic32mx_write_word(struct flash_bank_s *bank, uint32_t address, uint32_t word); +static int pic32mx_write_row(struct flash_bank *bank, uint32_t address, uint32_t srcaddr); +static int pic32mx_write_word(struct flash_bank *bank, uint32_t address, uint32_t word); /* flash bank pic32mx <base> <size> 0 0 <target#> */ @@ -81,7 +81,7 @@ FLASH_BANK_COMMAND_HANDLER(pic32mx_flash_bank_command) return ERROR_OK; } -static uint32_t pic32mx_get_flash_status(flash_bank_t *bank) +static uint32_t pic32mx_get_flash_status(struct flash_bank *bank) { struct target *target = bank->target; uint32_t status; @@ -91,7 +91,7 @@ static uint32_t pic32mx_get_flash_status(flash_bank_t *bank) return status; } -static uint32_t pic32mx_wait_status_busy(flash_bank_t *bank, int timeout) +static uint32_t pic32mx_wait_status_busy(struct flash_bank *bank, int timeout) { uint32_t status; @@ -107,7 +107,7 @@ static uint32_t pic32mx_wait_status_busy(flash_bank_t *bank, int timeout) return status; } -static int pic32mx_nvm_exec(struct flash_bank_s *bank, uint32_t op, uint32_t timeout) +static int pic32mx_nvm_exec(struct flash_bank *bank, uint32_t op, uint32_t timeout) { struct target *target = bank->target; uint32_t status; @@ -129,7 +129,7 @@ static int pic32mx_nvm_exec(struct flash_bank_s *bank, uint32_t op, uint32_t tim return status; } -static int pic32mx_protect_check(struct flash_bank_s *bank) +static int pic32mx_protect_check(struct flash_bank *bank) { struct target *target = bank->target; @@ -163,7 +163,7 @@ static int pic32mx_protect_check(struct flash_bank_s *bank) return ERROR_OK; } -static int pic32mx_erase(struct flash_bank_s *bank, int first, int last) +static int pic32mx_erase(struct flash_bank *bank, int first, int last) { struct target *target = bank->target; int i; @@ -205,7 +205,7 @@ static int pic32mx_erase(struct flash_bank_s *bank, int first, int last) return ERROR_OK; } -static int pic32mx_protect(struct flash_bank_s *bank, int set, int first, int last) +static int pic32mx_protect(struct flash_bank *bank, int set, int first, int last) { struct pic32mx_flash_bank *pic32mx_info = NULL; struct target *target = bank->target; @@ -298,7 +298,7 @@ static int pic32mx_protect(struct flash_bank_s *bank, int set, int first, int la #endif } -static int pic32mx_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int pic32mx_write_block(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct target *target = bank->target; uint32_t buffer_size = 512; @@ -427,7 +427,7 @@ static int pic32mx_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint3 return retval; } -static int pic32mx_write_word(struct flash_bank_s *bank, uint32_t address, uint32_t word) +static int pic32mx_write_word(struct flash_bank *bank, uint32_t address, uint32_t word) { struct target *target = bank->target; @@ -443,7 +443,7 @@ static int pic32mx_write_word(struct flash_bank_s *bank, uint32_t address, uint3 /* * Write a 128 word (512 byte) row to flash address from RAM srcaddr. */ -static int pic32mx_write_row(struct flash_bank_s *bank, uint32_t address, uint32_t srcaddr) +static int pic32mx_write_row(struct flash_bank *bank, uint32_t address, uint32_t srcaddr) { struct target *target = bank->target; @@ -461,7 +461,7 @@ static int pic32mx_write_row(struct flash_bank_s *bank, uint32_t address, uint32 return pic32mx_nvm_exec(bank, NVMCON_OP_ROW_PROG, 100); } -static int pic32mx_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int pic32mx_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { uint32_t words_remaining = (count / 4); uint32_t bytes_remaining = (count & 0x00000003); @@ -539,7 +539,7 @@ static int pic32mx_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t of return ERROR_OK; } -static int pic32mx_probe(struct flash_bank_s *bank) +static int pic32mx_probe(struct flash_bank *bank) { struct target *target = bank->target; struct pic32mx_flash_bank *pic32mx_info = bank->driver_priv; @@ -622,7 +622,7 @@ static int pic32mx_probe(struct flash_bank_s *bank) return ERROR_OK; } -static int pic32mx_auto_probe(struct flash_bank_s *bank) +static int pic32mx_auto_probe(struct flash_bank *bank) { struct pic32mx_flash_bank *pic32mx_info = bank->driver_priv; if (pic32mx_info->probed) @@ -637,7 +637,7 @@ COMMAND_HANDLER(pic32mx_handle_part_id_command) } #endif -static int pic32mx_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int pic32mx_info(struct flash_bank *bank, char *buf, int buf_size) { struct target *target = bank->target; struct mips32_common *mips32 = target->arch_info; @@ -683,7 +683,7 @@ COMMAND_HANDLER(pic32mx_handle_lock_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -729,7 +729,7 @@ COMMAND_HANDLER(pic32mx_handle_unlock_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -763,7 +763,7 @@ COMMAND_HANDLER(pic32mx_handle_unlock_command) #endif #if 0 -static int pic32mx_chip_erase(struct flash_bank_s *bank) +static int pic32mx_chip_erase(struct flash_bank *bank) { struct target *target = bank->target; #if 0 @@ -819,7 +819,7 @@ COMMAND_HANDLER(pic32mx_handle_chip_erase_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -857,7 +857,7 @@ COMMAND_HANDLER(pic32mx_handle_pgm_word_command) COMMAND_PARSE_NUMBER(u32, args[0], address); COMMAND_PARSE_NUMBER(u32, args[1], value); - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[2], &bank); if (ERROR_OK != retval) return retval; diff --git a/src/flash/stellaris.c b/src/flash/stellaris.c index 748b231c..efda8590 100644 --- a/src/flash/stellaris.c +++ b/src/flash/stellaris.c @@ -35,12 +35,12 @@ #define DID0_VER(did0) ((did0 >> 28)&0x07) -static int stellaris_read_part_info(struct flash_bank_s *bank); -static uint32_t stellaris_get_flash_status(flash_bank_t *bank); -static void stellaris_set_flash_mode(flash_bank_t *bank,int mode); -//static uint32_t stellaris_wait_status_busy(flash_bank_t *bank, uint32_t waitbits, int timeout); +static int stellaris_read_part_info(struct flash_bank *bank); +static uint32_t stellaris_get_flash_status(struct flash_bank *bank); +static void stellaris_set_flash_mode(struct flash_bank *bank,int mode); +//static uint32_t stellaris_wait_status_busy(struct flash_bank *bank, uint32_t waitbits, int timeout); -static int stellaris_mass_erase(struct flash_bank_s *bank); +static int stellaris_mass_erase(struct flash_bank *bank); static struct { uint32_t partno; @@ -239,7 +239,7 @@ FLASH_BANK_COMMAND_HANDLER(stellaris_flash_bank_command) return ERROR_OK; } -static int stellaris_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int stellaris_info(struct flash_bank *bank, char *buf, int buf_size) { int printed, device_class; struct stellaris_flash_bank *stellaris_info = bank->driver_priv; @@ -316,7 +316,7 @@ static int stellaris_info(struct flash_bank_s *bank, char *buf, int buf_size) * chip identification and status * ***************************************************************************/ -static uint32_t stellaris_get_flash_status(flash_bank_t *bank) +static uint32_t stellaris_get_flash_status(struct flash_bank *bank) { struct target *target = bank->target; uint32_t fmc; @@ -361,7 +361,7 @@ static const unsigned rcc_xtal[32] = { [0x16] = 16384000, }; -static void stellaris_read_clock_info(flash_bank_t *bank) +static void stellaris_read_clock_info(struct flash_bank *bank) { struct stellaris_flash_bank *stellaris_info = bank->driver_priv; struct target *target = bank->target; @@ -448,7 +448,7 @@ static void stellaris_read_clock_info(flash_bank_t *bank) } /* Setup the timimg registers */ -static void stellaris_set_flash_mode(flash_bank_t *bank,int mode) +static void stellaris_set_flash_mode(struct flash_bank *bank,int mode) { struct stellaris_flash_bank *stellaris_info = bank->driver_priv; struct target *target = bank->target; @@ -459,7 +459,7 @@ static void stellaris_set_flash_mode(flash_bank_t *bank,int mode) } #if 0 -static uint32_t stellaris_wait_status_busy(flash_bank_t *bank, uint32_t waitbits, int timeout) +static uint32_t stellaris_wait_status_busy(struct flash_bank *bank, uint32_t waitbits, int timeout) { uint32_t status; @@ -476,7 +476,7 @@ static uint32_t stellaris_wait_status_busy(flash_bank_t *bank, uint32_t waitbits } /* Send one command to the flash controller */ -static int stellaris_flash_command(struct flash_bank_s *bank,uint8_t cmd,uint16_t pagen) +static int stellaris_flash_command(struct flash_bank *bank,uint8_t cmd,uint16_t pagen) { uint32_t fmc; struct target *target = bank->target; @@ -495,7 +495,7 @@ static int stellaris_flash_command(struct flash_bank_s *bank,uint8_t cmd,uint16_ #endif /* Read device id register, main clock frequency register and fill in driver info structure */ -static int stellaris_read_part_info(struct flash_bank_s *bank) +static int stellaris_read_part_info(struct flash_bank *bank) { struct stellaris_flash_bank *stellaris_info = bank->driver_priv; struct target *target = bank->target; @@ -613,7 +613,7 @@ static int stellaris_read_part_info(struct flash_bank_s *bank) * flash operations * ***************************************************************************/ -static int stellaris_protect_check(struct flash_bank_s *bank) +static int stellaris_protect_check(struct flash_bank *bank) { uint32_t status; @@ -642,7 +642,7 @@ static int stellaris_protect_check(struct flash_bank_s *bank) return ERROR_OK; } -static int stellaris_erase(struct flash_bank_s *bank, int first, int last) +static int stellaris_erase(struct flash_bank *bank, int first, int last) { int banknr; uint32_t flash_fmc, flash_cris; @@ -712,7 +712,7 @@ static int stellaris_erase(struct flash_bank_s *bank, int first, int last) return ERROR_OK; } -static int stellaris_protect(struct flash_bank_s *bank, int set, int first, int last) +static int stellaris_protect(struct flash_bank *bank, int set, int first, int last) { uint32_t fmppe, flash_fmc, flash_cris; int lockregion; @@ -828,7 +828,7 @@ static uint8_t stellaris_write_code[] = 0x01,0x00,0x42,0xA4 /* .word 0xA4420001 */ }; -static int stellaris_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t wcount) +static int stellaris_write_block(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t wcount) { struct target *target = bank->target; uint32_t buffer_size = 8192; @@ -908,7 +908,7 @@ static int stellaris_write_block(struct flash_bank_s *bank, uint8_t *buffer, uin return retval; } -static int stellaris_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int stellaris_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct stellaris_flash_bank *stellaris_info = bank->driver_priv; struct target *target = bank->target; @@ -1043,7 +1043,7 @@ static int stellaris_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t return ERROR_OK; } -static int stellaris_probe(struct flash_bank_s *bank) +static int stellaris_probe(struct flash_bank *bank) { /* we can't probe on an stellaris * if this is an stellaris, it has the configured flash @@ -1059,7 +1059,7 @@ static int stellaris_probe(struct flash_bank_s *bank) return stellaris_read_part_info(bank); } -static int stellaris_auto_probe(struct flash_bank_s *bank) +static int stellaris_auto_probe(struct flash_bank *bank) { struct stellaris_flash_bank *stellaris_info = bank->driver_priv; if (stellaris_info->did1) @@ -1067,7 +1067,7 @@ static int stellaris_auto_probe(struct flash_bank_s *bank) return stellaris_probe(bank); } -static int stellaris_mass_erase(struct flash_bank_s *bank) +static int stellaris_mass_erase(struct flash_bank *bank) { struct target *target = NULL; struct stellaris_flash_bank *stellaris_info = NULL; @@ -1137,7 +1137,7 @@ COMMAND_HANDLER(stellaris_handle_mass_erase_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; diff --git a/src/flash/stm32x.c b/src/flash/stm32x.c index a9b4fb3f..cf842fcf 100644 --- a/src/flash/stm32x.c +++ b/src/flash/stm32x.c @@ -29,7 +29,7 @@ #include "binarybuffer.h" -static int stm32x_mass_erase(struct flash_bank_s *bank); +static int stm32x_mass_erase(struct flash_bank *bank); /* flash bank stm32x <base> <size> 0 0 <target#> */ @@ -52,7 +52,7 @@ FLASH_BANK_COMMAND_HANDLER(stm32x_flash_bank_command) return ERROR_OK; } -static uint32_t stm32x_get_flash_status(flash_bank_t *bank) +static uint32_t stm32x_get_flash_status(struct flash_bank *bank) { struct target *target = bank->target; uint32_t status; @@ -62,7 +62,7 @@ static uint32_t stm32x_get_flash_status(flash_bank_t *bank) return status; } -static uint32_t stm32x_wait_status_busy(flash_bank_t *bank, int timeout) +static uint32_t stm32x_wait_status_busy(struct flash_bank *bank, int timeout) { struct target *target = bank->target; uint32_t status; @@ -81,7 +81,7 @@ static uint32_t stm32x_wait_status_busy(flash_bank_t *bank, int timeout) return status; } -static int stm32x_read_options(struct flash_bank_s *bank) +static int stm32x_read_options(struct flash_bank *bank) { uint32_t optiondata; struct stm32x_flash_bank *stm32x_info = NULL; @@ -109,7 +109,7 @@ static int stm32x_read_options(struct flash_bank_s *bank) return ERROR_OK; } -static int stm32x_erase_options(struct flash_bank_s *bank) +static int stm32x_erase_options(struct flash_bank *bank) { struct stm32x_flash_bank *stm32x_info = NULL; struct target *target = bank->target; @@ -146,7 +146,7 @@ static int stm32x_erase_options(struct flash_bank_s *bank) return ERROR_OK; } -static int stm32x_write_options(struct flash_bank_s *bank) +static int stm32x_write_options(struct flash_bank *bank) { struct stm32x_flash_bank *stm32x_info = NULL; struct target *target = bank->target; @@ -230,7 +230,7 @@ static int stm32x_write_options(struct flash_bank_s *bank) return ERROR_OK; } -static int stm32x_protect_check(struct flash_bank_s *bank) +static int stm32x_protect_check(struct flash_bank *bank) { struct target *target = bank->target; struct stm32x_flash_bank *stm32x_info = bank->driver_priv; @@ -302,7 +302,7 @@ static int stm32x_protect_check(struct flash_bank_s *bank) return ERROR_OK; } -static int stm32x_erase(struct flash_bank_s *bank, int first, int last) +static int stm32x_erase(struct flash_bank *bank, int first, int last) { struct target *target = bank->target; int i; @@ -343,7 +343,7 @@ static int stm32x_erase(struct flash_bank_s *bank, int first, int last) return ERROR_OK; } -static int stm32x_protect(struct flash_bank_s *bank, int set, int first, int last) +static int stm32x_protect(struct flash_bank *bank, int set, int first, int last) { struct stm32x_flash_bank *stm32x_info = NULL; struct target *target = bank->target; @@ -430,7 +430,7 @@ static int stm32x_protect(struct flash_bank_s *bank, int set, int first, int las return stm32x_write_options(bank); } -static int stm32x_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int stm32x_write_block(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct stm32x_flash_bank *stm32x_info = bank->driver_priv; struct target *target = bank->target; @@ -549,7 +549,7 @@ static int stm32x_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint32 return retval; } -static int stm32x_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int stm32x_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct target *target = bank->target; uint32_t words_remaining = (count / 2); @@ -654,7 +654,7 @@ static int stm32x_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t off return ERROR_OK; } -static int stm32x_probe(struct flash_bank_s *bank) +static int stm32x_probe(struct flash_bank *bank) { struct target *target = bank->target; struct stm32x_flash_bank *stm32x_info = bank->driver_priv; @@ -771,7 +771,7 @@ static int stm32x_probe(struct flash_bank_s *bank) return ERROR_OK; } -static int stm32x_auto_probe(struct flash_bank_s *bank) +static int stm32x_auto_probe(struct flash_bank *bank) { struct stm32x_flash_bank *stm32x_info = bank->driver_priv; if (stm32x_info->probed) @@ -786,7 +786,7 @@ COMMAND_HANDLER(stm32x_handle_part_id_command) } #endif -static int stm32x_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int stm32x_info(struct flash_bank *bank, char *buf, int buf_size) { struct target *target = bank->target; uint32_t device_id; @@ -903,7 +903,7 @@ COMMAND_HANDLER(stm32x_handle_lock_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -949,7 +949,7 @@ COMMAND_HANDLER(stm32x_handle_unlock_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -993,7 +993,7 @@ COMMAND_HANDLER(stm32x_handle_options_read_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -1049,7 +1049,7 @@ COMMAND_HANDLER(stm32x_handle_options_write_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -1110,7 +1110,7 @@ COMMAND_HANDLER(stm32x_handle_options_write_command) return ERROR_OK; } -static int stm32x_mass_erase(struct flash_bank_s *bank) +static int stm32x_mass_erase(struct flash_bank *bank) { struct target *target = bank->target; uint32_t status; @@ -1158,7 +1158,7 @@ COMMAND_HANDLER(stm32x_handle_mass_erase_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; diff --git a/src/flash/str7x.c b/src/flash/str7x.c index d22886f9..fa235509 100644 --- a/src/flash/str7x.c +++ b/src/flash/str7x.c @@ -45,13 +45,13 @@ struct str7x_mem_layout mem_layout_str7bank1[] = { {0x00002000, 0x02000, 0x20000} }; -static int str7x_get_flash_adr(struct flash_bank_s *bank, uint32_t reg) +static int str7x_get_flash_adr(struct flash_bank *bank, uint32_t reg) { struct str7x_flash_bank *str7x_info = bank->driver_priv; return (str7x_info->register_base | reg); } -static int str7x_build_block_list(struct flash_bank_s *bank) +static int str7x_build_block_list(struct flash_bank *bank) { struct str7x_flash_bank *str7x_info = bank->driver_priv; @@ -154,7 +154,7 @@ FLASH_BANK_COMMAND_HANDLER(str7x_flash_bank_command) return ERROR_OK; } -static uint32_t str7x_status(struct flash_bank_s *bank) +static uint32_t str7x_status(struct flash_bank *bank) { struct target *target = bank->target; uint32_t retval; @@ -164,7 +164,7 @@ static uint32_t str7x_status(struct flash_bank_s *bank) return retval; } -static uint32_t str7x_result(struct flash_bank_s *bank) +static uint32_t str7x_result(struct flash_bank *bank) { struct target *target = bank->target; uint32_t retval; @@ -174,7 +174,7 @@ static uint32_t str7x_result(struct flash_bank_s *bank) return retval; } -static int str7x_protect_check(struct flash_bank_s *bank) +static int str7x_protect_check(struct flash_bank *bank) { struct str7x_flash_bank *str7x_info = bank->driver_priv; struct target *target = bank->target; @@ -201,7 +201,7 @@ static int str7x_protect_check(struct flash_bank_s *bank) return ERROR_OK; } -static int str7x_erase(struct flash_bank_s *bank, int first, int last) +static int str7x_erase(struct flash_bank *bank, int first, int last) { struct str7x_flash_bank *str7x_info = bank->driver_priv; struct target *target = bank->target; @@ -254,7 +254,7 @@ static int str7x_erase(struct flash_bank_s *bank, int first, int last) return ERROR_OK; } -static int str7x_protect(struct flash_bank_s *bank, int set, int first, int last) +static int str7x_protect(struct flash_bank *bank, int set, int first, int last) { struct str7x_flash_bank *str7x_info = bank->driver_priv; struct target *target = bank->target; @@ -308,7 +308,7 @@ static int str7x_protect(struct flash_bank_s *bank, int set, int first, int last return ERROR_OK; } -static int str7x_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int str7x_write_block(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct str7x_flash_bank *str7x_info = bank->driver_priv; struct target *target = bank->target; @@ -423,7 +423,7 @@ static int str7x_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint32_ return retval; } -static int str7x_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int str7x_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct target *target = bank->target; struct str7x_flash_bank *str7x_info = bank->driver_priv; @@ -583,7 +583,7 @@ static int str7x_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offs return ERROR_OK; } -static int str7x_probe(struct flash_bank_s *bank) +static int str7x_probe(struct flash_bank *bank) { return ERROR_OK; } @@ -595,7 +595,7 @@ COMMAND_HANDLER(str7x_handle_part_id_command) } #endif -static int str7x_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int str7x_info(struct flash_bank *bank, char *buf, int buf_size) { snprintf(buf, buf_size, "str7x flash driver info"); return ERROR_OK; @@ -616,7 +616,7 @@ COMMAND_HANDLER(str7x_handle_disable_jtag_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; diff --git a/src/flash/str9x.c b/src/flash/str9x.c index f7bc3c61..b3e8dffc 100644 --- a/src/flash/str9x.c +++ b/src/flash/str9x.c @@ -33,7 +33,7 @@ static uint32_t bank1start = 0x00080000; -static int str9x_build_block_list(struct flash_bank_s *bank) +static int str9x_build_block_list(struct flash_bank *bank) { struct str9x_flash_bank *str9x_info = bank->driver_priv; @@ -136,7 +136,7 @@ FLASH_BANK_COMMAND_HANDLER(str9x_flash_bank_command) return ERROR_OK; } -static int str9x_protect_check(struct flash_bank_s *bank) +static int str9x_protect_check(struct flash_bank *bank) { int retval; struct str9x_flash_bank *str9x_info = bank->driver_priv; @@ -214,7 +214,7 @@ static int str9x_protect_check(struct flash_bank_s *bank) return ERROR_OK; } -static int str9x_erase(struct flash_bank_s *bank, int first, int last) +static int str9x_erase(struct flash_bank *bank, int first, int last) { struct target *target = bank->target; int i; @@ -306,7 +306,7 @@ static int str9x_erase(struct flash_bank_s *bank, int first, int last) return ERROR_OK; } -static int str9x_protect(struct flash_bank_s *bank, +static int str9x_protect(struct flash_bank *bank, int set, int first, int last) { struct target *target = bank->target; @@ -345,7 +345,7 @@ static int str9x_protect(struct flash_bank_s *bank, return ERROR_OK; } -static int str9x_write_block(struct flash_bank_s *bank, +static int str9x_write_block(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct str9x_flash_bank *str9x_info = bank->driver_priv; @@ -454,7 +454,7 @@ static int str9x_write_block(struct flash_bank_s *bank, return retval; } -static int str9x_write(struct flash_bank_s *bank, +static int str9x_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct target *target = bank->target; @@ -612,7 +612,7 @@ static int str9x_write(struct flash_bank_s *bank, return ERROR_OK; } -static int str9x_probe(struct flash_bank_s *bank) +static int str9x_probe(struct flash_bank *bank) { return ERROR_OK; } @@ -624,7 +624,7 @@ COMMAND_HANDLER(str9x_handle_part_id_command) } #endif -static int str9x_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int str9x_info(struct flash_bank *bank, char *buf, int buf_size) { snprintf(buf, buf_size, "str9x flash driver info"); return ERROR_OK; @@ -640,7 +640,7 @@ COMMAND_HANDLER(str9x_handle_flash_config_command) return ERROR_COMMAND_SYNTAX_ERROR; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; diff --git a/src/flash/str9xpec.c b/src/flash/str9xpec.c index ec5d0316..6c42ce3e 100644 --- a/src/flash/str9xpec.c +++ b/src/flash/str9xpec.c @@ -28,9 +28,9 @@ #include "arm7_9_common.h" -static int str9xpec_erase_area(struct flash_bank_s *bank, int first, int last); -static int str9xpec_set_address(struct flash_bank_s *bank, uint8_t sector); -static int str9xpec_write_options(struct flash_bank_s *bank); +static int str9xpec_erase_area(struct flash_bank *bank, int first, int last); +static int str9xpec_set_address(struct flash_bank *bank, uint8_t sector); +static int str9xpec_write_options(struct flash_bank *bank); int str9xpec_set_instr(struct jtag_tap *tap, uint32_t new_instr, tap_state_t end_state) { @@ -81,7 +81,7 @@ static uint8_t str9xpec_isc_status(struct jtag_tap *tap) return status; } -static int str9xpec_isc_enable(struct flash_bank_s *bank) +static int str9xpec_isc_enable(struct flash_bank *bank) { uint8_t status; struct jtag_tap *tap; @@ -108,7 +108,7 @@ static int str9xpec_isc_enable(struct flash_bank_s *bank) return ERROR_OK; } -static int str9xpec_isc_disable(struct flash_bank_s *bank) +static int str9xpec_isc_disable(struct flash_bank *bank) { uint8_t status; struct jtag_tap *tap; @@ -137,7 +137,7 @@ static int str9xpec_isc_disable(struct flash_bank_s *bank) return ERROR_OK; } -static int str9xpec_read_config(struct flash_bank_s *bank) +static int str9xpec_read_config(struct flash_bank *bank) { struct scan_field field; uint8_t status; @@ -166,7 +166,7 @@ static int str9xpec_read_config(struct flash_bank_s *bank) return status; } -static int str9xpec_build_block_list(struct flash_bank_s *bank) +static int str9xpec_build_block_list(struct flash_bank *bank) { struct str9xpec_flash_controller *str9xpec_info = bank->driver_priv; @@ -269,7 +269,7 @@ FLASH_BANK_COMMAND_HANDLER(str9xpec_flash_bank_command) return ERROR_OK; } -static int str9xpec_blank_check(struct flash_bank_s *bank, int first, int last) +static int str9xpec_blank_check(struct flash_bank *bank, int first, int last) { struct scan_field field; uint8_t status; @@ -336,7 +336,7 @@ static int str9xpec_blank_check(struct flash_bank_s *bank, int first, int last) return ERROR_OK; } -static int str9xpec_protect_check(struct flash_bank_s *bank) +static int str9xpec_protect_check(struct flash_bank *bank) { uint8_t status; int i; @@ -358,7 +358,7 @@ static int str9xpec_protect_check(struct flash_bank_s *bank) return ERROR_OK; } -static int str9xpec_erase_area(struct flash_bank_s *bank, int first, int last) +static int str9xpec_erase_area(struct flash_bank *bank, int first, int last) { struct scan_field field; uint8_t status; @@ -428,7 +428,7 @@ static int str9xpec_erase_area(struct flash_bank_s *bank, int first, int last) return status; } -static int str9xpec_erase(struct flash_bank_s *bank, int first, int last) +static int str9xpec_erase(struct flash_bank *bank, int first, int last) { int status; @@ -440,7 +440,7 @@ static int str9xpec_erase(struct flash_bank_s *bank, int first, int last) return ERROR_OK; } -static int str9xpec_lock_device(struct flash_bank_s *bank) +static int str9xpec_lock_device(struct flash_bank *bank) { struct scan_field field; uint8_t status; @@ -482,7 +482,7 @@ static int str9xpec_lock_device(struct flash_bank_s *bank) return status; } -static int str9xpec_unlock_device(struct flash_bank_s *bank) +static int str9xpec_unlock_device(struct flash_bank *bank) { uint8_t status; @@ -491,7 +491,7 @@ static int str9xpec_unlock_device(struct flash_bank_s *bank) return status; } -static int str9xpec_protect(struct flash_bank_s *bank, int set, int first, int last) +static int str9xpec_protect(struct flash_bank *bank, int set, int first, int last) { uint8_t status; int i; @@ -537,7 +537,7 @@ static int str9xpec_protect(struct flash_bank_s *bank, int set, int first, int l return ERROR_OK; } -static int str9xpec_set_address(struct flash_bank_s *bank, uint8_t sector) +static int str9xpec_set_address(struct flash_bank *bank, uint8_t sector) { struct jtag_tap *tap; struct scan_field field; @@ -558,7 +558,7 @@ static int str9xpec_set_address(struct flash_bank_s *bank, uint8_t sector) return ERROR_OK; } -static int str9xpec_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int str9xpec_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct str9xpec_flash_controller *str9xpec_info = bank->driver_priv; uint32_t dwords_remaining = (count / 8); @@ -721,7 +721,7 @@ static int str9xpec_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t o return ERROR_OK; } -static int str9xpec_probe(struct flash_bank_s *bank) +static int str9xpec_probe(struct flash_bank *bank) { return ERROR_OK; } @@ -737,7 +737,7 @@ COMMAND_HANDLER(str9xpec_handle_part_id_command) if (argc < 1) return ERROR_COMMAND_SYNTAX_ERROR; - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -766,12 +766,12 @@ COMMAND_HANDLER(str9xpec_handle_part_id_command) return ERROR_OK; } -static int str9xpec_erase_check(struct flash_bank_s *bank) +static int str9xpec_erase_check(struct flash_bank *bank) { return str9xpec_blank_check(bank, 0, bank->num_sectors - 1); } -static int str9xpec_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int str9xpec_info(struct flash_bank *bank, char *buf, int buf_size) { snprintf(buf, buf_size, "str9xpec flash driver info"); return ERROR_OK; @@ -788,7 +788,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_read_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -833,7 +833,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_read_command) return ERROR_OK; } -static int str9xpec_write_options(struct flash_bank_s *bank) +static int str9xpec_write_options(struct flash_bank *bank) { struct scan_field field; uint8_t status; @@ -904,7 +904,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_write_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -927,7 +927,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_cmap_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -956,7 +956,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_lvdthd_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -985,7 +985,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_lvdsel_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -1014,7 +1014,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_lvdwarn_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -1043,7 +1043,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_lock_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -1066,7 +1066,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_unlock_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -1092,7 +1092,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_enable_turbo_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; @@ -1139,7 +1139,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_disable_turbo_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; diff --git a/src/flash/tms470.c b/src/flash/tms470.c index a23e042c..6e1516f3 100644 --- a/src/flash/tms470.c +++ b/src/flash/tms470.c @@ -106,7 +106,7 @@ const struct flash_sector TMS470R1A384_BANK2_SECTORS[] = { /* ---------------------------------------------------------------------- */ -static int tms470_read_part_info(struct flash_bank_s *bank) +static int tms470_read_part_info(struct flash_bank *bank) { struct tms470_flash_bank *tms470_info = bank->driver_priv; struct target *target = bank->target; @@ -491,7 +491,7 @@ static int tms470_try_flash_keys(struct target * target, const uint32_t * key_se /* ---------------------------------------------------------------------- */ -static int tms470_unlock_flash(struct flash_bank_s *bank) +static int tms470_unlock_flash(struct flash_bank *bank) { struct target *target = bank->target; const uint32_t *p_key_sets[5]; @@ -530,7 +530,7 @@ static int tms470_unlock_flash(struct flash_bank_s *bank) /* ---------------------------------------------------------------------- */ -static int tms470_flash_initialize_internal_state_machine(struct flash_bank_s *bank) +static int tms470_flash_initialize_internal_state_machine(struct flash_bank *bank) { uint32_t fmmac2, fmmac1, fmmaxep, k, delay, glbctrl, sysclk; struct target *target = bank->target; @@ -666,7 +666,7 @@ static int tms470_flash_initialize_internal_state_machine(struct flash_bank_s *b /* ---------------------------------------------------------------------- */ -int tms470_flash_status(struct flash_bank_s *bank) +int tms470_flash_status(struct flash_bank *bank) { struct target *target = bank->target; int result = ERROR_OK; @@ -722,7 +722,7 @@ int tms470_flash_status(struct flash_bank_s *bank) /* ---------------------------------------------------------------------- */ -static int tms470_erase_sector(struct flash_bank_s *bank, int sector) +static int tms470_erase_sector(struct flash_bank *bank, int sector) { uint32_t glbctrl, orig_fmregopt, fmbsea, fmbseb, fmmstat; struct target *target = bank->target; @@ -830,7 +830,7 @@ static int tms470_register_commands(struct command_context_s *cmd_ctx) /* ---------------------------------------------------------------------- */ -static int tms470_erase(struct flash_bank_s *bank, int first, int last) +static int tms470_erase(struct flash_bank *bank, int first, int last) { struct tms470_flash_bank *tms470_info = bank->driver_priv; int sector, result = ERROR_OK; @@ -877,7 +877,7 @@ static int tms470_erase(struct flash_bank_s *bank, int first, int last) /* ---------------------------------------------------------------------- */ -static int tms470_protect(struct flash_bank_s *bank, int set, int first, int last) +static int tms470_protect(struct flash_bank *bank, int set, int first, int last) { struct tms470_flash_bank *tms470_info = bank->driver_priv; struct target *target = bank->target; @@ -929,7 +929,7 @@ static int tms470_protect(struct flash_bank_s *bank, int set, int first, int las /* ---------------------------------------------------------------------- */ -static int tms470_write(struct flash_bank_s *bank, uint8_t * buffer, uint32_t offset, uint32_t count) +static int tms470_write(struct flash_bank *bank, uint8_t * buffer, uint32_t offset, uint32_t count) { struct target *target = bank->target; uint32_t glbctrl, fmbac2, orig_fmregopt, fmbsea, fmbseb, fmmaxpp, fmmstat; @@ -1027,7 +1027,7 @@ static int tms470_write(struct flash_bank_s *bank, uint8_t * buffer, uint32_t of /* ---------------------------------------------------------------------- */ -static int tms470_probe(struct flash_bank_s *bank) +static int tms470_probe(struct flash_bank *bank) { if (bank->target->state != TARGET_HALTED) { @@ -1038,7 +1038,7 @@ static int tms470_probe(struct flash_bank_s *bank) return tms470_read_part_info(bank); } -static int tms470_auto_probe(struct flash_bank_s *bank) +static int tms470_auto_probe(struct flash_bank *bank) { struct tms470_flash_bank *tms470_info = bank->driver_priv; @@ -1049,7 +1049,7 @@ static int tms470_auto_probe(struct flash_bank_s *bank) /* ---------------------------------------------------------------------- */ -static int tms470_erase_check(struct flash_bank_s *bank) +static int tms470_erase_check(struct flash_bank *bank) { struct target *target = bank->target; struct tms470_flash_bank *tms470_info = bank->driver_priv; @@ -1140,7 +1140,7 @@ static int tms470_erase_check(struct flash_bank_s *bank) /* ---------------------------------------------------------------------- */ -static int tms470_protect_check(struct flash_bank_s *bank) +static int tms470_protect_check(struct flash_bank *bank) { struct target *target = bank->target; struct tms470_flash_bank *tms470_info = bank->driver_priv; @@ -1188,7 +1188,7 @@ static int tms470_protect_check(struct flash_bank_s *bank) /* ---------------------------------------------------------------------- */ -static int tms470_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int tms470_info(struct flash_bank *bank, char *buf, int buf_size) { int used = 0; struct tms470_flash_bank *tms470_info = bank->driver_priv; diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 84ad76c9..f49f352f 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -1520,7 +1520,7 @@ static int decode_xfer_read(char *buf, char **annex, int *ofs, unsigned int *len return 0; } -int gdb_calc_blocksize(flash_bank_t *bank) +int gdb_calc_blocksize(struct flash_bank *bank) { uint32_t i; uint32_t block_size = 0xffffffff; @@ -1538,9 +1538,9 @@ int gdb_calc_blocksize(flash_bank_t *bank) static int compare_bank (const void * a, const void * b) { - flash_bank_t *b1, *b2; - b1=*((flash_bank_t **)a); - b2=*((flash_bank_t **)b); + struct flash_bank *b1, *b2; + b1=*((struct flash_bank **)a); + b2=*((struct flash_bank **)b); if (b1->base == b2->base) { @@ -1661,7 +1661,7 @@ int gdb_query_packet(struct connection *connection, struct target *target, char * Normally we only execute this code once, but no big deal if we * have to regenerate it a couple of times. */ - flash_bank_t *p; + struct flash_bank *p; char *xml = NULL; int size = 0; int pos = 0; @@ -1685,7 +1685,7 @@ int gdb_query_packet(struct connection *connection, struct target *target, char read/write) by default for GDB. GDB does not have a concept of non-cacheable read/write memory. */ - flash_bank_t **banks = malloc(sizeof(flash_bank_t *)*flash_get_bank_count()); + struct flash_bank **banks = malloc(sizeof(struct flash_bank *)*flash_get_bank_count()); int i; for (i = 0; i < flash_get_bank_count(); i++) @@ -1701,7 +1701,7 @@ int gdb_query_packet(struct connection *connection, struct target *target, char banks[i]=p; } - qsort(banks, flash_get_bank_count(), sizeof(flash_bank_t *), compare_bank); + qsort(banks, flash_get_bank_count(), sizeof(struct flash_bank *), compare_bank); uint32_t ram_start = 0; for (i = 0; i < flash_get_bank_count(); i++) |