You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(75) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(70) |
Feb
(20) |
Mar
(52) |
Apr
(149) |
May
(387) |
Jun
(466) |
Jul
(133) |
Aug
(87) |
Sep
(122) |
Oct
(140) |
Nov
(185) |
Dec
(105) |
2010 |
Jan
(85) |
Feb
(45) |
Mar
(75) |
Apr
(17) |
May
(41) |
Jun
(52) |
Jul
(33) |
Aug
(29) |
Sep
(36) |
Oct
(15) |
Nov
(26) |
Dec
(34) |
2011 |
Jan
(26) |
Feb
(25) |
Mar
(26) |
Apr
(29) |
May
(20) |
Jun
(27) |
Jul
(15) |
Aug
(32) |
Sep
(13) |
Oct
(64) |
Nov
(60) |
Dec
(10) |
2012 |
Jan
(64) |
Feb
(63) |
Mar
(39) |
Apr
(43) |
May
(54) |
Jun
(11) |
Jul
(30) |
Aug
(45) |
Sep
(11) |
Oct
(70) |
Nov
(24) |
Dec
(23) |
2013 |
Jan
(17) |
Feb
(8) |
Mar
(35) |
Apr
(40) |
May
(20) |
Jun
(24) |
Jul
(36) |
Aug
(25) |
Sep
(42) |
Oct
(40) |
Nov
(9) |
Dec
(21) |
2014 |
Jan
(29) |
Feb
(24) |
Mar
(60) |
Apr
(22) |
May
(22) |
Jun
(46) |
Jul
(11) |
Aug
(23) |
Sep
(26) |
Oct
(10) |
Nov
(14) |
Dec
(2) |
2015 |
Jan
(28) |
Feb
(47) |
Mar
(33) |
Apr
(58) |
May
(5) |
Jun
(1) |
Jul
|
Aug
(8) |
Sep
(12) |
Oct
(25) |
Nov
(58) |
Dec
(21) |
2016 |
Jan
(12) |
Feb
(40) |
Mar
(2) |
Apr
(1) |
May
(67) |
Jun
(2) |
Jul
(5) |
Aug
(36) |
Sep
|
Oct
(24) |
Nov
(17) |
Dec
(50) |
2017 |
Jan
(14) |
Feb
(16) |
Mar
(2) |
Apr
(35) |
May
(14) |
Jun
(16) |
Jul
(3) |
Aug
(3) |
Sep
|
Oct
(19) |
Nov
|
Dec
(16) |
2018 |
Jan
(55) |
Feb
(11) |
Mar
(34) |
Apr
(14) |
May
(4) |
Jun
(20) |
Jul
(39) |
Aug
(16) |
Sep
(17) |
Oct
(16) |
Nov
(20) |
Dec
(30) |
2019 |
Jan
(29) |
Feb
(24) |
Mar
(37) |
Apr
(26) |
May
(19) |
Jun
(21) |
Jul
(2) |
Aug
(3) |
Sep
(9) |
Oct
(12) |
Nov
(12) |
Dec
(12) |
2020 |
Jan
(47) |
Feb
(36) |
Mar
(54) |
Apr
(44) |
May
(37) |
Jun
(19) |
Jul
(32) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(32) |
Dec
(11) |
2021 |
Jan
(14) |
Feb
(5) |
Mar
(40) |
Apr
(32) |
May
(42) |
Jun
(31) |
Jul
(29) |
Aug
(47) |
Sep
(38) |
Oct
(17) |
Nov
(74) |
Dec
(33) |
2022 |
Jan
(11) |
Feb
(15) |
Mar
(40) |
Apr
(21) |
May
(39) |
Jun
(44) |
Jul
(19) |
Aug
(46) |
Sep
(79) |
Oct
(35) |
Nov
(21) |
Dec
(15) |
2023 |
Jan
(56) |
Feb
(13) |
Mar
(43) |
Apr
(28) |
May
(60) |
Jun
(15) |
Jul
(29) |
Aug
(28) |
Sep
(32) |
Oct
(21) |
Nov
(42) |
Dec
(39) |
2024 |
Jan
(35) |
Feb
(17) |
Mar
(28) |
Apr
(7) |
May
(14) |
Jun
(35) |
Jul
(30) |
Aug
(35) |
Sep
(30) |
Oct
(28) |
Nov
(38) |
Dec
(18) |
2025 |
Jan
(21) |
Feb
(28) |
Mar
(36) |
Apr
(35) |
May
(34) |
Jun
(58) |
Jul
(9) |
Aug
(37) |
Sep
|
Oct
|
Nov
|
Dec
|
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-22 20:24:14
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 6f28ac8fdef91b665b3edf5132c03f73fd4e1d1d (commit) from 044e0f8c9aec9fe94d77199e64c813fb4336984b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 6f28ac8fdef91b665b3edf5132c03f73fd4e1d1d Author: Antonio Borneo <bor...@gm...> Date: Fri Aug 13 18:52:20 2021 +0200 cortex_m: fix command 'step address' The command 'step' accepts an optional parameter 'address' to run the step-by-step execution from an address different from current program counter. When OpenOCD sets the new program counter value in the register cache, it doesn't flag it as dirty. The following call to function armv7m_restore_context() does not propagate the new value of the program counter to the target. This cause the target to continue from the old program counter value, ignoring the user's request. It is hard to notice the issue if the target is halted in an idle loop! In fact the default mode to operate step-by-step is to set a breakpoint to the following instruction and resume execution. In the idle loop the CPU will pass through the breakpoint whatever the resume address is. User will find the target halting at the instruction following 'address' which is consistent with the expected behaviour of command 'step address'. To verify the issue on an STM32F4, use a dummy code in SRAM: halt mww 0x20000000 0xbf00bf00 mww 0x20000004 0xbf00bf00 mww 0x20000008 0xe7fcbf00 arm disassemble 0x20000000 6 0x20000000 bf00 nop 0x20000002 bf00 nop 0x20000004 bf00 nop +--> 0x20000006 bf00 nop | 0x20000008 bf00 nop +-<- 0x2000000a e7fc b #0x20000006 resume 0x20000006 halt step 0x20000000 the target doesn't halt because it is in the loop from 0x20000006 to 0x2000000a. The 'step 0x20000000' did not changed the program counter so the temporary breakpoint at 0x20000002 is never hit. Then: halt step 0x20000008 target halted ... ... pc: 0x2000000a gives the feeling that only the instruction at 0x20000008 has been executed, but actually the whole loop has been executed from the place 'halt' stopped the execution till the breakpoint at the instruction following 0x20000008. Flag the program counter cached value as 'valid' and 'dirty' to force armv7m_restore_context() to update the target's register. Change-Id: I49bd8bb95b2f5429ec38ed016f2ad706618ae68a Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6434 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index 9f035a093..f3c8527cf 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -975,8 +975,11 @@ static int cortex_m_step(struct target *target, int current, } /* current = 1: continue on current pc, otherwise continue at <address> */ - if (!current) + if (!current) { buf_set_u32(pc->value, 0, 32, address); + pc->dirty = true; + pc->valid = true; + } uint32_t pc_value = buf_get_u32(pc->value, 0, 32); ----------------------------------------------------------------------- Summary of changes: src/target/cortex_m.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-22 20:23:00
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 044e0f8c9aec9fe94d77199e64c813fb4336984b (commit) from 013a0e88d2a6e4626987e9fbe056ee1d40026933 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 044e0f8c9aec9fe94d77199e64c813fb4336984b Author: Antonio Borneo <bor...@gm...> Date: Thu Aug 19 16:07:21 2021 +0200 stlink: fix SWIM mode on stlink-v3 Commit 89f07325f2e7 ("stlink: Set speed before entering JTAG/SWD mode") anticipates setting the adapter speed just before entering in the JTAG/SWD mode. This to initiate the communication with the speed selected by the user. But SWIM doesn't allow setting the speed before entering in SWIM mode. The resulting error causes OpenOCD to quit. The problem only happens with stlink-v3, due to the different way to set the adapter speed on different stlink versions. Set the speed before entering in the mode only for JTAG and SWD modes. Change-Id: Iab42cd9d72ecfac14c7e17bae74e0dee2218b235 Signed-off-by: Antonio Borneo <bor...@gm...> Fixes: 89f07325f2e7 ("stlink: Set speed before entering JTAG/SWD mode") Reviewed-on: https://review.openocd.org/c/openocd/+/6443 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tar...@gm...> diff --git a/src/jtag/drivers/stlink_usb.c b/src/jtag/drivers/stlink_usb.c index 0e86dcd4a..2bbd03b6a 100644 --- a/src/jtag/drivers/stlink_usb.c +++ b/src/jtag/drivers/stlink_usb.c @@ -1626,7 +1626,8 @@ static int stlink_usb_init_mode(void *handle, bool connect_under_reset, int init } } - if (h->version.jtag_api == STLINK_JTAG_API_V3) { + if (h->version.jtag_api == STLINK_JTAG_API_V3 && + (emode == STLINK_MODE_DEBUG_JTAG || emode == STLINK_MODE_DEBUG_SWD)) { struct speed_map map[STLINK_V3_MAX_FREQ_NB]; stlink_get_com_freq(h, (emode == STLINK_MODE_DEBUG_JTAG), map); ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/stlink_usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-22 20:22:18
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 013a0e88d2a6e4626987e9fbe056ee1d40026933 (commit) from 085dd21a16c84874fddd76b07a995afae9af182a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 013a0e88d2a6e4626987e9fbe056ee1d40026933 Author: Sebastiaan de Schaetzen <seb...@gm...> Date: Tue Jul 27 15:06:57 2021 +0200 rtos/riot: fix out-of-bounds writes when target is corrupted This protects against out-of-bounds writes when the memory of RIOT's scheduler is corrupted. This memory can be corrupted because of: - Programming errors - The scheduler not yet having been initialised - An incorrect symbol file being used during debugging. This error can result in OpenOCD segfaulting. Valgrind was used to find the approximate location of the error. Change-Id: I60e7d7c245b8c4e38f4c98cb0c0347a9b5ec3177 Signed-off-by: Sebastiaan de Schaetzen <seb...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6381 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/rtos/riot.c b/src/rtos/riot.c index 1d53da2b0..8a3874202 100644 --- a/src/rtos/riot.c +++ b/src/rtos/riot.c @@ -118,7 +118,7 @@ const struct rtos_type riot_rtos = { static int riot_update_threads(struct rtos *rtos) { int retval; - unsigned int tasks_found = 0; + int tasks_found = 0; const struct riot_params *param; if (!rtos) @@ -170,7 +170,6 @@ static int riot_update_threads(struct rtos *rtos) riot_symbol_list[RIOT_NUM_THREADS].name); return retval; } - rtos->thread_count = thread_count; /* read the maximum number of threads */ uint8_t max_threads = 0; @@ -182,6 +181,11 @@ static int riot_update_threads(struct rtos *rtos) riot_symbol_list[RIOT_MAX_THREADS].name); return retval; } + if (thread_count > max_threads) { + LOG_ERROR("Thread count is invalid"); + return ERROR_FAIL; + } + rtos->thread_count = thread_count; /* Base address of thread array */ uint32_t threads_base = rtos->symbols[RIOT_THREADS_BASE].address; @@ -211,6 +215,9 @@ static int riot_update_threads(struct rtos *rtos) char buffer[32]; for (unsigned int i = 0; i < max_threads; i++) { + if (tasks_found == rtos->thread_count) + break; + /* get pointer to tcb_t */ uint32_t tcb_pointer = 0; retval = target_read_u32(rtos->target, ----------------------------------------------------------------------- Summary of changes: src/rtos/riot.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-22 20:21:43
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 085dd21a16c84874fddd76b07a995afae9af182a (commit) from cbc1dc50490ba7a98778bef352aead754befabca (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 085dd21a16c84874fddd76b07a995afae9af182a Author: Sebastiaan de Schaetzen <seb...@gm...> Date: Wed Aug 11 14:51:29 2021 +0200 rtos/riot: fix out-of-bounds read of optional symbols array This fixes an out-of-bounds read of the riot_optional_symbols array. Change-Id: I172ae182dd0c7dd68edaa66ac030030d9bc65401 Signed-off-by: Sebastiaan de Schaetzen <seb...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6428 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <and...@gm...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/rtos/riot.c b/src/rtos/riot.c index fb5d1b29d..1d53da2b0 100644 --- a/src/rtos/riot.c +++ b/src/rtos/riot.c @@ -91,19 +91,19 @@ enum riot_symbol_values { RIOT_NAME_OFFSET, }; -/* refer RIOT core/sched.c */ -static const char *const riot_symbol_list[] = { - "sched_threads", - "sched_num_threads", - "sched_active_pid", - "max_threads", - "_tcb_name_offset", - NULL +struct riot_symbol { + const char *const name; + bool optional; }; -/* Define which symbols are not mandatory */ -static const enum riot_symbol_values riot_optional_symbols[] = { - RIOT_NAME_OFFSET, +/* refer RIOT core/sched.c */ +static struct riot_symbol const riot_symbol_list[] = { + {"sched_threads", false}, + {"sched_num_threads", false}, + {"sched_active_pid", false}, + {"max_threads", false}, + {"_tcb_name_offset", true}, + {NULL, false} }; const struct rtos_type riot_rtos = { @@ -136,7 +136,7 @@ static int riot_update_threads(struct rtos *rtos) if (rtos->symbols[RIOT_THREADS_BASE].address == 0) { LOG_ERROR("Can't find symbol `%s`", - riot_symbol_list[RIOT_THREADS_BASE]); + riot_symbol_list[RIOT_THREADS_BASE].name); return ERROR_FAIL; } @@ -154,7 +154,7 @@ static int riot_update_threads(struct rtos *rtos) (uint16_t *)&active_pid); if (retval != ERROR_OK) { LOG_ERROR("Can't read symbol `%s`", - riot_symbol_list[RIOT_ACTIVE_PID]); + riot_symbol_list[RIOT_ACTIVE_PID].name); return retval; } rtos->current_thread = active_pid; @@ -167,7 +167,7 @@ static int riot_update_threads(struct rtos *rtos) (uint16_t *)&thread_count); if (retval != ERROR_OK) { LOG_ERROR("Can't read symbol `%s`", - riot_symbol_list[RIOT_NUM_THREADS]); + riot_symbol_list[RIOT_NUM_THREADS].name); return retval; } rtos->thread_count = thread_count; @@ -179,7 +179,7 @@ static int riot_update_threads(struct rtos *rtos) &max_threads); if (retval != ERROR_OK) { LOG_ERROR("Can't read symbol `%s`", - riot_symbol_list[RIOT_MAX_THREADS]); + riot_symbol_list[RIOT_MAX_THREADS].name); return retval; } @@ -195,7 +195,7 @@ static int riot_update_threads(struct rtos *rtos) &name_offset); if (retval != ERROR_OK) { LOG_ERROR("Can't read symbol `%s`", - riot_symbol_list[RIOT_NAME_OFFSET]); + riot_symbol_list[RIOT_NAME_OFFSET].name); return retval; } } @@ -217,7 +217,8 @@ static int riot_update_threads(struct rtos *rtos) threads_base + (i * 4), &tcb_pointer); if (retval != ERROR_OK) { - LOG_ERROR("Can't parse `%s`", riot_symbol_list[RIOT_THREADS_BASE]); + LOG_ERROR("Can't parse `%s`", + riot_symbol_list[RIOT_THREADS_BASE].name); goto error; } @@ -235,7 +236,8 @@ static int riot_update_threads(struct rtos *rtos) tcb_pointer + param->thread_status_offset, &status); if (retval != ERROR_OK) { - LOG_ERROR("Can't parse `%s`", riot_symbol_list[RIOT_THREADS_BASE]); + LOG_ERROR("Can't parse `%s`", + riot_symbol_list[RIOT_THREADS_BASE].name); goto error; } @@ -269,7 +271,7 @@ static int riot_update_threads(struct rtos *rtos) &name_pointer); if (retval != ERROR_OK) { LOG_ERROR("Can't parse `%s`", - riot_symbol_list[RIOT_THREADS_BASE]); + riot_symbol_list[RIOT_THREADS_BASE].name); goto error; } @@ -280,7 +282,7 @@ static int riot_update_threads(struct rtos *rtos) (uint8_t *)&buffer); if (retval != ERROR_OK) { LOG_ERROR("Can't parse `%s`", - riot_symbol_list[RIOT_THREADS_BASE]); + riot_symbol_list[RIOT_THREADS_BASE].name); goto error; } @@ -339,7 +341,7 @@ static int riot_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, threads_base + (thread_id * 4), &tcb_pointer); if (retval != ERROR_OK) { - LOG_ERROR("Can't parse `%s`", riot_symbol_list[RIOT_THREADS_BASE]); + LOG_ERROR("Can't parse `%s`", riot_symbol_list[RIOT_THREADS_BASE].name); return retval; } @@ -349,7 +351,7 @@ static int riot_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, tcb_pointer + param->thread_sp_offset, &stackptr); if (retval != ERROR_OK) { - LOG_ERROR("Can't parse `%s`", riot_symbol_list[RIOT_THREADS_BASE]); + LOG_ERROR("Can't parse `%s`", riot_symbol_list[RIOT_THREADS_BASE].name); return retval; } @@ -370,16 +372,8 @@ static int riot_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[ } for (unsigned int i = 0; i < ARRAY_SIZE(riot_symbol_list); i++) { - (*symbol_list)[i].symbol_name = riot_symbol_list[i]; - (*symbol_list)[i].optional = false; - - /* Lookup if symbol is optional */ - for (unsigned int k = 0; k < sizeof(riot_optional_symbols); k++) { - if (i == riot_optional_symbols[k]) { - (*symbol_list)[i].optional = true; - break; - } - } + (*symbol_list)[i].symbol_name = riot_symbol_list[i].name; + (*symbol_list)[i].optional = riot_symbol_list[i].optional; } return ERROR_OK; ----------------------------------------------------------------------- Summary of changes: src/rtos/riot.c | 58 ++++++++++++++++++++++++++------------------------------- 1 file changed, 26 insertions(+), 32 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-22 13:19:41
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via cbc1dc50490ba7a98778bef352aead754befabca (commit) from 3caa18729cde415519824b4f9da16df40c125539 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit cbc1dc50490ba7a98778bef352aead754befabca Author: Tarek BOCHKATI <tar...@gm...> Date: Thu Jul 29 23:46:31 2021 +0100 flash/atsame5: use COMMAND_PARSE_NUMBER in command handlers the usage of COMMAND_PARSE_NUMBER is safer in COMMAND_HANDLERs since it provides better error checking than strto** functions. Change-Id: Ia7fe9c4017108616f21676f115f151ac62924205 Signed-off-by: Tarek BOCHKATI <tar...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6423 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/src/flash/nor/atsame5.c b/src/flash/nor/atsame5.c index 7c7e5d0f0..203c470ca 100644 --- a/src/flash/nor/atsame5.c +++ b/src/flash/nor/atsame5.c @@ -797,11 +797,12 @@ COMMAND_HANDLER(same5_handle_userpage_command) } if (CMD_ARGC >= 1) { - uint64_t mask = NVMUSERROW_SAM_E5_D5_MASK; - uint64_t value = strtoull(CMD_ARGV[0], NULL, 0); + uint64_t value, mask = NVMUSERROW_SAM_E5_D5_MASK; + COMMAND_PARSE_NUMBER(u64, CMD_ARGV[0], value); if (CMD_ARGC == 2) { - uint64_t mask_temp = strtoull(CMD_ARGV[1], NULL, 0); + uint64_t mask_temp; + COMMAND_PARSE_NUMBER(u64, CMD_ARGV[1], mask_temp); mask &= mask_temp; } @@ -837,7 +838,9 @@ COMMAND_HANDLER(same5_handle_bootloader_command) return ERROR_FAIL; if (CMD_ARGC >= 1) { - unsigned long size = strtoul(CMD_ARGV[0], NULL, 0); + unsigned long size; + + COMMAND_PARSE_NUMBER(ulong, CMD_ARGV[0], size); uint32_t code = (size + 8191) / 8192; if (code > 15) { command_print(CMD, "Invalid bootloader size. Please " ----------------------------------------------------------------------- Summary of changes: src/flash/nor/atsame5.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-22 13:19:18
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 3caa18729cde415519824b4f9da16df40c125539 (commit) via 01da8f6c2a8295a0f169d3da28b9a411fb2ef0bd (commit) from dd0ee1fa5b88a4e5015aae6d9527e97bec7f5bc5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3caa18729cde415519824b4f9da16df40c125539 Author: Tarek BOCHKATI <tar...@gm...> Date: Thu Jul 29 23:46:09 2021 +0100 flash/kinetis: use COMMAND_PARSE_NUMBER in command handlers the usage of COMMAND_PARSE_NUMBER is safer in COMMAND_HANDLERs since it provides better error checking than strto** functions. Change-Id: I972da1a75ba7c41c1b714c2429289c3d24594235 Signed-off-by: Tarek BOCHKATI <tar...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6422 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/src/flash/nor/kinetis.c b/src/flash/nor/kinetis.c index c99f881e8..3aa4c6bb5 100644 --- a/src/flash/nor/kinetis.c +++ b/src/flash/nor/kinetis.c @@ -2890,7 +2890,7 @@ COMMAND_HANDLER(kinetis_nvm_partition) else if (strcmp(CMD_ARGV[0], "eebkp") == 0) sz_type = EEBKP_SIZE; - par = strtoul(CMD_ARGV[1], NULL, 10); + COMMAND_PARSE_NUMBER(ulong, CMD_ARGV[1], par); while (par >> (log2 + 3)) log2++; } @@ -2945,11 +2945,13 @@ COMMAND_HANDLER(kinetis_nvm_partition) break; } - if (CMD_ARGC == 3) - ee1 = ee2 = strtoul(CMD_ARGV[2], NULL, 10) / 2; - else if (CMD_ARGC >= 4) { - ee1 = strtoul(CMD_ARGV[2], NULL, 10); - ee2 = strtoul(CMD_ARGV[3], NULL, 10); + if (CMD_ARGC == 3) { + unsigned long eex; + COMMAND_PARSE_NUMBER(ulong, CMD_ARGV[2], eex); + ee1 = ee2 = eex / 2; + } else if (CMD_ARGC >= 4) { + COMMAND_PARSE_NUMBER(ulong, CMD_ARGV[2], ee1); + COMMAND_PARSE_NUMBER(ulong, CMD_ARGV[3], ee2); } enable = ee1 + ee2 > 0; @@ -3044,7 +3046,7 @@ COMMAND_HANDLER(kinetis_fopt_handler) return ERROR_COMMAND_SYNTAX_ERROR; if (CMD_ARGC == 1) { - fcf_fopt = (uint8_t)strtoul(CMD_ARGV[0], NULL, 0); + COMMAND_PARSE_NUMBER(u8, CMD_ARGV[0], fcf_fopt); } else { command_print(CMD, "FCF_FOPT 0x%02" PRIx8, fcf_fopt); } commit 01da8f6c2a8295a0f169d3da28b9a411fb2ef0bd Author: Tarek BOCHKATI <tar...@gm...> Date: Thu Jul 29 23:45:38 2021 +0100 flash/xmc4xxx: use COMMAND_PARSE_NUMBER in command handlers the usage of COMMAND_PARSE_NUMBER is safer in COMMAND_HANDLERs since it provides better error checking than strto** functions. Change-Id: Ibfe95ce73f147f467de8de23e9573ef0179aed96 Signed-off-by: Tarek BOCHKATI <tar...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6421 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/src/flash/nor/xmc4xxx.c b/src/flash/nor/xmc4xxx.c index bd37537cc..1668e8993 100644 --- a/src/flash/nor/xmc4xxx.c +++ b/src/flash/nor/xmc4xxx.c @@ -1268,12 +1268,12 @@ COMMAND_HANDLER(xmc4xxx_handle_flash_password_command) errno = 0; /* We skip over the flash bank */ - fb->pw1 = strtol(CMD_ARGV[1], NULL, 16); + COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], fb->pw1); if (errno) return ERROR_COMMAND_SYNTAX_ERROR; - fb->pw2 = strtol(CMD_ARGV[2], NULL, 16); + COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], fb->pw2); if (errno) return ERROR_COMMAND_SYNTAX_ERROR; ----------------------------------------------------------------------- Summary of changes: src/flash/nor/kinetis.c | 16 +++++++++------- src/flash/nor/xmc4xxx.c | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-22 13:15:55
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via dd0ee1fa5b88a4e5015aae6d9527e97bec7f5bc5 (commit) from 277b0a5d9770fcf12a6b630df5ffc26f242edf80 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit dd0ee1fa5b88a4e5015aae6d9527e97bec7f5bc5 Author: Tarek BOCHKATI <tar...@gm...> Date: Thu Jul 29 23:47:07 2021 +0100 flash/at91samd: use COMMAND_PARSE_NUMBER in command handlers the usage of COMMAND_PARSE_NUMBER is safer in COMMAND_HANDLERs since it provides better error checking than strto** functions. Change-Id: I14061cb48da6bac13f9d2896190136f5784b8c07 Signed-off-by: Tarek BOCHKATI <tar...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6424 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/flash/nor/at91samd.c b/src/flash/nor/at91samd.c index 76c08d7b5..d4ac4c998 100644 --- a/src/flash/nor/at91samd.c +++ b/src/flash/nor/at91samd.c @@ -1051,31 +1051,6 @@ COMMAND_HANDLER(samd_handle_eeprom_command) return res; } -static COMMAND_HELPER(get_u64_from_hexarg, unsigned int num, uint64_t *value) -{ - if (num >= CMD_ARGC) { - command_print(CMD, "Too few Arguments."); - return ERROR_COMMAND_SYNTAX_ERROR; - } - - if (strlen(CMD_ARGV[num]) >= 3 && - CMD_ARGV[num][0] == '0' && - CMD_ARGV[num][1] == 'x') { - char *check = NULL; - *value = strtoull(&(CMD_ARGV[num][2]), &check, 16); - if ((value == 0 && errno == ERANGE) || - !check || *check != 0) { - command_print(CMD, "Invalid 64-bit hex value in argument %d.", - num + 1); - return ERROR_COMMAND_SYNTAX_ERROR; - } - } else { - command_print(CMD, "Argument %d needs to be a hex value.", num + 1); - return ERROR_COMMAND_SYNTAX_ERROR; - } - return ERROR_OK; -} - COMMAND_HANDLER(samd_handle_nvmuserrow_command) { int res = ERROR_OK; @@ -1102,14 +1077,12 @@ COMMAND_HANDLER(samd_handle_nvmuserrow_command) mask &= NVMUSERROW_LOCKBIT_MASK; uint64_t value; - res = CALL_COMMAND_HANDLER(get_u64_from_hexarg, 0, &value); - if (res != ERROR_OK) - return res; + COMMAND_PARSE_NUMBER(u64, CMD_ARGV[0], value); + if (CMD_ARGC == 2) { uint64_t mask_temp; - res = CALL_COMMAND_HANDLER(get_u64_from_hexarg, 1, &mask_temp); - if (res != ERROR_OK) - return res; + COMMAND_PARSE_NUMBER(u64, CMD_ARGV[1], mask_temp); + mask &= mask_temp; } res = samd_modify_user_row_masked(target, value, mask); ----------------------------------------------------------------------- Summary of changes: src/flash/nor/at91samd.c | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-22 11:11:21
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 277b0a5d9770fcf12a6b630df5ffc26f242edf80 (commit) from 91b5626e7fa7f30b1c5c8b69cf1decf33e892c42 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 277b0a5d9770fcf12a6b630df5ffc26f242edf80 Author: Tarek BOCHKATI <tar...@gm...> Date: Thu Jul 29 23:44:36 2021 +0100 jtag/cmcis_dap: use COMMAND_PARSE_NUMBER in command handlers the usage of COMMAND_PARSE_NUMBER is safer in COMMAND_HANDLERs since it provides better error checking than strto** functions. Change-Id: Ife9342c6088a241a0a4b77f9bd21f12c9b9862a0 Signed-off-by: Tarek BOCHKATI <tar...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6420 Reviewed-by: Adrian M Negreanu <adr...@nx...> Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/src/jtag/drivers/cmsis_dap.c b/src/jtag/drivers/cmsis_dap.c index 06d5c6962..9bd4cb73a 100644 --- a/src/jtag/drivers/cmsis_dap.c +++ b/src/jtag/drivers/cmsis_dap.c @@ -2004,7 +2004,7 @@ COMMAND_HANDLER(cmsis_dap_handle_cmd_command) uint8_t *command = cmsis_dap_handle->command; for (unsigned i = 0; i < CMD_ARGC; i++) - command[i] = strtoul(CMD_ARGV[i], NULL, 16); + COMMAND_PARSE_NUMBER(u8, CMD_ARGV[i], command[i]); int retval = cmsis_dap_xfer(cmsis_dap_handle, CMD_ARGC); diff --git a/src/jtag/drivers/cmsis_dap_usb_bulk.c b/src/jtag/drivers/cmsis_dap_usb_bulk.c index cb3e02fe2..26c6784f9 100644 --- a/src/jtag/drivers/cmsis_dap_usb_bulk.c +++ b/src/jtag/drivers/cmsis_dap_usb_bulk.c @@ -464,7 +464,7 @@ static int cmsis_dap_usb_alloc(struct cmsis_dap *dap, unsigned int pkt_sz) COMMAND_HANDLER(cmsis_dap_handle_usb_interface_command) { if (CMD_ARGC == 1) - cmsis_dap_usb_interface = strtoul(CMD_ARGV[0], NULL, 10); + COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], cmsis_dap_usb_interface); else LOG_ERROR("expected exactly one argument to cmsis_dap_usb_interface <interface_number>"); ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/cmsis_dap.c | 2 +- src/jtag/drivers/cmsis_dap_usb_bulk.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-22 10:46:34
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 91b5626e7fa7f30b1c5c8b69cf1decf33e892c42 (commit) from 88c3e767b29b2aeec6f9290cfb9efb749b4d6f82 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 91b5626e7fa7f30b1c5c8b69cf1decf33e892c42 Author: Tarek BOCHKATI <tar...@gm...> Date: Thu Jul 29 22:05:18 2021 +0100 flash/stm32l4x: use COMMAND_PARSE_NUMBER in command handlers the usage of COMMAND_PARSE_NUMBER is safer in COMMAND_HANDLERs since it provides better error checking than strto** functions. Change-Id: I7e113b06b74f2d8d9cc4c0ce1957994a1c49c964 Signed-off-by: Tarek BOCHKATI <tar...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6419 Reviewed-by: Antonio Borneo <bor...@gm...> Reviewed-by: Paul Fertser <fer...@gm...> Tested-by: jenkins diff --git a/src/flash/nor/stm32l4x.c b/src/flash/nor/stm32l4x.c index 7d6c90028..d770cdfa5 100644 --- a/src/flash/nor/stm32l4x.c +++ b/src/flash/nor/stm32l4x.c @@ -1734,7 +1734,7 @@ COMMAND_HANDLER(stm32l4_handle_option_read_command) uint32_t reg_offset, reg_addr; uint32_t value = 0; - reg_offset = strtoul(CMD_ARGV[1], NULL, 16); + COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], reg_offset); reg_addr = stm32l4_get_flash_reg(bank, reg_offset); retval = stm32l4_read_flash_reg(bank, reg_offset, &value); @@ -1762,10 +1762,11 @@ COMMAND_HANDLER(stm32l4_handle_option_write_command) uint32_t value = 0; uint32_t mask = 0xFFFFFFFF; - reg_offset = strtoul(CMD_ARGV[1], NULL, 16); - value = strtoul(CMD_ARGV[2], NULL, 16); + COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], reg_offset); + COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], value); + if (CMD_ARGC > 3) - mask = strtoul(CMD_ARGV[3], NULL, 16); + COMMAND_PARSE_NUMBER(u32, CMD_ARGV[3], mask); command_print(CMD, "%s Option written.\n" "INFO: a reset or power cycle is required " ----------------------------------------------------------------------- Summary of changes: src/flash/nor/stm32l4x.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-22 08:49:19
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 88c3e767b29b2aeec6f9290cfb9efb749b4d6f82 (commit) from 53556fcded056aa62ffdc6bf0c97bff87d891dab (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 88c3e767b29b2aeec6f9290cfb9efb749b4d6f82 Author: Tarek BOCHKATI <tar...@gm...> Date: Wed Jul 28 10:48:59 2021 +0100 github/workflow: disable libusb static link for windows build Current github build for windows is using dynamic libraries, but libftdi is requiring libusb static libraries. As a quick solution, just get rid of libftdi till it can be linked without static libusb. Change-Id: I9c7cb0b8853459ca48589674498403e255ade5cc Reported-by: Xiaofan <xia...@gm...> Signed-off-by: Tarek BOCHKATI <tar...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6384 Reviewed-by: Xiaofan <xia...@gm...> Reviewed-by: Paul Fertser <fer...@gm...> Tested-by: jenkins diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 81e3a78bd..96a2d34f2 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -38,14 +38,6 @@ jobs: cd hidapi-hidapi-${HIDAPI_VER} ./bootstrap echo "HIDAPI_SRC=$PWD" >> $GITHUB_ENV - - name: Prepare libftdi - env: - LIBFTDI_VER: 1.5 - run: | - mkdir -p $DL_DIR && cd $DL_DIR - wget "http://www.intra2net.com/en/developer/libftdi/download/libftdi1-${LIBFTDI_VER}.tar.bz2" - tar -xjf libftdi1-${LIBFTDI_VER}.tar.bz2 - echo "LIBFTDI_SRC=$PWD/libftdi1-${LIBFTDI_VER}" >> $GITHUB_ENV - name: Prepare capstone env: CAPSTONE_VER: 4.0.2 @@ -60,9 +52,8 @@ jobs: env: MAKE_JOBS: 2 HOST: i686-w64-mingw32 - LIBUSB1_CONFIG: --enable-shared --enable-static + LIBUSB1_CONFIG: --enable-shared --disable-static HIDAPI_CONFIG: --enable-shared --disable-static --disable-testgui - LIBFTDI_CONFIG: "-DCMAKE_TOOLCHAIN_FILE='${{ env.LIBFTDI_SRC }}/cmake/Toolchain-i686-w64-mingw32.cmake' -DBUILD_TESTS:BOOL=off -DFTDIPP:BOOL=off -DPYTHON_BINDINGS:BOOL=off -DEXAMPLES:BOOL=off -DDOCUMENTATION:BOOL=off -DFTDI_EEPROM:BOOL=off" CAPSTONE_CONFIG: "CAPSTONE_BUILD_CORE_ONLY=yes CAPSTONE_STATIC=yes CAPSTONE_SHARED=no" run: | # check if there is tag pointing at HEAD, otherwise take the HEAD SHA-1 as OPENOCD_TAG ----------------------------------------------------------------------- Summary of changes: .github/workflows/snapshot.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-14 12:39:12
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 53556fcded056aa62ffdc6bf0c97bff87d891dab (commit) from 186ed3311d061ba0237cb8889f9673366717fbf1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 53556fcded056aa62ffdc6bf0c97bff87d891dab Author: Ranjith Chandran <ran...@as...> Date: Fri Jul 23 10:21:05 2021 +0530 tcl/interface: add Ashling Opella-LD FTDI config files Adding Ashling's FTDI based Debug adapter Opella-LD's JTAG and SWD config files Change-Id: Ie0e82e3b8326de37641901f5c825372cab31de58 Signed-off-by: ran...@as... Reviewed-on: http://openocd.zylin.com/6379 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tar...@gm...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/contrib/60-openocd.rules b/contrib/60-openocd.rules index 1829f076c..8e2fd4665 100644 --- a/contrib/60-openocd.rules +++ b/contrib/60-openocd.rules @@ -125,6 +125,9 @@ ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6001", MODE="660", GROUP="plugdev", ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6010", MODE="660", GROUP="plugdev", TAG+="uaccess" ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6810", MODE="660", GROUP="plugdev", TAG+="uaccess" +# Ashling Opella-LD +ATTRS{idVendor}=="0B6B", ATTRS{idProduct}=="0040", MODE="660", GROUP="plugdev", TAG+="uaccess" + # Amontec JTAGkey-HiSpeed ATTRS{idVendor}=="0fbb", ATTRS{idProduct}=="1000", MODE="660", GROUP="plugdev", TAG+="uaccess" diff --git a/tcl/interface/ftdi/ashling-opella-ld-jtag.cfg b/tcl/interface/ftdi/ashling-opella-ld-jtag.cfg new file mode 100755 index 000000000..6256aa0c2 --- /dev/null +++ b/tcl/interface/ftdi/ashling-opella-ld-jtag.cfg @@ -0,0 +1,20 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# Ashling Opella-LD +# +# https://www.ashling.com/Opella-LD/ +# + +adapter driver ftdi +ftdi device_desc "Opella-LD Debug Probe" +ftdi vid_pid 0x0B6B 0x0040 +ftdi tdo_sample_edge falling +ftdi layout_init 0x0A68 0xFF7B +ftdi channel 0 +ftdi layout_signal JTAGOE -ndata 0x0010 +ftdi layout_signal nTRST -data 0x0020 +ftdi layout_signal nSRST -data 0x0040 +ftdi layout_signal SWD_EN -data 0x0100 +ftdi layout_signal SWDIO_OE -data 0x0200 +ftdi layout_signal LED -ndata 0x0800 +transport select jtag diff --git a/tcl/interface/ftdi/ashling-opella-ld-swd.cfg b/tcl/interface/ftdi/ashling-opella-ld-swd.cfg new file mode 100755 index 000000000..4a4e4e068 --- /dev/null +++ b/tcl/interface/ftdi/ashling-opella-ld-swd.cfg @@ -0,0 +1,19 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# Ashling Opella-LD +# +# https://www.ashling.com/Opella-LD/ +# + +adapter driver ftdi +ftdi device_desc "Opella-LD Debug Probe" +ftdi vid_pid 0x0B6B 0x0040 +ftdi layout_init 0x0860 0x0b7b +ftdi channel 0 +ftdi layout_signal JTAGOE -data 0x0010 +ftdi layout_signal nTRST -data 0x0020 +ftdi layout_signal nSRST -data 0x0040 +ftdi layout_signal SWD_EN -data 0x0100 +ftdi layout_signal SWDIO_OE -data 0x0200 +ftdi layout_signal LED -ndata 0x0800 +transport select swd ----------------------------------------------------------------------- Summary of changes: contrib/60-openocd.rules | 3 +++ tcl/interface/ftdi/ashling-opella-ld-jtag.cfg | 20 ++++++++++++++++++++ tcl/interface/ftdi/ashling-opella-ld-swd.cfg | 19 +++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100755 tcl/interface/ftdi/ashling-opella-ld-jtag.cfg create mode 100755 tcl/interface/ftdi/ashling-opella-ld-swd.cfg hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-14 12:38:30
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 186ed3311d061ba0237cb8889f9673366717fbf1 (commit) via ae5c438b001ae8d57055e2c1ff0829eee108cfbc (commit) via 1549bad5b3de2c64b106475cfc23cfbccba2b8a3 (commit) via cba3bb6f2a736414f86a0e26d3ac8b91551b1574 (commit) via e53f1c907a9ab16eba320d295db4d68d4b607cc1 (commit) from 8399cbc9584985c2b9e4aafb3a6afdb17df89b7f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 186ed3311d061ba0237cb8889f9673366717fbf1 Author: Marc Schink <de...@za...> Date: Sun Aug 1 14:20:22 2021 +0200 drivers/ft232r: Group adapter commands Use a command group 'ft232r' with subcommands instead of individual commands with 'ft232r_' prefix. The old commands are still available for backward compatibility but marked as deprecated. Change-Id: I0dbeb4716330c83f8ce89b0d054eb0286b887bdf Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6409 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 40f4ab284..340e6b65b 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2632,47 +2632,47 @@ FT232R These interfaces have several commands, used to configure the driver before initializing the JTAG scan chain: -@deffn {Config Command} {ft232r_vid_pid} @var{vid} @var{pid} +@deffn {Config Command} {ft232r vid_pid} @var{vid} @var{pid} The vendor ID and product ID of the adapter. If not specified, default 0x0403:0x6001 is used. @end deffn -@deffn {Config Command} {ft232r_serial_desc} @var{serial} +@deffn {Config Command} {ft232r serial_desc} @var{serial} Specifies the @var{serial} of the adapter to use, in case the vendor provides unique IDs and more than one adapter is connected to the host. If not specified, serial numbers are not considered. @end deffn -@deffn {Config Command} {ft232r_jtag_nums} @var{tck} @var{tms} @var{tdi} @var{tdo} +@deffn {Config Command} {ft232r jtag_nums} @var{tck} @var{tms} @var{tdi} @var{tdo} Set four JTAG GPIO numbers at once. If not specified, default 0 3 1 2 or TXD CTS RXD RTS is used. @end deffn -@deffn {Config Command} {ft232r_tck_num} @var{tck} +@deffn {Config Command} {ft232r tck_num} @var{tck} Set TCK GPIO number. If not specified, default 0 or TXD is used. @end deffn -@deffn {Config Command} {ft232r_tms_num} @var{tms} +@deffn {Config Command} {ft232r tms_num} @var{tms} Set TMS GPIO number. If not specified, default 3 or CTS is used. @end deffn -@deffn {Config Command} {ft232r_tdi_num} @var{tdi} +@deffn {Config Command} {ft232r tdi_num} @var{tdi} Set TDI GPIO number. If not specified, default 1 or RXD is used. @end deffn -@deffn {Config Command} {ft232r_tdo_num} @var{tdo} +@deffn {Config Command} {ft232r tdo_num} @var{tdo} Set TDO GPIO number. If not specified, default 2 or RTS is used. @end deffn -@deffn {Config Command} {ft232r_trst_num} @var{trst} +@deffn {Config Command} {ft232r trst_num} @var{trst} Set TRST GPIO number. If not specified, default 4 or DTR is used. @end deffn -@deffn {Config Command} {ft232r_srst_num} @var{srst} +@deffn {Config Command} {ft232r srst_num} @var{srst} Set SRST GPIO number. If not specified, default 6 or DCD is used. @end deffn -@deffn {Config Command} {ft232r_restore_serial} @var{word} +@deffn {Config Command} {ft232r restore_serial} @var{word} Restore serial port after JTAG. This USB bitmode control word (16-bit) will be sent before quit. Lower byte should set GPIO direction register to a "sane" state: diff --git a/src/jtag/drivers/ft232r.c b/src/jtag/drivers/ft232r.c index 3c0292561..22c0fe5dd 100644 --- a/src/jtag/drivers/ft232r.c +++ b/src/jtag/drivers/ft232r.c @@ -560,72 +560,72 @@ COMMAND_HANDLER(ft232r_handle_restore_serial_command) return ERROR_OK; } -static const struct command_registration ft232r_command_handlers[] = { +static const struct command_registration ft232r_subcommand_handlers[] = { { - .name = "ft232r_serial_desc", + .name = "serial_desc", .handler = ft232r_handle_serial_desc_command, .mode = COMMAND_CONFIG, .help = "USB serial descriptor of the adapter", .usage = "serial string", }, { - .name = "ft232r_vid_pid", + .name = "vid_pid", .handler = ft232r_handle_vid_pid_command, .mode = COMMAND_CONFIG, .help = "USB VID and PID of the adapter", .usage = "vid pid", }, { - .name = "ft232r_jtag_nums", + .name = "jtag_nums", .handler = ft232r_handle_jtag_nums_command, .mode = COMMAND_CONFIG, .help = "gpio numbers for tck, tms, tdi, tdo. (in that order)", .usage = "<0-7|TXD-RI> <0-7|TXD-RI> <0-7|TXD-RI> <0-7|TXD-RI>", }, { - .name = "ft232r_tck_num", + .name = "tck_num", .handler = ft232r_handle_tck_num_command, .mode = COMMAND_CONFIG, .help = "gpio number for tck.", .usage = "<0-7|TXD|RXD|RTS|CTS|DTR|DSR|DCD|RI>", }, { - .name = "ft232r_tms_num", + .name = "tms_num", .handler = ft232r_handle_tms_num_command, .mode = COMMAND_CONFIG, .help = "gpio number for tms.", .usage = "<0-7|TXD|RXD|RTS|CTS|DTR|DSR|DCD|RI>", }, { - .name = "ft232r_tdo_num", + .name = "tdo_num", .handler = ft232r_handle_tdo_num_command, .mode = COMMAND_CONFIG, .help = "gpio number for tdo.", .usage = "<0-7|TXD|RXD|RTS|CTS|DTR|DSR|DCD|RI>", }, { - .name = "ft232r_tdi_num", + .name = "tdi_num", .handler = ft232r_handle_tdi_num_command, .mode = COMMAND_CONFIG, .help = "gpio number for tdi.", .usage = "<0-7|TXD|RXD|RTS|CTS|DTR|DSR|DCD|RI>", }, { - .name = "ft232r_srst_num", + .name = "srst_num", .handler = ft232r_handle_srst_num_command, .mode = COMMAND_CONFIG, .help = "gpio number for srst.", .usage = "<0-7|TXD|RXD|RTS|CTS|DTR|DSR|DCD|RI>", }, { - .name = "ft232r_trst_num", + .name = "trst_num", .handler = ft232r_handle_trst_num_command, .mode = COMMAND_CONFIG, .help = "gpio number for trst.", .usage = "<0-7|TXD|RXD|RTS|CTS|DTR|DSR|DCD|RI>", }, { - .name = "ft232r_restore_serial", + .name = "restore_serial", .handler = ft232r_handle_restore_serial_command, .mode = COMMAND_CONFIG, .help = "bitmode control word that restores serial port.", @@ -634,6 +634,17 @@ static const struct command_registration ft232r_command_handlers[] = { COMMAND_REGISTRATION_DONE }; +static const struct command_registration ft232r_command_handlers[] = { + { + .name = "ft232r", + .mode = COMMAND_ANY, + .help = "perform ft232r management", + .chain = ft232r_subcommand_handlers, + .usage = "", + }, + COMMAND_REGISTRATION_DONE +}; + /* * Synchronous bitbang protocol implementation. */ diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 5763310f4..d5b2ae221 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -675,4 +675,64 @@ proc usb_blaster_firmware args { eval usb_blaster firmware $args } +lappend _telnet_autocomplete_skip ft232r_serial_desc +proc ft232r_serial_desc args { + echo "DEPRECATED! use 'ft232r serial_desc' not 'ft232r_serial_desc'" + eval ft232r serial_desc $args +} + +lappend _telnet_autocomplete_skip ft232r_vid_pid +proc ft232r_vid_pid args { + echo "DEPRECATED! use 'ft232r vid_pid' not 'ft232r_vid_pid'" + eval ft232r vid_pid $args +} + +lappend _telnet_autocomplete_skip ft232r_jtag_nums +proc ft232r_jtag_nums args { + echo "DEPRECATED! use 'ft232r jtag_nums' not 'ft232r_jtag_nums'" + eval ft232r jtag_nums $args +} + +lappend _telnet_autocomplete_skip ft232r_tck_num +proc ft232r_tck_num args { + echo "DEPRECATED! use 'ft232r tck_num' not 'ft232r_tck_num'" + eval ft232r tck_num $args +} + +lappend _telnet_autocomplete_skip ft232r_tms_num +proc ft232r_tms_num args { + echo "DEPRECATED! use 'ft232r tms_num' not 'ft232r_tms_num'" + eval ft232r tms_num $args +} + +lappend _telnet_autocomplete_skip ft232r_tdo_num +proc ft232r_tdo_num args { + echo "DEPRECATED! use 'ft232r tdo_num' not 'ft232r_tdo_num'" + eval ft232r tdo_num $args +} + +lappend _telnet_autocomplete_skip ft232r_tdi_num +proc ft232r_tdi_num args { + echo "DEPRECATED! use 'ft232r tdi_num' not 'ft232r_tdi_num'" + eval ft232r tdi_num $args +} + +lappend _telnet_autocomplete_skip ft232r_srst_num +proc ft232r_srst_num args { + echo "DEPRECATED! use 'ft232r srst_num' not 'ft232r_srst_num'" + eval ft232r srst_num $args +} + +lappend _telnet_autocomplete_skip ft232r_trst_num +proc ft232r_trst_num args { + echo "DEPRECATED! use 'ft232r trst_num' not 'ft232r_trst_num'" + eval ft232r trst_num $args +} + +lappend _telnet_autocomplete_skip ft232r_restore_serial +proc ft232r_restore_serial args { + echo "DEPRECATED! use 'ft232r restore_serial' not 'ft232r_restore_serial'" + eval ft232r restore_serial $args +} + # END MIGRATION AIDS commit ae5c438b001ae8d57055e2c1ff0829eee108cfbc Author: Marc Schink <de...@za...> Date: Sun Aug 1 14:15:06 2021 +0200 tcl: Adapt config files to new usb_blaster command syntax Change-Id: I4eb645f74ef31fc0b5882299b3487020aa142dd8 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6408 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/tcl/board/altera_sockit.cfg b/tcl/board/altera_sockit.cfg index b7c7993fe..4d10aef7b 100644 --- a/tcl/board/altera_sockit.cfg +++ b/tcl/board/altera_sockit.cfg @@ -12,7 +12,7 @@ adapter driver usb_blaster source [find target/altera_fpgasoc.cfg] # If the USB Blaster II were supported, these settings would be needed -#usb_blaster_vid_pid 0x09fb 0x6810 -#usb_blaster_device_desc "USB-Blaster II" +#usb_blaster vid_pid 0x09fb 0x6810 +#usb_blaster device_desc "USB-Blaster II" adapter speed 100 diff --git a/tcl/board/reflexces_achilles_i-dev_kit_arria10.cfg b/tcl/board/reflexces_achilles_i-dev_kit_arria10.cfg index a6e80650e..c9f8d3695 100644 --- a/tcl/board/reflexces_achilles_i-dev_kit_arria10.cfg +++ b/tcl/board/reflexces_achilles_i-dev_kit_arria10.cfg @@ -6,7 +6,7 @@ if { [info exists USE_EXTERNAL_DEBUGGER] } { echo "Using external debugger" } else { source [find interface/altera-usb-blaster2.cfg] - usb_blaster_device_desc "Arria10 IDK" + usb_blaster device_desc "Arria10 IDK" } source [find fpga/altera-10m50.cfg] diff --git a/tcl/interface/altera-usb-blaster.cfg b/tcl/interface/altera-usb-blaster.cfg index 84e77b13c..cb4ca9a78 100644 --- a/tcl/interface/altera-usb-blaster.cfg +++ b/tcl/interface/altera-usb-blaster.cfg @@ -5,7 +5,7 @@ # adapter driver usb_blaster -usb_blaster_lowlevel_driver ftdi +usb_blaster lowlevel_driver ftdi # These are already the defaults. -# usb_blaster_vid_pid 0x09FB 0x6001 -# usb_blaster_device_desc "USB-Blaster" +# usb_blaster vid_pid 0x09FB 0x6001 +# usb_blaster device_desc "USB-Blaster" diff --git a/tcl/interface/altera-usb-blaster2.cfg b/tcl/interface/altera-usb-blaster2.cfg index 4642b1dcf..05b0519b8 100644 --- a/tcl/interface/altera-usb-blaster2.cfg +++ b/tcl/interface/altera-usb-blaster2.cfg @@ -3,6 +3,6 @@ # adapter driver usb_blaster -usb_blaster_vid_pid 0x09fb 0x6010 0x09fb 0x6810 -usb_blaster_lowlevel_driver ublast2 -usb_blaster_firmware /path/to/quartus/blaster_6810.hex +usb_blaster vid_pid 0x09fb 0x6010 0x09fb 0x6810 +usb_blaster lowlevel_driver ublast2 +usb_blaster firmware /path/to/quartus/blaster_6810.hex diff --git a/tcl/interface/usb-jtag.cfg b/tcl/interface/usb-jtag.cfg index 8617c78c3..bbfb076d1 100644 --- a/tcl/interface/usb-jtag.cfg +++ b/tcl/interface/usb-jtag.cfg @@ -30,8 +30,8 @@ # driver but ixo-usb-jtag requires the ftdi driver. adapter driver usb_blaster -usb_blaster_vid_pid 0x16C0 0x06AD -usb_blaster_device_desc "Van Ooijen Technische Informatica" +usb_blaster vid_pid 0x16C0 0x06AD +usb_blaster device_desc "Van Ooijen Technische Informatica" # ixo-usb-jtag is only compatible with the ublast1 protocol implemented via the # ftdi modes, using ublast2 will cause openocd to hang. -usb_blaster_lowlevel_driver ftdi +usb_blaster lowlevel_driver ftdi commit 1549bad5b3de2c64b106475cfc23cfbccba2b8a3 Author: Marc Schink <de...@za...> Date: Sun Aug 1 14:12:23 2021 +0200 drivers/usb_blaster: Group adapter commands Use a command group 'usb_blaster' with subcommands instead of individual commands with 'usb_blaster_' prefix. The old commands are still available for backward compatibility but marked as deprecated. Change-Id: I2ae3d96ba864c20d7db67c74677781a62bfc4eb5 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6407 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 3e5e4cba7..40f4ab284 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2728,28 +2728,28 @@ USB JTAG/USB-Blaster compatibles over one of the userspace libraries for FTDI chips. These interfaces have several commands, used to configure the driver before initializing the JTAG scan chain: -@deffn {Config Command} {usb_blaster_device_desc} description +@deffn {Config Command} {usb_blaster device_desc} description Provides the USB device description (the @emph{iProduct string}) of the FTDI FT245 device. If not specified, the FTDI default value is used. This setting is only valid if compiled with FTD2XX support. @end deffn -@deffn {Config Command} {usb_blaster_vid_pid} vid pid +@deffn {Config Command} {usb_blaster vid_pid} vid pid The vendor ID and product ID of the FTDI FT245 device. If not specified, default values are used. Currently, only one @var{vid}, @var{pid} pair may be given, e.g. for Altera USB-Blaster (default): @example -usb_blaster_vid_pid 0x09FB 0x6001 +usb_blaster vid_pid 0x09FB 0x6001 @end example The following VID/PID is for Kolja Waschk's USB JTAG: @example -usb_blaster_vid_pid 0x16C0 0x06AD +usb_blaster vid_pid 0x16C0 0x06AD @end example @end deffn -@deffn {Command} {usb_blaster_pin} (@option{pin6}|@option{pin8}) (@option{0}|@option{1}|@option{s}|@option{t}) +@deffn {Command} {usb_blaster pin} (@option{pin6}|@option{pin8}) (@option{0}|@option{1}|@option{s}|@option{t}) Sets the state or function of the unused GPIO pins on USB-Blasters (pins 6 and 8 on the female JTAG header). These pins can be used as SRST and/or TRST provided the appropriate connections are made on the @@ -2757,18 +2757,18 @@ target board. For example, to use pin 6 as SRST: @example -usb_blaster_pin pin6 s +usb_blaster pin pin6 s reset_config srst_only @end example @end deffn -@deffn {Config Command} {usb_blaster_lowlevel_driver} (@option{ftdi}|@option{ublast2}) +@deffn {Config Command} {usb_blaster lowlevel_driver} (@option{ftdi}|@option{ublast2}) Chooses the low level access method for the adapter. If not specified, @option{ftdi} is selected unless it wasn't enabled during the configure stage. USB-Blaster II needs @option{ublast2}. @end deffn -@deffn {Config Command} {usb_blaster_firmware} @var{path} +@deffn {Config Command} {usb_blaster firmware} @var{path} This command specifies @var{path} to access USB-Blaster II firmware image. To be used with USB-Blaster II only. @end deffn diff --git a/src/jtag/drivers/usb_blaster/usb_blaster.c b/src/jtag/drivers/usb_blaster/usb_blaster.c index 8519d197a..cc1d4758f 100644 --- a/src/jtag/drivers/usb_blaster/usb_blaster.c +++ b/src/jtag/drivers/usb_blaster/usb_blaster.c @@ -1030,16 +1030,16 @@ COMMAND_HANDLER(ublast_firmware_command) } -static const struct command_registration ublast_command_handlers[] = { +static const struct command_registration ublast_subcommand_handlers[] = { { - .name = "usb_blaster_device_desc", + .name = "device_desc", .handler = ublast_handle_device_desc_command, .mode = COMMAND_CONFIG, .help = "set the USB device description of the USB-Blaster", .usage = "description-string", }, { - .name = "usb_blaster_vid_pid", + .name = "vid_pid", .handler = ublast_handle_vid_pid_command, .mode = COMMAND_CONFIG, .help = "the vendor ID and product ID of the USB-Blaster and " @@ -1048,21 +1048,21 @@ static const struct command_registration ublast_command_handlers[] = { .usage = "vid pid vid_uninit pid_uninit", }, { - .name = "usb_blaster_lowlevel_driver", + .name = "lowlevel_driver", .handler = ublast_handle_lowlevel_drv_command, .mode = COMMAND_CONFIG, .help = "set the lowlevel access for the USB Blaster (ftdi, ublast2)", .usage = "(ftdi|ublast2)", }, { - .name = "usb_blaster_pin", + .name = "pin", .handler = ublast_handle_pin_command, .mode = COMMAND_ANY, .help = "show or set pin state for the unused GPIO pins", .usage = "(pin6|pin8) (0|1|s|t)", }, { - .name = "usb_blaster_firmware", + .name = "firmware", .handler = &ublast_firmware_command, .mode = COMMAND_CONFIG, .help = "configure the USB-Blaster II firmware location", @@ -1071,6 +1071,17 @@ static const struct command_registration ublast_command_handlers[] = { COMMAND_REGISTRATION_DONE }; +static const struct command_registration ublast_command_handlers[] = { + { + .name = "usb_blaster", + .mode = COMMAND_ANY, + .help = "perform usb_blaster management", + .chain = ublast_subcommand_handlers, + .usage = "", + }, + COMMAND_REGISTRATION_DONE +}; + static struct jtag_interface usb_blaster_interface = { .supported = DEBUG_CAP_TMS_SEQ, .execute_queue = ublast_execute_queue, diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 80d21e7bd..5763310f4 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -645,4 +645,34 @@ proc buspirate_port args { eval buspirate port $args } +lappend _telnet_autocomplete_skip usb_blaster_device_desc +proc usb_blaster_device_desc args { + echo "DEPRECATED! use 'usb_blaster device_desc' not 'usb_blaster_device_desc'" + eval usb_blaster device_desc $args +} + +lappend _telnet_autocomplete_skip usb_blaster_vid_pid +proc usb_blaster_vid_pid args { + echo "DEPRECATED! use 'usb_blaster vid_pid' not 'usb_blaster_vid_pid'" + eval usb_blaster vid_pid $args +} + +lappend _telnet_autocomplete_skip usb_blaster_lowlevel_driver +proc usb_blaster_lowlevel_driver args { + echo "DEPRECATED! use 'usb_blaster lowlevel_driver' not 'usb_blaster_lowlevel_driver'" + eval usb_blaster lowlevel_driver $args +} + +lappend _telnet_autocomplete_skip usb_blaster_pin +proc usb_blaster_pin args { + echo "DEPRECATED! use 'usb_blaster pin' not 'usb_blaster_pin'" + eval usb_blaster pin $args +} + +lappend _telnet_autocomplete_skip usb_blaster_firmware +proc usb_blaster_firmware args { + echo "DEPRECATED! use 'usb_blaster firmware' not 'usb_blaster_firmware'" + eval usb_blaster firmware $args +} + # END MIGRATION AIDS commit cba3bb6f2a736414f86a0e26d3ac8b91551b1574 Author: Marc Schink <de...@za...> Date: Sun Aug 1 14:06:59 2021 +0200 doc/openocd: Fix buspirate example Change-Id: Idcbe73220d7630953cb49e643a58a7ab05c395fa Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6406 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 65252d69e..3e5e4cba7 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -3349,7 +3349,7 @@ buspirate port /dev/ttyUSB0 @deffn {Config Command} {buspirate speed} (normal|fast) Set the communication speed to 115k (normal) or 1M (fast). For example: @example -buspirate mode normal +buspirate speed normal @end example @end deffn commit e53f1c907a9ab16eba320d295db4d68d4b607cc1 Author: Marc Schink <de...@za...> Date: Sun Aug 1 14:05:19 2021 +0200 tcl/interface/buspirate: Adapt to new buspirate command syntax Change-Id: I1a82608532f043054abd22eb5b50ab5c5f58cee4 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6405 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/tcl/interface/buspirate.cfg b/tcl/interface/buspirate.cfg index 265e37e06..20761d152 100644 --- a/tcl/interface/buspirate.cfg +++ b/tcl/interface/buspirate.cfg @@ -7,19 +7,19 @@ adapter driver buspirate # you need to specify port on which BP lives -#buspirate_port /dev/ttyUSB0 +#buspirate port /dev/ttyUSB0 # communication speed setting -buspirate_speed normal ;# or fast +buspirate speed normal ;# or fast # voltage regulator Enabled = 1 Disabled = 0 -#buspirate_vreg 0 +#buspirate vreg 0 # pin mode normal or open-drain (jtag only) -#buspirate_mode normal +#buspirate mode normal # pullup state Enabled = 1 Disabled = 0 -#buspirate_pullup 0 +#buspirate pullup 0 # this depends on the cable, you are safe with this option reset_config srst_only ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 38 ++++----- src/jtag/drivers/ft232r.c | 33 +++++--- src/jtag/drivers/usb_blaster/usb_blaster.c | 23 ++++-- src/jtag/startup.tcl | 90 ++++++++++++++++++++++ tcl/board/altera_sockit.cfg | 4 +- tcl/board/reflexces_achilles_i-dev_kit_arria10.cfg | 2 +- tcl/interface/altera-usb-blaster.cfg | 6 +- tcl/interface/altera-usb-blaster2.cfg | 6 +- tcl/interface/buspirate.cfg | 10 +-- tcl/interface/usb-jtag.cfg | 6 +- 10 files changed, 165 insertions(+), 53 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-14 12:37:38
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 8399cbc9584985c2b9e4aafb3a6afdb17df89b7f (commit) via 8d70a67b200fbed8a5599873a55d7cab1e4c9994 (commit) via a369b6b87a89bf09c51e65b037deb4bcd4683791 (commit) via 14cefe82067e4b64ccc830159ad842e27aff6027 (commit) via 620211bec677306854786892dcc0b6876a46a057 (commit) via a33646a8827984c32e436603b552602b958c27f6 (commit) from b421d2a4c52b3fe4d939c6f41327b6a5370e09c0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 8399cbc9584985c2b9e4aafb3a6afdb17df89b7f Author: Marc Schink <de...@za...> Date: Sun Aug 1 14:04:49 2021 +0200 drivers/buspirate: Group adapter commands Use a command group 'buspirate' with subcommands instead of individual commands with 'buspirate_' prefix. The old commands are still available for backward compatibility but marked as deprecated. Change-Id: Id999d4ba276af576fb22b76052f3c0a1f3e1b876 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6404 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 5aab4ba1d..65252d69e 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -3339,21 +3339,21 @@ It uses a simple data protocol over a serial port connection. Most hardware development boards have a UART, a real serial port, or a virtual USB serial device, so this driver allows you to start building your own JTAG adapter without the complexity of a custom USB connection. -@deffn {Config Command} {buspirate_port} serial_port +@deffn {Config Command} {buspirate port} serial_port Specify the serial port's filename. For example: @example -buspirate_port /dev/ttyUSB0 +buspirate port /dev/ttyUSB0 @end example @end deffn -@deffn {Config Command} {buspirate_speed} (normal|fast) +@deffn {Config Command} {buspirate speed} (normal|fast) Set the communication speed to 115k (normal) or 1M (fast). For example: @example -buspirate_mode normal +buspirate mode normal @end example @end deffn -@deffn {Config Command} {buspirate_mode} (normal|open-drain) +@deffn {Config Command} {buspirate mode} (normal|open-drain) Set the Bus Pirate output mode. @itemize @minus @item In normal mode (push/pull), do not enable the pull-ups, and do not connect I/O header pin VPU to JTAG VREF. @@ -3361,33 +3361,33 @@ Set the Bus Pirate output mode. @end itemize For example: @example -buspirate_mode normal +buspirate mode normal @end example @end deffn -@deffn {Config Command} {buspirate_pullup} (0|1) +@deffn {Config Command} {buspirate pullup} (0|1) Whether to connect (1) or not (0) the I/O header pin VPU (JTAG VREF) to the pull-up/pull-down resistors on MOSI (JTAG TDI), CLK (JTAG TCK), MISO (JTAG TDO) and CS (JTAG TMS). For example: @example -buspirate_pullup 0 +buspirate pullup 0 @end example @end deffn -@deffn {Config Command} {buspirate_vreg} (0|1) +@deffn {Config Command} {buspirate vreg} (0|1) Whether to enable (1) or disable (0) the built-in voltage regulator, which can be used to supply power to a test circuit through I/O header pins +3V3 and +5V. For example: @example -buspirate_vreg 0 +buspirate vreg 0 @end example @end deffn -@deffn {Command} {buspirate_led} (0|1) +@deffn {Command} {buspirate led} (0|1) Turns the Bus Pirate's LED on (1) or off (0). For example: @end deffn @example -buspirate_led 1 +buspirate led 1 @end example @end deffn diff --git a/src/jtag/drivers/buspirate.c b/src/jtag/drivers/buspirate.c index 0864c60b3..51ace615f 100644 --- a/src/jtag/drivers/buspirate.c +++ b/src/jtag/drivers/buspirate.c @@ -473,51 +473,51 @@ COMMAND_HANDLER(buspirate_handle_port_command) } -static const struct command_registration buspirate_command_handlers[] = { +static const struct command_registration buspirate_subcommand_handlers[] = { { - .name = "buspirate_adc", + .name = "adc", .handler = &buspirate_handle_adc_command, .mode = COMMAND_EXEC, .help = "reads voltages on adc pins", .usage = "", }, { - .name = "buspirate_vreg", + .name = "vreg", .usage = "<1|0>", .handler = &buspirate_handle_vreg_command, .mode = COMMAND_CONFIG, .help = "changes the state of voltage regulators", }, { - .name = "buspirate_pullup", + .name = "pullup", .usage = "<1|0>", .handler = &buspirate_handle_pullup_command, .mode = COMMAND_CONFIG, .help = "changes the state of pullup", }, { - .name = "buspirate_led", + .name = "led", .usage = "<1|0>", .handler = &buspirate_handle_led_command, .mode = COMMAND_EXEC, .help = "changes the state of led", }, { - .name = "buspirate_speed", + .name = "speed", .usage = "<normal|fast>", .handler = &buspirate_handle_speed_command, .mode = COMMAND_CONFIG, .help = "speed of the interface", }, { - .name = "buspirate_mode", + .name = "mode", .usage = "<normal|open-drain>", .handler = &buspirate_handle_mode_command, .mode = COMMAND_CONFIG, .help = "pin mode of the interface", }, { - .name = "buspirate_port", + .name = "port", .usage = "/dev/ttyUSB0", .handler = &buspirate_handle_port_command, .mode = COMMAND_CONFIG, @@ -526,6 +526,17 @@ static const struct command_registration buspirate_command_handlers[] = { COMMAND_REGISTRATION_DONE }; +static const struct command_registration buspirate_command_handlers[] = { + { + .name = "buspirate", + .mode = COMMAND_ANY, + .help = "perform buspirate management", + .chain = buspirate_subcommand_handlers, + .usage = "", + }, + COMMAND_REGISTRATION_DONE +}; + static const struct swd_driver buspirate_swd = { .init = buspirate_swd_init, .switch_seq = buspirate_swd_switch_seq, diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 9e5ac26f4..80d21e7bd 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -603,4 +603,46 @@ proc sysfsgpio_swdio_num args { eval sysfsgpio swdio_num $args } +lappend _telnet_autocomplete_skip buspirate_adc +proc buspirate_adc args { + echo "DEPRECATED! use 'buspirate adc' not 'buspirate_adc'" + eval buspirate adc $args +} + +lappend _telnet_autocomplete_skip buspirate_vreg +proc buspirate_vreg args { + echo "DEPRECATED! use 'buspirate vreg' not 'buspirate_vreg'" + eval buspirate vreg $args +} + +lappend _telnet_autocomplete_skip buspirate_pullup +proc buspirate_pullup args { + echo "DEPRECATED! use 'buspirate pullup' not 'buspirate_pullup'" + eval buspirate pullup $args +} + +lappend _telnet_autocomplete_skip buspirate_led +proc buspirate_led args { + echo "DEPRECATED! use 'buspirate led' not 'buspirate_led'" + eval buspirate led $args +} + +lappend _telnet_autocomplete_skip buspirate_speed +proc buspirate_speed args { + echo "DEPRECATED! use 'buspirate speed' not 'buspirate_speed'" + eval buspirate speed $args +} + +lappend _telnet_autocomplete_skip buspirate_mode +proc buspirate_mode args { + echo "DEPRECATED! use 'buspirate mode' not 'buspirate_mode'" + eval buspirate mode $args +} + +lappend _telnet_autocomplete_skip buspirate_port +proc buspirate_port args { + echo "DEPRECATED! use 'buspirate port' not 'buspirate_port'" + eval buspirate port $args +} + # END MIGRATION AIDS commit 8d70a67b200fbed8a5599873a55d7cab1e4c9994 Author: Marc Schink <de...@za...> Date: Sat Jul 31 23:51:56 2021 +0200 tcl/interface: Adapt config files to new sysfsgpio command syntax Change-Id: I8e8dee6e8869d2853a7a73c8d4dc8b4891fb0389 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6403 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/tcl/board/novena-internal-fpga.cfg b/tcl/board/novena-internal-fpga.cfg index 0e9ff5b1f..780586223 100644 --- a/tcl/board/novena-internal-fpga.cfg +++ b/tcl/board/novena-internal-fpga.cfg @@ -19,6 +19,6 @@ adapter driver sysfsgpio transport select jtag # TCK TMS TDI TDO -sysfsgpio_jtag_nums 136 139 137 138 +sysfsgpio jtag_nums 136 139 137 138 source [find cpld/xilinx-xc6s.cfg] diff --git a/tcl/interface/sysfsgpio-raspberrypi.cfg b/tcl/interface/sysfsgpio-raspberrypi.cfg index ebb150219..0030560ca 100644 --- a/tcl/interface/sysfsgpio-raspberrypi.cfg +++ b/tcl/interface/sysfsgpio-raspberrypi.cfg @@ -12,19 +12,19 @@ adapter driver sysfsgpio # Each of the JTAG lines need a gpio number set: tck tms tdi tdo # Header pin numbers: 23 22 19 21 -sysfsgpio_jtag_nums 11 25 10 9 +sysfsgpio jtag_nums 11 25 10 9 # Each of the SWD lines need a gpio number set: swclk swdio # Header pin numbers: 23 22 -sysfsgpio_swd_nums 11 25 +sysfsgpio swd_nums 11 25 # If you define trst or srst, use appropriate reset_config # Header pin numbers: TRST - 26, SRST - 18 -# sysfsgpio_trst_num 7 +# sysfsgpio trst_num 7 # reset_config trst_only -# sysfsgpio_srst_num 24 +# sysfsgpio srst_num 24 # reset_config srst_only srst_push_pull # or if you have both connected, commit a369b6b87a89bf09c51e65b037deb4bcd4683791 Author: Marc Schink <de...@za...> Date: Sat Jul 31 23:49:10 2021 +0200 drivers/sysfsgpio: Group adapter commands Use a command group 'sysfsgpio' with subcommands instead of individual commands with 'sysfsgpio_' prefix. The old commands are still available for backward compatibility but marked as deprecated. Change-Id: I103d8d9b0e3169a916d944a999579746f6f6a59c Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6402 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/jtag/drivers/sysfsgpio.c b/src/jtag/drivers/sysfsgpio.c index 78a4c5b77..103b81009 100644 --- a/src/jtag/drivers/sysfsgpio.c +++ b/src/jtag/drivers/sysfsgpio.c @@ -468,72 +468,72 @@ COMMAND_HANDLER(sysfsgpio_handle_swd_gpionum_swdio) return ERROR_OK; } -static const struct command_registration sysfsgpio_command_handlers[] = { +static const struct command_registration sysfsgpio_subcommand_handlers[] = { { - .name = "sysfsgpio_jtag_nums", + .name = "jtag_nums", .handler = &sysfsgpio_handle_jtag_gpionums, .mode = COMMAND_CONFIG, .help = "gpio numbers for tck, tms, tdi, tdo. (in that order)", .usage = "[tck tms tdi tdo]", }, { - .name = "sysfsgpio_tck_num", + .name = "tck_num", .handler = &sysfsgpio_handle_jtag_gpionum_tck, .mode = COMMAND_CONFIG, .help = "gpio number for tck.", .usage = "[tck]", }, { - .name = "sysfsgpio_tms_num", + .name = "tms_num", .handler = &sysfsgpio_handle_jtag_gpionum_tms, .mode = COMMAND_CONFIG, .help = "gpio number for tms.", .usage = "[tms]", }, { - .name = "sysfsgpio_tdo_num", + .name = "tdo_num", .handler = &sysfsgpio_handle_jtag_gpionum_tdo, .mode = COMMAND_CONFIG, .help = "gpio number for tdo.", .usage = "[tdo]", }, { - .name = "sysfsgpio_tdi_num", + .name = "tdi_num", .handler = &sysfsgpio_handle_jtag_gpionum_tdi, .mode = COMMAND_CONFIG, .help = "gpio number for tdi.", .usage = "[tdi]", }, { - .name = "sysfsgpio_srst_num", + .name = "srst_num", .handler = &sysfsgpio_handle_jtag_gpionum_srst, .mode = COMMAND_CONFIG, .help = "gpio number for srst.", .usage = "[srst]", }, { - .name = "sysfsgpio_trst_num", + .name = "trst_num", .handler = &sysfsgpio_handle_jtag_gpionum_trst, .mode = COMMAND_CONFIG, .help = "gpio number for trst.", .usage = "[trst]", }, { - .name = "sysfsgpio_swd_nums", + .name = "swd_nums", .handler = &sysfsgpio_handle_swd_gpionums, .mode = COMMAND_CONFIG, .help = "gpio numbers for swclk, swdio. (in that order)", .usage = "[swclk swdio]", }, { - .name = "sysfsgpio_swclk_num", + .name = "swclk_num", .handler = &sysfsgpio_handle_swd_gpionum_swclk, .mode = COMMAND_CONFIG, .help = "gpio number for swclk.", .usage = "[swclk]", }, { - .name = "sysfsgpio_swdio_num", + .name = "swdio_num", .handler = &sysfsgpio_handle_swd_gpionum_swdio, .mode = COMMAND_CONFIG, .help = "gpio number for swdio.", @@ -542,6 +542,17 @@ static const struct command_registration sysfsgpio_command_handlers[] = { COMMAND_REGISTRATION_DONE }; +static const struct command_registration sysfsgpio_command_handlers[] = { + { + .name = "sysfsgpio", + .mode = COMMAND_ANY, + .help = "perform sysfsgpio management", + .chain = sysfsgpio_subcommand_handlers, + .usage = "", + }, + COMMAND_REGISTRATION_DONE +}; + static int sysfsgpio_init(void); static int sysfsgpio_quit(void); diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 5a0f96773..9e5ac26f4 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -543,4 +543,64 @@ proc linuxgpiod_gpiochip args { eval linuxgpiod gpiochip $args } +lappend _telnet_autocomplete_skip sysfsgpio_jtag_nums +proc sysfsgpio_jtag_nums args { + echo "DEPRECATED! use 'sysfsgpio jtag_nums' not 'sysfsgpio_jtag_nums'" + eval sysfsgpio jtag_nums $args +} + +lappend _telnet_autocomplete_skip sysfsgpio_tck_num +proc sysfsgpio_tck_num args { + echo "DEPRECATED! use 'sysfsgpio tck_num' not 'sysfsgpio_tck_num'" + eval sysfsgpio tck_num $args +} + +lappend _telnet_autocomplete_skip sysfsgpio_tms_num +proc sysfsgpio_tms_num args { + echo "DEPRECATED! use 'sysfsgpio tms_num' not 'sysfsgpio_tms_num'" + eval sysfsgpio tms_num $args +} + +lappend _telnet_autocomplete_skip sysfsgpio_tdo_num +proc sysfsgpio_tdo_num args { + echo "DEPRECATED! use 'sysfsgpio tdo_num' not 'sysfsgpio_tdo_num'" + eval sysfsgpio tdo_num $args +} + +lappend _telnet_autocomplete_skip sysfsgpio_tdi_num +proc sysfsgpio_tdi_num args { + echo "DEPRECATED! use 'sysfsgpio tdi_num' not 'sysfsgpio_tdi_num'" + eval sysfsgpio tdi_num $args +} + +lappend _telnet_autocomplete_skip sysfsgpio_srst_num +proc sysfsgpio_srst_num args { + echo "DEPRECATED! use 'sysfsgpio srst_num' not 'sysfsgpio_srst_num'" + eval sysfsgpio srst_num $args +} + +lappend _telnet_autocomplete_skip sysfsgpio_trst_num +proc sysfsgpio_trst_num args { + echo "DEPRECATED! use 'sysfsgpio trst_num' not 'sysfsgpio_trst_num'" + eval sysfsgpio trst_num $args +} + +lappend _telnet_autocomplete_skip sysfsgpio_swd_nums +proc sysfsgpio_swd_nums args { + echo "DEPRECATED! use 'sysfsgpio swd_nums' not 'sysfsgpio_swd_nums'" + eval sysfsgpio swd_nums $args +} + +lappend _telnet_autocomplete_skip sysfsgpio_swclk_num +proc sysfsgpio_swclk_num args { + echo "DEPRECATED! use 'sysfsgpio swclk_num' not 'sysfsgpio_swclk_num'" + eval sysfsgpio swclk_num $args +} + +lappend _telnet_autocomplete_skip sysfsgpio_swdio_num +proc sysfsgpio_swdio_num args { + echo "DEPRECATED! use 'sysfsgpio swdio_num' not 'sysfsgpio_swdio_num'" + eval sysfsgpio swdio_num $args +} + # END MIGRATION AIDS commit 14cefe82067e4b64ccc830159ad842e27aff6027 Author: Marc Schink <de...@za...> Date: Sat Jul 31 23:45:31 2021 +0200 tcl/interface/dln-2-gpiod: Adapt to new linuxgpiod command syntax Change-Id: Ife1e52fe5da0e0374a606072f1faf7c598cf0e2b Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6401 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/tcl/interface/dln-2-gpiod.cfg b/tcl/interface/dln-2-gpiod.cfg index 5407a244e..cd6061fd9 100644 --- a/tcl/interface/dln-2-gpiod.cfg +++ b/tcl/interface/dln-2-gpiod.cfg @@ -17,11 +17,11 @@ adapter driver linuxgpiod -linuxgpiod_gpiochip 0 -linuxgpiod_jtag_nums 2 3 4 1 -linuxgpiod_trst_num 5 -linuxgpiod_swd_nums 2 3 -linuxgpiod_srst_num 0 -linuxgpiod_led_num 6 +linuxgpiod gpiochip 0 +linuxgpiod jtag_nums 2 3 4 1 +linuxgpiod trst_num 5 +linuxgpiod swd_nums 2 3 +linuxgpiod srst_num 0 +linuxgpiod led_num 6 reset_config trst_and_srst separate srst_push_pull commit 620211bec677306854786892dcc0b6876a46a057 Author: Marc Schink <de...@za...> Date: Sat Jul 31 23:44:24 2021 +0200 drivers/linuxgpiod: Group adapter commands Use a command group 'linuxgpiod' with subcommands instead of individual commands with 'linuxgpiod_' prefix. The old commands are still available for backward compatibility but marked as deprecated. Change-Id: Iad9b330363f81128ab1ec1cbc498df28ba2ca152 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6400 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/jtag/drivers/linuxgpiod.c b/src/jtag/drivers/linuxgpiod.c index 03afd3da7..42c8a3140 100644 --- a/src/jtag/drivers/linuxgpiod.c +++ b/src/jtag/drivers/linuxgpiod.c @@ -524,86 +524,86 @@ COMMAND_HANDLER(linuxgpiod_handle_gpiochip) return ERROR_OK; } -static const struct command_registration linuxgpiod_command_handlers[] = { +static const struct command_registration linuxgpiod_subcommand_handlers[] = { { - .name = "linuxgpiod_jtag_nums", + .name = "jtag_nums", .handler = linuxgpiod_handle_jtag_gpionums, .mode = COMMAND_CONFIG, .help = "gpio numbers for tck, tms, tdi, tdo. (in that order)", .usage = "tck tms tdi tdo", }, { - .name = "linuxgpiod_tck_num", + .name = "tck_num", .handler = linuxgpiod_handle_jtag_gpionum_tck, .mode = COMMAND_CONFIG, .help = "gpio number for tck.", .usage = "tck", }, { - .name = "linuxgpiod_tms_num", + .name = "tms_num", .handler = linuxgpiod_handle_jtag_gpionum_tms, .mode = COMMAND_CONFIG, .help = "gpio number for tms.", .usage = "tms", }, { - .name = "linuxgpiod_tdo_num", + .name = "tdo_num", .handler = linuxgpiod_handle_jtag_gpionum_tdo, .mode = COMMAND_CONFIG, .help = "gpio number for tdo.", .usage = "tdo", }, { - .name = "linuxgpiod_tdi_num", + .name = "tdi_num", .handler = linuxgpiod_handle_jtag_gpionum_tdi, .mode = COMMAND_CONFIG, .help = "gpio number for tdi.", .usage = "tdi", }, { - .name = "linuxgpiod_srst_num", + .name = "srst_num", .handler = linuxgpiod_handle_jtag_gpionum_srst, .mode = COMMAND_CONFIG, .help = "gpio number for srst.", .usage = "srst", }, { - .name = "linuxgpiod_trst_num", + .name = "trst_num", .handler = linuxgpiod_handle_jtag_gpionum_trst, .mode = COMMAND_CONFIG, .help = "gpio number for trst.", .usage = "trst", }, { - .name = "linuxgpiod_swd_nums", + .name = "swd_nums", .handler = linuxgpiod_handle_swd_gpionums, .mode = COMMAND_CONFIG, .help = "gpio numbers for swclk, swdio. (in that order)", .usage = "swclk swdio", }, { - .name = "linuxgpiod_swclk_num", + .name = "swclk_num", .handler = linuxgpiod_handle_swd_gpionum_swclk, .mode = COMMAND_CONFIG, .help = "gpio number for swclk.", .usage = "swclk", }, { - .name = "linuxgpiod_swdio_num", + .name = "swdio_num", .handler = linuxgpiod_handle_swd_gpionum_swdio, .mode = COMMAND_CONFIG, .help = "gpio number for swdio.", .usage = "swdio", }, { - .name = "linuxgpiod_led_num", + .name = "led_num", .handler = linuxgpiod_handle_gpionum_led, .mode = COMMAND_CONFIG, .help = "gpio number for LED.", .usage = "led", }, { - .name = "linuxgpiod_gpiochip", + .name = "gpiochip", .handler = linuxgpiod_handle_gpiochip, .mode = COMMAND_CONFIG, .help = "number of the gpiochip.", @@ -612,6 +612,17 @@ static const struct command_registration linuxgpiod_command_handlers[] = { COMMAND_REGISTRATION_DONE }; +static const struct command_registration linuxgpiod_command_handlers[] = { + { + .name = "linuxgpiod", + .mode = COMMAND_ANY, + .help = "perform linuxgpiod management", + .chain = linuxgpiod_subcommand_handlers, + .usage = "", + }, + COMMAND_REGISTRATION_DONE +}; + static const char *const linuxgpiod_transport[] = { "swd", "jtag", NULL }; static struct jtag_interface linuxgpiod_interface = { diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 688d1fccf..5a0f96773 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -471,4 +471,76 @@ proc bcm2835gpio_peripheral_base args { eval bcm2835gpio peripheral_base $args } +lappend _telnet_autocomplete_skip linuxgpiod_jtag_nums +proc linuxgpiod_jtag_nums args { + echo "DEPRECATED! use 'linuxgpiod jtag_nums' not 'linuxgpiod_jtag_nums'" + eval linuxgpiod jtag_nums $args +} + +lappend _telnet_autocomplete_skip linuxgpiod_tck_num +proc linuxgpiod_tck_num args { + echo "DEPRECATED! use 'linuxgpiod tck_num' not 'linuxgpiod_tck_num'" + eval linuxgpiod tck_num $args +} + +lappend _telnet_autocomplete_skip linuxgpiod_tms_num +proc linuxgpiod_tms_num args { + echo "DEPRECATED! use 'linuxgpiod tms_num' not 'linuxgpiod_tms_num'" + eval linuxgpiod tms_num $args +} + +lappend _telnet_autocomplete_skip linuxgpiod_tdo_num +proc linuxgpiod_tdo_num args { + echo "DEPRECATED! use 'linuxgpiod tdo_num' not 'linuxgpiod_tdo_num'" + eval linuxgpiod tdo_num $args +} + +lappend _telnet_autocomplete_skip linuxgpiod_tdi_num +proc linuxgpiod_tdi_num args { + echo "DEPRECATED! use 'linuxgpiod tdi_num' not 'linuxgpiod_tdi_num'" + eval linuxgpiod tdi_num $args +} + +lappend _telnet_autocomplete_skip linuxgpiod_srst_num +proc linuxgpiod_srst_num args { + echo "DEPRECATED! use 'linuxgpiod srst_num' not 'linuxgpiod_srst_num'" + eval linuxgpiod srst_num $args +} + +lappend _telnet_autocomplete_skip linuxgpiod_trst_num +proc linuxgpiod_trst_num args { + echo "DEPRECATED! use 'linuxgpiod trst_num' not 'linuxgpiod_trst_num'" + eval linuxgpiod trst_num $args +} + +lappend _telnet_autocomplete_skip linuxgpiod_swd_nums +proc linuxgpiod_swd_nums args { + echo "DEPRECATED! use 'linuxgpiod swd_nums' not 'linuxgpiod_swd_nums'" + eval linuxgpiod swd_nums $args +} + +lappend _telnet_autocomplete_skip linuxgpiod_swclk_num +proc linuxgpiod_swclk_num args { + echo "DEPRECATED! use 'linuxgpiod swclk_num' not 'linuxgpiod_swclk_num'" + eval linuxgpiod swclk_num $args +} + +lappend _telnet_autocomplete_skip linuxgpiod_swdio_num +proc linuxgpiod_swdio_num args { + echo "DEPRECATED! use 'linuxgpiod swdio_num' not 'linuxgpiod_swdio_num'" + eval linuxgpiod swdio_num $args +} + +lappend _telnet_autocomplete_skip linuxgpiod_led_num +proc linuxgpiod_led_num args { + echo "DEPRECATED! use 'linuxgpiod led_num' not 'linuxgpiod_led_num'" + eval linuxgpiod led_num $args +} + +lappend _telnet_autocomplete_skip linuxgpiod_gpiochip +proc linuxgpiod_gpiochip args { + echo "DEPRECATED! use 'linuxgpiod gpiochip' not 'linuxgpiod_gpiochip'" + eval linuxgpiod gpiochip $args +} + # END MIGRATION AIDS commit a33646a8827984c32e436603b552602b958c27f6 Author: Marc Schink <de...@za...> Date: Fri Jul 30 18:40:03 2021 +0200 tcl/interface/jtag_vpi: Adapt to new jtag_vpi command syntax Change-Id: I27eeab5e3dd554af00799104471ee8f30fbd0c51 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6399 Tested-by: jenkins Reviewed-by: Jan Matyas <ma...@co...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/tcl/interface/jtag_vpi.cfg b/tcl/interface/jtag_vpi.cfg index e665a6331..f2f90f745 100644 --- a/tcl/interface/jtag_vpi.cfg +++ b/tcl/interface/jtag_vpi.cfg @@ -14,5 +14,5 @@ if { [info exists VPI_ADDRESS] } { set _VPI_ADDRESS "127.0.0.1" } -jtag_vpi_set_port $_VPI_PORT -jtag_vpi_set_address $_VPI_ADDRESS +jtag_vpi set_port $_VPI_PORT +jtag_vpi set_address $_VPI_ADDRESS ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 24 ++--- src/jtag/drivers/buspirate.c | 27 +++-- src/jtag/drivers/linuxgpiod.c | 37 ++++--- src/jtag/drivers/sysfsgpio.c | 33 ++++-- src/jtag/startup.tcl | 174 ++++++++++++++++++++++++++++++++ tcl/board/novena-internal-fpga.cfg | 2 +- tcl/interface/dln-2-gpiod.cfg | 12 +-- tcl/interface/jtag_vpi.cfg | 4 +- tcl/interface/sysfsgpio-raspberrypi.cfg | 8 +- 9 files changed, 264 insertions(+), 57 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-14 12:36:47
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via b421d2a4c52b3fe4d939c6f41327b6a5370e09c0 (commit) via e57ffd84b89a9f33b55d887212fc88e9f2c6ab39 (commit) via 2fdf6788e20d53f8368f508de5ff39627d8ce27a (commit) from 30bb4524de2b430d9c9ff005608fb5a2886fcd60 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b421d2a4c52b3fe4d939c6f41327b6a5370e09c0 Author: Marc Schink <de...@za...> Date: Fri Jul 30 18:39:27 2021 +0200 drivers/jtag_vpi: Group adapter commands Use a command group 'jtag_vpi' with subcommands instead of individual commands with 'jtag_vpi_' prefix. The old commands are still available for backward compatibility but marked as deprecated. Change-Id: Ie1fcc2cc138796d27f1e862692bb9ef8b11bc10d Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6398 Tested-by: jenkins Reviewed-by: Jan Matyas <ma...@co...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/jtag/drivers/jtag_vpi.c b/src/jtag/drivers/jtag_vpi.c index a5b51aeb8..a0138f840 100644 --- a/src/jtag/drivers/jtag_vpi.c +++ b/src/jtag/drivers/jtag_vpi.c @@ -640,23 +640,23 @@ COMMAND_HANDLER(jtag_vpi_stop_sim_on_exit_handler) return ERROR_OK; } -static const struct command_registration jtag_vpi_command_handlers[] = { +static const struct command_registration jtag_vpi_subcommand_handlers[] = { { - .name = "jtag_vpi_set_port", + .name = "set_port", .handler = &jtag_vpi_set_port, .mode = COMMAND_CONFIG, .help = "set the port of the VPI server", .usage = "tcp_port_num", }, { - .name = "jtag_vpi_set_address", + .name = "set_address", .handler = &jtag_vpi_set_address, .mode = COMMAND_CONFIG, .help = "set the address of the VPI server", .usage = "ipv4_addr", }, { - .name = "jtag_vpi_stop_sim_on_exit", + .name = "stop_sim_on_exit", .handler = &jtag_vpi_stop_sim_on_exit_handler, .mode = COMMAND_CONFIG, .help = "Configure if simulation stop command shall be sent " @@ -666,6 +666,17 @@ static const struct command_registration jtag_vpi_command_handlers[] = { COMMAND_REGISTRATION_DONE }; +static const struct command_registration jtag_vpi_command_handlers[] = { + { + .name = "jtag_vpi", + .mode = COMMAND_ANY, + .help = "perform jtag_vpi management", + .chain = jtag_vpi_subcommand_handlers, + .usage = "", + }, + COMMAND_REGISTRATION_DONE +}; + static struct jtag_interface jtag_vpi_interface = { .supported = DEBUG_CAP_TMS_SEQ, .execute_queue = jtag_vpi_execute_queue, diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 4217d2335..688d1fccf 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -321,6 +321,24 @@ proc jtag_dpi_set_address args { eval jtag_dpi set_address $args } +lappend _telnet_autocomplete_skip jtag_vpi_set_port +proc jtag_vpi_set_port args { + echo "DEPRECATED! use 'jtag_vpi set_port' not 'jtag_vpi_set_port'" + eval jtag_vpi set_port $args +} + +lappend _telnet_autocomplete_skip jtag_vpi_set_address +proc jtag_vpi_set_address args { + echo "DEPRECATED! use 'jtag_vpi set_address' not 'jtag_vpi_set_address'" + eval jtag_vpi set_address $args +} + +lappend _telnet_autocomplete_skip jtag_vpi_stop_sim_on_exit +proc jtag_vpi_stop_sim_on_exit args { + echo "DEPRECATED! use 'jtag_vpi stop_sim_on_exit' not 'jtag_vpi_stop_sim_on_exit'" + eval jtag_vpi stop_sim_on_exit $args +} + lappend _telnet_autocomplete_skip presto_serial proc presto_serial args { echo "DEPRECATED! use 'presto serial' not 'presto_serial'" commit e57ffd84b89a9f33b55d887212fc88e9f2c6ab39 Author: Marc Schink <de...@za...> Date: Fri Jul 30 18:31:07 2021 +0200 tcl/interface: Adapt config files to new bcm2835gpio command syntax Change-Id: I2d649117aa8dbdf5484ace068785a1416efa3ecc Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6397 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/tcl/interface/raspberrypi-native.cfg b/tcl/interface/raspberrypi-native.cfg index 2d0547f31..634b8c95a 100644 --- a/tcl/interface/raspberrypi-native.cfg +++ b/tcl/interface/raspberrypi-native.cfg @@ -10,28 +10,28 @@ adapter driver bcm2835gpio -bcm2835gpio_peripheral_base 0x20000000 +bcm2835gpio peripheral_base 0x20000000 # Transition delay calculation: SPEED_COEFF/khz - SPEED_OFFSET # These depend on system clock, calibrated for stock 700MHz -# bcm2835gpio_speed SPEED_COEFF SPEED_OFFSET -bcm2835gpio_speed_coeffs 113714 28 +# bcm2835gpio speed SPEED_COEFF SPEED_OFFSET +bcm2835gpio speed_coeffs 113714 28 # Each of the JTAG lines need a gpio number set: tck tms tdi tdo # Header pin numbers: 23 22 19 21 -bcm2835gpio_jtag_nums 11 25 10 9 +bcm2835gpio jtag_nums 11 25 10 9 # Each of the SWD lines need a gpio number set: swclk swdio # Header pin numbers: 23 22 -bcm2835gpio_swd_nums 11 25 +bcm2835gpio swd_nums 11 25 # If you define trst or srst, use appropriate reset_config # Header pin numbers: TRST - 26, SRST - 18 -# bcm2835gpio_trst_num 7 +# bcm2835gpio trst_num 7 # reset_config trst_only -# bcm2835gpio_srst_num 24 +# bcm2835gpio srst_num 24 # reset_config srst_only srst_push_pull # or if you have both connected, diff --git a/tcl/interface/raspberrypi2-native.cfg b/tcl/interface/raspberrypi2-native.cfg index e53b0f3b0..14c5771c4 100644 --- a/tcl/interface/raspberrypi2-native.cfg +++ b/tcl/interface/raspberrypi2-native.cfg @@ -10,28 +10,28 @@ adapter driver bcm2835gpio -bcm2835gpio_peripheral_base 0x3F000000 +bcm2835gpio peripheral_base 0x3F000000 # Transition delay calculation: SPEED_COEFF/khz - SPEED_OFFSET # These depend on system clock, calibrated for stock 700MHz -# bcm2835gpio_speed SPEED_COEFF SPEED_OFFSET -bcm2835gpio_speed_coeffs 146203 36 +# bcm2835gpio speed SPEED_COEFF SPEED_OFFSET +bcm2835gpio speed_coeffs 146203 36 # Each of the JTAG lines need a gpio number set: tck tms tdi tdo # Header pin numbers: 23 22 19 21 -bcm2835gpio_jtag_nums 11 25 10 9 +bcm2835gpio jtag_nums 11 25 10 9 # Each of the SWD lines need a gpio number set: swclk swdio # Header pin numbers: 23 22 -bcm2835gpio_swd_nums 11 25 +bcm2835gpio swd_nums 11 25 # If you define trst or srst, use appropriate reset_config # Header pin numbers: TRST - 26, SRST - 18 -# bcm2835gpio_trst_num 7 +# bcm2835gpio trst_num 7 # reset_config trst_only -# bcm2835gpio_srst_num 24 +# bcm2835gpio srst_num 24 # reset_config srst_only srst_push_pull # or if you have both connected, commit 2fdf6788e20d53f8368f508de5ff39627d8ce27a Author: Marc Schink <de...@za...> Date: Fri Jul 30 18:29:01 2021 +0200 drivers/bcm2835gpio: Group adapter commands Use a command group 'bcm2835gpio' with subcommands instead of individual commands with 'bcm2835gpio_' prefix. The old commands are still available for backward compatibility but marked as deprecated. Change-Id: I8f7b14273b1b2813ac3c9704605d175fa2053008 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6396 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/doc/openocd.texi b/doc/openocd.texi index aec6bbe4f..5aab4ba1d 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -3197,67 +3197,67 @@ configuration on exit. See @file{interface/raspberrypi-native.cfg} for a sample config and pinout. -@deffn {Config Command} {bcm2835gpio_jtag_nums} @var{tck} @var{tms} @var{tdi} @var{tdo} +@deffn {Config Command} {bcm2835gpio jtag_nums} @var{tck} @var{tms} @var{tdi} @var{tdo} Set JTAG transport GPIO numbers for TCK, TMS, TDI, and TDO (in that order). Must be specified to enable JTAG transport. These pins can also be specified individually. @end deffn -@deffn {Config Command} {bcm2835gpio_tck_num} @var{tck} +@deffn {Config Command} {bcm2835gpio tck_num} @var{tck} Set TCK GPIO number. Must be specified to enable JTAG transport. Can also be -specified using the configuration command bcm2835gpio_jtag_nums. +specified using the configuration command @command{bcm2835gpio jtag_nums}. @end deffn -@deffn {Config Command} {bcm2835gpio_tms_num} @var{tms} +@deffn {Config Command} {bcm2835gpio tms_num} @var{tms} Set TMS GPIO number. Must be specified to enable JTAG transport. Can also be -specified using the configuration command bcm2835gpio_jtag_nums. +specified using the configuration command @command{bcm2835gpio jtag_nums}. @end deffn -@deffn {Config Command} {bcm2835gpio_tdo_num} @var{tdo} +@deffn {Config Command} {bcm2835gpio tdo_num} @var{tdo} Set TDO GPIO number. Must be specified to enable JTAG transport. Can also be -specified using the configuration command bcm2835gpio_jtag_nums. +specified using the configuration command @command{bcm2835gpio jtag_nums}. @end deffn -@deffn {Config Command} {bcm2835gpio_tdi_num} @var{tdi} +@deffn {Config Command} {bcm2835gpio tdi_num} @var{tdi} Set TDI GPIO number. Must be specified to enable JTAG transport. Can also be -specified using the configuration command bcm2835gpio_jtag_nums. +specified using the configuration command @command{bcm2835gpio jtag_nums}. @end deffn -@deffn {Config Command} {bcm2835gpio_swd_nums} @var{swclk} @var{swdio} +@deffn {Config Command} {bcm2835gpio swd_nums} @var{swclk} @var{swdio} Set SWD transport GPIO numbers for SWCLK and SWDIO (in that order). Must be specified to enable SWD transport. These pins can also be specified individually. @end deffn -@deffn {Config Command} {bcm2835gpio_swclk_num} @var{swclk} +@deffn {Config Command} {bcm2835gpio swclk_num} @var{swclk} Set SWCLK GPIO number. Must be specified to enable SWD transport. Can also be -specified using the configuration command bcm2835gpio_swd_nums. +specified using the configuration command @command{bcm2835gpio swd_nums}. @end deffn -@deffn {Config Command} {bcm2835gpio_swdio_num} @var{swdio} +@deffn {Config Command} {bcm2835gpio swdio_num} @var{swdio} Set SWDIO GPIO number. Must be specified to enable SWD transport. Can also be -specified using the configuration command bcm2835gpio_swd_nums. +specified using the configuration command @command{bcm2835gpio swd_nums}. @end deffn -@deffn {Config Command} {bcm2835gpio_swdio_dir_num} @var{swdio} @var{dir} +@deffn {Config Command} {bcm2835gpio swdio_dir_num} @var{swdio} @var{dir} Set SWDIO direction control pin GPIO number. If specified, this pin can be used to control the direction of an external buffer on the SWDIO pin (set=output mode, clear=input mode). If not specified, this feature is disabled. @end deffn -@deffn {Config Command} {bcm2835gpio_srst_num} @var{srst} +@deffn {Config Command} {bcm2835gpio srst_num} @var{srst} Set SRST GPIO number. Must be specified to enable SRST. @end deffn -@deffn {Config Command} {bcm2835gpio_trst_num} @var{trst} +@deffn {Config Command} {bcm2835gpio trst_num} @var{trst} Set TRST GPIO number. Must be specified to enable TRST. @end deffn -@deffn {Config Command} {bcm2835gpio_speed_coeffs} @var{speed_coeff} @var{speed_offset} +@deffn {Config Command} {bcm2835gpio speed_coeffs} @var{speed_coeff} @var{speed_offset} Set SPEED_COEFF and SPEED_OFFSET for delay calculations. If unspecified, speed_coeff defaults to 113714, and speed_offset defaults to 28. @end deffn -@deffn {Config Command} {bcm2835gpio_peripheral_base} @var{base} +@deffn {Config Command} {bcm2835gpio peripheral_base} @var{base} Set the peripheral base register address to access GPIOs. For the RPi1, use 0x20000000. For RPi2 and RPi3, use 0x3F000000. For RPi4, use 0xFE000000. A full list can be found in the diff --git a/src/jtag/drivers/bcm2835gpio.c b/src/jtag/drivers/bcm2835gpio.c index 6db4340e8..95e077c33 100644 --- a/src/jtag/drivers/bcm2835gpio.c +++ b/src/jtag/drivers/bcm2835gpio.c @@ -338,93 +338,93 @@ COMMAND_HANDLER(bcm2835gpio_handle_peripheral_base) return ERROR_OK; } -static const struct command_registration bcm2835gpio_command_handlers[] = { +static const struct command_registration bcm2835gpio_subcommand_handlers[] = { { - .name = "bcm2835gpio_jtag_nums", + .name = "jtag_nums", .handler = &bcm2835gpio_handle_jtag_gpionums, .mode = COMMAND_CONFIG, .help = "gpio numbers for tck, tms, tdi, tdo. (in that order)", .usage = "[tck tms tdi tdo]", }, { - .name = "bcm2835gpio_tck_num", + .name = "tck_num", .handler = &bcm2835gpio_handle_jtag_gpionum_tck, .mode = COMMAND_CONFIG, .help = "gpio number for tck.", .usage = "[tck]", }, { - .name = "bcm2835gpio_tms_num", + .name = "tms_num", .handler = &bcm2835gpio_handle_jtag_gpionum_tms, .mode = COMMAND_CONFIG, .help = "gpio number for tms.", .usage = "[tms]", }, { - .name = "bcm2835gpio_tdo_num", + .name = "tdo_num", .handler = &bcm2835gpio_handle_jtag_gpionum_tdo, .mode = COMMAND_CONFIG, .help = "gpio number for tdo.", .usage = "[tdo]", }, { - .name = "bcm2835gpio_tdi_num", + .name = "tdi_num", .handler = &bcm2835gpio_handle_jtag_gpionum_tdi, .mode = COMMAND_CONFIG, .help = "gpio number for tdi.", .usage = "[tdi]", }, { - .name = "bcm2835gpio_swd_nums", + .name = "swd_nums", .handler = &bcm2835gpio_handle_swd_gpionums, .mode = COMMAND_CONFIG, .help = "gpio numbers for swclk, swdio. (in that order)", .usage = "[swclk swdio]", }, { - .name = "bcm2835gpio_swclk_num", + .name = "swclk_num", .handler = &bcm2835gpio_handle_swd_gpionum_swclk, .mode = COMMAND_CONFIG, .help = "gpio number for swclk.", .usage = "[swclk]", }, { - .name = "bcm2835gpio_swdio_num", + .name = "swdio_num", .handler = &bcm2835gpio_handle_swd_gpionum_swdio, .mode = COMMAND_CONFIG, .help = "gpio number for swdio.", .usage = "[swdio]", }, { - .name = "bcm2835gpio_swdio_dir_num", + .name = "swdio_dir_num", .handler = &bcm2835gpio_handle_swd_dir_gpionum_swdio, .mode = COMMAND_CONFIG, .help = "gpio number for swdio direction control pin (set=output mode, clear=input mode)", .usage = "[swdio_dir]", }, { - .name = "bcm2835gpio_srst_num", + .name = "srst_num", .handler = &bcm2835gpio_handle_jtag_gpionum_srst, .mode = COMMAND_CONFIG, .help = "gpio number for srst.", .usage = "[srst]", }, { - .name = "bcm2835gpio_trst_num", + .name = "trst_num", .handler = &bcm2835gpio_handle_jtag_gpionum_trst, .mode = COMMAND_CONFIG, .help = "gpio number for trst.", .usage = "[trst]", }, { - .name = "bcm2835gpio_speed_coeffs", + .name = "speed_coeffs", .handler = &bcm2835gpio_handle_speed_coeffs, .mode = COMMAND_CONFIG, .help = "SPEED_COEFF and SPEED_OFFSET for delay calculations.", .usage = "[SPEED_COEFF SPEED_OFFSET]", }, { - .name = "bcm2835gpio_peripheral_base", + .name = "peripheral_base", .handler = &bcm2835gpio_handle_peripheral_base, .mode = COMMAND_CONFIG, .help = "peripheral base to access GPIOs (RPi1 0x20000000, RPi2 0x3F000000).", @@ -434,6 +434,17 @@ static const struct command_registration bcm2835gpio_command_handlers[] = { COMMAND_REGISTRATION_DONE }; +static const struct command_registration bcm2835gpio_command_handlers[] = { + { + .name = "bcm2835gpio", + .mode = COMMAND_ANY, + .help = "perform bcm2835gpio management", + .chain = bcm2835gpio_subcommand_handlers, + .usage = "", + }, + COMMAND_REGISTRATION_DONE +}; + static const char * const bcm2835_transports[] = { "jtag", "swd", NULL }; static struct jtag_interface bcm2835gpio_interface = { diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 263cde255..4217d2335 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -375,4 +375,82 @@ proc vsllink_usb_interface args { eval vsllink usb_interface $args } +lappend _telnet_autocomplete_skip bcm2835gpio_jtag_nums +proc bcm2835gpio_jtag_nums args { + echo "DEPRECATED! use 'bcm2835gpio jtag_nums' not 'bcm2835gpio_jtag_nums'" + eval bcm2835gpio jtag_nums $args +} + +lappend _telnet_autocomplete_skip bcm2835gpio_tck_num +proc bcm2835gpio_tck_num args { + echo "DEPRECATED! use 'bcm2835gpio tck_num' not 'bcm2835gpio_tck_num'" + eval bcm2835gpio tck_num $args +} + +lappend _telnet_autocomplete_skip bcm2835gpio_tms_num +proc bcm2835gpio_tms_num args { + echo "DEPRECATED! use 'bcm2835gpio tms_num' not 'bcm2835gpio_tms_num'" + eval bcm2835gpio tms_num $args +} + +lappend _telnet_autocomplete_skip bcm2835gpio_tdo_num +proc bcm2835gpio_tdo_num args { + echo "DEPRECATED! use 'bcm2835gpio tdo_num' not 'bcm2835gpio_tdo_num'" + eval bcm2835gpio tdo_num $args +} + +lappend _telnet_autocomplete_skip bcm2835gpio_tdi_num +proc bcm2835gpio_tdi_num args { + echo "DEPRECATED! use 'bcm2835gpio tdi_num' not 'bcm2835gpio_tdi_num'" + eval bcm2835gpio tdi_num $args +} + +lappend _telnet_autocomplete_skip bcm2835gpio_swd_nums +proc bcm2835gpio_swd_nums args { + echo "DEPRECATED! use 'bcm2835gpio swd_nums' not 'bcm2835gpio_swd_nums'" + eval bcm2835gpio swd_nums $args +} + +lappend _telnet_autocomplete_skip bcm2835gpio_swclk_num +proc bcm2835gpio_swclk_num args { + echo "DEPRECATED! use 'bcm2835gpio swclk_num' not 'bcm2835gpio_swclk_num'" + eval bcm2835gpio swclk_num $args +} + +lappend _telnet_autocomplete_skip bcm2835gpio_swdio_num +proc bcm2835gpio_swdio_num args { + echo "DEPRECATED! use 'bcm2835gpio swdio_num' not 'bcm2835gpio_swdio_num'" + eval bcm2835gpio swdio_num $args +} + +lappend _telnet_autocomplete_skip bcm2835gpio_swdio_dir_num +proc bcm2835gpio_swdio_dir_num args { + echo "DEPRECATED! use 'bcm2835gpio swdio_dir_num' not 'bcm2835gpio_swdio_dir_num'" + eval bcm2835gpio swdio_dir_num $args +} + +lappend _telnet_autocomplete_skip bcm2835gpio_srst_num +proc bcm2835gpio_srst_num args { + echo "DEPRECATED! use 'bcm2835gpio srst_num' not 'bcm2835gpio_srst_num'" + eval bcm2835gpio srst_num $args +} + +lappend _telnet_autocomplete_skip bcm2835gpio_trst_num +proc bcm2835gpio_trst_num args { + echo "DEPRECATED! use 'bcm2835gpio trst_num' not 'bcm2835gpio_trst_num'" + eval bcm2835gpio trst_num $args +} + +lappend _telnet_autocomplete_skip bcm2835gpio_speed_coeffs +proc bcm2835gpio_speed_coeffs args { + echo "DEPRECATED! use 'bcm2835gpio speed_coeffs' not 'bcm2835gpio_speed_coeffs'" + eval bcm2835gpio speed_coeffs $args +} + +lappend _telnet_autocomplete_skip bcm2835gpio_peripheral_base +proc bcm2835gpio_peripheral_base args { + echo "DEPRECATED! use 'bcm2835gpio peripheral_base' not 'bcm2835gpio_peripheral_base'" + eval bcm2835gpio peripheral_base $args +} + # END MIGRATION AIDS ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 38 +++++++------- src/jtag/drivers/bcm2835gpio.c | 39 +++++++++----- src/jtag/drivers/jtag_vpi.c | 19 +++++-- src/jtag/startup.tcl | 96 +++++++++++++++++++++++++++++++++++ tcl/interface/raspberrypi-native.cfg | 14 ++--- tcl/interface/raspberrypi2-native.cfg | 14 ++--- 6 files changed, 169 insertions(+), 51 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-14 12:35:42
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 30bb4524de2b430d9c9ff005608fb5a2886fcd60 (commit) via 08ce499f14c59ab816f781045fa4d7f75657f917 (commit) via 347af768edd32c1d954f503cd64c6c366455599d (commit) from 6c5618218494263cc52c8b140d047f0d046c5d69 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 30bb4524de2b430d9c9ff005608fb5a2886fcd60 Author: Marc Schink <de...@za...> Date: Fri Jul 30 18:25:41 2021 +0200 tcl/interface/jtag_dpi: Adapt to new jtag_dpi command syntax Change-Id: Icebf6f0a037f4ea9fb450581fcc599417bffc153 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6395 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/tcl/interface/jtag_dpi.cfg b/tcl/interface/jtag_dpi.cfg index e43386d58..a92e131a9 100644 --- a/tcl/interface/jtag_dpi.cfg +++ b/tcl/interface/jtag_dpi.cfg @@ -34,5 +34,5 @@ if { [info exists DPI_ADDRESS] } { set _DPI_ADDRESS "127.0.0.1" } -jtag_dpi_set_port $_DPI_PORT -jtag_dpi_set_address $_DPI_ADDRESS +jtag_dpi set_port $_DPI_PORT +jtag_dpi set_address $_DPI_ADDRESS commit 08ce499f14c59ab816f781045fa4d7f75657f917 Author: Marc Schink <de...@za...> Date: Fri Jul 30 18:24:03 2021 +0200 drivers/jtag_dpi: Group adapter commands Use a command group 'jtag_dpi' with subcommands instead of individual commands with 'jtag_dpi_' prefix. The old commands are still available for backward compatibility but marked as deprecated. Change-Id: I19271546235a3c6737f975976a0bf0a2f66cbbe7 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6394 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/doc/openocd.texi b/doc/openocd.texi index eb45acc39..aec6bbe4f 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -3321,11 +3321,11 @@ SystemVerilog Direct Programming Interface (DPI) compatible driver for JTAG devices in emulation. The driver acts as a client for the SystemVerilog DPI server interface. -@deffn {Config Command} {jtag_dpi_set_port} port +@deffn {Config Command} {jtag_dpi set_port} port Specifies the TCP/IP port number of the SystemVerilog DPI server interface. @end deffn -@deffn {Config Command} {jtag_dpi_set_address} address +@deffn {Config Command} {jtag_dpi set_address} address Specifies the TCP/IP address of the SystemVerilog DPI server interface. @end deffn @end deffn diff --git a/src/jtag/drivers/jtag_dpi.c b/src/jtag/drivers/jtag_dpi.c index 73746d6d2..016ff5536 100644 --- a/src/jtag/drivers/jtag_dpi.c +++ b/src/jtag/drivers/jtag_dpi.c @@ -373,16 +373,16 @@ COMMAND_HANDLER(jtag_dpi_set_address) return ERROR_OK; } -static const struct command_registration jtag_dpi_command_handlers[] = { +static const struct command_registration jtag_dpi_subcommand_handlers[] = { { - .name = "jtag_dpi_set_port", + .name = "set_port", .handler = &jtag_dpi_set_port, .mode = COMMAND_CONFIG, .help = "set the port of the DPI server", .usage = "[port]", }, { - .name = "jtag_dpi_set_address", + .name = "set_address", .handler = &jtag_dpi_set_address, .mode = COMMAND_CONFIG, .help = "set the address of the DPI server", @@ -391,6 +391,17 @@ static const struct command_registration jtag_dpi_command_handlers[] = { COMMAND_REGISTRATION_DONE }; +static const struct command_registration jtag_dpi_command_handlers[] = { + { + .name = "jtag_dpi", + .mode = COMMAND_ANY, + .help = "perform jtag_dpi management", + .chain = jtag_dpi_subcommand_handlers, + .usage = "", + }, + COMMAND_REGISTRATION_DONE +}; + static struct jtag_interface jtag_dpi_interface = { .supported = DEBUG_CAP_TMS_SEQ, .execute_queue = jtag_dpi_execute_queue, diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 92d8c8de4..263cde255 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -309,6 +309,18 @@ proc parport_toggling_time args { eval parport toggling_time $args } +lappend _telnet_autocomplete_skip jtag_dpi_set_port +proc jtag_dpi_set_port args { + echo "DEPRECATED! use 'jtag_dpi set_port' not 'jtag_dpi_set_port'" + eval jtag_dpi set_port $args +} + +lappend _telnet_autocomplete_skip jtag_dpi_set_address +proc jtag_dpi_set_address args { + echo "DEPRECATED! use 'jtag_dpi set_address' not 'jtag_dpi_set_address'" + eval jtag_dpi set_address $args +} + lappend _telnet_autocomplete_skip presto_serial proc presto_serial args { echo "DEPRECATED! use 'presto serial' not 'presto_serial'" commit 347af768edd32c1d954f503cd64c6c366455599d Author: Marc Schink <de...@za...> Date: Fri Jul 30 18:22:41 2021 +0200 drivers/vsllink: Group adapter commands Use a command group 'vsllink' with subcommands instead of individual commands with 'vsllink_' prefix. The old commands are still available for backward compatibility but marked as deprecated. Change-Id: I59273bd7cd08c9801e4a9b3de7beaa86ca854622 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6393 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tar...@gm...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/jtag/drivers/vsllink.c b/src/jtag/drivers/vsllink.c index 57a7c666f..7325f6abc 100644 --- a/src/jtag/drivers/vsllink.c +++ b/src/jtag/drivers/vsllink.c @@ -887,44 +887,44 @@ static void vsllink_debug_buffer(uint8_t *buffer, int length) } } -static const struct command_registration vsllink_command_handlers[] = { +static const struct command_registration vsllink_subcommand_handlers[] = { { - .name = "vsllink_usb_vid", + .name = "usb_vid", .handler = &vsllink_handle_usb_vid_command, .mode = COMMAND_CONFIG, .help = "Set USB VID", .usage = "<vid>", }, { - .name = "vsllink_usb_pid", + .name = "usb_pid", .handler = &vsllink_handle_usb_pid_command, .mode = COMMAND_CONFIG, .help = "Set USB PID", .usage = "<pid>", }, { - .name = "vsllink_usb_serial", + .name = "usb_serial", .handler = &vsllink_handle_usb_serial_command, .mode = COMMAND_CONFIG, .help = "Set or disable check for USB serial", .usage = "[<serial>]", }, { - .name = "vsllink_usb_bulkin", + .name = "usb_bulkin", .handler = &vsllink_handle_usb_bulkin_command, .mode = COMMAND_CONFIG, .help = "Set USB input endpoint", .usage = "<ep_in>", }, { - .name = "vsllink_usb_bulkout", + .name = "usb_bulkout", .handler = &vsllink_handle_usb_bulkout_command, .mode = COMMAND_CONFIG, .help = "Set USB output endpoint", .usage = "<ep_out>", }, { - .name = "vsllink_usb_interface", + .name = "usb_interface", .handler = &vsllink_handle_usb_interface_command, .mode = COMMAND_CONFIG, .help = "Set USB output interface", @@ -933,6 +933,17 @@ static const struct command_registration vsllink_command_handlers[] = { COMMAND_REGISTRATION_DONE }; +static const struct command_registration vsllink_command_handlers[] = { + { + .name = "vsllink", + .mode = COMMAND_ANY, + .help = "perform vsllink management", + .chain = vsllink_subcommand_handlers, + .usage = "", + }, + COMMAND_REGISTRATION_DONE +}; + static const char * const vsllink_transports[] = {"jtag", "swd", NULL}; static const struct swd_driver vsllink_swd_driver = { diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 19ce510c8..92d8c8de4 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -327,4 +327,40 @@ proc ulink_download_firmware args { eval ulink download_firmware $args } +lappend _telnet_autocomplete_skip vsllink_usb_vid +proc vsllink_usb_vid args { + echo "DEPRECATED! use 'vsllink usb_vid' not 'vsllink_usb_vid'" + eval vsllink usb_vid $args +} + +lappend _telnet_autocomplete_skip vsllink_usb_pid +proc vsllink_usb_pid args { + echo "DEPRECATED! use 'vsllink usb_pid' not 'vsllink_usb_pid'" + eval vsllink usb_pid $args +} + +lappend _telnet_autocomplete_skip vsllink_usb_serial +proc vsllink_usb_serial args { + echo "DEPRECATED! use 'vsllink usb_serial' not 'vsllink_usb_serial'" + eval vsllink usb_serial $args +} + +lappend _telnet_autocomplete_skip vsllink_usb_bulkin +proc vsllink_usb_bulkin args { + echo "DEPRECATED! use 'vsllink usb_bulkin' not 'vsllink_usb_bulkin'" + eval vsllink usb_bulkin $args +} + +lappend _telnet_autocomplete_skip vsllink_usb_bulkout +proc vsllink_usb_bulkout args { + echo "DEPRECATED! use 'vsllink usb_bulkout' not 'vsllink_usb_bulkout'" + eval vsllink usb_bulkout $args +} + +lappend _telnet_autocomplete_skip vsllink_usb_interface +proc vsllink_usb_interface args { + echo "DEPRECATED! use 'vsllink usb_interface' not 'vsllink_usb_interface'" + eval vsllink usb_interface $args +} + # END MIGRATION AIDS ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 4 ++-- src/jtag/drivers/jtag_dpi.c | 17 +++++++++++++--- src/jtag/drivers/vsllink.c | 25 ++++++++++++++++------- src/jtag/startup.tcl | 48 +++++++++++++++++++++++++++++++++++++++++++++ tcl/interface/jtag_dpi.cfg | 4 ++-- 5 files changed, 84 insertions(+), 14 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-14 12:35:06
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 6c5618218494263cc52c8b140d047f0d046c5d69 (commit) via 32b18728491c8a0e1cc7b2ea33836db86b92a882 (commit) via 48f34382e3aa1c19480a1b004df35018cbadd93f (commit) via 4a5045b143cad3b0bdba7c5590504bfc19e9a627 (commit) from dd04079c2c15bbdb0460342284c96812f4c78d87 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 6c5618218494263cc52c8b140d047f0d046c5d69 Author: Marc Schink <de...@za...> Date: Fri Jul 30 18:20:39 2021 +0200 drivers/ulink: Group adapter commands Use a command group 'ulink' with subcommands instead of individual commands with 'ulink_' prefix. The old commands are still available for backward compatibility but marked as deprecated. Change-Id: I600d65de2bbd5fb8107445f7fe93b6b24c572e3e Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6392 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/jtag/drivers/ulink.c b/src/jtag/drivers/ulink.c index b2fedbefd..3ae5cac62 100644 --- a/src/jtag/drivers/ulink.c +++ b/src/jtag/drivers/ulink.c @@ -2258,9 +2258,9 @@ COMMAND_HANDLER(ulink_download_firmware_handler) /*************************** Command Registration **************************/ -static const struct command_registration ulink_command_handlers[] = { +static const struct command_registration ulink_subcommand_handlers[] = { { - .name = "ulink_download_firmware", + .name = "download_firmware", .handler = &ulink_download_firmware_handler, .mode = COMMAND_EXEC, .help = "download firmware image to ULINK device", @@ -2269,6 +2269,17 @@ static const struct command_registration ulink_command_handlers[] = { COMMAND_REGISTRATION_DONE, }; +static const struct command_registration ulink_command_handlers[] = { + { + .name = "ulink", + .mode = COMMAND_ANY, + .help = "perform ulink management", + .chain = ulink_subcommand_handlers, + .usage = "", + }, + COMMAND_REGISTRATION_DONE +}; + static struct jtag_interface ulink_interface = { .execute_queue = ulink_execute_queue, }; diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index d4226c686..19ce510c8 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -321,5 +321,10 @@ proc xlnx_pcie_xvc_config args { eval xlnx_pcie_xvc config $args } +lappend _telnet_autocomplete_skip ulink_download_firmware +proc ulink_download_firmware args { + echo "DEPRECATED! use 'ulink download_firmware' not 'ulink_download_firmware'" + eval ulink download_firmware $args +} # END MIGRATION AIDS commit 32b18728491c8a0e1cc7b2ea33836db86b92a882 Author: Marc Schink <de...@za...> Date: Fri Jul 30 18:19:02 2021 +0200 drivers/xlnx-pcie-xvc: Group adapter commands Use a command group 'xlnx_pcie_xvc' with subcommands instead of individual commands with 'xlnx_pcie_xvc_' prefix. The old commands are still available for backward compatibility but marked as deprecated. Change-Id: I0deaaa14ed14f65bf356f3c248331bfab472f08d Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6391 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/doc/openocd.texi b/doc/openocd.texi index a9fe2906c..eb45acc39 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -3172,7 +3172,7 @@ exposed via extended capability registers in the PCI Express configuration space For more information see Xilinx PG245 (Section on From_PCIE_to_JTAG mode). -@deffn {Config Command} {xlnx_pcie_xvc_config} device +@deffn {Config Command} {xlnx_pcie_xvc config} device Specifies the PCI Express device via parameter @var{device} to use. The correct value for @var{device} can be obtained by looking at the output diff --git a/src/jtag/drivers/xlnx-pcie-xvc.c b/src/jtag/drivers/xlnx-pcie-xvc.c index 27295f596..c05b9cf4a 100644 --- a/src/jtag/drivers/xlnx-pcie-xvc.c +++ b/src/jtag/drivers/xlnx-pcie-xvc.c @@ -460,9 +460,9 @@ COMMAND_HANDLER(xlnx_pcie_xvc_handle_config_command) return ERROR_OK; } -static const struct command_registration xlnx_pcie_xvc_command_handlers[] = { +static const struct command_registration xlnx_pcie_xvc_subcommand_handlers[] = { { - .name = "xlnx_pcie_xvc_config", + .name = "config", .handler = xlnx_pcie_xvc_handle_config_command, .mode = COMMAND_CONFIG, .help = "Configure XVC/PCIe JTAG adapter", @@ -471,6 +471,17 @@ static const struct command_registration xlnx_pcie_xvc_command_handlers[] = { COMMAND_REGISTRATION_DONE }; +static const struct command_registration xlnx_pcie_xvc_command_handlers[] = { + { + .name = "xlnx_pcie_xvc", + .mode = COMMAND_ANY, + .help = "perform xlnx_pcie_xvc management", + .chain = xlnx_pcie_xvc_subcommand_handlers, + .usage = "", + }, + COMMAND_REGISTRATION_DONE +}; + static struct jtag_interface xlnx_pcie_xvc_jtag_ops = { .execute_queue = &xlnx_pcie_xvc_execute_queue, }; diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 94dbca263..d4226c686 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -315,4 +315,11 @@ proc presto_serial args { eval presto serial $args } +lappend _telnet_autocomplete_skip xlnx_pcie_xvc_config +proc xlnx_pcie_xvc_config args { + echo "DEPRECATED! use 'xlnx_pcie_xvc config' not 'xlnx_pcie_xvc_config'" + eval xlnx_pcie_xvc config $args +} + + # END MIGRATION AIDS commit 48f34382e3aa1c19480a1b004df35018cbadd93f Author: Marc Schink <de...@za...> Date: Fri Jul 30 18:11:23 2021 +0200 drivers/presto: Group adapter commands Use a command group 'presto' with subcommands instead of individual commands with 'presto_' prefix. The old commands are still available for backward compatibility but marked as deprecated. Change-Id: I883d8d87fd457d29cee8d12cd80f2e6c405e8f42 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6390 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 0d7719def..a9fe2906c 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -3033,7 +3033,7 @@ parport cable wiggler @deffn {Interface Driver} {presto} ASIX PRESTO USB JTAG programmer. -@deffn {Config Command} {presto_serial} serial_string +@deffn {Config Command} {presto serial} serial_string Configures the USB serial number of the Presto device to use. @end deffn @end deffn diff --git a/src/jtag/drivers/presto.c b/src/jtag/drivers/presto.c index b6f110be8..61de42630 100644 --- a/src/jtag/drivers/presto.c +++ b/src/jtag/drivers/presto.c @@ -519,9 +519,9 @@ COMMAND_HANDLER(presto_handle_serial_command) return ERROR_OK; } -static const struct command_registration presto_command_handlers[] = { +static const struct command_registration presto_subcommand_handlers[] = { { - .name = "presto_serial", + .name = "serial", .handler = presto_handle_serial_command, .mode = COMMAND_CONFIG, .help = "Configure USB serial number of Presto device.", @@ -530,6 +530,17 @@ static const struct command_registration presto_command_handlers[] = { COMMAND_REGISTRATION_DONE }; +static const struct command_registration presto_command_handlers[] = { + { + .name = "presto", + .mode = COMMAND_ANY, + .help = "perform presto management", + .chain = presto_subcommand_handlers, + .usage = "", + }, + COMMAND_REGISTRATION_DONE +}; + static int presto_jtag_init(void) { if (presto_open(presto_serial) != ERROR_OK) { diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 02a3626f4..94dbca263 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -309,4 +309,10 @@ proc parport_toggling_time args { eval parport toggling_time $args } +lappend _telnet_autocomplete_skip presto_serial +proc presto_serial args { + echo "DEPRECATED! use 'presto serial' not 'presto_serial'" + eval presto serial $args +} + # END MIGRATION AIDS commit 4a5045b143cad3b0bdba7c5590504bfc19e9a627 Author: Marc Schink <de...@za...> Date: Fri Jul 30 18:01:09 2021 +0200 drivers/remote_bitbang: Group adapter commands Use a command group 'remote_bitbang' with subcommands instead of individual commands with 'remote_bitbang_' prefix. The old commands are still available for backward compatibility but marked as deprecated. Change-Id: I2692320f19c8a357112a365db6ca7e13cd6ad411 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6389 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/contrib/remote_bitbang/remote_bitbang_sysfsgpio.c b/contrib/remote_bitbang/remote_bitbang_sysfsgpio.c index 5c717ce0e..6cf30c3bc 100644 --- a/contrib/remote_bitbang/remote_bitbang_sysfsgpio.c +++ b/contrib/remote_bitbang/remote_bitbang_sysfsgpio.c @@ -30,12 +30,12 @@ socat TCP6-LISTEN:7777,fork EXEC:"sudo ./remote_bitbang_sysfsgpio tck 11 tms 25 tdo 9 tdi 10" On host run: - openocd -c "interface remote_bitbang; remote_bitbang_host raspberrypi; remote_bitbang_port 7777" \ + openocd -c "interface remote_bitbang; remote_bitbang host raspberrypi; remote_bitbang port 7777" \ -f target/stm32f1x.cfg Or if you want to test UNIX sockets, run both on Raspberry Pi: socat UNIX-LISTEN:/tmp/remotebitbang-socket,fork EXEC:"sudo ./remote_bitbang_sysfsgpio tck 11 tms 25 tdo 9 tdi 10" - openocd -c "interface remote_bitbang; remote_bitbang_host /tmp/remotebitbang-socket" -f target/stm32f1x.cfg + openocd -c "interface remote_bitbang; remote_bitbang host /tmp/remotebitbang-socket" -f target/stm32f1x.cfg */ #include <sys/types.h> diff --git a/doc/openocd.texi b/doc/openocd.texi index c3963d6cb..0d7719def 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2694,14 +2694,14 @@ instead of directly driving JTAG. The remote_bitbang driver is useful for debugging software running on processors which are being simulated. -@deffn {Config Command} {remote_bitbang_port} number +@deffn {Config Command} {remote_bitbang port} number Specifies the TCP port of the remote process to connect to or 0 to use UNIX sockets instead of TCP. @end deffn -@deffn {Config Command} {remote_bitbang_host} hostname +@deffn {Config Command} {remote_bitbang host} hostname Specifies the hostname of the remote process to connect to using TCP, or the -name of the UNIX socket to use if remote_bitbang_port is 0. +name of the UNIX socket to use if remote_bitbang port is 0. @end deffn For example, to connect remotely via TCP to the host foobar you might have @@ -2709,8 +2709,8 @@ something like: @example adapter driver remote_bitbang -remote_bitbang_port 3335 -remote_bitbang_host foobar +remote_bitbang port 3335 +remote_bitbang host foobar @end example To connect to another process running locally via UNIX sockets with socket @@ -2718,8 +2718,8 @@ named mysocket: @example adapter driver remote_bitbang -remote_bitbang_port 0 -remote_bitbang_host mysocket +remote_bitbang port 0 +remote_bitbang host mysocket @end example @end deffn diff --git a/src/jtag/drivers/remote_bitbang.c b/src/jtag/drivers/remote_bitbang.c index 6d1f48bc3..ce1a06544 100644 --- a/src/jtag/drivers/remote_bitbang.c +++ b/src/jtag/drivers/remote_bitbang.c @@ -340,9 +340,9 @@ COMMAND_HANDLER(remote_bitbang_handle_remote_bitbang_host_command) return ERROR_COMMAND_SYNTAX_ERROR; } -static const struct command_registration remote_bitbang_command_handlers[] = { +static const struct command_registration remote_bitbang_subcommand_handlers[] = { { - .name = "remote_bitbang_port", + .name = "port", .handler = remote_bitbang_handle_remote_bitbang_port_command, .mode = COMMAND_CONFIG, .help = "Set the port to use to connect to the remote jtag.\n" @@ -350,7 +350,7 @@ static const struct command_registration remote_bitbang_command_handlers[] = { .usage = "port_number", }, { - .name = "remote_bitbang_host", + .name = "host", .handler = remote_bitbang_handle_remote_bitbang_host_command, .mode = COMMAND_CONFIG, .help = "Set the host to use to connect to the remote jtag.\n" @@ -360,6 +360,17 @@ static const struct command_registration remote_bitbang_command_handlers[] = { COMMAND_REGISTRATION_DONE, }; +static const struct command_registration remote_bitbang_command_handlers[] = { + { + .name = "remote_bitbang", + .mode = COMMAND_ANY, + .help = "perform remote_bitbang management", + .chain = remote_bitbang_subcommand_handlers, + .usage = "", + }, + COMMAND_REGISTRATION_DONE +}; + static int remote_bitbang_execute_queue(void) { /* safety: the send buffer must be empty, no leftover characters from diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index f2e4ec353..02a3626f4 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -261,6 +261,18 @@ proc ftdi_tdo_sample_edge args { eval ftdi tdo_sample_edge $args } +lappend _telnet_autocomplete_skip remote_bitbang_host +proc remote_bitbang_host args { + echo "DEPRECATED! use 'remote_bitbang host' not 'remote_bitbang_host'" + eval remote_bitbang host $args +} + +lappend _telnet_autocomplete_skip remote_bitbang_port +proc remote_bitbang_port args { + echo "DEPRECATED! use 'remote_bitbang port' not 'remote_bitbang_port'" + eval remote_bitbang port $args +} + lappend _telnet_autocomplete_skip openjtag_device_desc proc openjtag_device_desc args { echo "DEPRECATED! use 'openjtag device_desc' not 'openjtag_device_desc'" ----------------------------------------------------------------------- Summary of changes: contrib/remote_bitbang/remote_bitbang_sysfsgpio.c | 4 +-- doc/openocd.texi | 18 +++++++------- src/jtag/drivers/presto.c | 15 ++++++++++-- src/jtag/drivers/remote_bitbang.c | 17 ++++++++++--- src/jtag/drivers/ulink.c | 15 ++++++++++-- src/jtag/drivers/xlnx-pcie-xvc.c | 15 ++++++++++-- src/jtag/startup.tcl | 30 +++++++++++++++++++++++ 7 files changed, 94 insertions(+), 20 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-14 12:34:14
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via dd04079c2c15bbdb0460342284c96812f4c78d87 (commit) via de5c752102b54ca91895094fa6b867f0c20d21ac (commit) via 3ce92fa33ded60a0f03f51dae49dcb0236c33a6f (commit) via fbbf63f6597e825158960c8f65d7aa91ce0a1f00 (commit) from 38f94a26772f2e1c99e4e65ac1b60bc9e1bb150a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit dd04079c2c15bbdb0460342284c96812f4c78d87 Author: Marc Schink <de...@za...> Date: Fri Jul 30 17:51:04 2021 +0200 tcl/interface/openjtag: Adapt to new openjtag command syntax Change-Id: I3a9d649dd38a913b1ce6d4a2d506bbf44743d529 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6388 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/tcl/interface/openjtag.cfg b/tcl/interface/openjtag.cfg index 9a5827b14..8d015b704 100644 --- a/tcl/interface/openjtag.cfg +++ b/tcl/interface/openjtag.cfg @@ -5,4 +5,4 @@ # adapter driver openjtag -openjtag_device_desc "Open JTAG Project" +openjtag device_desc "Open JTAG Project" commit de5c752102b54ca91895094fa6b867f0c20d21ac Author: Marc Schink <de...@za...> Date: Fri Jul 30 17:50:21 2021 +0200 drivers/openjtag: Group adapter commands Use a command group 'openjtag' with subcommands instead of individual commands with 'openjtag_' prefix. The old commands are still available for backward compatibility but marked as deprecated. Change-Id: Ie1b1bf0b7c03e7703cfb074e554288384bf7b1b9 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6387 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 1b247578e..c3963d6cb 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -3298,7 +3298,7 @@ See @file{interface/sysfsgpio-raspberrypi.cfg} for a sample config. OpenJTAG compatible USB adapter. This defines some driver-specific commands: -@deffn {Config Command} {openjtag_variant} variant +@deffn {Config Command} {openjtag variant} variant Specifies the variant of the OpenJTAG adapter (see @uref{http://www.openjtag.org/}). Currently valid @var{variant} values include: @@ -3309,7 +3309,7 @@ Currently valid @var{variant} values include: @end itemize @end deffn -@deffn {Config Command} {openjtag_device_desc} string +@deffn {Config Command} {openjtag device_desc} string The USB device description string of the adapter. This value is only used with the standard variant. @end deffn diff --git a/src/jtag/drivers/openjtag.c b/src/jtag/drivers/openjtag.c index 7efb0e5e0..123134f51 100644 --- a/src/jtag/drivers/openjtag.c +++ b/src/jtag/drivers/openjtag.c @@ -870,16 +870,16 @@ COMMAND_HANDLER(openjtag_handle_variant_command) return ERROR_OK; } -static const struct command_registration openjtag_command_handlers[] = { +static const struct command_registration openjtag_subcommand_handlers[] = { { - .name = "openjtag_device_desc", + .name = "device_desc", .handler = openjtag_handle_device_desc_command, .mode = COMMAND_CONFIG, .help = "set the USB device description of the OpenJTAG", .usage = "description-string", }, { - .name = "openjtag_variant", + .name = "variant", .handler = openjtag_handle_variant_command, .mode = COMMAND_CONFIG, .help = "set the OpenJTAG variant", @@ -888,6 +888,17 @@ static const struct command_registration openjtag_command_handlers[] = { COMMAND_REGISTRATION_DONE }; +static const struct command_registration openjtag_command_handlers[] = { + { + .name = "openjtag", + .mode = COMMAND_ANY, + .help = "perform openjtag management", + .chain = openjtag_subcommand_handlers, + .usage = "", + }, + COMMAND_REGISTRATION_DONE +}; + static struct jtag_interface openjtag_interface = { .execute_queue = openjtag_execute_queue, }; diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index d6413e48f..f2e4ec353 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -261,6 +261,18 @@ proc ftdi_tdo_sample_edge args { eval ftdi tdo_sample_edge $args } +lappend _telnet_autocomplete_skip openjtag_device_desc +proc openjtag_device_desc args { + echo "DEPRECATED! use 'openjtag device_desc' not 'openjtag_device_desc'" + eval openjtag device_desc $args +} + +lappend _telnet_autocomplete_skip openjtag_variant +proc openjtag_variant args { + echo "DEPRECATED! use 'openjtag variant' not 'openjtag_variant'" + eval openjtag variant $args +} + lappend _telnet_autocomplete_skip parport_port proc parport_port args { echo "DEPRECATED! use 'parport port' not 'parport_port'" commit 3ce92fa33ded60a0f03f51dae49dcb0236c33a6f Author: Marc Schink <de...@za...> Date: Fri Jul 30 17:43:58 2021 +0200 tcl/interface: Adapt config files to new parport command syntax Change-Id: Iffe7a04c36c6ec680497081a99d55b8c69f8f079 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6386 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/tcl/interface/chameleon.cfg b/tcl/interface/chameleon.cfg index 1cb1d6151..97bf98d27 100644 --- a/tcl/interface/chameleon.cfg +++ b/tcl/interface/chameleon.cfg @@ -5,4 +5,4 @@ # adapter driver parport -parport_cable chameleon +parport cable chameleon diff --git a/tcl/interface/flashlink.cfg b/tcl/interface/flashlink.cfg index e0a4b97d0..b7ec0bb24 100644 --- a/tcl/interface/flashlink.cfg +++ b/tcl/interface/flashlink.cfg @@ -12,5 +12,5 @@ if { [info exists PARPORTADDR] } { } adapter driver parport -parport_port $_PARPORTADDR -parport_cable flashlink +parport port $_PARPORTADDR +parport cable flashlink diff --git a/tcl/interface/parport.cfg b/tcl/interface/parport.cfg index 4c0b260b9..05195f027 100644 --- a/tcl/interface/parport.cfg +++ b/tcl/interface/parport.cfg @@ -15,5 +15,5 @@ if { [info exists PARPORTADDR] } { } adapter driver parport -parport_port $_PARPORTADDR -parport_cable wiggler +parport port $_PARPORTADDR +parport cable wiggler diff --git a/tcl/interface/parport_dlc5.cfg b/tcl/interface/parport_dlc5.cfg index e9beaaf41..19e21ffda 100644 --- a/tcl/interface/parport_dlc5.cfg +++ b/tcl/interface/parport_dlc5.cfg @@ -11,5 +11,5 @@ if { [info exists PARPORTADDR] } { } adapter driver parport -parport_port $_PARPORTADDR -parport_cable dlc5 +parport port $_PARPORTADDR +parport cable dlc5 commit fbbf63f6597e825158960c8f65d7aa91ce0a1f00 Author: Marc Schink <de...@za...> Date: Fri Jul 30 17:39:11 2021 +0200 drivers/parport: Group adapter commands Use a command group 'parport' with subcommands instead of individual commands with 'parport_' prefix. The old commands are still available for backward compatibility but marked as deprecated. Change-Id: I4cb7096a8ba8d6cd7a6dc970862cd73c32b5c0a2 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6385 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 3aee034a4..1b247578e 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2378,7 +2378,7 @@ Amontec Chameleon in its JTAG Accelerator configuration, connected to a PC's EPP mode parallel port. This defines some driver-specific commands: -@deffn {Config Command} {parport_port} number +@deffn {Config Command} {parport port} number Specifies either the address of the I/O port (default: 0x378 for LPT1) or the number of the @file{/dev/parport} device. @end deffn @@ -2779,7 +2779,7 @@ image. To be used with USB-Blaster II only. Gateworks GW16012 JTAG programmer. This has one driver-specific command: -@deffn {Config Command} {parport_port} [port_number] +@deffn {Config Command} {parport port} [port_number] Display either the address of the I/O port (default: 0x378 for LPT1) or the number of the @file{/dev/parport} device. If a parameter is provided, first switch to use that port. @@ -2938,7 +2938,7 @@ Wigglers, PLD download cable, and more. These interfaces have several commands, used to configure the driver before initializing the JTAG scan chain: -@deffn {Config Command} {parport_cable} name +@deffn {Config Command} {parport cable} name Set the layout of the parallel port cable used to connect to the target. This is a write-once setting. Currently valid cable @var{name} values include: @@ -2968,18 +2968,18 @@ several clones, such as the Olimex ARM-JTAG @end itemize @end deffn -@deffn {Config Command} {parport_port} [port_number] +@deffn {Config Command} {parport port} [port_number] Display either the address of the I/O port (default: 0x378 for LPT1) or the number of the @file{/dev/parport} device. If a parameter is provided, first switch to use that port. This is a write-once setting. When using PPDEV to access the parallel port, use the number of the parallel port: -@option{parport_port 0} (the default). If @option{parport_port 0x378} is specified +@option{parport port 0} (the default). If @option{parport port 0x378} is specified you may encounter a problem. @end deffn -@deffn {Config Command} {parport_toggling_time} [nanoseconds] +@deffn {Config Command} {parport toggling_time} [nanoseconds] Displays how many nanoseconds the hardware needs to toggle TCK; the parport driver uses this value to obey the @command{adapter speed} configuration. @@ -2992,7 +2992,7 @@ However, you may want to calibrate for your specific hardware. To measure the toggling time with a logic analyzer or a digital storage oscilloscope, follow the procedure below: @example -> parport_toggling_time 1000 +> parport toggling_time 1000 > adapter speed 500 @end example This sets the maximum JTAG clock speed of the hardware, but @@ -3002,7 +3002,7 @@ You can use @command{runtest 1000} or something similar to generate a large set of samples. Update the setting to match your measurement: @example -> parport_toggling_time <measured nanoseconds> +> parport toggling_time <measured nanoseconds> @end example Now the clock speed will be a better match for @command{adapter speed} command given in OpenOCD scripts and event handlers. @@ -3016,7 +3016,7 @@ be conservative. @end quotation @end deffn -@deffn {Config Command} {parport_write_on_exit} (@option{on}|@option{off}) +@deffn {Config Command} {parport write_on_exit} (@option{on}|@option{off}) This will configure the parallel driver to write a known cable-specific value to the parallel interface on exiting OpenOCD. @end deffn @@ -3026,8 +3026,8 @@ classic ``Wiggler'' cable on LPT2 might look something like this: @example adapter driver parport -parport_port 0x278 -parport_cable wiggler +parport port 0x278 +parport cable wiggler @end example @end deffn diff --git a/src/jtag/drivers/parport.c b/src/jtag/drivers/parport.c index 1d7fcc44d..d50d306d3 100644 --- a/src/jtag/drivers/parport.c +++ b/src/jtag/drivers/parport.c @@ -473,9 +473,9 @@ COMMAND_HANDLER(parport_handle_parport_toggling_time_command) return ERROR_OK; } -static const struct command_registration parport_command_handlers[] = { +static const struct command_registration parport_subcommand_handlers[] = { { - .name = "parport_port", + .name = "port", .handler = parport_handle_parport_port_command, .mode = COMMAND_CONFIG, .help = "Display the address of the I/O port (e.g. 0x378) " @@ -484,7 +484,7 @@ static const struct command_registration parport_command_handlers[] = { .usage = "[port_number]", }, { - .name = "parport_cable", + .name = "cable", .handler = parport_handle_parport_cable_command, .mode = COMMAND_CONFIG, .help = "Set the layout of the parallel port cable " @@ -493,7 +493,7 @@ static const struct command_registration parport_command_handlers[] = { .usage = "[layout]", }, { - .name = "parport_write_on_exit", + .name = "write_on_exit", .handler = parport_handle_write_on_exit_command, .mode = COMMAND_CONFIG, .help = "Configure the parallel driver to write " @@ -501,7 +501,7 @@ static const struct command_registration parport_command_handlers[] = { .usage = "('on'|'off')", }, { - .name = "parport_toggling_time", + .name = "toggling_time", .handler = parport_handle_parport_toggling_time_command, .mode = COMMAND_CONFIG, .help = "Displays or assigns how many nanoseconds it " @@ -511,6 +511,17 @@ static const struct command_registration parport_command_handlers[] = { COMMAND_REGISTRATION_DONE }; +static const struct command_registration parport_command_handlers[] = { + { + .name = "parport", + .mode = COMMAND_ANY, + .help = "perform parport management", + .chain = parport_subcommand_handlers, + .usage = "", + }, + COMMAND_REGISTRATION_DONE +}; + static struct jtag_interface parport_interface = { .supported = DEBUG_CAP_TMS_SEQ, .execute_queue = bitbang_execute_queue, diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 472a9f283..d6413e48f 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -261,4 +261,28 @@ proc ftdi_tdo_sample_edge args { eval ftdi tdo_sample_edge $args } +lappend _telnet_autocomplete_skip parport_port +proc parport_port args { + echo "DEPRECATED! use 'parport port' not 'parport_port'" + eval parport port $args +} + +lappend _telnet_autocomplete_skip parport_cable +proc parport_cable args { + echo "DEPRECATED! use 'parport cable' not 'parport_cable'" + eval parport cable $args +} + +lappend _telnet_autocomplete_skip parport_write_on_exit +proc parport_write_on_exit args { + echo "DEPRECATED! use 'parport write_on_exit' not 'parport_write_on_exit'" + eval parport write_on_exit $args +} + +lappend _telnet_autocomplete_skip parport_toggling_time +proc parport_toggling_time args { + echo "DEPRECATED! use 'parport toggling_time' not 'parport_toggling_time'" + eval parport toggling_time $args +} + # END MIGRATION AIDS ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 26 +++++++++++++------------- src/jtag/drivers/openjtag.c | 17 ++++++++++++++--- src/jtag/drivers/parport.c | 21 ++++++++++++++++----- src/jtag/startup.tcl | 36 ++++++++++++++++++++++++++++++++++++ tcl/interface/chameleon.cfg | 2 +- tcl/interface/flashlink.cfg | 4 ++-- tcl/interface/openjtag.cfg | 2 +- tcl/interface/parport.cfg | 4 ++-- tcl/interface/parport_dlc5.cfg | 4 ++-- 9 files changed, 87 insertions(+), 29 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-14 12:33:20
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 38f94a26772f2e1c99e4e65ac1b60bc9e1bb150a (commit) from a555434c50544410ab6f8915f1e2a829cc6e6de2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 38f94a26772f2e1c99e4e65ac1b60bc9e1bb150a Author: Marc Schink <de...@za...> Date: Fri May 7 12:02:23 2021 +0200 flash/nor: Do not update 'is_erased' Remove useless setting of the 'is_erased' flag after a flash modification. Also, remove code that erroneously depends on this flag. Keep the flag for now since it is still used by the erase_check() functionality. See commit 07da3b3913dcb6b65564f4fe67c2f26032f180c0 Change-Id: Ia046905bc9e0cb2572145f19251c3e10c4e2d553 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6279 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tar...@gm...> Reviewed-by: Tomas Vanek <va...@fb...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/flash/nor/ambiqmicro.c b/src/flash/nor/ambiqmicro.c index 684d21de0..6eda9286c 100644 --- a/src/flash/nor/ambiqmicro.c +++ b/src/flash/nor/ambiqmicro.c @@ -777,13 +777,9 @@ COMMAND_HANDLER(ambiqmicro_handle_mass_erase_command) if (retval != ERROR_OK) return retval; - if (ambiqmicro_mass_erase(bank) == ERROR_OK) { - /* set all sectors as erased */ - for (unsigned int i = 0; i < bank->num_sectors; i++) - bank->sectors[i].is_erased = 1; - + if (ambiqmicro_mass_erase(bank) == ERROR_OK) command_print(CMD, "ambiqmicro mass erase complete"); - } else + else command_print(CMD, "ambiqmicro mass erase failed"); return ERROR_OK; diff --git a/src/flash/nor/at91sam4l.c b/src/flash/nor/at91sam4l.c index d09414cbe..f8c6f6490 100644 --- a/src/flash/nor/at91sam4l.c +++ b/src/flash/nor/at91sam4l.c @@ -480,9 +480,6 @@ static int sam4l_erase(struct flash_bank *bank, unsigned int first, return ERROR_FAIL; } } - - /* This sector is definitely erased. */ - bank->sectors[i].is_erased = 1; } } diff --git a/src/flash/nor/avrf.c b/src/flash/nor/avrf.c index a5a2cbd5b..634f7396a 100644 --- a/src/flash/nor/avrf.c +++ b/src/flash/nor/avrf.c @@ -438,13 +438,9 @@ COMMAND_HANDLER(avrf_handle_mass_erase_command) if (retval != ERROR_OK) return retval; - if (avrf_mass_erase(bank) == ERROR_OK) { - /* set all sectors as erased */ - for (unsigned int i = 0; i < bank->num_sectors; i++) - bank->sectors[i].is_erased = 1; - + if (avrf_mass_erase(bank) == ERROR_OK) command_print(CMD, "avr mass erase complete"); - } else + else command_print(CMD, "avr mass erase failed"); LOG_DEBUG("%s", __func__); diff --git a/src/flash/nor/cfi.c b/src/flash/nor/cfi.c index 830d3e369..e3fb6c8ff 100644 --- a/src/flash/nor/cfi.c +++ b/src/flash/nor/cfi.c @@ -870,9 +870,7 @@ static int cfi_intel_erase(struct flash_bank *bank, unsigned int first, if (retval != ERROR_OK) return retval; - if (status == 0x80) - bank->sectors[i].is_erased = 1; - else { + if (status != 0x80) { retval = cfi_send_command(bank, 0xff, cfi_flash_address(bank, 0, 0x0)); if (retval != ERROR_OK) return retval; @@ -927,9 +925,7 @@ static int cfi_spansion_erase(struct flash_bank *bank, unsigned int first, if (retval != ERROR_OK) return retval; - if (cfi_spansion_wait_status_busy(bank, cfi_info->block_erase_timeout) == ERROR_OK) - bank->sectors[i].is_erased = 1; - else { + if (cfi_spansion_wait_status_busy(bank, cfi_info->block_erase_timeout) != ERROR_OK) { retval = cfi_send_command(bank, 0xf0, cfi_flash_address(bank, 0, 0x0)); if (retval != ERROR_OK) return retval; diff --git a/src/flash/nor/dsp5680xx_flash.c b/src/flash/nor/dsp5680xx_flash.c index 49022825e..5e8eec30f 100644 --- a/src/flash/nor/dsp5680xx_flash.c +++ b/src/flash/nor/dsp5680xx_flash.c @@ -130,15 +130,9 @@ static int dsp5680xx_flash_protect(struct flash_bank *bank, int set, if (set) retval = dsp5680xx_f_lock(bank->target); - else { + else retval = dsp5680xx_f_unlock(bank->target); - if (retval == ERROR_OK) { - /* mark all as erased */ - for (int i = 0; i <= (HFM_SECTOR_COUNT - 1); i++) - /* FM does not recognize it as erased if erased via JTAG. */ - bank->sectors[i].is_erased = 1; - } - } + return retval; } @@ -156,8 +150,6 @@ static int dsp5680xx_flash_protect(struct flash_bank *bank, int set, static int dsp5680xx_flash_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) { - int retval; - if ((offset + count / 2) > bank->size) { LOG_ERROR("%s: Flash bank cannot fit data.", __func__); return ERROR_FAIL; @@ -171,17 +163,7 @@ static int dsp5680xx_flash_write(struct flash_bank *bank, const uint8_t *buffer, LOG_ERROR("%s: Writing to odd addresses not supported for this target", __func__); return ERROR_FAIL; } - retval = dsp5680xx_f_wr(bank->target, buffer, bank->base + offset / 2, count, 0); - uint32_t addr_word; - - for (addr_word = bank->base + offset / 2; addr_word < count / 2; - addr_word += (HFM_SECTOR_SIZE / 2)) { - if (retval == ERROR_OK) - bank->sectors[addr_word / (HFM_SECTOR_SIZE / 2)].is_erased = 0; - else - bank->sectors[addr_word / (HFM_SECTOR_SIZE / 2)].is_erased = -1; - } - return retval; + return dsp5680xx_f_wr(bank->target, buffer, bank->base + offset / 2, count, 0); } static int dsp5680xx_probe(struct flash_bank *bank) @@ -206,22 +188,7 @@ static int dsp5680xx_probe(struct flash_bank *bank) static int dsp5680xx_flash_erase(struct flash_bank *bank, unsigned int first, unsigned int last) { - int retval; - - retval = dsp5680xx_f_erase(bank->target, (uint32_t) first, (uint32_t) last); - if ((!(first | last)) || ((first == 0) && (last == (HFM_SECTOR_COUNT - 1)))) - last = HFM_SECTOR_COUNT - 1; - if (retval == ERROR_OK) - for (unsigned int i = first; i <= last; i++) - bank->sectors[i].is_erased = 1; - else - /** - * If an error occurred unknown status - *is set even though some sector could have been correctly erased. - */ - for (unsigned int i = first; i <= last; i++) - bank->sectors[i].is_erased = -1; - return retval; + return dsp5680xx_f_erase(bank->target, (uint32_t) first, (uint32_t) last); } /** @@ -241,16 +208,14 @@ static int dsp5680xx_flash_erase_check(struct flash_bank *bank) uint32_t i; for (i = 0; i < HFM_SECTOR_COUNT; i++) { - if (bank->sectors[i].is_erased == -1) { - retval = dsp5680xx_f_erase_check(bank->target, &erased, i); - if (retval != ERROR_OK) { - bank->sectors[i].is_erased = -1; - } else { - if (erased) - bank->sectors[i].is_erased = 1; - else - bank->sectors[i].is_erased = 0; - } + retval = dsp5680xx_f_erase_check(bank->target, &erased, i); + if (retval != ERROR_OK) { + bank->sectors[i].is_erased = -1; + } else { + if (erased) + bank->sectors[i].is_erased = 1; + else + bank->sectors[i].is_erased = 0; } } return retval; diff --git a/src/flash/nor/em357.c b/src/flash/nor/em357.c index 2597d8beb..705c1b339 100644 --- a/src/flash/nor/em357.c +++ b/src/flash/nor/em357.c @@ -382,8 +382,6 @@ static int em357_erase(struct flash_bank *bank, unsigned int first, retval = em357_wait_status_busy(bank, 100); if (retval != ERROR_OK) return retval; - - bank->sectors[i].is_erased = 1; } retval = target_write_u32(target, EM357_FLASH_CR, FLASH_LOCK); @@ -877,13 +875,9 @@ COMMAND_HANDLER(em357_handle_mass_erase_command) return retval; retval = em357_mass_erase(bank); - if (retval == ERROR_OK) { - /* set all sectors as erased */ - for (unsigned int i = 0; i < bank->num_sectors; i++) - bank->sectors[i].is_erased = 1; - + if (retval == ERROR_OK) command_print(CMD, "em357 mass erase complete"); - } else + else command_print(CMD, "em357 mass erase failed"); return retval; diff --git a/src/flash/nor/fm3.c b/src/flash/nor/fm3.c index dc7dd40be..831f34257 100644 --- a/src/flash/nor/fm3.c +++ b/src/flash/nor/fm3.c @@ -328,7 +328,6 @@ static int fm3_erase(struct flash_bank *bank, unsigned int first, if (retval != ERROR_OK) return retval; } - bank->sectors[sector].is_erased = 1; } target_free_working_area(target, write_algorithm); @@ -953,10 +952,6 @@ COMMAND_HANDLER(fm3_handle_chip_erase_command) return retval; if (fm3_chip_erase(bank) == ERROR_OK) { - /* set all sectors as erased */ - for (unsigned int i = 0; i < bank->num_sectors; i++) - bank->sectors[i].is_erased = 1; - command_print(CMD, "fm3 chip erase complete"); } else { command_print(CMD, "fm3 chip erase failed"); diff --git a/src/flash/nor/fm4.c b/src/flash/nor/fm4.c index 592ccb603..09865d2ab 100644 --- a/src/flash/nor/fm4.c +++ b/src/flash/nor/fm4.c @@ -177,8 +177,6 @@ static int fm4_flash_erase(struct flash_bank *bank, unsigned int first, goto err_run_ret; } else retval = ERROR_OK; - - bank->sectors[sector].is_erased = 1; } err_run_ret: diff --git a/src/flash/nor/kinetis_ke.c b/src/flash/nor/kinetis_ke.c index 0b5ba12a9..513b072dd 100644 --- a/src/flash/nor/kinetis_ke.c +++ b/src/flash/nor/kinetis_ke.c @@ -1000,8 +1000,6 @@ static int kinetis_ke_erase(struct flash_bank *bank, unsigned int first, return ERROR_FLASH_OPERATION_FAILED; } - bank->sectors[i].is_erased = 1; - if (i == 2) fcf_erased = true; } diff --git a/src/flash/nor/max32xxx.c b/src/flash/nor/max32xxx.c index 1327da6e1..d11af9094 100644 --- a/src/flash/nor/max32xxx.c +++ b/src/flash/nor/max32xxx.c @@ -302,8 +302,6 @@ static int max32xxx_erase(struct flash_bank *bank, unsigned int first, max32xxx_flash_op_post(bank); return ERROR_FLASH_OPERATION_FAILED; } - - bank->sectors[banknr].is_erased = 1; } if (!erased) { @@ -771,13 +769,9 @@ COMMAND_HANDLER(max32xxx_handle_mass_erase_command) if (retval != ERROR_OK) return retval; - if (max32xxx_mass_erase(bank) == ERROR_OK) { - /* set all sectors as erased */ - for (unsigned i = 0; i < bank->num_sectors; i++) - bank->sectors[i].is_erased = 1; - + if (max32xxx_mass_erase(bank) == ERROR_OK) command_print(CMD, "max32xxx mass erase complete"); - } else + else command_print(CMD, "max32xxx mass erase failed"); return ERROR_OK; diff --git a/src/flash/nor/mdr.c b/src/flash/nor/mdr.c index 228d4bcd5..f3c85525a 100644 --- a/src/flash/nor/mdr.c +++ b/src/flash/nor/mdr.c @@ -197,7 +197,6 @@ static int mdr_erase(struct flash_bank *bank, unsigned int first, if (retval != ERROR_OK) goto reset_pg_and_lock; } - bank->sectors[i].is_erased = 1; } reset_pg_and_lock: diff --git a/src/flash/nor/niietcm4.c b/src/flash/nor/niietcm4.c index b26680383..6f9a5d378 100644 --- a/src/flash/nor/niietcm4.c +++ b/src/flash/nor/niietcm4.c @@ -1206,8 +1206,6 @@ static int niietcm4_erase(struct flash_bank *bank, unsigned int first, retval = niietcm4_opstatus_check(bank); if (retval != ERROR_OK) return retval; - - bank->sectors[i].is_erased = 1; } return retval; diff --git a/src/flash/nor/numicro.c b/src/flash/nor/numicro.c index ce3973b9f..cb7c1df83 100644 --- a/src/flash/nor/numicro.c +++ b/src/flash/nor/numicro.c @@ -1532,8 +1532,6 @@ static int numicro_erase(struct flash_bank *bank, unsigned int first, retval = target_write_u32(target, NUMICRO_FLASH_ISPCON, (status | ISPCON_ISPFF)); if (retval != ERROR_OK) return retval; - } else { - bank->sectors[i].is_erased = 1; } } diff --git a/src/flash/nor/pic32mx.c b/src/flash/nor/pic32mx.c index a1f2cdf4e..31433e03f 100644 --- a/src/flash/nor/pic32mx.c +++ b/src/flash/nor/pic32mx.c @@ -353,7 +353,6 @@ static int pic32mx_erase(struct flash_bank *bank, unsigned int first, return ERROR_FLASH_OPERATION_FAILED; if (status & NVMCON_LVDERR) return ERROR_FLASH_OPERATION_FAILED; - bank->sectors[i].is_erased = 1; } return ERROR_OK; diff --git a/src/flash/nor/psoc4.c b/src/flash/nor/psoc4.c index 609d3b9dd..0a2702ab5 100644 --- a/src/flash/nor/psoc4.c +++ b/src/flash/nor/psoc4.c @@ -520,16 +520,9 @@ static int psoc4_mass_erase(struct flash_bank *bank) /* Call "Erase All" system ROM API */ uint32_t param = 0; - retval = psoc4_sysreq(bank, PSOC4_CMD_ERASE_ALL, + return psoc4_sysreq(bank, PSOC4_CMD_ERASE_ALL, 0, ¶m, sizeof(param), NULL); - - if (retval == ERROR_OK) - /* set all sectors as erased */ - for (unsigned int i = 0; i < bank->num_sectors; i++) - bank->sectors[i].is_erased = 1; - - return retval; } diff --git a/src/flash/nor/psoc6.c b/src/flash/nor/psoc6.c index c65411bb9..b8b520237 100644 --- a/src/flash/nor/psoc6.c +++ b/src/flash/nor/psoc6.c @@ -744,9 +744,6 @@ static int psoc6_erase(struct flash_bank *bank, unsigned int first, if (hr != ERROR_OK) goto exit_free_wa; - for (unsigned int i = first; i < first + rows_in_sector; i++) - bank->sectors[i].is_erased = 1; - first += rows_in_sector; } else { /* Perform Row Erase otherwise */ @@ -754,7 +751,6 @@ static int psoc6_erase(struct flash_bank *bank, unsigned int first, if (hr != ERROR_OK) goto exit_free_wa; - bank->sectors[first].is_erased = 1; first += 1; } } diff --git a/src/flash/nor/stellaris.c b/src/flash/nor/stellaris.c index 569c09b46..d2638c152 100644 --- a/src/flash/nor/stellaris.c +++ b/src/flash/nor/stellaris.c @@ -886,8 +886,6 @@ static int stellaris_erase(struct flash_bank *bank, unsigned int first, target_write_u32(target, FLASH_CRIS, 0); return ERROR_FLASH_OPERATION_FAILED; } - - bank->sectors[banknr].is_erased = 1; } return ERROR_OK; @@ -1318,13 +1316,9 @@ COMMAND_HANDLER(stellaris_handle_mass_erase_command) if (retval != ERROR_OK) return retval; - if (stellaris_mass_erase(bank) == ERROR_OK) { - /* set all sectors as erased */ - for (unsigned int i = 0; i < bank->num_sectors; i++) - bank->sectors[i].is_erased = 1; - + if (stellaris_mass_erase(bank) == ERROR_OK) command_print(CMD, "stellaris mass erase complete"); - } else + else command_print(CMD, "stellaris mass erase failed"); return ERROR_OK; diff --git a/src/flash/nor/stm32f1x.c b/src/flash/nor/stm32f1x.c index afc6ec9b6..3bda9bc20 100644 --- a/src/flash/nor/stm32f1x.c +++ b/src/flash/nor/stm32f1x.c @@ -402,8 +402,6 @@ static int stm32x_erase(struct flash_bank *bank, unsigned int first, retval = stm32x_wait_status_busy(bank, FLASH_ERASE_TIMEOUT); if (retval != ERROR_OK) return retval; - - bank->sectors[i].is_erased = 1; } retval = target_write_u32(target, stm32x_get_flash_reg(bank, STM32_FLASH_CR), FLASH_LOCK); @@ -1524,13 +1522,9 @@ COMMAND_HANDLER(stm32x_handle_mass_erase_command) return retval; retval = stm32x_mass_erase(bank); - if (retval == ERROR_OK) { - /* set all sectors as erased */ - for (unsigned int i = 0; i < bank->num_sectors; i++) - bank->sectors[i].is_erased = 1; - + if (retval == ERROR_OK) command_print(CMD, "stm32x mass erase complete"); - } else + else command_print(CMD, "stm32x mass erase failed"); return retval; diff --git a/src/flash/nor/stm32f2x.c b/src/flash/nor/stm32f2x.c index c5adf0926..e80928ddf 100644 --- a/src/flash/nor/stm32f2x.c +++ b/src/flash/nor/stm32f2x.c @@ -649,8 +649,6 @@ static int stm32x_erase(struct flash_bank *bank, unsigned int first, retval = stm32x_wait_status_busy(bank, FLASH_ERASE_TIMEOUT); if (retval != ERROR_OK) return retval; - - bank->sectors[i].is_erased = 1; } retval = target_write_u32(target, stm32x_get_flash_reg(bank, STM32_FLASH_CR), FLASH_LOCK); @@ -1561,10 +1559,6 @@ COMMAND_HANDLER(stm32x_handle_mass_erase_command) retval = stm32x_mass_erase(bank); if (retval == ERROR_OK) { - /* set all sectors as erased */ - for (unsigned int i = 0; i < bank->num_sectors; i++) - bank->sectors[i].is_erased = 1; - command_print(CMD, "stm32x mass erase complete"); } else { command_print(CMD, "stm32x mass erase failed"); diff --git a/src/flash/nor/stm32h7x.c b/src/flash/nor/stm32h7x.c index 5c71d31f0..89ba75dad 100644 --- a/src/flash/nor/stm32h7x.c +++ b/src/flash/nor/stm32h7x.c @@ -512,7 +512,6 @@ static int stm32x_erase(struct flash_bank *bank, unsigned int first, LOG_ERROR("erase time-out or operation error sector %u", i); goto flash_lock; } - bank->sectors[i].is_erased = 1; } flash_lock: @@ -1087,15 +1086,10 @@ COMMAND_HANDLER(stm32x_handle_mass_erase_command) return retval; retval = stm32x_mass_erase(bank); - if (retval == ERROR_OK) { - /* set all sectors as erased */ - for (unsigned int i = 0; i < bank->num_sectors; i++) - bank->sectors[i].is_erased = 1; - + if (retval == ERROR_OK) command_print(CMD, "stm32h7x mass erase complete"); - } else { + else command_print(CMD, "stm32h7x mass erase failed"); - } return retval; } diff --git a/src/flash/nor/stm32l4x.c b/src/flash/nor/stm32l4x.c index e6d3a8350..7d6c90028 100644 --- a/src/flash/nor/stm32l4x.c +++ b/src/flash/nor/stm32l4x.c @@ -1002,8 +1002,6 @@ static int stm32l4_erase(struct flash_bank *bank, unsigned int first, retval = stm32l4_wait_status_busy(bank, FLASH_ERASE_TIMEOUT); if (retval != ERROR_OK) break; - - bank->sectors[i].is_erased = 1; } err_lock: @@ -1713,15 +1711,10 @@ COMMAND_HANDLER(stm32l4_handle_mass_erase_command) return retval; retval = stm32l4_mass_erase(bank); - if (retval == ERROR_OK) { - /* set all sectors as erased */ - for (unsigned int i = 0; i < bank->num_sectors; i++) - bank->sectors[i].is_erased = 1; - + if (retval == ERROR_OK) command_print(CMD, "stm32l4x mass erase complete"); - } else { + else command_print(CMD, "stm32l4x mass erase failed"); - } return retval; } diff --git a/src/flash/nor/stm32lx.c b/src/flash/nor/stm32lx.c index 3bb986e1c..488dc978a 100644 --- a/src/flash/nor/stm32lx.c +++ b/src/flash/nor/stm32lx.c @@ -317,15 +317,10 @@ COMMAND_HANDLER(stm32lx_handle_mass_erase_command) return retval; retval = stm32lx_mass_erase(bank); - if (retval == ERROR_OK) { - /* set all sectors as erased */ - for (unsigned int i = 0; i < bank->num_sectors; i++) - bank->sectors[i].is_erased = 1; - + if (retval == ERROR_OK) command_print(CMD, "stm32lx mass erase complete"); - } else { + else command_print(CMD, "stm32lx mass erase failed"); - } return retval; } diff --git a/src/flash/nor/stmqspi.c b/src/flash/nor/stmqspi.c index f6a493414..0abd8449b 100644 --- a/src/flash/nor/stmqspi.c +++ b/src/flash/nor/stmqspi.c @@ -588,18 +588,13 @@ COMMAND_HANDLER(stmqspi_handle_mass_erase_command) retval = wait_till_ready(bank, SPI_MASS_ERASE_TIMEOUT); duration_measure(&bench); - if (retval == ERROR_OK) { - /* set all sectors as erased */ - for (sector = 0; sector < bank->num_sectors; sector++) - bank->sectors[sector].is_erased = 1; - + if (retval == ERROR_OK) command_print(CMD, "stmqspi mass erase completed in %fs (%0.3f KiB/s)", duration_elapsed(&bench), duration_kbps(&bench, bank->size)); - } else { + else command_print(CMD, "stmqspi mass erase not completed even after %fs", duration_elapsed(&bench)); - } err: /* Switch to memory mapped mode before return to prompt */ diff --git a/src/flash/nor/str7x.c b/src/flash/nor/str7x.c index 5f3ff0069..9b977bf90 100644 --- a/src/flash/nor/str7x.c +++ b/src/flash/nor/str7x.c @@ -376,9 +376,6 @@ static int str7x_erase(struct flash_bank *bank, unsigned int first, if (err != ERROR_OK) return err; - for (unsigned int i = first; i <= last; i++) - bank->sectors[i].is_erased = 1; - return ERROR_OK; } diff --git a/src/flash/nor/str9x.c b/src/flash/nor/str9x.c index 5c3a9cb2b..8f39d75fa 100644 --- a/src/flash/nor/str9x.c +++ b/src/flash/nor/str9x.c @@ -300,9 +300,6 @@ static int str9x_erase(struct flash_bank *bank, unsigned int first, break; } - for (unsigned int i = first; i <= last; i++) - bank->sectors[i].is_erased = 1; - return ERROR_OK; } diff --git a/src/flash/nor/xmc1xxx.c b/src/flash/nor/xmc1xxx.c index a519ab864..9e5f0a3dd 100644 --- a/src/flash/nor/xmc1xxx.c +++ b/src/flash/nor/xmc1xxx.c @@ -141,9 +141,6 @@ static int xmc1xxx_erase(struct flash_bank *bank, unsigned int first, goto err_run; } - for (unsigned int sector = first; sector <= last; sector++) - bank->sectors[sector].is_erased = 1; - err_run: for (i = 0; i < ARRAY_SIZE(reg_params); i++) destroy_reg_param(®_params[i]); diff --git a/src/flash/nor/xmc4xxx.c b/src/flash/nor/xmc4xxx.c index 04734d10f..bd37537cc 100644 --- a/src/flash/nor/xmc4xxx.c +++ b/src/flash/nor/xmc4xxx.c @@ -577,8 +577,6 @@ static int xmc4xxx_erase(struct flash_bank *bank, unsigned int first, if (res != ERROR_OK) goto clear_status_and_exit; - - bank->sectors[i].is_erased = 1; } clear_status_and_exit: ----------------------------------------------------------------------- Summary of changes: src/flash/nor/ambiqmicro.c | 8 ++---- src/flash/nor/at91sam4l.c | 3 --- src/flash/nor/avrf.c | 8 ++---- src/flash/nor/cfi.c | 8 ++---- src/flash/nor/dsp5680xx_flash.c | 59 +++++++++-------------------------------- src/flash/nor/em357.c | 10 ++----- src/flash/nor/fm3.c | 5 ---- src/flash/nor/fm4.c | 2 -- src/flash/nor/kinetis_ke.c | 2 -- src/flash/nor/max32xxx.c | 10 ++----- src/flash/nor/mdr.c | 1 - src/flash/nor/niietcm4.c | 2 -- src/flash/nor/numicro.c | 2 -- src/flash/nor/pic32mx.c | 1 - src/flash/nor/psoc4.c | 9 +------ src/flash/nor/psoc6.c | 4 --- src/flash/nor/stellaris.c | 10 ++----- src/flash/nor/stm32f1x.c | 10 ++----- src/flash/nor/stm32f2x.c | 6 ----- src/flash/nor/stm32h7x.c | 10 ++----- src/flash/nor/stm32l4x.c | 11 ++------ src/flash/nor/stm32lx.c | 9 ++----- src/flash/nor/stmqspi.c | 9 ++----- src/flash/nor/str7x.c | 3 --- src/flash/nor/str9x.c | 3 --- src/flash/nor/xmc1xxx.c | 3 --- src/flash/nor/xmc4xxx.c | 2 -- 27 files changed, 35 insertions(+), 175 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-14 12:32:40
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via a555434c50544410ab6f8915f1e2a829cc6e6de2 (commit) via 3ce70962d144406adb58a34f892dc370df9d5475 (commit) via 48282fbce06fbcf490d857ec9da8c4d603f379c2 (commit) from 020e46d1868a0b936a4e5b53c4d75706bb524618 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a555434c50544410ab6f8915f1e2a829cc6e6de2 Author: Antonio Borneo <bor...@gm...> Date: Mon Aug 9 15:03:37 2021 +0200 jtag/mpsse: fix SIGSEGV for use after free By pressing CTRL-C on a running openocd with FTDI adapter, it's possible to generate a segmentation fault that with valgrind is dumped as a SIGABRT: ^CError: libusb_handle_events() failed with LIBUSB_ERROR_INTERRUPTED ==16594== Invalid read of size 8 ==16594== at 0x48B2472: libusb_submit_transfer ==16594== by 0x48B4B0F: libusb_control_transfer ==16594== by 0x1A6B9D: mpsse_purge (mpsse.c:428) ==16594== by 0x1A7B96: mpsse_flush (mpsse.c:953) ==16594== by 0x19BA5B: ftdi_execute_queue (ftdi.c:654) ... ==16594== Address 0x6158568 is 72 bytes inside a block of size 216 free'd ==16594== at 0x484118B: free (vg_replace_malloc.c:755) ==16594== by 0x1A7B88: mpsse_flush (mpsse.c:950) ==16594== by 0x19BA5B: ftdi_execute_queue (ftdi.c:654) ... ==16594== Block was alloc'd at ==16594== at 0x48435FF: calloc (vg_replace_malloc.c:1117) ==16594== by 0x48B2259: libusb_alloc_transfer ==16594== by 0x1A7A26: mpsse_flush (mpsse.c:880) ==16594== by 0x19BA5B: ftdi_execute_queue (ftdi.c:654) ... ==16594== Process terminating with default action of signal 6 (SIGABRT): dumping core ... Aborted (core dumped) The error is in mpsse_flush() that, following valgrind dump: - allocates the buffer at line mpsse.c:880 read_transfer = libusb_alloc_transfer(0); - frees the buffer at line mpsse.c:950 libusb_free_transfer(read_transfer); - still pretends to use the freed buffer at line mpsse.c:953 mpsse_purge(ctx); Move the call to mpsse_purge() right before freeing the buffer. Change-Id: I47c71ec8c283f4b037fdd7cd72ca2e877cd3a851 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: http://openocd.zylin.com/6417 Tested-by: jenkins diff --git a/src/jtag/drivers/mpsse.c b/src/jtag/drivers/mpsse.c index 4e64fdbbf..0e3d2be0e 100644 --- a/src/jtag/drivers/mpsse.c +++ b/src/jtag/drivers/mpsse.c @@ -945,12 +945,12 @@ error_check: retval = ERROR_OK; } + if (retval != ERROR_OK) + mpsse_purge(ctx); + libusb_free_transfer(write_transfer); if (read_transfer) libusb_free_transfer(read_transfer); - if (retval != ERROR_OK) - mpsse_purge(ctx); - return retval; } commit 3ce70962d144406adb58a34f892dc370df9d5475 Author: Antonio Borneo <bor...@gm...> Date: Thu Aug 5 00:37:32 2021 +0200 arm_adi_v5: use macro DP_APSEL_MAX in place of magic number Commit 11019a824d02 ("adi_v5: enforce check on AP number value") introduces the macro DP_APSEL_MAX and use it in place of hardcoded magic numbers for the upper limit of AP selection value. Fix one more place where the macro should be used. Change-Id: I6c57f72405c69bbb40924221309d95dfeb5f7540 Signed-off-by: Antonio Borneo <bor...@gm...> Fixes: 11019a824d02 ("adi_v5: enforce check on AP number value") Reviewed-on: http://openocd.zylin.com/6415 Reviewed-by: Tomas Vanek <va...@fb...> Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tar...@gm...> diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 2bb11b25e..0c4b80ca1 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -648,7 +648,7 @@ void dap_invalidate_cache(struct adiv5_dap *dap) dap->last_read = NULL; int i; - for (i = 0; i <= 255; i++) { + for (i = 0; i <= DP_APSEL_MAX; i++) { /* force csw and tar write on the next mem-ap access */ dap->ap[i].tar_valid = false; dap->ap[i].csw_value = 0; commit 48282fbce06fbcf490d857ec9da8c4d603f379c2 Author: Antonio Borneo <bor...@gm...> Date: Thu Aug 5 00:22:06 2021 +0200 openocd: fix cleanup order: cti before dap cti access is based on dap. During cleanup, drop cti before dropping dap to guarantee that cti can still access its dap. Change-Id: I40c7f67d4d4a32f53802c0ce7668a5321a05893c Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: http://openocd.zylin.com/6414 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tar...@gm...> diff --git a/src/openocd.c b/src/openocd.c index 2c9466624..b4571b464 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -364,8 +364,8 @@ int openocd_main(int argc, char *argv[]) help_del_all_commands(cmd_ctx); /* free all DAP and CTI objects */ - dap_cleanup_all(); arm_cti_cleanup_all(); + dap_cleanup_all(); adapter_quit(); ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/mpsse.c | 6 +++--- src/openocd.c | 2 +- src/target/arm_adi_v5.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-14 12:31:47
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 020e46d1868a0b936a4e5b53c4d75706bb524618 (commit) via 2f97856c5b3097199c23ddbfe53a98d25895b500 (commit) from 08a0cfdeebbad10a33a6a5bc25d468ebd3ab6119 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 020e46d1868a0b936a4e5b53c4d75706bb524618 Author: Antonio Borneo <bor...@gm...> Date: Thu Aug 5 17:08:11 2021 +0200 arm_adi_v5: fix access to 64-bit MEM-AP Commit ac22cdc57322 ("target/adiv5: Large Physical Address Extension") reads the register MEM_AP_REG_CFG and keeps it in a new field of struct adiv5_ap. The test on LE bit (Large Extension) is used to identify if mem_ap addresses are 32 or 64 bits. But the register MEM_AP_REG_CFG is only read during mem_ap_init(), that is called only when the AP is used as a target debug AP or if a target mem_ap is attached to that AP. The openocd commands '<dapname> baseaddr', '<dapname> info' and 'dap info' can be executed on AP that has not been associated yet to a target, thus executed without any knowledge of MEM_AP_REG_CFG value. The initialization to ADI_BAD_CFG causes openocd to always use 32 bit mode on un-associated APs. Verify if MEM_AP_REG_CFG has not been read and eventually read it. In case of 32 bits mode AP, MEM_AP_REG_BASE64 is defined as 'RES0' (reserved, but readable); the code can queue both the read of MEM_AP_REG_CFG and MEM_AP_REG_BASE64, before knowing if the former is required. This speeds-up the operation. Rename ADI_BAD_CFG as MEM_AP_REG_CFG_INVALID. Change-Id: If3bbd792b56a483022c37ccc2ce82b5ba5c36caa Signed-off-by: Antonio Borneo <bor...@gm...> Fixes: ac22cdc57322 ("target/adiv5: Large Physical Address Extension") Reviewed-on: http://openocd.zylin.com/6412 Tested-by: jenkins Reviewed-by: Daniel Goehring <dgo...@os...> diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 21788af79..2bb11b25e 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -946,25 +946,30 @@ int dap_get_debugbase(struct adiv5_ap *ap, int retval; uint32_t baseptr_upper, baseptr_lower; - baseptr_upper = 0; - - if (is_64bit_ap(ap)) { - /* Read higher order 32-bits of base address */ - retval = dap_queue_ap_read(ap, MEM_AP_REG_BASE64, &baseptr_upper); + if (ap->cfg_reg == MEM_AP_REG_CFG_INVALID) { + retval = dap_queue_ap_read(ap, MEM_AP_REG_CFG, &ap->cfg_reg); if (retval != ERROR_OK) return retval; } - retval = dap_queue_ap_read(ap, MEM_AP_REG_BASE, &baseptr_lower); if (retval != ERROR_OK) return retval; retval = dap_queue_ap_read(ap, AP_REG_IDR, apid); if (retval != ERROR_OK) return retval; + /* MEM_AP_REG_BASE64 is defined as 'RES0'; can be read and then ignored on 32 bits AP */ + if (ap->cfg_reg == MEM_AP_REG_CFG_INVALID || is_64bit_ap(ap)) { + retval = dap_queue_ap_read(ap, MEM_AP_REG_BASE64, &baseptr_upper); + if (retval != ERROR_OK) + return retval; + } + retval = dap_run(dap); if (retval != ERROR_OK) return retval; + if (!is_64bit_ap(ap)) + baseptr_upper = 0; *dbgbase = (((target_addr_t)baseptr_upper) << 32) | baseptr_lower; return ERROR_OK; @@ -1768,20 +1773,26 @@ COMMAND_HANDLER(dap_baseaddr_command) ap = dap_ap(dap, apsel); retval = dap_queue_ap_read(ap, MEM_AP_REG_BASE, &baseaddr_lower); - if (is_64bit_ap(ap) && retval == ERROR_OK) + if (retval == ERROR_OK && ap->cfg_reg == MEM_AP_REG_CFG_INVALID) + retval = dap_queue_ap_read(ap, MEM_AP_REG_CFG, &ap->cfg_reg); + + if (retval == ERROR_OK && (ap->cfg_reg == MEM_AP_REG_CFG_INVALID || is_64bit_ap(ap))) { + /* MEM_AP_REG_BASE64 is defined as 'RES0'; can be read and then ignored on 32 bits AP */ retval = dap_queue_ap_read(ap, MEM_AP_REG_BASE64, &baseaddr_upper); + } + + if (retval == ERROR_OK) + retval = dap_run(dap); if (retval != ERROR_OK) return retval; - retval = dap_run(dap); - if (retval != ERROR_OK) - return retval; + if (is_64bit_ap(ap)) { baseaddr = (((target_addr_t)baseaddr_upper) << 32) | baseaddr_lower; command_print(CMD, "0x%016" PRIx64, baseaddr); } else command_print(CMD, "0x%08" PRIx32, baseaddr_lower); - return retval; + return ERROR_OK; } COMMAND_HANDLER(dap_memaccess_command) diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h index 5d1e79378..73ceea03f 100644 --- a/src/target/arm_adi_v5.h +++ b/src/target/arm_adi_v5.h @@ -151,9 +151,10 @@ #define CSW_APB_DEFAULT (CSW_DBGSWENABLE) /* Fields of the MEM-AP's CFG register */ -#define MEM_AP_REG_CFG_BE BIT(0) -#define MEM_AP_REG_CFG_LA BIT(1) -#define MEM_AP_REG_CFG_LD BIT(2) +#define MEM_AP_REG_CFG_BE BIT(0) +#define MEM_AP_REG_CFG_LA BIT(1) +#define MEM_AP_REG_CFG_LD BIT(2) +#define MEM_AP_REG_CFG_INVALID 0xFFFFFFF8 /* Fields of the MEM-AP's IDR register */ #define IDR_REV (0xFUL << 28) diff --git a/src/target/arm_dap.c b/src/target/arm_dap.c index a399c51de..2f21aa170 100644 --- a/src/target/arm_dap.c +++ b/src/target/arm_dap.c @@ -36,8 +36,6 @@ extern const struct dap_ops swd_dap_ops; extern const struct dap_ops jtag_dp_ops; extern struct adapter_driver *adapter_driver; -#define ADI_BAD_CFG 0xBAD00000 - /* DAP command support */ struct arm_dap_object { struct list_head lh; @@ -59,7 +57,7 @@ static void dap_instance_init(struct adiv5_dap *dap) dap->ap[i].tar_autoincr_block = (1<<10); /* default CSW value */ dap->ap[i].csw_default = CSW_AHB_DEFAULT; - dap->ap[i].cfg_reg = ADI_BAD_CFG; /* mem_ap configuration reg (large physical addr, etc.) */ + dap->ap[i].cfg_reg = MEM_AP_REG_CFG_INVALID; /* mem_ap configuration reg (large physical addr, etc.) */ } INIT_LIST_HEAD(&dap->cmd_journal); INIT_LIST_HEAD(&dap->cmd_pool); commit 2f97856c5b3097199c23ddbfe53a98d25895b500 Author: Antonio Borneo <bor...@gm...> Date: Wed Aug 4 12:25:18 2021 +0200 arm_adi_v5: fix signed offset in Class 0x1 ROM tables In both arm ADIv5 and ADIv6 documentation, for both Class 0x1 and Class 0x9 ROM tables, the offset field from ROM tables is supposed to be a signed value: "Negative values of OFFSET are permitted, using twoâs complement." The commit ac22cdc57322 ("target/adiv5: Large Physical Address Extension") extends to 64 bits the addresses while managing the ROM tables. The offset is read as unsigned and in the former 32 bits implementation the wrap-around was hiding the need for converting the offset to signed. The new implementation requires the proper cast to the offset. On a STM32F411, without this fix the ROM table dump is incorrectly reporting addresses out of the 32 bit bus range: MEM-AP BASE 0xe00ff003 Valid ROM table present Component base address 0xe00ff000 Peripheral ID 0x00000a0411 Designer is 0x0a0, STMicroelectronics Part is 0x411, Unrecognized Component class is 0x1, ROM table MEMTYPE system memory present on bus ROMTABLE[0x0] = 0xfff0f003 Component base address 0x1e000e000 ^^^^^^^^^^^ Cast the offset before adding it to the base address of the ROM table. Change-Id: I8d31fd2b3d657286cb96f8e22fb00842baa728f7 Signed-off-by: Antonio Borneo <bor...@gm...> Fixes: ac22cdc57322 ("target/adiv5: Large Physical Address Extension") Reviewed-on: http://openocd.zylin.com/6410 Tested-by: jenkins Reviewed-by: Daniel Goehring <dgo...@os...> diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index c421fe6a3..21788af79 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -1310,8 +1310,8 @@ static int dap_rom_display(struct command_invocation *cmd, command_print(cmd, "\t%sROMTABLE[0x%x] = 0x%" PRIx32 "", tabs, entry_offset, romentry); if (romentry & 0x01) { - /* Recurse */ - retval = dap_rom_display(cmd, ap, base_addr + (romentry & 0xFFFFF000), depth + 1); + /* Recurse. "romentry" is signed */ + retval = dap_rom_display(cmd, ap, base_addr + (int32_t)(romentry & 0xFFFFF000), depth + 1); if (retval != ERROR_OK) return retval; } else if (romentry != 0) { ----------------------------------------------------------------------- Summary of changes: src/target/arm_adi_v5.c | 37 ++++++++++++++++++++++++------------- src/target/arm_adi_v5.h | 7 ++++--- src/target/arm_dap.c | 4 +--- 3 files changed, 29 insertions(+), 19 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-14 12:30:55
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 08a0cfdeebbad10a33a6a5bc25d468ebd3ab6119 (commit) via 9544cd653df120266582f69bddc77d32541caae7 (commit) from 41efc6c419cf5c63a1f555dc5b7634a2e18d9c04 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 08a0cfdeebbad10a33a6a5bc25d468ebd3ab6119 Author: Antonio Borneo <bor...@gm...> Date: Fri May 14 00:48:31 2021 +0200 helper/align.h: use it Use the new helper to make the code more readable. Change-Id: I11b2a79dbc6f93f6cfde382bcc00dd7ff710d908 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: http://openocd.zylin.com/6375 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tar...@gm...> diff --git a/src/flash/nor/stm32l4x.c b/src/flash/nor/stm32l4x.c index d70895c53..e6d3a8350 100644 --- a/src/flash/nor/stm32l4x.c +++ b/src/flash/nor/stm32l4x.c @@ -24,6 +24,7 @@ #endif #include "imp.h" +#include <helper/align.h> #include <helper/binarybuffer.h> #include <target/algorithm.h> #include <target/armv7m.h> @@ -1591,7 +1592,7 @@ static int stm32l4_probe(struct flash_bank *bank) * max_flash_size is always power of two, so max_pages too */ uint32_t max_pages = stm32l4_info->part_info->max_flash_size_kb / page_size_kb; - assert((max_pages & (max_pages - 1)) == 0); + assert(IS_PWR_OF_2(max_pages)); /* in dual bank mode number of pages is doubled, but extra bit is bank selection */ stm32l4_info->wrpxxr_mask = ((max_pages >> (stm32l4_info->dual_bank_mode ? 1 : 0)) - 1); diff --git a/src/flash/nor/xmc1xxx.c b/src/flash/nor/xmc1xxx.c index 11542ac5b..a519ab864 100644 --- a/src/flash/nor/xmc1xxx.c +++ b/src/flash/nor/xmc1xxx.c @@ -11,6 +11,7 @@ #endif #include "imp.h" +#include <helper/align.h> #include <helper/binarybuffer.h> #include <target/algorithm.h> #include <target/armv7m.h> @@ -256,12 +257,12 @@ static int xmc1xxx_write(struct flash_bank *bank, const uint8_t *buffer, LOG_DEBUG("Infineon XMC1000 write at 0x%08" PRIx32 " (%" PRIu32 " bytes)", offset, byte_count); - if (offset & (NVM_BLOCK_SIZE - 1)) { + if (!IS_ALIGNED(offset, NVM_BLOCK_SIZE)) { LOG_ERROR("offset 0x%" PRIx32 " breaks required block alignment", offset); return ERROR_FLASH_DST_BREAKS_ALIGNMENT; } - if (byte_count & (NVM_BLOCK_SIZE - 1)) { + if (!IS_ALIGNED(byte_count, NVM_BLOCK_SIZE)) { LOG_WARNING("length %" PRIu32 " is not block aligned, rounding up", byte_count); } diff --git a/src/target/mips32_pracc.c b/src/target/mips32_pracc.c index 4a8cfcd4b..923cdf877 100644 --- a/src/target/mips32_pracc.c +++ b/src/target/mips32_pracc.c @@ -68,6 +68,7 @@ #include "config.h" #endif +#include <helper/align.h> #include <helper/time_support.h> #include "mips32.h" @@ -658,7 +659,7 @@ static int mips32_pracc_synchronize_cache(struct mips_ejtag *ejtag_info, goto exit; /* Nothing to do */ /* make sure clsiz is power of 2 */ - if (clsiz & (clsiz - 1)) { + if (!IS_PWR_OF_2(clsiz)) { LOG_DEBUG("clsiz must be power of 2"); ctx.retval = ERROR_FAIL; goto exit; diff --git a/src/target/target.c b/src/target/target.c index a67712009..7bace83f9 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -41,6 +41,7 @@ #include "config.h" #endif +#include <helper/align.h> #include <helper/time_support.h> #include <jtag/jtag.h> #include <flash/nor/core.h> @@ -1004,7 +1005,7 @@ int target_run_flash_async_algorithm(struct target *target, uint32_t rp = fifo_start_addr; /* validate block_size is 2^n */ - assert(!block_size || !(block_size & (block_size - 1))); + assert(IS_PWR_OF_2(block_size)); retval = target_write_u32(target, wp_addr, wp); if (retval != ERROR_OK) @@ -1042,7 +1043,7 @@ int target_run_flash_async_algorithm(struct target *target, break; } - if (((rp - fifo_start_addr) & (block_size - 1)) || rp < fifo_start_addr || rp >= fifo_end_addr) { + if (!IS_ALIGNED(rp - fifo_start_addr, block_size) || rp < fifo_start_addr || rp >= fifo_end_addr) { LOG_ERROR("corrupted fifo read pointer 0x%" PRIx32, rp); break; } @@ -1157,7 +1158,7 @@ int target_run_read_async_algorithm(struct target *target, uint32_t rp = fifo_start_addr; /* validate block_size is 2^n */ - assert(!block_size || !(block_size & (block_size - 1))); + assert(IS_PWR_OF_2(block_size)); retval = target_write_u32(target, wp_addr, wp); if (retval != ERROR_OK) @@ -1194,7 +1195,7 @@ int target_run_read_async_algorithm(struct target *target, break; } - if (((wp - fifo_start_addr) & (block_size - 1)) || wp < fifo_start_addr || wp >= fifo_end_addr) { + if (!IS_ALIGNED(wp - fifo_start_addr, block_size) || wp < fifo_start_addr || wp >= fifo_end_addr) { LOG_ERROR("corrupted fifo write pointer 0x%" PRIx32, wp); break; } commit 9544cd653df120266582f69bddc77d32541caae7 Author: Antonio Borneo <bor...@gm...> Date: Thu May 13 19:07:50 2021 +0200 helper: add align.h OpenOCD has to often align values or check for alignment. Use a dedicated set of macros instead of reinventing the wheel each time. Change-Id: Ia58711608aae0801deeaccb5f33148f2073b0bbd Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: http://openocd.zylin.com/6374 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tar...@gm...> diff --git a/src/helper/Makefile.am b/src/helper/Makefile.am index bedc9f707..42cee80d3 100644 --- a/src/helper/Makefile.am +++ b/src/helper/Makefile.am @@ -15,6 +15,7 @@ noinst_LTLIBRARIES += %D%/libhelper.la %D%/util.c \ %D%/jep106.c \ %D%/jim-nvp.c \ + %D%/align.h \ %D%/binarybuffer.h \ %D%/bits.h \ %D%/configuration.h \ diff --git a/src/helper/align.h b/src/helper/align.h new file mode 100644 index 000000000..935a6a3b2 --- /dev/null +++ b/src/helper/align.h @@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +/* + * The content of this file is mainly copied/inspired from Linux kernel + * code in include/linux/align.h and include/uapi/linux/const.h + * + * Macro name 'ALIGN' conflicts with macOS/BSD file param.h + */ + +#ifndef OPENOCD_HELPER_ALIGN_H +#define OPENOCD_HELPER_ALIGN_H + +#define ALIGN_MASK(x, mask) \ +({ \ + typeof(mask) _mask = (mask); \ + ((x) + _mask) & ~_mask; \ +}) + +/* @a is a power of 2 value */ +#define ALIGN_UP(x, a) ALIGN_MASK(x, (typeof(x))(a) - 1) +#define ALIGN_DOWN(x, a) ((x) & ~((typeof(x))(a) - 1)) +#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) + +#define IS_PWR_OF_2(x) \ +({ \ + typeof(x) _x = (x); \ + _x == 0 || (_x & (_x - 1)) == 0; \ +}) + +#endif /* OPENOCD_HELPER_ALIGN_H */ ----------------------------------------------------------------------- Summary of changes: src/flash/nor/stm32l4x.c | 3 ++- src/flash/nor/xmc1xxx.c | 5 +++-- src/helper/Makefile.am | 1 + src/helper/align.h | 30 ++++++++++++++++++++++++++++++ src/target/mips32_pracc.c | 3 ++- src/target/target.c | 9 +++++---- 6 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 src/helper/align.h hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-14 12:29:44
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 41efc6c419cf5c63a1f555dc5b7634a2e18d9c04 (commit) via 69eabf9d61d98e63d68257525e4dca86b17541d9 (commit) from 16eee77c10c186e83914a0da86a6aea9870d8144 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 41efc6c419cf5c63a1f555dc5b7634a2e18d9c04 Author: Jan Matyas <ma...@co...> Date: Thu Jun 3 16:55:50 2021 +0200 rtos: add debug prints for qSymbol lookup - Added two debug prints that allow to inspect the symbol lookup process (carried out via the qSymbol packets). - Added a check for an edge situation when the debugger would send us different symbol than what we asked for (avoids NULL dereference). Change-Id: I84ae1b2b66473eab76a7966c678d2777b6ef48d6 Signed-off-by: Jan Matyas <ma...@co...> Reviewed-on: http://openocd.zylin.com/6287 Tested-by: jenkins Reviewed-by: Tim Newsome <ti...@si...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c index c9c4efd41..0e747e3e4 100644 --- a/src/rtos/rtos.c +++ b/src/rtos/rtos.c @@ -266,8 +266,17 @@ int rtos_qsymbol(struct connection *connection, char const *packet, int packet_s cur_sym[0] = '\x00'; } } + + LOG_DEBUG("RTOS: Address of symbol '%s' is 0x%" PRIx64, cur_sym, addr); + next_sym = next_symbol(os, cur_sym, addr); + /* Should never happen unless the debugger misbehaves */ + if (next_sym == NULL) { + LOG_WARNING("RTOS: Debugger sent us qSymbol with '%s' that we did not ask for", cur_sym); + goto done; + } + if (!next_sym->symbol_name) { /* No more symbols need looking up */ @@ -291,6 +300,8 @@ int rtos_qsymbol(struct connection *connection, char const *packet, int packet_s goto done; } + LOG_DEBUG("RTOS: Requesting symbol lookup of '%s' from the debugger", next_sym->symbol_name); + reply_len = snprintf(reply, sizeof(reply), "qSymbol:"); reply_len += hexify(reply + reply_len, (const uint8_t *)next_sym->symbol_name, strlen(next_sym->symbol_name), commit 69eabf9d61d98e63d68257525e4dca86b17541d9 Author: Jan Matyas <ma...@co...> Date: Fri Jun 4 10:19:29 2021 +0200 flash/nor/atsamv: fixed "maybe uninitialized" compiler warning This warning about "maybe uninitialized" variable used to pop up on certain versions of GCC. Change-Id: I1cf43b9600885d507afc1dc042322a06751fe146 Signed-off-by: Jan Matyas <ma...@co...> Reviewed-on: http://openocd.zylin.com/6290 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/flash/nor/atsamv.c b/src/flash/nor/atsamv.c index a64c2b4cc..efc242395 100644 --- a/src/flash/nor/atsamv.c +++ b/src/flash/nor/atsamv.c @@ -661,7 +661,7 @@ COMMAND_HANDLER(samv_handle_gpnvm_command) return ERROR_COMMAND_SYNTAX_ERROR; } - unsigned v; + unsigned v = 0; if (!strcmp("show", CMD_ARGV[0])) { if (who == -1) { showall: ----------------------------------------------------------------------- Summary of changes: src/flash/nor/atsamv.c | 2 +- src/rtos/rtos.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-08-14 07:05:49
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 16eee77c10c186e83914a0da86a6aea9870d8144 (commit) from 3d9534b8a85d314f82440ce0e37632571c42245a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 16eee77c10c186e83914a0da86a6aea9870d8144 Author: Oleksij Rempel <o.r...@pe...> Date: Mon Aug 12 12:33:50 2019 +0200 add config for Microchip SAMA5D27 SOM1 Kit1 ... and related SAMA5D27 SoC. Change-Id: Ic2584e3005ac691642dc2e5a8ee3fb8a4eacaa00 Signed-off-by: Oleksij Rempel <o.r...@pe...> Reviewed-on: http://openocd.zylin.com/5275 Tested-by: jenkins Reviewed-by: Oleksij Rempel <li...@re...> diff --git a/tcl/board/microchip_sama5d27_som1_kit1.cfg b/tcl/board/microchip_sama5d27_som1_kit1.cfg new file mode 100644 index 000000000..8e920405c --- /dev/null +++ b/tcl/board/microchip_sama5d27_som1_kit1.cfg @@ -0,0 +1,19 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# Microchip SAMA5D27-SOM1-EK1 +# https://www.microchip.com/DevelopmentTools/ProductDetails/PartNO/ATSAMA5D27-SOM1-EK1 +# This board provide two jtag interfaces: +# J11 - 10 pin interface +# J10 - USB interface connected to the J-Link-OB. +# This functionality is implemented with an ATSAM3U4C microcontroller and +# provides JTAG functions and a bridge USB/Serial debug port (CDC). +# +# Jumper J7 disables the J-Link-OB-ATSAM3U4C JTAG functionality. +# - Jumper J7 not installed: J-Link-OB-ATSAM3U4C is enabled and fully functional. +# - Jumper J7 installed: J-Link-OB-ATSAM3U4C is disabled and an external JTAG +# controller can be used through the 10-pin JTAG port J11. + +source [find interface/jlink.cfg] +reset_config srst_only + +source [find target/at91sama5d2.cfg] diff --git a/tcl/target/at91sama5d2.cfg b/tcl/target/at91sama5d2.cfg new file mode 100644 index 000000000..65e5217e1 --- /dev/null +++ b/tcl/target/at91sama5d2.cfg @@ -0,0 +1,28 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# The JTAG connection is disabled at reset, and during the ROM Code execution. +# It is re-enabled when the ROM code jumps in the boot file copied from an +# external Flash memory into the internalSRAM, or when the ROM code launches +# the SAM-BA monitor, when no boot file has been found in any external Flash +# memory. +# For more JTAG related information see, : +# https://ww1.microchip.com/downloads/en/DeviceDoc/SAMA5D2-Series-Data-sheet-ds60001476G.pdf +# +# If JTAGSEL pin: +# - if enabled, boundary Scan mode is activated. JTAG ID Code value is 0x05B3F03F. +# - if disabled, ICE mode is activated. Debug Port JTAG IDCODE value is 0x5BA00477 +# +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + set _CHIPNAME at91sama5d2 +} + +jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x01 -irmask 0x0f \ + -expected-id 0x5ba00477 + +# Cortex-A5 target +set _TARGETNAME $_CHIPNAME.cpu_a5 +dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu + +target create $_TARGETNAME.0 cortex_a -dap $_CHIPNAME.dap ----------------------------------------------------------------------- Summary of changes: tcl/board/microchip_sama5d27_som1_kit1.cfg | 19 +++++++++++++++++++ tcl/target/at91sama5d2.cfg | 28 ++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 tcl/board/microchip_sama5d27_som1_kit1.cfg create mode 100644 tcl/target/at91sama5d2.cfg hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-07-31 09:12:47
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 3d9534b8a85d314f82440ce0e37632571c42245a (commit) via 9eefd630669f74508f056071eb28ac097cf6c75c (commit) from 332a1607d9e9b1cca3a855c524dfe44bb51e1306 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3d9534b8a85d314f82440ce0e37632571c42245a Author: Tarek BOCHKATI <tar...@gm...> Date: Wed Jul 28 10:14:51 2021 +0100 github/workflow: upgrade libraries in windows build to latest versions Change-Id: I11fb6eb948531f1a2e8c0c3926cac52cf92765b9 Reported-by: Xiaofan <xia...@gm...> Signed-off-by: Tarek BOCHKATI <tar...@gm...> Reviewed-on: http://openocd.zylin.com/6383 Reviewed-by: Xiaofan <xia...@gm...> Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index bde803cc4..81e3a78bd 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -22,7 +22,7 @@ jobs: - run: ./bootstrap - name: Prepare libusb1 env: - LIBUSB1_VER: 1.0.23 + LIBUSB1_VER: 1.0.24 run: | mkdir -p $DL_DIR && cd $DL_DIR wget "https://github.com/libusb/libusb/releases/download/v${LIBUSB1_VER}/libusb-${LIBUSB1_VER}.tar.bz2" @@ -30,7 +30,7 @@ jobs: echo "LIBUSB1_SRC=$PWD/libusb-${LIBUSB1_VER}" >> $GITHUB_ENV - name: Prepare hidapi env: - HIDAPI_VER: 0.9.0 + HIDAPI_VER: 0.10.1 run: | mkdir -p $DL_DIR && cd $DL_DIR wget "https://github.com/libusb/hidapi/archive/hidapi-${HIDAPI_VER}.tar.gz" @@ -40,7 +40,7 @@ jobs: echo "HIDAPI_SRC=$PWD" >> $GITHUB_ENV - name: Prepare libftdi env: - LIBFTDI_VER: 1.4 + LIBFTDI_VER: 1.5 run: | mkdir -p $DL_DIR && cd $DL_DIR wget "http://www.intra2net.com/en/developer/libftdi/download/libftdi1-${LIBFTDI_VER}.tar.bz2" commit 9eefd630669f74508f056071eb28ac097cf6c75c Author: Jan Matyas <ma...@co...> Date: Fri Jul 23 07:29:56 2021 +0200 .github/workflows: Add missing 'apt-get update' to the snapshot workflow During the build of the OpenOCD snapshot via GitHub Actions, ensure that the local package database is first updated, prior to installing any packages via apt-get install. Otherwise the apt-get install could fail. Change-Id: If3c29faeb1496d5e2be75350f6352575b1f3a42e Signed-off-by: Jan Matyas <ma...@co...> Reviewed-on: http://openocd.zylin.com/6378 Reviewed-by: Xiaofan <xia...@gm...> Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tar...@gm...> Reviewed-by: Tim Newsome <ti...@si...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 45db72e94..bde803cc4 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -14,7 +14,9 @@ jobs: BUILD_DIR: ../build steps: - name: Install needed packages - run: sudo apt-get install autotools-dev autoconf automake libtool pkg-config cmake texinfo texlive g++-mingw-w64-i686 + run: | + sudo apt-get update + sudo apt-get install autotools-dev autoconf automake libtool pkg-config cmake texinfo texlive g++-mingw-w64-i686 - name: Checkout Code uses: actions/checkout@v1 - run: ./bootstrap ----------------------------------------------------------------------- Summary of changes: .github/workflows/snapshot.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2021-07-31 09:11:27
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 332a1607d9e9b1cca3a855c524dfe44bb51e1306 (commit) via 25d45da40721d4a5413f796628536b88d4e23c3b (commit) via f5aa2e11cd2c6ddd3e8829b6323dd520b7f8ff90 (commit) from db16b3dc5b061c152f2478a5b9b7b3a3b0908911 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 332a1607d9e9b1cca3a855c524dfe44bb51e1306 Author: Julien Massot <jul...@io...h> Date: Tue Jul 13 08:41:20 2021 +0200 rtos: zephyr: add zephyr_params for cortex r4 Implementation for Cortex-M does works for Cortex-R too, it allows me to fetch thread list and their backtrace on a Cortex-R platforms. Change-Id: I23e6eb00879587ba36e0bfb560f7002a9653d39b Signed-off-by: Julien Massot <jul...@io...h> Reviewed-on: http://openocd.zylin.com/6369 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/rtos/zephyr.c b/src/rtos/zephyr.c index fc5e0375b..a59673557 100644 --- a/src/rtos/zephyr.c +++ b/src/rtos/zephyr.c @@ -340,6 +340,14 @@ static struct zephyr_params zephyr_params_list[] = { .cpu_saved_fp_stacking = &arm_cpu_saved_fp_stacking, .get_cpu_state = &zephyr_get_arm_state, }, + { + .target_name = "cortex_r4", + .pointer_width = 4, + .callee_saved_stacking = &arm_callee_saved_stacking, + .cpu_saved_nofp_stacking = &arm_cpu_saved_nofp_stacking, + .cpu_saved_fp_stacking = &arm_cpu_saved_fp_stacking, + .get_cpu_state = &zephyr_get_arm_state, + }, { .target_name = "hla_target", .pointer_width = 4, commit 25d45da40721d4a5413f796628536b88d4e23c3b Author: Jian-Hong Pan <chi...@gm...> Date: Sun Jul 11 12:54:39 2021 +0800 tcl/board: Add Raspberry Pi 4 model B board OpenOCD cannot connect to BCM2711's JTAG interface on RPi 4B board until the reset configuration mode is set as trst_only. According to Table 94. GPIO Pins Alternative Function Assignment of Broadcom's BCM2711 ARM Peripherals datasheet [1] and Raspberry Pi's GPIO control in config.txt document [2], only Test Reset (TRST) pin (no System Reset, SRST) is exposed. [1] https://datasheets.raspberrypi.org/bcm2711/bcm2711-peripherals.pdf [2] https://www.raspberrypi.org/documentation/configuration/config-txt/gpio.md Change-Id: I806f0be9700fa0f0944b42c8a651a5731adc762b Link: http://openocd.zylin.com/#/c/6364/1 Signed-off-by: Jian-Hong Pan <chi...@gm...> Reviewed-on: http://openocd.zylin.com/6367 Tested-by: jenkins Reviewed-by: Florian Fainelli <f.f...@gm...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/tcl/board/rpi4b.cfg b/tcl/board/rpi4b.cfg new file mode 100644 index 000000000..5b046af7b --- /dev/null +++ b/tcl/board/rpi4b.cfg @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +# This is the Raspberry Pi 4 model B board with BCM2711 chip +# https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711/README.md +# +# Enable JTAG GPIO on Raspberry Pi boards +# https://www.raspberrypi.org/documentation/configuration/config-txt/gpio.md + +source [find target/bcm2711.cfg] +transport select jtag + +# Raspberry Pi boards only expose Test Reset (TRST) pin, no System Reset (SRST) +reset_config trst_only commit f5aa2e11cd2c6ddd3e8829b6323dd520b7f8ff90 Author: Jian-Hong Pan <chi...@gm...> Date: Sun Jul 11 12:04:06 2021 +0800 tcl/board: Add Raspberry Pi 3 board OpenOCD cannot connect to BCM2837's JTAG interface on RPi 3 board until the reset configuration mode is set as trst_only. According to Table 6-31 GPIO Pins Alternative Function Assignment of Broadcom's BCM2837 ARM Peripherials datasheet [1] and Raspberry Pi's GPIO control in config.txt document [2], only Test Reset (TRST) pin (no System Reset, SRST) is exposed. [1] https://usermanual.wiki/Datasheet/BCM2837ARMPeripheralsBroadcom.1054296467/view [2] https://www.raspberrypi.org/documentation/configuration/config-txt/gpio.md Change-Id: I26ff3924039ff7943faf0a5b1ad0427c8dbb88f2 Link: http://openocd.zylin.com/#/c/6364/1 Signed-off-by: Jian-Hong Pan <chi...@gm...> Reviewed-on: http://openocd.zylin.com/6366 Tested-by: jenkins Reviewed-by: Florian Fainelli <f.f...@gm...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/tcl/board/rpi3.cfg b/tcl/board/rpi3.cfg new file mode 100644 index 000000000..fd93a9d9d --- /dev/null +++ b/tcl/board/rpi3.cfg @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +# This is the Raspberry Pi 3 board with BCM2837 chip +# https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2837/README.md +# +# Enable JTAG GPIO on Raspberry Pi boards +# https://www.raspberrypi.org/documentation/configuration/config-txt/gpio.md + +source [find target/bcm2837.cfg] +transport select jtag + +# Raspberry Pi boards only expose Test Reset (TRST) pin, no System Reset (SRST) +reset_config trst_only ----------------------------------------------------------------------- Summary of changes: src/rtos/zephyr.c | 8 ++++++++ tcl/board/rpi3.cfg | 13 +++++++++++++ tcl/board/rpi4b.cfg | 13 +++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 tcl/board/rpi3.cfg create mode 100644 tcl/board/rpi4b.cfg hooks/post-receive -- Main OpenOCD repository |