src/target/mips_m4k : fix condition on overlapping workspace data area

The condition to check if the workspace area (used by actual MIPS code
executed on target) and data area (sandbox to put data to be read/written
to/from flash) is wrong, thus preventing the use of FAST_* commands to
program/verify FLASH.

Signed-off-by: François LEGAL <devel@thom.fr.eu.org>
Change-Id: Ic68424b7f42d44e550433a120093db5e7980fd56
Reviewed-on: https://review.openocd.org/c/openocd/+/7563
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
François LEGAL 2023-03-29 14:19:48 +02:00 committed by Antonio Borneo
parent 41037eb265
commit 18aacc8bf3
1 changed files with 2 additions and 2 deletions

View File

@ -1218,8 +1218,8 @@ static int mips_m4k_bulk_write_memory(struct target *target, target_addr_t addre
fast_data_area = mips32->fast_data_area;
if (address <= fast_data_area->address + fast_data_area->size &&
fast_data_area->address <= address + count) {
if (address < (fast_data_area->address + fast_data_area->size) &&
fast_data_area->address < (address + count)) {
LOG_ERROR("fast_data (" TARGET_ADDR_FMT ") is within write area "
"(" TARGET_ADDR_FMT "-" TARGET_ADDR_FMT ").",
fast_data_area->address, address, address + count);