riscv-openocd/src/flash/nor
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
..
Makefile.am build: add build/src to include path 2009-12-08 10:16:10 +01:00
aduc702x.c flash: less bogus errors 2010-05-04 09:11:21 +02:00
at91sam3.c ARMv7M: use software breakpoints for algorithms 2010-02-28 22:26:52 +00:00
at91sam3.h move nor drivers to src/flash/nor 2009-12-02 23:27:09 -08:00
at91sam7.c src/flash/nor: usage/help/doc updates 2010-01-09 10:25:03 -08:00
at91sam7.h remove flash.h from tree 2009-12-04 16:56:24 -08:00
avrf.c NOR/AVRF: review scope of data 2010-04-10 19:56:24 +08:00
avrf.h remove flash.h from tree 2009-12-04 16:56:24 -08:00
cfi.c NOR/CFI: check "flash bank" command arguments 2010-05-16 13:39:47 +02:00
cfi.h remove flash.h from tree 2009-12-04 16:56:24 -08:00
core.c flash: stop caching protection state 2010-05-05 15:24:25 +02:00
core.h flash: stop caching protection state 2010-05-05 15:24:25 +02:00
driver.h split flash.h into into flash/nor/*.h 2009-12-04 16:56:24 -08:00
drivers.c NOR/DRIVERS: review scope of functions 2010-04-10 19:38:15 +08:00
ecos.c NOR: cleanup driver decls 2010-01-29 13:52:08 -08:00
faux.c NOR: cleanup driver decls 2010-01-29 13:52:08 -08:00
imp.h Comment and doxygen fixes 2009-12-09 10:25:52 -08:00
lpc288x.c NOR: cleanup driver decls 2010-01-29 13:52:08 -08:00
lpc288x.h remove flash.h from tree 2009-12-04 16:56:24 -08:00
lpc2000.c LPC1768 updates, IAR board support 2010-03-02 15:02:01 -08:00
lpc2000.h remove flash.h from tree 2009-12-04 16:56:24 -08:00
lpc2900.c flash: less bogus errors 2010-05-04 09:11:21 +02:00
non_cfi.c Fujitsu MBM29SL800TE flash support 2010-05-11 20:10:08 +02:00
non_cfi.h remove flash.h from tree 2009-12-04 16:56:24 -08:00
ocl.c NOR: cleanup driver decls 2010-01-29 13:52:08 -08:00
ocl.h move nor drivers to src/flash/nor 2009-12-02 23:27:09 -08:00
pic32mx.c flash: less bogus errors 2010-05-04 09:11:21 +02:00
pic32mx.h PIC32: add flash algorithm support 2010-03-10 21:03:22 +00:00
stellaris.c flash: less bogus errors 2010-05-04 09:11:21 +02:00
stellaris.h stellaris: comments 2009-12-16 14:17:31 -08:00
stm32x.c flash: less bogus errors 2010-05-04 09:11:21 +02:00
stm32x.h remove flash.h from tree 2009-12-04 16:56:24 -08:00
str7x.c str7x: improve error handling 2010-05-05 15:24:24 +02:00
str7x.h remove flash.h from tree 2009-12-04 16:56:24 -08:00
str9x.c flash: less bogus errors 2010-05-04 09:11:21 +02:00
str9x.h remove flash.h from tree 2009-12-04 16:56:24 -08:00
str9xpec.c STR9XPEC: review scope of functions 2010-04-10 19:29:51 +08:00
str9xpec.h remove flash.h from tree 2009-12-04 16:56:24 -08:00
tcl.c flash: require unique flash bank name 2010-05-13 20:44:07 +01:00
tms470.c NOR/TMS470: review scope of symbols 2010-04-11 01:19:41 +08:00
tms470.h remove flash.h from tree 2009-12-04 16:56:24 -08:00