From fbf5bec7f3ea9f4a9584099a12e71681cb55ce35 Mon Sep 17 00:00:00 2001 From: drath Date: Sun, 6 Aug 2006 11:20:42 +0000 Subject: - fixed a minor problem with the GDB server that could drop the first packet (non-fatal) - fixed some small memory leaks (thanks to Spencer Oliver) - verify chip- and buswidth of cfi flash configurations - added support for ARM966E based systems (tested only with ST micro STR9, thanks to Spencer Oliver) git-svn-id: svn://svn.berlios.de/openocd/trunk@81 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/flash/cfi.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/flash/cfi.c') diff --git a/src/flash/cfi.c b/src/flash/cfi.c index 3dc7885c..fb3d4cc8 100644 --- a/src/flash/cfi.c +++ b/src/flash/cfi.c @@ -50,6 +50,7 @@ int cfi_info(struct flash_bank_s *bank, char *buf, int buf_size); int cfi_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); #define CFI_MAX_BUS_WIDTH 4 +#define CFI_MAX_CHIP_WIDTH 4 flash_driver_t cfi_flash = { @@ -335,6 +336,13 @@ int cfi_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char ** return ERROR_FLASH_BANK_INVALID; } + if ((strtoul(args[4], NULL, 0) > CFI_MAX_CHIP_WIDTH) + || (strtoul(args[3], NULL, 0) > CFI_MAX_BUS_WIDTH)) + { + ERROR("chip and bus width have to specified in byte"); + return ERROR_FLASH_BANK_INVALID; + } + cfi_info = malloc(sizeof(cfi_flash_bank_t)); bank->driver_priv = cfi_info; -- cgit v1.2.3