From eb8912ec38c0fd6867d2b5a88b40549f791ce7bb Mon Sep 17 00:00:00 2001 From: Tomas Vanek Date: Thu, 23 Nov 2017 09:18:24 +0100 Subject: target, flash: prepare infrastructure for multi-block blank check 'flash erase_check' command runs a check algorithm on a target if possible. The algorithm is run repeatedly for each flash sector. Unfortunately every start and stop of the algorithm impose not negligible overhead. In practice it means checking is faster than plain read only for sectors of size approx 4 kByte or bigger. And checking sectors as short as 512 bytes runs approx 4 times slower than plain read. The patch changes API call target_blank_check_memory() and related to take an array of sectors (or arbitrary memory blocks). Changes in target-specific checking routines are kept minimal. They use only the first block from the array and process it by the unchanged algorithm. default_flash_blank_check() routine repeats target_blank_check_memory() until all blocks are checked, so it works with both multi-block and single-block based checkers. Change-Id: I0e6c60f2d71364c9c07c09416b04de9268807f5e Signed-off-by: Tomas Vanek Reviewed-on: http://openocd.zylin.com/4297 Tested-by: jenkins Reviewed-by: Andreas Bolsch --- src/target/target.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/target/target.h') diff --git a/src/target/target.h b/src/target/target.h index 7a8a80f..c5fb55b 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -312,6 +312,12 @@ struct target_timer_callback { struct target_timer_callback *next; }; +struct target_memory_check_block { + target_addr_t address; + uint32_t size; + uint32_t result; +}; + int target_register_commands(struct command_context *cmd_ctx); int target_examine(void); @@ -585,7 +591,8 @@ int target_read_buffer(struct target *target, int target_checksum_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t *crc); int target_blank_check_memory(struct target *target, - target_addr_t address, uint32_t size, uint32_t *blank, uint8_t erased_value); + struct target_memory_check_block *blocks, int num_blocks, + uint8_t erased_value); int target_wait_state(struct target *target, enum target_state state, int ms); /** -- cgit v1.1 From 2517bae6c1438350255dca63e7d1c1e06c64b6bb Mon Sep 17 00:00:00 2001 From: Liviu Ionescu Date: Sun, 13 May 2018 18:39:06 +0300 Subject: Rework/update ARM semihosting In 2016, ARM released the second edition of the semihosting specs ("Semihosting for AArch32 and AArch64"), adding support for 64-bits. To ease the reuse of the semihosting logic for other platforms (like RISC-V), the semihosting code was isolated from the ARM target and updated to the latest specs. The new code is already in use since January (in GNU MCU Eclipse OpenOCD) and no problems were reported, neither for ARM nor for RISC-V targets, after more than 7K downloads. The 2 new files were formatted with uncrustify. Change-Id: Ie84dbd86a547323bb8a5d24eab68fc7dad013d96 Signed-off-by: Liviu Ionescu Reviewed-on: http://openocd.zylin.com/4518 Tested-by: jenkins Reviewed-by: Matthias Welwarsky --- src/target/target.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/target/target.h') diff --git a/src/target/target.h b/src/target/target.h index c5fb55b..51a5b69 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -205,6 +205,9 @@ struct target { /* file-I/O information for host to do syscall */ struct gdb_fileio_info *fileio_info; + + /* The semihosting information, extracted from the target. */ + struct semihosting *semihosting; }; struct target_list { @@ -214,10 +217,10 @@ struct target_list { struct gdb_fileio_info { char *identifier; - uint32_t param_1; - uint32_t param_2; - uint32_t param_3; - uint32_t param_4; + uint64_t param_1; + uint64_t param_2; + uint64_t param_3; + uint64_t param_4; }; /** Returns the instance-specific name of the specified target. */ -- cgit v1.1