riscv-openocd/src/flash
Antonio Borneo c7b269ace1 NOR/CFI: check "flash bank" command arguments
Arguments chip_width and bus_width of command "flash bank" are
not fully checked.
While bus_width is later on redundantly checked in several other
parts (e.g. in cfi_command_val()) and generates run-time error,
chip_width is never checked, nor related to actual bus_width
value.
Added check to avoid:
- (chip_width == 0), that would mean no memory chip at all,
  avoiding also division by zero e.g. in cfi_get_u8();
- (bus_width == 0), that would mean no bus at all;
- unsupported cases of chip_width or bus_width value not power
  of 2;
- unsupported case of chip width wider than bus.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-05-16 13:39:47 +02:00
..
nand NAND: fix first and last handling in nand_build_bbt 2010-05-14 13:23:01 +02:00
nor NOR/CFI: check "flash bank" command arguments 2010-05-16 13:39:47 +02:00
ocl/at91sam7x change #include "ocl.h" to <flash/nor/ocl.h> 2009-12-03 04:24:49 -08:00
Makefile.am build: add build/src to include path 2009-12-08 10:16:10 +01:00
common.c change #include "log.h" to <helper/log.h> 2009-12-03 04:22:52 -08:00
common.h split NOR and NAND flash headers 2009-12-04 16:56:23 -08:00
mflash.c MFLASH: review scope of functions 2010-04-10 20:11:40 +08:00
mflash.h MFLASH: review scope of functions 2010-04-10 20:11:40 +08:00
startup.tcl add 'flash list', rewrite 'flash banks' 2009-12-06 21:39:35 -08:00