summaryrefslogtreecommitdiff
path: root/src/flash
diff options
context:
space:
mode:
authordrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2006-08-06 11:20:42 +0000
committerdrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2006-08-06 11:20:42 +0000
commitfbf5bec7f3ea9f4a9584099a12e71681cb55ce35 (patch)
tree576fd656bbf5ba38fc42fbc99109a5082eed6887 /src/flash
parent7d244761461701e1161df32c2f1d4cd50ae2bb26 (diff)
downloadopenocd_libswd-fbf5bec7f3ea9f4a9584099a12e71681cb55ce35.tar.gz
openocd_libswd-fbf5bec7f3ea9f4a9584099a12e71681cb55ce35.tar.bz2
openocd_libswd-fbf5bec7f3ea9f4a9584099a12e71681cb55ce35.tar.xz
openocd_libswd-fbf5bec7f3ea9f4a9584099a12e71681cb55ce35.zip
- 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
Diffstat (limited to 'src/flash')
-rw-r--r--src/flash/cfi.c8
1 files changed, 8 insertions, 0 deletions
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;