-
- Downloads
flash/nor: Add erased_value to drivers and pass it to targets
struct flash_driver has a default_padded_value field that is similar, but it can be changed by the user for the specific purpose of padding. Add a new erased_value field and initialize it for all targets, particularly stm32lx, xmc4xxx and virtual. Use this value in core.c:default_flash_mem_blank_check(), the slow path. Extend the target API to pass erased_value down to target code. Adding an argument ensures that we catch all callers. This allows us to merge xmc4xxx.c:xmc4xxx_blank_check_memory() into armv7m:armv7m_blank_check_memory(). It further allows us to use default_flash_blank_check() in place of xmc4xxx.c:xmc4xxx_flash_blank_check(), adding a potential slow path fallback, as well as stm32lx:stm32lx_erase_check(), adding the potential armv7m fast path with fallback to default_flash_mem_blank_check(). Fix a mips32 code comment while at it (zeroed -> erased). The armv4_5 and mips32 target implementations will now error out if an erase value other than 0xff is used, causing default_flash_blank_check() to fall back to the default_flank_mem_blank_check() slow path. Change-Id: I39323fbbc4b71c256cd567e439896d0245d4745f Signed-off-by:Andreas Färber <afaerber@suse.de> Reviewed-on: http://openocd.zylin.com/3497 Tested-by: jenkins Reviewed-by:
Tomas Vanek <vanekt@fbl.cz>
Showing
- src/flash/nor/at91sam7.c 1 addition, 1 deletionsrc/flash/nor/at91sam7.c
- src/flash/nor/core.c 3 additions, 3 deletionssrc/flash/nor/core.c
- src/flash/nor/core.h 3 additions, 0 deletionssrc/flash/nor/core.h
- src/flash/nor/stm32lx.c 2 additions, 52 deletionssrc/flash/nor/stm32lx.c
- src/flash/nor/tcl.c 1 addition, 1 deletionsrc/flash/nor/tcl.c
- src/flash/nor/virtual.c 1 addition, 0 deletionssrc/flash/nor/virtual.c
- src/flash/nor/xmc4xxx.c 3 additions, 96 deletionssrc/flash/nor/xmc4xxx.c
- src/target/arm.h 1 addition, 1 deletionsrc/target/arm.h
- src/target/armv4_5.c 8 additions, 2 deletionssrc/target/armv4_5.c
- src/target/armv7m.c 22 additions, 6 deletionssrc/target/armv7m.c
- src/target/armv7m.h 1 addition, 1 deletionsrc/target/armv7m.h
- src/target/mips32.c 9 additions, 3 deletionssrc/target/mips32.c
- src/target/mips32.h 1 addition, 1 deletionsrc/target/mips32.h
- src/target/target.c 3 additions, 2 deletionssrc/target/target.c
- src/target/target.h 1 addition, 1 deletionsrc/target/target.h
- src/target/target_type.h 1 addition, 1 deletionsrc/target/target_type.h
Loading
Please register or sign in to comment