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
(54) |
Sep
(47) |
Oct
(15) |
Nov
(61) |
Dec
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-18 08:08:01
|
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 27e7f5df5ff691a78ca7530892ee5dc05820a947 (commit)
from 9f024dbedcf6dae472b2434ab426d64c4f798e90 (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 27e7f5df5ff691a78ca7530892ee5dc05820a947
Author: Ian Thompson <ia...@ca...>
Date: Thu Sep 15 16:24:33 2022 -0700
target/xtensa: fix clang analyzer warning
Reworked xtensa_queue_exec_ins_wide() logic to properly handle endian issues while executing arbitrary instructions.
Signed-off-by: Ian Thompson <ia...@ca...>
Change-Id: I5752dd254ce8b8822886ffc7edecaa242a93cce8
Reviewed-on: https://review.openocd.org/c/openocd/+/7198
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/target/xtensa/xtensa.c b/src/target/xtensa/xtensa.c
index f331a8665..50658e9d5 100644
--- a/src/target/xtensa/xtensa.c
+++ b/src/target/xtensa/xtensa.c
@@ -498,17 +498,20 @@ static void xtensa_queue_exec_ins(struct xtensa *xtensa, uint32_t ins)
static void xtensa_queue_exec_ins_wide(struct xtensa *xtensa, uint8_t *ops, uint8_t oplen)
{
- if ((oplen > 0) && (oplen <= 64)) {
- uint32_t opsw[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; /* 8 DIRx regs: max width 64B */
- uint8_t oplenw = (oplen + 3) / 4;
- if (xtensa->target->endianness == TARGET_BIG_ENDIAN)
- buf_bswap32((uint8_t *)opsw, ops, oplenw * 4);
- else
- memcpy(opsw, ops, oplen);
+ const int max_oplen = 64; /* 8 DIRx regs: max width 64B */
+ if ((oplen > 0) && (oplen <= max_oplen)) {
+ uint8_t ops_padded[max_oplen];
+ memcpy(ops_padded, ops, oplen);
+ memset(ops_padded + oplen, 0, max_oplen - oplen);
+ unsigned int oplenw = DIV_ROUND_UP(oplen, sizeof(uint32_t));
for (int32_t i = oplenw - 1; i > 0; i--)
- xtensa_queue_dbg_reg_write(xtensa, XDMREG_DIR0 + i, opsw[i]);
+ xtensa_queue_dbg_reg_write(xtensa,
+ XDMREG_DIR0 + i,
+ target_buffer_get_u32(xtensa->target, &ops_padded[sizeof(uint32_t)*i]));
/* Write DIR0EXEC last */
- xtensa_queue_dbg_reg_write(xtensa, XDMREG_DIR0EXEC, opsw[0]);
+ xtensa_queue_dbg_reg_write(xtensa,
+ XDMREG_DIR0EXEC,
+ target_buffer_get_u32(xtensa->target, &ops_padded[0]));
}
}
-----------------------------------------------------------------------
Summary of changes:
src/target/xtensa/xtensa.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-17 21:19: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 9f024dbedcf6dae472b2434ab426d64c4f798e90 (commit)
from f9837d1807dae8042aac2e52af3f007ef3cca4d9 (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 9f024dbedcf6dae472b2434ab426d64c4f798e90
Author: Marc Schink <de...@za...>
Date: Thu Sep 15 08:56:27 2022 +0200
flash/nor/stm32lx: Add revision 'X' for Cat.4/3 devices
Change-Id: I18c62ddb3963c357c7ce5dfc067c8d63fbc82b99
Signed-off-by: Marc Schink <de...@za...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7196
Tested-by: jenkins
Reviewed-by: Tomas Vanek <va...@fb...>
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/flash/nor/stm32lx.c b/src/flash/nor/stm32lx.c
index d7a83efa6..64073c31c 100644
--- a/src/flash/nor/stm32lx.c
+++ b/src/flash/nor/stm32lx.c
@@ -141,7 +141,7 @@ static const struct stm32lx_rev stm32_429_revs[] = {
{ 0x1000, "A" }, { 0x1018, "Z" },
};
static const struct stm32lx_rev stm32_436_revs[] = {
- { 0x1000, "A" }, { 0x1008, "Z" }, { 0x1018, "Y" },
+ { 0x1000, "A" }, { 0x1008, "Z" }, { 0x1018, "Y" }, { 0x1038, "X" },
};
static const struct stm32lx_rev stm32_437_revs[] = {
{ 0x1000, "A" },
-----------------------------------------------------------------------
Summary of changes:
src/flash/nor/stm32lx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-17 20:59:24
|
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 f9837d1807dae8042aac2e52af3f007ef3cca4d9 (commit)
from 68fe396b79a7732d1b0674bc60542bed3e0838b7 (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 f9837d1807dae8042aac2e52af3f007ef3cca4d9
Author: Tim Nordell <tno...@ai...>
Date: Wed Sep 7 11:59:47 2022 -0500
rtos: Support looking up .lto_priv.0 appended to symbol name
When FreeRTOS (at least) is compiled with -flto, this leaves certain
static symbols with .lto_priv.0 appended to their name. Arguably this
could be considered to be a gdb or gcc bug, but one place to resolve it
for OpenOCD usage is here at symbol lookup time.
Note that the ".0" is for the first such instance of the variable as a
static; additional ones would end up as ".1", ".2", etc, and are not
considered here.
Signed-off-by: Tim Nordell <tno...@ai...>
Change-Id: I03580b45e8ea364392ef4e05c96276416b390cb0
Reviewed-on: https://review.openocd.org/c/openocd/+/7179
Tested-by: jenkins
Reviewed-by: Tomas Vanek <va...@fb...>
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c
index ccf15c7c7..31fd057ed 100644
--- a/src/rtos/rtos.c
+++ b/src/rtos/rtos.c
@@ -215,6 +215,12 @@ static struct symbol_table_elem *next_symbol(struct rtos *os, char *cur_symbol,
* specified explicitly, then no further symbol lookup is done. When
* auto-detecting, the RTOS driver _detect() function must return success.
*
+ * The symbol is tried twice to handle the -flto case with gcc. The first
+ * attempt uses the symbol as-is, and the second attempt tries the symbol
+ * with ".lto_priv.0" appended to it. We only consider the first static
+ * symbol here from the -flto case. (Each subsequent static symbol with
+ * the same name is exported as .lto_priv.1, .lto_priv.2, etc.)
+ *
* rtos_qsymbol() returns 1 if an RTOS has been detected, or 0 otherwise.
*/
int rtos_qsymbol(struct connection *connection, char const *packet, int packet_size)
@@ -223,7 +229,7 @@ int rtos_qsymbol(struct connection *connection, char const *packet, int packet_s
uint64_t addr = 0;
size_t reply_len;
char reply[GDB_BUFFER_SIZE + 1], cur_sym[GDB_BUFFER_SIZE / 2 + 1] = ""; /* Extra byte for null-termination */
- struct symbol_table_elem *next_sym;
+ struct symbol_table_elem *next_sym = NULL;
struct target *target = get_target_from_connection(connection);
struct rtos *os = target->rtos;
@@ -236,13 +242,34 @@ int rtos_qsymbol(struct connection *connection, char const *packet, int packet_s
size_t len = unhexify((uint8_t *)cur_sym, strchr(packet + 8, ':') + 1, strlen(strchr(packet + 8, ':') + 1));
cur_sym[len] = 0;
+ const char no_suffix[] = "";
+ const char lto_suffix[] = ".lto_priv.0";
+ const size_t lto_suffix_len = strlen(lto_suffix);
+
+ const char *cur_suffix;
+ const char *next_suffix;
+
+ /* Detect what suffix was used during the previous symbol lookup attempt, and
+ * speculatively determine the next suffix (only used for the unknown address case) */
+ if (len > lto_suffix_len && !strcmp(cur_sym + len - lto_suffix_len, lto_suffix)) {
+ /* Trim the suffix from cur_sym for comparison purposes below */
+ cur_sym[len - lto_suffix_len] = '\0';
+ cur_suffix = lto_suffix;
+ next_suffix = NULL;
+ } else {
+ cur_suffix = no_suffix;
+ next_suffix = lto_suffix;
+ }
+
if ((strcmp(packet, "qSymbol::") != 0) && /* GDB is not offering symbol lookup for the first time */
(!sscanf(packet, "qSymbol:%" SCNx64 ":", &addr))) { /* GDB did not find an address for a symbol */
/* GDB could not find an address for the previous symbol */
struct symbol_table_elem *sym = find_symbol(os, cur_sym);
- if (sym && !sym->optional) { /* the symbol is mandatory for this RTOS */
+ if (next_suffix) {
+ next_sym = sym;
+ } else if (sym && !sym->optional) { /* the symbol is mandatory for this RTOS */
if (!target->rtos_auto_detect) {
LOG_WARNING("RTOS %s not detected. (GDB could not find symbol \'%s\')", os->type->name, cur_sym);
goto done;
@@ -259,13 +286,16 @@ int rtos_qsymbol(struct connection *connection, char const *packet, int packet_s
}
}
- LOG_DEBUG("RTOS: Address of symbol '%s' is 0x%" PRIx64, cur_sym, addr);
+ LOG_DEBUG("RTOS: Address of symbol '%s%s' is 0x%" PRIx64, cur_sym, cur_suffix, addr);
- next_sym = next_symbol(os, cur_sym, addr);
+ if (!next_sym) {
+ next_sym = next_symbol(os, cur_sym, addr);
+ next_suffix = no_suffix;
+ }
/* Should never happen unless the debugger misbehaves */
if (!next_sym) {
- LOG_WARNING("RTOS: Debugger sent us qSymbol with '%s' that we did not ask for", cur_sym);
+ LOG_WARNING("RTOS: Debugger sent us qSymbol with '%s%s' that we did not ask for", cur_sym, cur_suffix);
goto done;
}
@@ -287,17 +317,26 @@ int rtos_qsymbol(struct connection *connection, char const *packet, int packet_s
}
}
- if (8 + (strlen(next_sym->symbol_name) * 2) + 1 > sizeof(reply)) {
- LOG_ERROR("ERROR: RTOS symbol '%s' name is too long for GDB!", next_sym->symbol_name);
+ assert(next_suffix);
+
+ reply_len = 8; /* snprintf(..., "qSymbol:") */
+ reply_len += 2 * strlen(next_sym->symbol_name); /* hexify(..., next_sym->symbol_name, ...) */
+ reply_len += 2 * strlen(next_suffix); /* hexify(..., next_suffix, ...) */
+ reply_len += 1; /* Terminating NUL */
+ if (reply_len > sizeof(reply)) {
+ LOG_ERROR("ERROR: RTOS symbol '%s%s' name is too long for GDB!", next_sym->symbol_name, next_suffix);
goto done;
}
- LOG_DEBUG("RTOS: Requesting symbol lookup of '%s' from the debugger", next_sym->symbol_name);
+ LOG_DEBUG("RTOS: Requesting symbol lookup of '%s%s' from the debugger", next_sym->symbol_name, next_suffix);
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),
sizeof(reply) - reply_len);
+ reply_len += hexify(reply + reply_len,
+ (const uint8_t *)next_suffix, strlen(next_suffix),
+ sizeof(reply) - reply_len);
done:
gdb_put_packet(connection, reply, reply_len);
-----------------------------------------------------------------------
Summary of changes:
src/rtos/rtos.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 47 insertions(+), 8 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-17 20:59:08
|
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 68fe396b79a7732d1b0674bc60542bed3e0838b7 (commit)
from 9f5a74c228cbab3d80c47c87fa9735167da7eb77 (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 68fe396b79a7732d1b0674bc60542bed3e0838b7
Author: Tim Nordell <tno...@ai...>
Date: Wed Sep 7 11:52:09 2022 -0500
rtos: Fold is_symbol_mandatory into rtos_qsymbol(..)
This is in preparation for a future commit that looks for an optional
suffix of .lto_priv.0 on the symbol name.
Signed-off-by: Tim Nordell <tno...@ai...>
Change-Id: If803332373825b73bc986bd4ea7dfaee9c625c0a
Reviewed-on: https://review.openocd.org/c/openocd/+/7178
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c
index 3c3896de3..ccf15c7c7 100644
--- a/src/rtos/rtos.c
+++ b/src/rtos/rtos.c
@@ -198,14 +198,6 @@ static struct symbol_table_elem *next_symbol(struct rtos *os, char *cur_symbol,
return s;
}
-/* searches for 'symbol' in the lookup table for 'os' and returns TRUE,
- * if 'symbol' is not declared optional */
-static bool is_symbol_mandatory(const struct rtos *os, const char *symbol)
-{
- struct symbol_table_elem *s = find_symbol(os, symbol);
- return s && !s->optional;
-}
-
/* rtos_qsymbol() processes and replies to all qSymbol packets from GDB.
*
* GDB sends a qSymbol:: packet (empty address, empty name) to notify
@@ -245,22 +237,25 @@ int rtos_qsymbol(struct connection *connection, char const *packet, int packet_s
cur_sym[len] = 0;
if ((strcmp(packet, "qSymbol::") != 0) && /* GDB is not offering symbol lookup for the first time */
- (!sscanf(packet, "qSymbol:%" SCNx64 ":", &addr)) && /* GDB did not find an address for a symbol */
- is_symbol_mandatory(os, cur_sym)) { /* the symbol is mandatory for this RTOS */
+ (!sscanf(packet, "qSymbol:%" SCNx64 ":", &addr))) { /* GDB did not find an address for a symbol */
/* GDB could not find an address for the previous symbol */
- if (!target->rtos_auto_detect) {
- LOG_WARNING("RTOS %s not detected. (GDB could not find symbol \'%s\')", os->type->name, cur_sym);
- goto done;
- } else {
- /* Autodetecting RTOS - try next RTOS */
- if (!rtos_try_next(target)) {
- LOG_WARNING("No RTOS could be auto-detected!");
+ struct symbol_table_elem *sym = find_symbol(os, cur_sym);
+
+ if (sym && !sym->optional) { /* the symbol is mandatory for this RTOS */
+ if (!target->rtos_auto_detect) {
+ LOG_WARNING("RTOS %s not detected. (GDB could not find symbol \'%s\')", os->type->name, cur_sym);
goto done;
- }
+ } else {
+ /* Autodetecting RTOS - try next RTOS */
+ if (!rtos_try_next(target)) {
+ LOG_WARNING("No RTOS could be auto-detected!");
+ goto done;
+ }
- /* Next RTOS selected - invalidate current symbol */
- cur_sym[0] = '\x00';
+ /* Next RTOS selected - invalidate current symbol */
+ cur_sym[0] = '\x00';
+ }
}
}
-----------------------------------------------------------------------
Summary of changes:
src/rtos/rtos.c | 35 +++++++++++++++--------------------
1 file changed, 15 insertions(+), 20 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-17 20:58:51
|
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 9f5a74c228cbab3d80c47c87fa9735167da7eb77 (commit)
from 4279b23fcacaf3bb6f7c5e8da9386eaeeafe5736 (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 9f5a74c228cbab3d80c47c87fa9735167da7eb77
Author: Tim Nordell <tno...@ai...>
Date: Wed Sep 7 11:35:33 2022 -0500
rtos: Create a new helper function find_symbol(...)
This will be utilized for an upcoming refactorization to support -flto
compiled programs.
Signed-off-by: Tim Nordell <tno...@ai...>
Change-Id: Id523c0b3ac2dad8b248ea0d2cac7b4dd2f83d293
Reviewed-on: https://review.openocd.org/c/openocd/+/7177
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c
index 3e43e828d..3c3896de3 100644
--- a/src/rtos/rtos.c
+++ b/src/rtos/rtos.c
@@ -170,35 +170,40 @@ int gdb_thread_packet(struct connection *connection, char const *packet, int pac
return target->rtos->gdb_thread_packet(connection, packet, packet_size);
}
-static struct symbol_table_elem *next_symbol(struct rtos *os, char *cur_symbol, uint64_t cur_addr)
+static struct symbol_table_elem *find_symbol(const struct rtos *os, const char *symbol)
{
struct symbol_table_elem *s;
+ for (s = os->symbols; s->symbol_name; s++)
+ if (!strcmp(s->symbol_name, symbol))
+ return s;
+
+ return NULL;
+}
+
+static struct symbol_table_elem *next_symbol(struct rtos *os, char *cur_symbol, uint64_t cur_addr)
+{
if (!os->symbols)
os->type->get_symbol_list_to_lookup(&os->symbols);
if (!cur_symbol[0])
return &os->symbols[0];
- for (s = os->symbols; s->symbol_name; s++)
- if (!strcmp(s->symbol_name, cur_symbol)) {
- s->address = cur_addr;
- s++;
- return s;
- }
+ struct symbol_table_elem *s = find_symbol(os, cur_symbol);
+ if (!s)
+ return NULL;
- return NULL;
+ s->address = cur_addr;
+ s++;
+ return s;
}
/* searches for 'symbol' in the lookup table for 'os' and returns TRUE,
* if 'symbol' is not declared optional */
static bool is_symbol_mandatory(const struct rtos *os, const char *symbol)
{
- for (struct symbol_table_elem *s = os->symbols; s->symbol_name; ++s) {
- if (!strcmp(s->symbol_name, symbol))
- return !s->optional;
- }
- return false;
+ struct symbol_table_elem *s = find_symbol(os, symbol);
+ return s && !s->optional;
}
/* rtos_qsymbol() processes and replies to all qSymbol packets from GDB.
-----------------------------------------------------------------------
Summary of changes:
src/rtos/rtos.c | 31 ++++++++++++++++++-------------
1 file changed, 18 insertions(+), 13 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-17 20:58: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 4279b23fcacaf3bb6f7c5e8da9386eaeeafe5736 (commit)
from 9464c801b9837b111e06d70beb7cad053752120b (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 4279b23fcacaf3bb6f7c5e8da9386eaeeafe5736
Author: Ian Thompson <ia...@ca...>
Date: Wed Sep 14 09:59:47 2022 -0700
target/xtensa: populate PS correctly during fetch
Read PS from EPS[debuglevel] during fetch such that it reflects the correct value when read via telnet (not just via gdb_server).
Signed-off-by: Ian Thompson <ia...@ca...>
Change-Id: I8504f68989bc6d5fe451a8cb69d01c86f4ec0100
Reviewed-on: https://review.openocd.org/c/openocd/+/7195
Tested-by: jenkins
Reviewed-by: Erhan Kurubas <erh...@es...>
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/target/xtensa/xtensa.c b/src/target/xtensa/xtensa.c
index a6e50ccc7..f331a8665 100644
--- a/src/target/xtensa/xtensa.c
+++ b/src/target/xtensa/xtensa.c
@@ -1100,6 +1100,9 @@ int xtensa_fetch_all_regs(struct target *target)
if (reg_num == XT_PC_REG_NUM_VIRTUAL) {
/* reg number of PC for debug interrupt depends on NDEBUGLEVEL */
reg_num = (XT_PC_REG_NUM_BASE + xtensa->core_config->debug.irq_level);
+ } else if (reg_num == xtensa_regs[XT_REG_IDX_PS].reg_num) {
+ /* reg number of PS for debug interrupt depends on NDEBUGLEVEL */
+ reg_num = (XT_PS_REG_NUM_BASE + xtensa->core_config->debug.irq_level);
} else if (reg_num == xtensa_regs[XT_REG_IDX_CPENABLE].reg_num) {
/* CPENABLE already read/updated; don't re-read */
reg_fetched = false;
-----------------------------------------------------------------------
Summary of changes:
src/target/xtensa/xtensa.c | 3 +++
1 file changed, 3 insertions(+)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-17 20:57:24
|
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 9464c801b9837b111e06d70beb7cad053752120b (commit)
from 219cb9598a6221ed24967f205a144a223add039a (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 9464c801b9837b111e06d70beb7cad053752120b
Author: Toms Stūrmanis <tom...@gm...>
Date: Wed Sep 14 15:13:59 2022 +0300
flash/nor/rsl10: Check return value
Change-Id: Id1ad72e74d6a1bddc4dfe46dcf715ef74e19a27f
Signed-off-by: Toms Stūrmanis <tom...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7194
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
Reviewed-by: Tomas Vanek <va...@fb...>
diff --git a/src/flash/nor/rsl10.c b/src/flash/nor/rsl10.c
index 164701fe0..ef501f4ee 100644
--- a/src/flash/nor/rsl10.c
+++ b/src/flash/nor/rsl10.c
@@ -747,6 +747,8 @@ COMMAND_HANDLER(rsl10_unlock_command)
uint32_t key;
retval = mem_ap_read_atomic_u32(ap, RSL10_FLASH_ADDRESS_LOCK_INFO_SETTING, &key);
+ if (retval != ERROR_OK)
+ return retval;
LOG_INFO("mem read: 0x%08" PRIx32, key);
if (key == RSL10_KEY_DEBUG_LOCK) {
-----------------------------------------------------------------------
Summary of changes:
src/flash/nor/rsl10.c | 2 ++
1 file changed, 2 insertions(+)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:20:29
|
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 219cb9598a6221ed24967f205a144a223add039a (commit)
from cec3b6232811dc504ad461ad99384e39b40aad52 (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 219cb9598a6221ed24967f205a144a223add039a
Author: Frank Dischner <fra...@gm...>
Date: Wed Apr 20 21:49:44 2022 -0500
FreeRTOS: Fix thread reg list for Cortex-M7
This updates the FreeRTOS module to use the M4F FPU stacking also for the
FPV5_SP and FPV5_DP FPUs, which are found on the Cortex-M7. The FPUs are
in fact different than the FPV4_SP found on the M4, but the register
stacking is the same.
Signed-off-by: Frank Dischner <fra...@gm...>
Change-Id: I74c45d2cfb55f55e6c557f2450068ad3c2fe9497
Reviewed-on: https://review.openocd.org/c/openocd/+/6939
Tested-by: jenkins
Reviewed-by: Tomas Vanek <va...@fb...>
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/rtos/FreeRTOS.c b/src/rtos/FreeRTOS.c
index afea9db90..583e2f752 100644
--- a/src/rtos/FreeRTOS.c
+++ b/src/rtos/FreeRTOS.c
@@ -437,7 +437,8 @@ static int freertos_get_thread_reg_list(struct rtos *rtos, int64_t thread_id,
int cm4_fpu_enabled = 0;
struct armv7m_common *armv7m_target = target_to_armv7m(rtos->target);
if (is_armv7m(armv7m_target)) {
- if (armv7m_target->fp_feature == FPV4_SP) {
+ if ((armv7m_target->fp_feature == FPV4_SP) || (armv7m_target->fp_feature == FPV5_SP) ||
+ (armv7m_target->fp_feature == FPV5_DP)) {
/* Found ARM v7m target which includes a FPU */
uint32_t cpacr;
-----------------------------------------------------------------------
Summary of changes:
src/rtos/FreeRTOS.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:19: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 cec3b6232811dc504ad461ad99384e39b40aad52 (commit)
from 58bd387219f4586f09f90fd6ebe441f3e2d29598 (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 cec3b6232811dc504ad461ad99384e39b40aad52
Author: Antonio Borneo <bor...@gm...>
Date: Sat Sep 10 14:34:51 2022 +0200
mips64: remove empty mips_mips64_soft_reset_halt()
The method soft_reset_halt is optional; no need to add an
empty function.
Remove mips_mips64_soft_reset_halt() and move the TODO comment
in struct target_type.
Change-Id: Id541a75e7a08645568961d59b73a120c2238701f
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7184
Tested-by: jenkins
Reviewed-by: Tomas Vanek <va...@fb...>
diff --git a/src/target/mips_mips64.c b/src/target/mips_mips64.c
index 449f5a217..d05b55c46 100644
--- a/src/target/mips_mips64.c
+++ b/src/target/mips_mips64.c
@@ -205,12 +205,6 @@ static int mips_mips64_deassert_reset(struct target *target)
return ERROR_OK;
}
-static int mips_mips64_soft_reset_halt(struct target *target)
-{
- /* TODO */
- return ERROR_OK;
-}
-
static int mips_mips64_single_step_core(struct target *target)
{
struct mips64_common *mips64 = target->arch_info;
@@ -1168,7 +1162,7 @@ struct target_type mips_mips64_target = {
.assert_reset = mips_mips64_assert_reset,
.deassert_reset = mips_mips64_deassert_reset,
- .soft_reset_halt = mips_mips64_soft_reset_halt,
+ /* TODO: add .soft_reset_halt */
.get_gdb_reg_list = mips64_get_gdb_reg_list,
-----------------------------------------------------------------------
Summary of changes:
src/target/mips_mips64.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:19:22
|
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 58bd387219f4586f09f90fd6ebe441f3e2d29598 (commit)
from 16cbddf1ce8b38bb5c2f02e438441572d285d946 (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 58bd387219f4586f09f90fd6ebe441f3e2d29598
Author: Ian Thompson <ia...@ca...>
Date: Fri Sep 9 12:10:20 2022 -0700
target/xtensa: fully initialize buffers for PWRSTAT read
Read buffer is sized for 32-bit APB version of PWRSTAT/PWRCTL registers. Initialize to zero so 8-bit JTAG register mirrors are accurate.
Signed-off-by: Ian Thompson <ia...@ca...>
Change-Id: I81310649fa7180893d0188aab3c8a14315aaea0a
Reviewed-on: https://review.openocd.org/c/openocd/+/7183
Tested-by: jenkins
Reviewed-by: Erhan Kurubas <erh...@es...>
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/target/xtensa/xtensa_debug_module.c b/src/target/xtensa/xtensa_debug_module.c
index 8753b863c..4f33c08aa 100644
--- a/src/target/xtensa/xtensa_debug_module.c
+++ b/src/target/xtensa/xtensa_debug_module.c
@@ -246,8 +246,8 @@ int xtensa_dm_device_id_read(struct xtensa_debug_module *dm)
int xtensa_dm_power_status_read(struct xtensa_debug_module *dm, uint32_t clear)
{
- uint8_t stat_buf[sizeof(uint32_t)];
- uint8_t stath_buf[sizeof(uint32_t)];
+ uint8_t stat_buf[sizeof(uint32_t)] = { 0, 0, 0, 0 };
+ uint8_t stath_buf[sizeof(uint32_t)] = { 0, 0, 0, 0 };
/* TODO: JTAG does not work when PWRCTL_JTAGDEBUGUSE is not set.
* It is set in xtensa_examine(), need to move reading of XDMREG_OCDID out of this function */
-----------------------------------------------------------------------
Summary of changes:
src/target/xtensa/xtensa_debug_module.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:18: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 16cbddf1ce8b38bb5c2f02e438441572d285d946 (commit)
from fed16496ab31041a7e113db3f3d6b0cf5c23866d (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 16cbddf1ce8b38bb5c2f02e438441572d285d946
Author: Paul Fertser <fer...@gm...>
Date: Sun Jun 24 20:48:35 2018 +0300
tcl: board: mini2440: fix to work with the current version
Change-Id: I5cf3ab09dbf100d40ce40a4599cd8d2af18a5567
Signed-off-by: Paul Fertser <fer...@gm...>
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/4574
Tested-by: jenkins
diff --git a/tcl/board/mini2440.cfg b/tcl/board/mini2440.cfg
index 790b4c7c8..85d9a35b9 100644
--- a/tcl/board/mini2440.cfg
+++ b/tcl/board/mini2440.cfg
@@ -123,7 +123,6 @@ reset_config trst_and_srst
#-------------------------------------------------------------------------
adapter speed 12000
- jtag interface
#-------------------------------------------------------------------------
# GDB Setup
-----------------------------------------------------------------------
Summary of changes:
tcl/board/mini2440.cfg | 1 -
1 file changed, 1 deletion(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:18: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 fed16496ab31041a7e113db3f3d6b0cf5c23866d (commit)
from 24e801d5d68a9383a8c269ef93bc10ae1a7b19b7 (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 fed16496ab31041a7e113db3f3d6b0cf5c23866d
Author: Steve Marple <ste...@go...>
Date: Mon Aug 15 15:45:02 2022 +0100
drivers/bcm2835gpio: Fully restore GPIOs after use
Restore outputs to their initial output level.
Signed-off-by: Steve Marple <ste...@go...>
Change-Id: I82402fd7b59d944f81c0ea7859ac499943901f82
Reviewed-on: https://review.openocd.org/c/openocd/+/7125
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/jtag/drivers/bcm2835gpio.c b/src/jtag/drivers/bcm2835gpio.c
index 50db87a93..d02b6e434 100644
--- a/src/jtag/drivers/bcm2835gpio.c
+++ b/src/jtag/drivers/bcm2835gpio.c
@@ -51,7 +51,11 @@ static int speed_offset = 28;
static unsigned int jtag_delay;
static const struct adapter_gpio_config *adapter_gpio_config;
-static int initial_gpio_mode[ADAPTER_GPIO_IDX_NUM];
+static struct initial_gpio_state {
+ unsigned int mode;
+ unsigned int output_level;
+} initial_gpio_state[ADAPTER_GPIO_IDX_NUM];
+static uint32_t initial_drive_strength_etc;
static bool is_gpio_config_valid(enum adapter_gpio_config_index idx)
{
@@ -96,8 +100,15 @@ static void set_gpio_value(const struct adapter_gpio_config *gpio_config, int va
static void restore_gpio(enum adapter_gpio_config_index idx)
{
- if (is_gpio_config_valid(idx))
- SET_MODE_GPIO(adapter_gpio_config[idx].gpio_num, initial_gpio_mode[idx]);
+ if (is_gpio_config_valid(idx)) {
+ SET_MODE_GPIO(adapter_gpio_config[idx].gpio_num, initial_gpio_state[idx].mode);
+ if (initial_gpio_state[idx].mode == BCM2835_GPIO_MODE_OUTPUT) {
+ if (initial_gpio_state[idx].output_level)
+ GPIO_SET = 1 << adapter_gpio_config[idx].gpio_num;
+ else
+ GPIO_CLR = 1 << adapter_gpio_config[idx].gpio_num;
+ }
+ }
}
static void initialize_gpio(enum adapter_gpio_config_index idx)
@@ -105,10 +116,12 @@ static void initialize_gpio(enum adapter_gpio_config_index idx)
if (!is_gpio_config_valid(idx))
return;
- initial_gpio_mode[idx] = MODE_GPIO(adapter_gpio_config[idx].gpio_num);
+ initial_gpio_state[idx].mode = MODE_GPIO(adapter_gpio_config[idx].gpio_num);
+ unsigned int shift = adapter_gpio_config[idx].gpio_num;
+ initial_gpio_state[idx].output_level = (GPIO_LEV >> shift) & 1;
LOG_DEBUG("saved GPIO mode for %s (GPIO %d %d): %d",
adapter_gpio_get_name(idx), adapter_gpio_config[idx].chip_num, adapter_gpio_config[idx].gpio_num,
- initial_gpio_mode[idx]);
+ initial_gpio_state[idx].mode);
if (adapter_gpio_config[idx].pull != ADAPTER_GPIO_PULL_NONE) {
LOG_WARNING("BCM2835 GPIO does not support pull-up or pull-down settings (signal %s)",
@@ -407,6 +420,7 @@ static int bcm2835gpio_init(void)
close(dev_mem_fd);
/* set 4mA drive strength, slew rate limited, hysteresis on */
+ initial_drive_strength_etc = pads_base[BCM2835_PADS_GPIO_0_27_OFFSET] & 0x1f;
pads_base[BCM2835_PADS_GPIO_0_27_OFFSET] = 0x5a000008 + 1;
/* Configure JTAG/SWD signals. Default directions and initial states are handled
@@ -478,6 +492,8 @@ static int bcm2835gpio_quit(void)
restore_gpio(ADAPTER_GPIO_IDX_SRST);
restore_gpio(ADAPTER_GPIO_IDX_LED);
+ /* Restore drive strength. MSB is password ("5A") */
+ pads_base[BCM2835_PADS_GPIO_0_27_OFFSET] = 0x5A000000 | initial_drive_strength_etc;
bcm2835gpio_munmap();
return ERROR_OK;
-----------------------------------------------------------------------
Summary of changes:
src/jtag/drivers/bcm2835gpio.c | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:17: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 24e801d5d68a9383a8c269ef93bc10ae1a7b19b7 (commit)
via 0dd969d83badb6793519ee99dd8ab8579d5f59df (commit)
from e643a494d46c571711ccba361ad20faaf6f6503c (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 24e801d5d68a9383a8c269ef93bc10ae1a7b19b7
Author: Steve Marple <ste...@go...>
Date: Sun Aug 14 11:01:08 2022 +0100
drivers/bcm2835gpio: Add support for activity LED
Signed-off-by: Steve Marple <ste...@go...>
Change-Id: I472385753507167c93328b9b4dc62d5d61c86f74
Reviewed-on: https://review.openocd.org/c/openocd/+/7124
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/jtag/drivers/bcm2835gpio.c b/src/jtag/drivers/bcm2835gpio.c
index f1538dda7..50db87a93 100644
--- a/src/jtag/drivers/bcm2835gpio.c
+++ b/src/jtag/drivers/bcm2835gpio.c
@@ -341,13 +341,21 @@ static void bcm2835gpio_munmap(void)
}
}
+static int bcm2835gpio_blink(int on)
+{
+ if (is_gpio_config_valid(ADAPTER_GPIO_IDX_LED))
+ set_gpio_value(&adapter_gpio_config[ADAPTER_GPIO_IDX_LED], on);
+
+ return ERROR_OK;
+}
+
static struct bitbang_interface bcm2835gpio_bitbang = {
.read = bcm2835gpio_read,
.write = bcm2835gpio_write,
.swdio_read = bcm2835_swdio_read,
.swdio_drive = bcm2835_swdio_drive,
.swd_write = bcm2835gpio_swd_write_generic,
- .blink = NULL
+ .blink = bcm2835gpio_blink,
};
static int bcm2835gpio_init(void)
@@ -440,6 +448,7 @@ static int bcm2835gpio_init(void)
}
initialize_gpio(ADAPTER_GPIO_IDX_SRST);
+ initialize_gpio(ADAPTER_GPIO_IDX_LED);
return ERROR_OK;
}
@@ -467,6 +476,7 @@ static int bcm2835gpio_quit(void)
}
restore_gpio(ADAPTER_GPIO_IDX_SRST);
+ restore_gpio(ADAPTER_GPIO_IDX_LED);
bcm2835gpio_munmap();
commit 0dd969d83badb6793519ee99dd8ab8579d5f59df
Author: Steve Marple <ste...@go...>
Date: Sat Jun 25 23:45:18 2022 +0100
drivers/bcm2835gpio: Migrate to adapter gpio commands
Use the new "adapter gpio" commands to configure the GPIOs used by the
bcm2835gpio driver. The driver supports only 1 chip (gpiochip0).
The reset function now honours the srst_open_drain and trst_open_drain
options.
Signed-off-by: Steve Marple <ste...@go...>
Change-Id: I5b6c68b16362000cf5141a83394549d2bf3af108
Reviewed-on: https://review.openocd.org/c/openocd/+/7123
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/doc/openocd.texi b/doc/openocd.texi
index 3e56079fe..fc86429d1 100644
--- a/doc/openocd.texi
+++ b/doc/openocd.texi
@@ -3292,66 +3292,12 @@ able to coexist nicely with both sysfs bitbanging and various
peripherals' kernel drivers. The driver restores the previous
configuration on exit.
-GPIO numbers >= 32 can't be used for performance reasons.
+GPIO numbers >= 32 can't be used for performance reasons. GPIO configuration is
+handled by the generic command @ref{adapter gpio, @command{adapter gpio}}.
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}
-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}
-Set TCK GPIO number. Must be specified to enable JTAG transport. Can also be
-specified using the configuration command @command{bcm2835gpio jtag_nums}.
-@end deffn
-
-@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 @command{bcm2835gpio jtag_nums}.
-@end deffn
-
-@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 @command{bcm2835gpio jtag_nums}.
-@end deffn
-
-@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 @command{bcm2835gpio jtag_nums}.
-@end deffn
-
-@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}
-Set SWCLK GPIO number. Must be specified to enable SWD transport. Can also be
-specified using the configuration command @command{bcm2835gpio swd_nums}.
-@end deffn
-
-@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 @command{bcm2835gpio swd_nums}.
-@end deffn
-
-@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}
-Set SRST GPIO number. Must be specified to enable SRST.
-@end deffn
-
-@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}
Set SPEED_COEFF and SPEED_OFFSET for delay calculations. If unspecified,
speed_coeff defaults to 113714, and speed_offset defaults to 28.
diff --git a/src/jtag/drivers/bcm2835gpio.c b/src/jtag/drivers/bcm2835gpio.c
index 0bbbc6fce..f1538dda7 100644
--- a/src/jtag/drivers/bcm2835gpio.c
+++ b/src/jtag/drivers/bcm2835gpio.c
@@ -12,6 +12,7 @@
#include "config.h"
#endif
+#include <jtag/adapter.h>
#include <jtag/interface.h>
#include <transport/transport.h>
#include "bitbang.h"
@@ -24,13 +25,17 @@ uint32_t bcm2835_peri_base = 0x20000000;
#define BCM2835_PADS_GPIO_0_27 (bcm2835_peri_base + 0x100000)
#define BCM2835_PADS_GPIO_0_27_OFFSET (0x2c / 4)
+/* See "GPIO Function Select Registers (GPFSELn)" in "Broadcom BCM2835 ARM Peripherals" datasheet. */
+#define BCM2835_GPIO_MODE_INPUT 0
+#define BCM2835_GPIO_MODE_OUTPUT 1
+
/* GPIO setup macros */
#define MODE_GPIO(g) (*(pio_base+((g)/10))>>(((g)%10)*3) & 7)
#define INP_GPIO(g) do { *(pio_base+((g)/10)) &= ~(7<<(((g)%10)*3)); } while (0)
#define SET_MODE_GPIO(g, m) do { /* clear the mode bits first, then set as necessary */ \
INP_GPIO(g); \
*(pio_base+((g)/10)) |= ((m)<<(((g)%10)*3)); } while (0)
-#define OUT_GPIO(g) SET_MODE_GPIO(g, 1)
+#define OUT_GPIO(g) SET_MODE_GPIO(g, BCM2835_GPIO_MODE_OUTPUT)
#define GPIO_SET (*(pio_base+7)) /* sets bits which are 1, ignores bits which are 0 */
#define GPIO_CLR (*(pio_base+10)) /* clears bits which are 1, ignores bits which are 0 */
@@ -40,64 +45,109 @@ static int dev_mem_fd;
static volatile uint32_t *pio_base = MAP_FAILED;
static volatile uint32_t *pads_base = MAP_FAILED;
-static bb_value_t bcm2835gpio_read(void);
-static int bcm2835gpio_write(int tck, int tms, int tdi);
-
-static int bcm2835_swdio_read(void);
-static void bcm2835_swdio_drive(bool is_output);
-static int bcm2835gpio_swd_write(int swclk, int swdio);
-
-static int bcm2835gpio_init(void);
-static int bcm2835gpio_quit(void);
-
-static struct bitbang_interface bcm2835gpio_bitbang = {
- .read = bcm2835gpio_read,
- .write = bcm2835gpio_write,
- .swdio_read = bcm2835_swdio_read,
- .swdio_drive = bcm2835_swdio_drive,
- .swd_write = bcm2835gpio_swd_write,
- .blink = NULL
-};
-
-/* GPIO numbers for each signal. Negative values are invalid */
-static int tck_gpio = -1;
-static int tck_gpio_mode;
-static int tms_gpio = -1;
-static int tms_gpio_mode;
-static int tdi_gpio = -1;
-static int tdi_gpio_mode;
-static int tdo_gpio = -1;
-static int tdo_gpio_mode;
-static int trst_gpio = -1;
-static int trst_gpio_mode;
-static int srst_gpio = -1;
-static int srst_gpio_mode;
-static int swclk_gpio = -1;
-static int swclk_gpio_mode;
-static int swdio_gpio = -1;
-static int swdio_gpio_mode;
-static int swdio_dir_gpio = -1;
-static int swdio_dir_gpio_mode;
-
/* Transition delay coefficients */
static int speed_coeff = 113714;
static int speed_offset = 28;
static unsigned int jtag_delay;
-static int is_gpio_valid(int gpio)
+static const struct adapter_gpio_config *adapter_gpio_config;
+static int initial_gpio_mode[ADAPTER_GPIO_IDX_NUM];
+
+static bool is_gpio_config_valid(enum adapter_gpio_config_index idx)
{
- return gpio >= 0 && gpio <= 31;
+ /* Only chip 0 is supported, accept unset value (-1) too */
+ return adapter_gpio_config[idx].chip_num >= -1
+ && adapter_gpio_config[idx].chip_num <= 0
+ && adapter_gpio_config[idx].gpio_num >= 0
+ && adapter_gpio_config[idx].gpio_num <= 31;
+}
+
+static void set_gpio_value(const struct adapter_gpio_config *gpio_config, int value)
+{
+ value = value ^ (gpio_config->active_low ? 1 : 0);
+ switch (gpio_config->drive) {
+ case ADAPTER_GPIO_DRIVE_MODE_PUSH_PULL:
+ if (value)
+ GPIO_SET = 1 << gpio_config->gpio_num;
+ else
+ GPIO_CLR = 1 << gpio_config->gpio_num;
+ /* For performance reasons assume the GPIO is already set as an output
+ * and therefore the call can be omitted here.
+ */
+ break;
+ case ADAPTER_GPIO_DRIVE_MODE_OPEN_DRAIN:
+ if (value) {
+ INP_GPIO(gpio_config->gpio_num);
+ } else {
+ GPIO_CLR = 1 << gpio_config->gpio_num;
+ OUT_GPIO(gpio_config->gpio_num);
+ }
+ break;
+ case ADAPTER_GPIO_DRIVE_MODE_OPEN_SOURCE:
+ if (value) {
+ GPIO_SET = 1 << gpio_config->gpio_num;
+ OUT_GPIO(gpio_config->gpio_num);
+ } else {
+ INP_GPIO(gpio_config->gpio_num);
+ }
+ break;
+ }
+}
+
+static void restore_gpio(enum adapter_gpio_config_index idx)
+{
+ if (is_gpio_config_valid(idx))
+ SET_MODE_GPIO(adapter_gpio_config[idx].gpio_num, initial_gpio_mode[idx]);
+}
+
+static void initialize_gpio(enum adapter_gpio_config_index idx)
+{
+ if (!is_gpio_config_valid(idx))
+ return;
+
+ initial_gpio_mode[idx] = MODE_GPIO(adapter_gpio_config[idx].gpio_num);
+ LOG_DEBUG("saved GPIO mode for %s (GPIO %d %d): %d",
+ adapter_gpio_get_name(idx), adapter_gpio_config[idx].chip_num, adapter_gpio_config[idx].gpio_num,
+ initial_gpio_mode[idx]);
+
+ if (adapter_gpio_config[idx].pull != ADAPTER_GPIO_PULL_NONE) {
+ LOG_WARNING("BCM2835 GPIO does not support pull-up or pull-down settings (signal %s)",
+ adapter_gpio_get_name(idx));
+ }
+
+ switch (adapter_gpio_config[idx].init_state) {
+ case ADAPTER_GPIO_INIT_STATE_INACTIVE:
+ set_gpio_value(&adapter_gpio_config[idx], 0);
+ break;
+ case ADAPTER_GPIO_INIT_STATE_ACTIVE:
+ set_gpio_value(&adapter_gpio_config[idx], 1);
+ break;
+ case ADAPTER_GPIO_INIT_STATE_INPUT:
+ INP_GPIO(adapter_gpio_config[idx].gpio_num);
+ break;
+ }
+
+ /* Direction for non push-pull is already set by set_gpio_value() */
+ if (adapter_gpio_config[idx].drive == ADAPTER_GPIO_DRIVE_MODE_PUSH_PULL)
+ OUT_GPIO(adapter_gpio_config[idx].gpio_num);
}
static bb_value_t bcm2835gpio_read(void)
{
- return (GPIO_LEV & 1<<tdo_gpio) ? BB_HIGH : BB_LOW;
+ unsigned int shift = adapter_gpio_config[ADAPTER_GPIO_IDX_TDO].gpio_num;
+ uint32_t value = (GPIO_LEV >> shift) & 1;
+ return value ^ (adapter_gpio_config[ADAPTER_GPIO_IDX_TDO].active_low ? BB_HIGH : BB_LOW);
+
}
static int bcm2835gpio_write(int tck, int tms, int tdi)
{
- uint32_t set = tck<<tck_gpio | tms<<tms_gpio | tdi<<tdi_gpio;
- uint32_t clear = !tck<<tck_gpio | !tms<<tms_gpio | !tdi<<tdi_gpio;
+ uint32_t set = tck << adapter_gpio_config[ADAPTER_GPIO_IDX_TCK].gpio_num |
+ tms << adapter_gpio_config[ADAPTER_GPIO_IDX_TMS].gpio_num |
+ tdi << adapter_gpio_config[ADAPTER_GPIO_IDX_TDI].gpio_num;
+ uint32_t clear = !tck << adapter_gpio_config[ADAPTER_GPIO_IDX_TCK].gpio_num |
+ !tms << adapter_gpio_config[ADAPTER_GPIO_IDX_TMS].gpio_num |
+ !tdi << adapter_gpio_config[ADAPTER_GPIO_IDX_TDI].gpio_num;
GPIO_SET = set;
GPIO_CLR = clear;
@@ -108,10 +158,16 @@ static int bcm2835gpio_write(int tck, int tms, int tdi)
return ERROR_OK;
}
-static int bcm2835gpio_swd_write(int swclk, int swdio)
+/* Requires push-pull drive mode for swclk and swdio */
+static int bcm2835gpio_swd_write_fast(int swclk, int swdio)
{
- uint32_t set = swclk << swclk_gpio | swdio << swdio_gpio;
- uint32_t clear = !swclk << swclk_gpio | !swdio << swdio_gpio;
+ swclk = swclk ^ (adapter_gpio_config[ADAPTER_GPIO_IDX_SWCLK].active_low ? 1 : 0);
+ swdio = swdio ^ (adapter_gpio_config[ADAPTER_GPIO_IDX_SWDIO].active_low ? 1 : 0);
+
+ uint32_t set = swclk << adapter_gpio_config[ADAPTER_GPIO_IDX_SWCLK].gpio_num |
+ swdio << adapter_gpio_config[ADAPTER_GPIO_IDX_SWDIO].gpio_num;
+ uint32_t clear = !swclk << adapter_gpio_config[ADAPTER_GPIO_IDX_SWCLK].gpio_num |
+ !swdio << adapter_gpio_config[ADAPTER_GPIO_IDX_SWDIO].gpio_num;
GPIO_SET = set;
GPIO_CLR = clear;
@@ -122,55 +178,62 @@ static int bcm2835gpio_swd_write(int swclk, int swdio)
return ERROR_OK;
}
-/* (1) assert or (0) deassert reset lines */
-static int bcm2835gpio_reset(int trst, int srst)
+/* Generic mode that works for open-drain/open-source drive modes, but slower */
+static int bcm2835gpio_swd_write_generic(int swclk, int swdio)
{
- uint32_t set = 0;
- uint32_t clear = 0;
+ set_gpio_value(&adapter_gpio_config[ADAPTER_GPIO_IDX_SWDIO], swdio);
+ set_gpio_value(&adapter_gpio_config[ADAPTER_GPIO_IDX_SWCLK], swclk); /* Write clock last */
- if (is_gpio_valid(trst_gpio)) {
- set |= !trst<<trst_gpio;
- clear |= trst<<trst_gpio;
- }
+ for (unsigned int i = 0; i < jtag_delay; ++i)
+ asm volatile ("");
- if (is_gpio_valid(srst_gpio)) {
- set |= !srst<<srst_gpio;
- clear |= srst<<srst_gpio;
- }
+ return ERROR_OK;
+}
- GPIO_SET = set;
- GPIO_CLR = clear;
+/* (1) assert or (0) deassert reset lines */
+static int bcm2835gpio_reset(int trst, int srst)
+{
+ /* As the "adapter reset_config" command keeps the srst and trst gpio drive
+ * mode settings in sync we can use our standard set_gpio_value() function
+ * that honours drive mode and active low.
+ */
+ if (is_gpio_config_valid(ADAPTER_GPIO_IDX_SRST))
+ set_gpio_value(&adapter_gpio_config[ADAPTER_GPIO_IDX_SRST], srst);
+ if (is_gpio_config_valid(ADAPTER_GPIO_IDX_TRST))
+ set_gpio_value(&adapter_gpio_config[ADAPTER_GPIO_IDX_TRST], trst);
+
+ LOG_DEBUG("BCM2835 GPIO: bcm2835gpio_reset(%d, %d), trst_gpio: %d %d, srst_gpio: %d %d",
+ trst, srst,
+ adapter_gpio_config[ADAPTER_GPIO_IDX_TRST].chip_num, adapter_gpio_config[ADAPTER_GPIO_IDX_TRST].gpio_num,
+ adapter_gpio_config[ADAPTER_GPIO_IDX_SRST].chip_num, adapter_gpio_config[ADAPTER_GPIO_IDX_SRST].gpio_num);
return ERROR_OK;
}
static void bcm2835_swdio_drive(bool is_output)
{
- if (is_gpio_valid(swdio_dir_gpio)) {
- if (is_output) {
- GPIO_SET = 1 << swdio_dir_gpio;
- OUT_GPIO(swdio_gpio);
- } else {
- INP_GPIO(swdio_gpio);
- GPIO_CLR = 1 << swdio_dir_gpio;
- }
+ if (is_output) {
+ if (is_gpio_config_valid(ADAPTER_GPIO_IDX_SWDIO_DIR))
+ set_gpio_value(&adapter_gpio_config[ADAPTER_GPIO_IDX_SWDIO_DIR], 1);
+ OUT_GPIO(adapter_gpio_config[ADAPTER_GPIO_IDX_SWDIO].gpio_num);
} else {
- if (is_output)
- OUT_GPIO(swdio_gpio);
- else
- INP_GPIO(swdio_gpio);
+ INP_GPIO(adapter_gpio_config[ADAPTER_GPIO_IDX_SWDIO].gpio_num);
+ if (is_gpio_config_valid(ADAPTER_GPIO_IDX_SWDIO_DIR))
+ set_gpio_value(&adapter_gpio_config[ADAPTER_GPIO_IDX_SWDIO_DIR], 0);
}
}
static int bcm2835_swdio_read(void)
{
- return !!(GPIO_LEV & 1 << swdio_gpio);
+ unsigned int shift = adapter_gpio_config[ADAPTER_GPIO_IDX_SWDIO].gpio_num;
+ uint32_t value = (GPIO_LEV >> shift) & 1;
+ return value ^ (adapter_gpio_config[ADAPTER_GPIO_IDX_SWDIO].active_low ? 1 : 0);
}
static int bcm2835gpio_khz(int khz, int *jtag_speed)
{
if (!khz) {
- LOG_DEBUG("RCLK not supported");
+ LOG_DEBUG("BCM2835 GPIO: RCLK not supported");
return ERROR_FAIL;
}
*jtag_speed = speed_coeff/khz - speed_offset;
@@ -191,121 +254,6 @@ static int bcm2835gpio_speed(int speed)
return ERROR_OK;
}
-COMMAND_HANDLER(bcm2835gpio_handle_jtag_gpionums)
-{
- if (CMD_ARGC == 4) {
- COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], tck_gpio);
- COMMAND_PARSE_NUMBER(int, CMD_ARGV[1], tms_gpio);
- COMMAND_PARSE_NUMBER(int, CMD_ARGV[2], tdi_gpio);
- COMMAND_PARSE_NUMBER(int, CMD_ARGV[3], tdo_gpio);
- } else if (CMD_ARGC != 0) {
- return ERROR_COMMAND_SYNTAX_ERROR;
- }
-
- command_print(CMD,
- "BCM2835 GPIO config: tck = %d, tms = %d, tdi = %d, tdo = %d",
- tck_gpio, tms_gpio, tdi_gpio, tdo_gpio);
-
- return ERROR_OK;
-}
-
-COMMAND_HANDLER(bcm2835gpio_handle_jtag_gpionum_tck)
-{
- if (CMD_ARGC == 1)
- COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], tck_gpio);
-
- command_print(CMD, "BCM2835 GPIO config: tck = %d", tck_gpio);
- return ERROR_OK;
-}
-
-COMMAND_HANDLER(bcm2835gpio_handle_jtag_gpionum_tms)
-{
- if (CMD_ARGC == 1)
- COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], tms_gpio);
-
- command_print(CMD, "BCM2835 GPIO config: tms = %d", tms_gpio);
- return ERROR_OK;
-}
-
-COMMAND_HANDLER(bcm2835gpio_handle_jtag_gpionum_tdo)
-{
- if (CMD_ARGC == 1)
- COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], tdo_gpio);
-
- command_print(CMD, "BCM2835 GPIO config: tdo = %d", tdo_gpio);
- return ERROR_OK;
-}
-
-COMMAND_HANDLER(bcm2835gpio_handle_jtag_gpionum_tdi)
-{
- if (CMD_ARGC == 1)
- COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], tdi_gpio);
-
- command_print(CMD, "BCM2835 GPIO config: tdi = %d", tdi_gpio);
- return ERROR_OK;
-}
-
-COMMAND_HANDLER(bcm2835gpio_handle_jtag_gpionum_srst)
-{
- if (CMD_ARGC == 1)
- COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], srst_gpio);
-
- command_print(CMD, "BCM2835 GPIO config: srst = %d", srst_gpio);
- return ERROR_OK;
-}
-
-COMMAND_HANDLER(bcm2835gpio_handle_jtag_gpionum_trst)
-{
- if (CMD_ARGC == 1)
- COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], trst_gpio);
-
- command_print(CMD, "BCM2835 GPIO config: trst = %d", trst_gpio);
- return ERROR_OK;
-}
-
-COMMAND_HANDLER(bcm2835gpio_handle_swd_gpionums)
-{
- if (CMD_ARGC == 2) {
- COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], swclk_gpio);
- COMMAND_PARSE_NUMBER(int, CMD_ARGV[1], swdio_gpio);
- } else if (CMD_ARGC != 0) {
- return ERROR_COMMAND_SYNTAX_ERROR;
- }
-
- command_print(CMD,
- "BCM2835 GPIO nums: swclk = %d, swdio = %d",
- swclk_gpio, swdio_gpio);
-
- return ERROR_OK;
-}
-
-COMMAND_HANDLER(bcm2835gpio_handle_swd_gpionum_swclk)
-{
- if (CMD_ARGC == 1)
- COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], swclk_gpio);
-
- command_print(CMD, "BCM2835 num: swclk = %d", swclk_gpio);
- return ERROR_OK;
-}
-
-COMMAND_HANDLER(bcm2835gpio_handle_swd_gpionum_swdio)
-{
- if (CMD_ARGC == 1)
- COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], swdio_gpio);
-
- command_print(CMD, "BCM2835 num: swdio = %d", swdio_gpio);
- return ERROR_OK;
-}
-
-COMMAND_HANDLER(bcm2835gpio_handle_swd_dir_gpionum_swdio)
-{
- if (CMD_ARGC == 1)
- COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], swdio_dir_gpio);
-
- command_print(CMD, "BCM2835 num: swdio_dir = %d", swdio_dir_gpio);
- return ERROR_OK;
-}
-
COMMAND_HANDLER(bcm2835gpio_handle_speed_coeffs)
{
if (CMD_ARGC == 2) {
@@ -329,83 +277,6 @@ COMMAND_HANDLER(bcm2835gpio_handle_peripheral_base)
}
static const struct command_registration bcm2835gpio_subcommand_handlers[] = {
- {
- .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 = "tck_num",
- .handler = &bcm2835gpio_handle_jtag_gpionum_tck,
- .mode = COMMAND_CONFIG,
- .help = "gpio number for tck.",
- .usage = "[tck]",
- },
- {
- .name = "tms_num",
- .handler = &bcm2835gpio_handle_jtag_gpionum_tms,
- .mode = COMMAND_CONFIG,
- .help = "gpio number for tms.",
- .usage = "[tms]",
- },
- {
- .name = "tdo_num",
- .handler = &bcm2835gpio_handle_jtag_gpionum_tdo,
- .mode = COMMAND_CONFIG,
- .help = "gpio number for tdo.",
- .usage = "[tdo]",
- },
- {
- .name = "tdi_num",
- .handler = &bcm2835gpio_handle_jtag_gpionum_tdi,
- .mode = COMMAND_CONFIG,
- .help = "gpio number for tdi.",
- .usage = "[tdi]",
- },
- {
- .name = "swd_nums",
- .handler = &bcm2835gpio_handle_swd_gpionums,
- .mode = COMMAND_CONFIG,
- .help = "gpio numbers for swclk, swdio. (in that order)",
- .usage = "[swclk swdio]",
- },
- {
- .name = "swclk_num",
- .handler = &bcm2835gpio_handle_swd_gpionum_swclk,
- .mode = COMMAND_CONFIG,
- .help = "gpio number for swclk.",
- .usage = "[swclk]",
- },
- {
- .name = "swdio_num",
- .handler = &bcm2835gpio_handle_swd_gpionum_swdio,
- .mode = COMMAND_CONFIG,
- .help = "gpio number for swdio.",
- .usage = "[swdio]",
- },
- {
- .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 = "srst_num",
- .handler = &bcm2835gpio_handle_jtag_gpionum_srst,
- .mode = COMMAND_CONFIG,
- .help = "gpio number for srst.",
- .usage = "[srst]",
- },
- {
- .name = "trst_num",
- .handler = &bcm2835gpio_handle_jtag_gpionum_trst,
- .mode = COMMAND_CONFIG,
- .help = "gpio number for trst.",
- .usage = "[trst]",
- },
{
.name = "speed_coeffs",
.handler = &bcm2835gpio_handle_speed_coeffs,
@@ -435,49 +306,26 @@ static const struct command_registration bcm2835gpio_command_handlers[] = {
COMMAND_REGISTRATION_DONE
};
-static const char * const bcm2835_transports[] = { "jtag", "swd", NULL };
-
-static struct jtag_interface bcm2835gpio_interface = {
- .supported = DEBUG_CAP_TMS_SEQ,
- .execute_queue = bitbang_execute_queue,
-};
-
-struct adapter_driver bcm2835gpio_adapter_driver = {
- .name = "bcm2835gpio",
- .transports = bcm2835_transports,
- .commands = bcm2835gpio_command_handlers,
-
- .init = bcm2835gpio_init,
- .quit = bcm2835gpio_quit,
- .reset = bcm2835gpio_reset,
- .speed = bcm2835gpio_speed,
- .khz = bcm2835gpio_khz,
- .speed_div = bcm2835gpio_speed_div,
-
- .jtag_ops = &bcm2835gpio_interface,
- .swd_ops = &bitbang_swd,
-};
-
static bool bcm2835gpio_jtag_mode_possible(void)
{
- if (!is_gpio_valid(tck_gpio))
- return 0;
- if (!is_gpio_valid(tms_gpio))
- return 0;
- if (!is_gpio_valid(tdi_gpio))
- return 0;
- if (!is_gpio_valid(tdo_gpio))
- return 0;
- return 1;
+ if (!is_gpio_config_valid(ADAPTER_GPIO_IDX_TCK))
+ return false;
+ if (!is_gpio_config_valid(ADAPTER_GPIO_IDX_TMS))
+ return false;
+ if (!is_gpio_config_valid(ADAPTER_GPIO_IDX_TDI))
+ return false;
+ if (!is_gpio_config_valid(ADAPTER_GPIO_IDX_TDO))
+ return false;
+ return true;
}
static bool bcm2835gpio_swd_mode_possible(void)
{
- if (!is_gpio_valid(swclk_gpio))
- return 0;
- if (!is_gpio_valid(swdio_gpio))
- return 0;
- return 1;
+ if (!is_gpio_config_valid(ADAPTER_GPIO_IDX_SWCLK))
+ return false;
+ if (!is_gpio_config_valid(ADAPTER_GPIO_IDX_SWDIO))
+ return false;
+ return true;
}
static void bcm2835gpio_munmap(void)
@@ -493,12 +341,22 @@ static void bcm2835gpio_munmap(void)
}
}
+static struct bitbang_interface bcm2835gpio_bitbang = {
+ .read = bcm2835gpio_read,
+ .write = bcm2835gpio_write,
+ .swdio_read = bcm2835_swdio_read,
+ .swdio_drive = bcm2835_swdio_drive,
+ .swd_write = bcm2835gpio_swd_write_generic,
+ .blink = NULL
+};
+
static int bcm2835gpio_init(void)
{
- bitbang_interface = &bcm2835gpio_bitbang;
-
LOG_INFO("BCM2835 GPIO JTAG/SWD bitbang driver");
+ bitbang_interface = &bcm2835gpio_bitbang;
+ adapter_gpio_config = adapter_gpio_get_config();
+
if (transport_is_jtag() && !bcm2835gpio_jtag_mode_possible()) {
LOG_ERROR("Require tck, tms, tdi and tdo gpios for JTAG mode");
return ERROR_JTAG_INIT_FAILED;
@@ -543,58 +401,45 @@ static int bcm2835gpio_init(void)
/* set 4mA drive strength, slew rate limited, hysteresis on */
pads_base[BCM2835_PADS_GPIO_0_27_OFFSET] = 0x5a000008 + 1;
- /*
- * Configure TDO as an input, and TDI, TCK, TMS, TRST, SRST
- * as outputs. Drive TDI and TCK low, and TMS/TRST/SRST high.
+ /* Configure JTAG/SWD signals. Default directions and initial states are handled
+ * by adapter.c and "adapter gpio" command.
*/
if (transport_is_jtag()) {
- tdo_gpio_mode = MODE_GPIO(tdo_gpio);
- tdi_gpio_mode = MODE_GPIO(tdi_gpio);
- tck_gpio_mode = MODE_GPIO(tck_gpio);
- tms_gpio_mode = MODE_GPIO(tms_gpio);
-
- INP_GPIO(tdo_gpio);
-
- GPIO_CLR = 1<<tdi_gpio | 1<<tck_gpio;
- GPIO_SET = 1<<tms_gpio;
-
- OUT_GPIO(tdi_gpio);
- OUT_GPIO(tck_gpio);
- OUT_GPIO(tms_gpio);
-
- if (is_gpio_valid(trst_gpio)) {
- trst_gpio_mode = MODE_GPIO(trst_gpio);
- GPIO_SET = 1 << trst_gpio;
- OUT_GPIO(trst_gpio);
- }
+ initialize_gpio(ADAPTER_GPIO_IDX_TDO);
+ initialize_gpio(ADAPTER_GPIO_IDX_TDI);
+ initialize_gpio(ADAPTER_GPIO_IDX_TMS);
+ initialize_gpio(ADAPTER_GPIO_IDX_TCK);
+ initialize_gpio(ADAPTER_GPIO_IDX_TRST);
}
if (transport_is_swd()) {
- /* Make buffer an output before the GPIO connected to it */
- if (is_gpio_valid(swdio_dir_gpio)) {
- swdio_dir_gpio_mode = MODE_GPIO(swdio_dir_gpio);
- GPIO_SET = 1 << swdio_dir_gpio;
- OUT_GPIO(swdio_dir_gpio);
+ /* swdio and its buffer should be initialized in the order that prevents
+ * two outputs from being connected together. This will occur if the
+ * swdio GPIO of the AM335x is configured as an output while its
+ * external buffer is configured to send the swdio signal from the
+ * target to the AM335x.
+ */
+ if (adapter_gpio_config[ADAPTER_GPIO_IDX_SWDIO].init_state == ADAPTER_GPIO_INIT_STATE_INPUT) {
+ initialize_gpio(ADAPTER_GPIO_IDX_SWDIO);
+ initialize_gpio(ADAPTER_GPIO_IDX_SWDIO_DIR);
+ } else {
+ initialize_gpio(ADAPTER_GPIO_IDX_SWDIO_DIR);
+ initialize_gpio(ADAPTER_GPIO_IDX_SWDIO);
}
- swclk_gpio_mode = MODE_GPIO(swclk_gpio);
- swdio_gpio_mode = MODE_GPIO(swdio_gpio);
-
- GPIO_CLR = 1<<swdio_gpio | 1<<swclk_gpio;
+ initialize_gpio(ADAPTER_GPIO_IDX_SWCLK);
- OUT_GPIO(swclk_gpio);
- OUT_GPIO(swdio_gpio);
- }
-
- if (is_gpio_valid(srst_gpio)) {
- srst_gpio_mode = MODE_GPIO(srst_gpio);
- GPIO_SET = 1 << srst_gpio;
- OUT_GPIO(srst_gpio);
+ if (adapter_gpio_config[ADAPTER_GPIO_IDX_SWCLK].drive == ADAPTER_GPIO_DRIVE_MODE_PUSH_PULL &&
+ adapter_gpio_config[ADAPTER_GPIO_IDX_SWDIO].drive == ADAPTER_GPIO_DRIVE_MODE_PUSH_PULL) {
+ LOG_DEBUG("BCM2835 GPIO using fast mode for SWD write");
+ bcm2835gpio_bitbang.swd_write = bcm2835gpio_swd_write_fast;
+ } else {
+ LOG_DEBUG("BCM2835 GPIO using generic mode for SWD write");
+ bcm2835gpio_bitbang.swd_write = bcm2835gpio_swd_write_generic;
+ }
}
- LOG_DEBUG("saved pinmux settings: tck %d tms %d tdi %d "
- "tdo %d trst %d srst %d", tck_gpio_mode, tms_gpio_mode,
- tdi_gpio_mode, tdo_gpio_mode, trst_gpio_mode, srst_gpio_mode);
+ initialize_gpio(ADAPTER_GPIO_IDX_SRST);
return ERROR_OK;
}
@@ -602,26 +447,51 @@ static int bcm2835gpio_init(void)
static int bcm2835gpio_quit(void)
{
if (transport_is_jtag()) {
- SET_MODE_GPIO(tdo_gpio, tdo_gpio_mode);
- SET_MODE_GPIO(tdi_gpio, tdi_gpio_mode);
- SET_MODE_GPIO(tck_gpio, tck_gpio_mode);
- SET_MODE_GPIO(tms_gpio, tms_gpio_mode);
- if (is_gpio_valid(trst_gpio))
- SET_MODE_GPIO(trst_gpio, trst_gpio_mode);
+ restore_gpio(ADAPTER_GPIO_IDX_TDO);
+ restore_gpio(ADAPTER_GPIO_IDX_TDI);
+ restore_gpio(ADAPTER_GPIO_IDX_TCK);
+ restore_gpio(ADAPTER_GPIO_IDX_TMS);
+ restore_gpio(ADAPTER_GPIO_IDX_TRST);
}
if (transport_is_swd()) {
- SET_MODE_GPIO(swclk_gpio, swclk_gpio_mode);
- SET_MODE_GPIO(swdio_gpio, swdio_gpio_mode);
+ /* Restore swdio/swdio_dir to their initial modes, even if that means
+ * connecting two outputs. Begin by making swdio an input so that the
+ * current and final states of swdio and swdio_dir do not have to be
+ * considered to calculate the safe restoration order.
+ */
+ INP_GPIO(adapter_gpio_config[ADAPTER_GPIO_IDX_SWDIO].gpio_num);
+ restore_gpio(ADAPTER_GPIO_IDX_SWDIO_DIR);
+ restore_gpio(ADAPTER_GPIO_IDX_SWDIO);
+ restore_gpio(ADAPTER_GPIO_IDX_SWCLK);
}
- if (is_gpio_valid(srst_gpio))
- SET_MODE_GPIO(srst_gpio, srst_gpio_mode);
-
- if (is_gpio_valid(swdio_dir_gpio))
- SET_MODE_GPIO(swdio_dir_gpio, swdio_dir_gpio_mode);
+ restore_gpio(ADAPTER_GPIO_IDX_SRST);
bcm2835gpio_munmap();
return ERROR_OK;
}
+
+
+static const char * const bcm2835_transports[] = { "jtag", "swd", NULL };
+
+static struct jtag_interface bcm2835gpio_interface = {
+ .supported = DEBUG_CAP_TMS_SEQ,
+ .execute_queue = bitbang_execute_queue,
+};
+struct adapter_driver bcm2835gpio_adapter_driver = {
+ .name = "bcm2835gpio",
+ .transports = bcm2835_transports,
+ .commands = bcm2835gpio_command_handlers,
+
+ .init = bcm2835gpio_init,
+ .quit = bcm2835gpio_quit,
+ .reset = bcm2835gpio_reset,
+ .speed = bcm2835gpio_speed,
+ .khz = bcm2835gpio_khz,
+ .speed_div = bcm2835gpio_speed_div,
+
+ .jtag_ops = &bcm2835gpio_interface,
+ .swd_ops = &bitbang_swd,
+};
diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl
index 1a638a30f..aeb42ed4f 100644
--- a/src/jtag/startup.tcl
+++ b/src/jtag/startup.tcl
@@ -455,70 +455,140 @@ proc vsllink_usb_interface args {
eval vsllink usb_interface $args
}
+
+lappend _telnet_autocomplete_skip bcm2835_gpio_helper
+proc bcm2835_gpio_helper {sig_name args} {
+ set caller [lindex [info level -1] 0]
+ echo "DEPRECATED! use 'adapter gpio $sig_name' not '$caller'"
+ switch [llength $args] {
+ 0 {}
+ 1 {eval adapter gpio $sig_name $args -chip 0}
+ 2 {eval adapter gpio $sig_name [lindex $args 1] -chip [lindex $args 0]}
+ default {return -code 1 -level 1 "$caller: syntax error"}
+ }
+ eval adapter gpio $sig_name
+}
+
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
+proc bcm2835gpio_jtag_nums {tck_num tms_num tdi_num tdo_num} {
+ echo "DEPRECATED! use 'adapter gpio tck; adapter gpio tms; adapter gpio tdi; adapter gpio tdo' not 'bcm2835gpio_jtag_nums'"
+ eval adapter gpio tck $tck_num -chip 0
+ eval adapter gpio tms $tms_num -chip 0
+ eval adapter gpio tdi $tdi_num -chip 0
+ eval adapter gpio tdo $tdo_num -chip 0
}
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
+ eval bcm2835_gpio_helper tck $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
+ eval bcm2835_gpio_helper tms $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
+ eval bcm2835_gpio_helper tdo $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
+ eval bcm2835_gpio_helper tdi $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
+proc bcm2835gpio_swd_nums {swclk_num swdio_num} {
+ echo "DEPRECATED! use 'adapter gpio swclk; adapter gpio swdio' not 'bcm2835gpio_swd_nums'"
+ eval adapter gpio swclk $swclk_num -chip 0
+ eval adapter gpio swdio $swdio_num -chip 0
}
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
+ eval bcm2835_gpio_helper swclk $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
+ eval bcm2835_gpio_helper swdio $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
+ eval bcm2835_gpio_helper swdio_dir $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
+ eval bcm2835_gpio_helper srst $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
+ eval bcm2835_gpio_helper trst $args
+}
+
+lappend _telnet_autocomplete_skip "bcm2835gpio jtag_nums"
+proc "bcm2835gpio jtag_nums" {tck_num tms_num tdi_num tdo_num} {
+ echo "DEPRECATED! use 'adapter gpio tck; adapter gpio tms; adapter gpio tdi; adapter gpio tdo' not 'bcm2835gpio jtag_nums'"
+ eval adapter gpio tck $tck_num -chip 0
+ eval adapter gpio tms $tms_num -chip 0
+ eval adapter gpio tdi $tdi_num -chip 0
+ eval adapter gpio tdo $tdo_num -chip 0
+}
+
+lappend _telnet_autocomplete_skip "bcm2835gpio tck_num"
+proc "bcm2835gpio tck_num" args {
+ eval bcm2835_gpio_helper tck $args
+}
+
+lappend _telnet_autocomplete_skip "bcm2835gpio tms_num"
+proc "bcm2835gpio tms_num" args {
+ eval bcm2835_gpio_helper tms $args
+}
+
+lappend _telnet_autocomplete_skip "bcm2835gpio tdo_num"
+proc "bcm2835gpio tdo_num" args {
+ eval bcm2835_gpio_helper tdo $args
+}
+
+lappend _telnet_autocomplete_skip "bcm2835gpio tdi_num"
+proc "bcm2835gpio tdi_num" args {
+ eval bcm2835_gpio_helper tdi $args
+}
+
+lappend _telnet_autocomplete_skip "bcm2835gpio swd_nums"
+proc "bcm2835gpio swd_nums" {swclk_num swdio_num} {
+ echo "DEPRECATED! use 'adapter gpio swclk; adapter gpio swdio' not 'bcm2835gpio swd_nums'"
+ eval adapter gpio swclk $swclk_num -chip 0
+ eval adapter gpio swdio $swdio_num -chip 0
+}
+
+lappend _telnet_autocomplete_skip "bcm2835gpio swclk_num"
+proc "bcm2835gpio swclk_num" args {
+ eval bcm2835_gpio_helper swclk $args
+}
+
+lappend _telnet_autocomplete_skip "bcm2835gpio swdio_num"
+proc "bcm2835gpio swdio_num" args {
+ eval bcm2835_gpio_helper swdio $args
+}
+
+lappend _telnet_autocomplete_skip "bcm2835gpio swdio_dir_num"
+proc "bcm2835gpio swdio_dir_num" args {
+ eval bcm2835_gpio_helper swdio_dir $args
+}
+
+lappend _telnet_autocomplete_skip "bcm2835gpio srst_num"
+proc "bcm2835gpio srst_num" args {
+ eval bcm2835_gpio_helper srst $args
+}
+
+lappend _telnet_autocomplete_skip "bcm2835gpio trst_num"
+proc "bcm2835gpio trst_num" args {
+ eval bcm2835_gpio_helper trst $args
}
lappend _telnet_autocomplete_skip bcm2835gpio_speed_coeffs
diff --git a/tcl/interface/jtag_hat_rpi2.cfg b/tcl/interface/jtag_hat_rpi2.cfg
index 495ff0f04..cd1cbfb8a 100644
--- a/tcl/interface/jtag_hat_rpi2.cfg
+++ b/tcl/interface/jtag_hat_rpi2.cfg
@@ -7,31 +7,35 @@
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_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
+adapter gpio tck -chip 0 11
+adapter gpio tms -chip 0 25
+adapter gpio tdi -chip 0 10
+adapter gpio tdo -chip 0 9
# Each of the SWD lines need a gpio number set: swclk swdio
# Header pin numbers: 23 22
-bcm2835gpio_swd_nums 11 25
+adapter gpio swclk -chip 0 11
+adapter gpio swdio -chip 0 25
# Direction pin for SWDIO level shifting buffer
-bcm2835gpio_swdio_dir_num 6
+adapter gpio swdio_dir -chip 0 6
# If you define trst or srst, use appropriate reset_config
# Header pin numbers: TRST - 26, SRST - 18
-bcm2835gpio_trst_num 7
+adapter gpio trst -chip 0 7
#reset_config trst_only
-bcm2835gpio_srst_num 24
+adapter gpio srst -chip 0 24
#reset_config srst_only
# or if you have both connected
diff --git a/tcl/interface/raspberrypi-native.cfg b/tcl/interface/raspberrypi-native.cfg
index 6d5c3bfd4..02a356350 100644
--- a/tcl/interface/raspberrypi-native.cfg
+++ b/tcl/interface/raspberrypi-native.cfg
@@ -21,19 +21,23 @@ 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
+adapter gpio tck -chip 0 11
+adapter gpio tms -chip 0 25
+adapter gpio tdi -chip 0 10
+adapter gpio tdo -chip 0 9
# Each of the SWD lines need a gpio number set: swclk swdio
# Header pin numbers: 23 22
-bcm2835gpio swd_nums 11 25
+adapter gpio swclk -chip 0 11
+adapter gpio swdio -chip 0 25
# If you define trst or srst, use appropriate reset_config
# Header pin numbers: TRST - 26, SRST - 18
-# bcm2835gpio trst_num 7
+# adapter gpio trst -chip 0 7
# reset_config trst_only
-# bcm2835gpio srst_num 24
+# adapter gpio srst -chip 0 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 547df0872..5faabed9d 100644
--- a/tcl/interface/raspberrypi2-native.cfg
+++ b/tcl/interface/raspberrypi2-native.cfg
@@ -21,19 +21,23 @@ 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
+adapter gpio tck -chip 0 11
+adapter gpio tms -chip 0 25
+adapter gpio tdi -chip 0 10
+adapter gpio tdo -chip 0 9
# Each of the SWD lines need a gpio number set: swclk swdio
# Header pin numbers: 23 22
-bcm2835gpio swd_nums 11 25
+adapter gpio swclk -chip 0 11
+adapter gpio swdio -chip 0 25
# If you define trst or srst, use appropriate reset_config
# Header pin numbers: TRST - 26, SRST - 18
-# bcm2835gpio trst_num 7
+# adapter gpio trst -chip 0 7
# reset_config trst_only
-# bcm2835gpio srst_num 24
+# adapter gpio srst -chip 0 24
# reset_config srst_only srst_push_pull
# or if you have both connected,
diff --git a/testing/test-bcm2835gpio-deprecated-commands.cfg b/testing/test-bcm2835gpio-deprecated-commands.cfg
new file mode 100644
index 000000000..b34eb36bb
--- /dev/null
+++ b/testing/test-bcm2835gpio-deprecated-commands.cfg
@@ -0,0 +1,105 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# OpenOCD script to test that the deprecated "bcm2835gpio *" and "bcm2835gpio_*"
+# commands produce the expected results. Run this command as:
+# openocd -f <path>/test-bcm2835gpio-deprecated-commands.cfg
+
+# Raise an error if the "actual" value does not match the "expected" value. Trim
+# whitespace (including newlines) from strings before comparing.
+proc expected_value {expected actual} {
+ if {[string trim $expected] ne [string trim $actual]} {
+ error [puts "ERROR: '${actual}' != '${expected}'"]
+ }
+}
+
+set supported_signals {tdo tdi tms tck trst swdio swdio_dir swclk srst}
+
+adapter speed 100
+adapter driver bcm2835gpio
+puts "Driver is '[adapter name]'"
+expected_value "bcm2835gpio" [adapter name]
+echo [adapter gpio]
+
+#####################################
+# Test the "bcm2835gpio *" commands
+
+# Change the GPIO chip for all signals. Don't check directly here, do so when
+# each signal command is tested.
+# bcm2835gpio gpiochip 0
+
+bcm2835gpio jtag_nums 1 2 3 4
+expected_value "adapter gpio tck (output): num 1, chip 0, active-high, push-pull, pull-none, init-state inactive" [eval adapter gpio tck]
+expected_value "adapter gpio tms (output): num 2, chip 0, active-high, push-pull, pull-none, init-state active" [eval adapter gpio tms]
+expected_value "adapter gpio tdi (output): num 3, chip 0, active-high, push-pull, pull-none, init-state inactive" [eval adapter gpio tdi]
+expected_value "adapter gpio tdo (input): num 4, chip 0, active-high, pull-none, init-state input" [eval adapter gpio tdo]
+
+bcm2835gpio tck_num 5
+expected_value "adapter gpio tck (output): num 5, chip 0, active-high, push-pull, pull-none, init-state inactive" [eval adapter gpio tck]
+
+bcm2835gpio tms_num 6
+expected_value "adapter gpio tms (output): num 6, chip 0, active-high, push-pull, pull-none, init-state active" [eval adapter gpio tms]
+
+bcm2835gpio tdi_num 7
+expected_value "adapter gpio tdi (output): num 7, chip 0, active-high, push-pull, pull-none, init-state inactive" [eval adapter gpio tdi]
+
+bcm2835gpio tdo_num 8
+expected_value "adapter gpio tdo (input): num 8, chip 0, active-high, pull-none, init-state input" [eval adapter gpio tdo]
+
+bcm2835gpio swd_nums 9 10
+expected_value "adapter gpio swclk (output): num 9, chip 0, active-high, push-pull, pull-none, init-state inactive" [eval adapter gpio swclk]
+expected_value "adapter gpio swdio (bidirectional): num 10, chip 0, active-high, push-pull, pull-none, init-state inactive" [eval adapter gpio swdio]
+
+bcm2835gpio swclk_num 11
+expected_value "adapter gpio swclk (output): num 11, chip 0, active-high, push-pull, pull-none, init-state inactive" [eval adapter gpio swclk]
+
+bcm2835gpio swdio_num 12
+expected_value "adapter gpio swdio (bidirectional): num 12, chip 0, active-high, push-pull, pull-none, init-state inactive" [eval adapter gpio swdio]
+
+bcm2835gpio swdio_dir_num 13
+expected_value "adapter gpio swdio_dir (output): num 13, chip 0, active-high, push-pull, pull-none" [eval adapter gpio swdio_dir]
+
+bcm2835gpio srst_num 14
+expected_value "adapter gpio srst (output): num 14, chip 0, active-low, pull-none, init-state inactive" [eval adapter gpio srst]
+
+bcm2835gpio trst_num 15
+expected_value "adapter gpio trst (output): num 15, chip 0, active-low, pull-none, init-state inactive" [eval adapter gpio trst]
+
+
+#####################################
+# Test the old bcm2835gpio_* commands
+
+# Reset the GPIO chip for all signals. Don't check directly here, do so when
+# each signal command is tested.
+foreach sig_name $supported_signals {
+ eval adapter gpio $sig_name -chip -1
+}
+
+bcm2835gpio_jtag_nums 17 18 19 20
+expected_value "adapter gpio tck (output): num 17, chip 0, active-high, push-pull, pull-none, init-state inactive" [eval adapter gpio tck]
+expected_value "adapter gpio tms (output): num 18, chip 0, active-high, push-pull, pull-none, init-state active" [eval adapter gpio tms]
+expected_value "adapter gpio tdi (output): num 19, chip 0, active-high, push-pull, pull-none, init-state inactive" [eval adapter gpio tdi]
+expected_value "adapter gpio tdo (input): num 20, chip 0, active-high, pull-none, init-state input" [eval adapter gpio tdo]
+
+bcm2835gpio_tck_num 21
+expected_value "adapter gpio tck (output): num 21, chip 0, active-high, push-pull, pull-none, init-state inactive" [eval adapter gpio tck]
+
+bcm2835gpio_tms_num 22
+expected_value "adapter gpio tms (output): num 22, chip 0, active-high, push-pull, pull-none, init-state active" [eval adapter gpio tms]
+
+bcm2835gpio_tdi_num 23
+expected_value "adapter gpio tdi (output): num 23, chip 0, active-high, push-pull, pull-none, init-state inactive" [eval adapter gpio tdi]
+
+bcm2835gpio_tdo_num 24
+expected_value "adapter gpio tdo (input): num 24, chip 0, active-high, pull-none, init-state input" [eval adapter gpio tdo]
+
+bcm2835gpio_swd_nums 25 26
+expected_value "adapter gpio swclk (output): num 25, chip 0, active-high, push-pull, pull-none, init-state inactive" [eval adapter gpio swclk]
+expected_value "adapter gpio swdio (bidirectional): num 26, chip 0, active-high, push-pull, pull-none, init-state inactive" [eval adapter gpio swdio]
+
+bcm2835gpio_swclk_num 27
+expected_value "adapter gpio swclk (output): num 27, chip 0, active-high, push-pull, pull-none, init-state inactive" [eval adapter gpio swclk]
+
+bcm2835gpio_swdio_num 28
+expected_value "adapter gpio swdio (bidirectional): num 28, chip 0, active-high, push-pull, pull-none, init-state inactive" [eval adapter gpio swdio]
+
+puts "SUCCESS"
-----------------------------------------------------------------------
Summary of changes:
doc/openocd.texi | 58 +-
src/jtag/drivers/bcm2835gpio.c | 604 +++++++++------------
src/jtag/startup.tcl | 118 +++-
tcl/interface/jtag_hat_rpi2.cfg | 18 +-
tcl/interface/raspberrypi-native.cfg | 12 +-
tcl/interface/raspberrypi2-native.cfg | 12 +-
...fg => test-bcm2835gpio-deprecated-commands.cfg} | 90 +--
7 files changed, 410 insertions(+), 502 deletions(-)
copy testing/{test-linuxgpiod-deprecated-commands.cfg => test-bcm2835gpio-deprecated-commands.cfg} (65%)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:17:24
|
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 e643a494d46c571711ccba361ad20faaf6f6503c (commit)
from ce217538bc2b9c5ef6dc760b0b03d54602ed3be6 (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 e643a494d46c571711ccba361ad20faaf6f6503c
Author: Steve Marple <ste...@go...>
Date: Sat Jun 25 17:02:14 2022 +0100
drivers/bcm2835gpio: Release resources on error and when quitting
The /dev/mem file descriptor can be closed without invalidating the
mappings so close as soon as possible.
munmap() all memory, either on error or from quit.
Signed-off-by: Steve Marple <ste...@go...>
Change-Id: I2b6a8365f554e332520fa77ccf076188083a932f
Reviewed-on: https://review.openocd.org/c/openocd/+/7122
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/jtag/drivers/bcm2835gpio.c b/src/jtag/drivers/bcm2835gpio.c
index 11d9a8020..0bbbc6fce 100644
--- a/src/jtag/drivers/bcm2835gpio.c
+++ b/src/jtag/drivers/bcm2835gpio.c
@@ -37,7 +37,8 @@ uint32_t bcm2835_peri_base = 0x20000000;
#define GPIO_LEV (*(pio_base+13)) /* current level of the pin */
static int dev_mem_fd;
-static volatile uint32_t *pio_base;
+static volatile uint32_t *pio_base = MAP_FAILED;
+static volatile uint32_t *pads_base = MAP_FAILED;
static bb_value_t bcm2835gpio_read(void);
static int bcm2835gpio_write(int tck, int tms, int tdi);
@@ -479,6 +480,19 @@ static bool bcm2835gpio_swd_mode_possible(void)
return 1;
}
+static void bcm2835gpio_munmap(void)
+{
+ if (pio_base != MAP_FAILED) {
+ munmap((void *)pio_base, sysconf(_SC_PAGE_SIZE));
+ pio_base = MAP_FAILED;
+ }
+
+ if (pads_base != MAP_FAILED) {
+ munmap((void *)pads_base, sysconf(_SC_PAGE_SIZE));
+ pads_base = MAP_FAILED;
+ }
+}
+
static int bcm2835gpio_init(void)
{
bitbang_interface = &bcm2835gpio_bitbang;
@@ -514,16 +528,18 @@ static int bcm2835gpio_init(void)
return ERROR_JTAG_INIT_FAILED;
}
- static volatile uint32_t *pads_base;
pads_base = mmap(NULL, sysconf(_SC_PAGE_SIZE), PROT_READ | PROT_WRITE,
MAP_SHARED, dev_mem_fd, BCM2835_PADS_GPIO_0_27);
if (pads_base == MAP_FAILED) {
LOG_ERROR("mmap: %s", strerror(errno));
+ bcm2835gpio_munmap();
close(dev_mem_fd);
return ERROR_JTAG_INIT_FAILED;
}
+ close(dev_mem_fd);
+
/* set 4mA drive strength, slew rate limited, hysteresis on */
pads_base[BCM2835_PADS_GPIO_0_27_OFFSET] = 0x5a000008 + 1;
@@ -605,5 +621,7 @@ static int bcm2835gpio_quit(void)
if (is_gpio_valid(swdio_dir_gpio))
SET_MODE_GPIO(swdio_dir_gpio, swdio_dir_gpio_mode);
+ bcm2835gpio_munmap();
+
return ERROR_OK;
}
-----------------------------------------------------------------------
Summary of changes:
src/jtag/drivers/bcm2835gpio.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:17:03
|
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 ce217538bc2b9c5ef6dc760b0b03d54602ed3be6 (commit)
from b8594026e4bf1aa910944c0b72dd5f1def181f13 (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 ce217538bc2b9c5ef6dc760b0b03d54602ed3be6
Author: Antonio Borneo <bor...@gm...>
Date: Fri Sep 9 11:23:04 2022 +0200
tcl/interface: replace last deprecated commands
Still some config file uses deprecated commands.
Replace them with the new commands.
Change-Id: I6ccbfb832e0ad2012e9af160bd2d92ad104af2bb
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7181
Tested-by: jenkins
diff --git a/tcl/interface/ft232r/radiona_ulx3s.cfg b/tcl/interface/ft232r/radiona_ulx3s.cfg
index 424777e9e..3fc3d7105 100644
--- a/tcl/interface/ft232r/radiona_ulx3s.cfg
+++ b/tcl/interface/ft232r/radiona_ulx3s.cfg
@@ -7,10 +7,10 @@
adapter driver ft232r
adapter speed 1000
-ft232r_vid_pid 0x0403 0x6015
-ft232r_tck_num DSR
-ft232r_tms_num DCD
-ft232r_tdi_num RI
-ft232r_tdo_num CTS
-ft232r_trst_num RTS
-ft232r_srst_num DTR
+ft232r vid_pid 0x0403 0x6015
+ft232r tck_num DSR
+ft232r tms_num DCD
+ft232r tdi_num RI
+ft232r tdo_num CTS
+ft232r trst_num RTS
+ft232r srst_num DTR
diff --git a/tcl/interface/ftdi/esp32_devkitj_v1.cfg b/tcl/interface/ftdi/esp32_devkitj_v1.cfg
index c34a500a6..1b455a9ac 100644
--- a/tcl/interface/ftdi/esp32_devkitj_v1.cfg
+++ b/tcl/interface/ftdi/esp32_devkitj_v1.cfg
@@ -21,5 +21,5 @@ ftdi layout_signal LED4 -data 0x8000
# ESP32 series chips do not have a TRST input, and the SRST line is connected to the EN pin.
# The target code doesn't handle SRST reset properly yet, so this is commented out:
-# ftdi_layout_signal nSRST -oe 0x0020
+# ftdi layout_signal nSRST -oe 0x0020
# reset_config srst_only
diff --git a/tcl/interface/ftdi/lambdaconcept_ecpix-5.cfg b/tcl/interface/ftdi/lambdaconcept_ecpix-5.cfg
index b61caff64..df4955f8a 100644
--- a/tcl/interface/ftdi/lambdaconcept_ecpix-5.cfg
+++ b/tcl/interface/ftdi/lambdaconcept_ecpix-5.cfg
@@ -7,8 +7,8 @@
adapter driver ftdi
adapter speed 10000
-ftdi_device_desc "Dual RS232-HS"
-ftdi_vid_pid 0x0403 0x6010
+ftdi device_desc "Dual RS232-HS"
+ftdi vid_pid 0x0403 0x6010
-ftdi_layout_init 0xfff8 0xfffb
+ftdi layout_init 0xfff8 0xfffb
transport select jtag
diff --git a/tcl/interface/ftdi/xt_kc705_ml605.cfg b/tcl/interface/ftdi/xt_kc705_ml605.cfg
index f62f2c291..dda8c0a2b 100644
--- a/tcl/interface/ftdi/xt_kc705_ml605.cfg
+++ b/tcl/interface/ftdi/xt_kc705_ml605.cfg
@@ -3,9 +3,9 @@
#
adapter driver ftdi
-ftdi_vid_pid 0x0403 0x6010
-# Specify "ftdi_serial <identifier>" here as needed
+ftdi vid_pid 0x0403 0x6010
+# Specify "adapter serial <identifier>" here as needed
-ftdi_layout_init 0x0010 0x007b
-ftdi_layout_signal nTRST -data 0x0010
-ftdi_layout_signal nSRST -ndata 0x0020
+ftdi layout_init 0x0010 0x007b
+ftdi layout_signal nTRST -data 0x0010
+ftdi layout_signal nSRST -ndata 0x0020
-----------------------------------------------------------------------
Summary of changes:
tcl/interface/ft232r/radiona_ulx3s.cfg | 14 +++++++-------
tcl/interface/ftdi/esp32_devkitj_v1.cfg | 2 +-
tcl/interface/ftdi/lambdaconcept_ecpix-5.cfg | 6 +++---
tcl/interface/ftdi/xt_kc705_ml605.cfg | 10 +++++-----
4 files changed, 16 insertions(+), 16 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:16: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 b8594026e4bf1aa910944c0b72dd5f1def181f13 (commit)
from e5c103a8d31bddfbda2fd2583c1fcdcc0c818a94 (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 b8594026e4bf1aa910944c0b72dd5f1def181f13
Author: Antonio Borneo <bor...@gm...>
Date: Thu Sep 8 14:37:55 2022 +0200
src/jtag/drivers/ep93xx: fix GCC 12 warning
New GCC reports 5 warning:
src/jtag/drivers/ep93xx.c: In function 'set_gonk_mode':
src/jtag/drivers/ep93xx.c:123:47: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
123 | devicecfg = *((volatile int *)(syscon + 0x80));
| ^
src/jtag/drivers/ep93xx.c:124:35: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
124 | *((volatile int *)(syscon + 0xc0)) = 0xaa;
| ^
src/jtag/drivers/ep93xx.c:125:35: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
125 | *((volatile int *)(syscon + 0x80)) = devicecfg | 0x08000000;
| ^
src/jtag/drivers/ep93xx.c: In function 'ep93xx_init':
src/jtag/drivers/ep93xx.c:182:46: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
182 | gpio_data_register = gpio_controller + 0x08;
| ^
src/jtag/drivers/ep93xx.c:183:56: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
183 | gpio_data_direction_register = gpio_controller + 0x18;
| ^
Change pointer type to allow pointer arithmetic.
Change-Id: Idd78a7156bdf99df2624043e924b8e54a0588ace
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7180
Tested-by: jenkins
Reviewed-by: Tomas Vanek <va...@fb...>
diff --git a/src/jtag/drivers/ep93xx.c b/src/jtag/drivers/ep93xx.c
index e7c993b3b..5130bd422 100644
--- a/src/jtag/drivers/ep93xx.c
+++ b/src/jtag/drivers/ep93xx.c
@@ -24,7 +24,7 @@
static uint8_t output_value;
static int dev_mem_fd;
-static void *gpio_controller;
+static uint8_t *gpio_controller;
static volatile uint8_t *gpio_data_register;
static volatile uint8_t *gpio_data_direction_register;
@@ -110,19 +110,16 @@ static int ep93xx_reset(int trst, int srst)
static int set_gonk_mode(void)
{
- void *syscon;
- uint32_t devicecfg;
-
- syscon = mmap(NULL, 4096, PROT_READ | PROT_WRITE,
+ void *syscon = mmap(NULL, 4096, PROT_READ | PROT_WRITE,
MAP_SHARED, dev_mem_fd, 0x80930000);
if (syscon == MAP_FAILED) {
LOG_ERROR("mmap: %s", strerror(errno));
return ERROR_JTAG_INIT_FAILED;
}
- devicecfg = *((volatile int *)(syscon + 0x80));
- *((volatile int *)(syscon + 0xc0)) = 0xaa;
- *((volatile int *)(syscon + 0x80)) = devicecfg | 0x08000000;
+ uint32_t devicecfg = *((volatile uint32_t *)((uintptr_t)syscon + 0x80));
+ *((volatile uint32_t *)((uintptr_t)syscon + 0xc0)) = 0xaa;
+ *((volatile uint32_t *)((uintptr_t)syscon + 0x80)) = devicecfg | 0x08000000;
munmap(syscon, 4096);
-----------------------------------------------------------------------
Summary of changes:
src/jtag/drivers/ep93xx.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:15: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 e5c103a8d31bddfbda2fd2583c1fcdcc0c818a94 (commit)
from 320043c054dc0c9f274d462014bd7aafff86fe02 (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 e5c103a8d31bddfbda2fd2583c1fcdcc0c818a94
Author: Antonio Borneo <bor...@gm...>
Date: Tue Sep 6 17:55:44 2022 +0200
configure.ac: drop unneeded dependency check
The script configure.ac checks for the presence of system include
files required to build OpenOCD.
It incorrectly check for:
dirent.h
pthread.h
ifaddrs.h
net/if.h
that are never included by OpenOCD source code, plus the generated
macros:
HAVE_DIRENT_H
HAVE_PTHREAD_H
HAVE_IFADDRS_H
HAVE_NET_IF_H
are never used in OpenOCD source code.
It also checks for the system function:
vasprintf()
that is never called by OpenOCD source code, plus the generated
macro:
HAVE_VASPRINTF
is never used in OpenOCD source code.
Drop the checks for the unused system include files and the unused
system function.
Change-Id: I68c1b1a1be268a830247fc489f210877c32d7d23
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7175
Tested-by: jenkins
diff --git a/configure.ac b/configure.ac
index 7d0cc2469..8e1f11e2d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,12 +55,10 @@ AC_CHECK_HEADERS([elf.h])
AC_EGREP_HEADER(Elf64_Ehdr, [elf.h], [
AC_DEFINE([HAVE_ELF64], [1], [Define to 1 if the system has the type `Elf64_Ehdr'.])
])
-AC_CHECK_HEADERS([dirent.h])
AC_CHECK_HEADERS([fcntl.h])
AC_CHECK_HEADERS([malloc.h])
AC_CHECK_HEADERS([netdb.h])
AC_CHECK_HEADERS([poll.h])
-AC_CHECK_HEADERS([pthread.h])
AC_CHECK_HEADERS([strings.h])
AC_CHECK_HEADERS([sys/ioctl.h])
AC_CHECK_HEADERS([sys/param.h])
@@ -70,7 +68,7 @@ AC_CHECK_HEADERS([sys/sysctl.h])
AC_CHECK_HEADERS([sys/time.h])
AC_CHECK_HEADERS([sys/types.h])
AC_CHECK_HEADERS([unistd.h])
-AC_CHECK_HEADERS([arpa/inet.h ifaddrs.h netinet/in.h netinet/tcp.h net/if.h], [], [], [dnl
+AC_CHECK_HEADERS([arpa/inet.h netinet/in.h netinet/tcp.h], [], [], [dnl
#include <stdio.h>
#ifdef STDC_HEADERS
# include <stdlib.h>
@@ -94,7 +92,6 @@ AC_CHECK_FUNCS([strndup])
AC_CHECK_FUNCS([strnlen])
AC_CHECK_FUNCS([gettimeofday])
AC_CHECK_FUNCS([usleep])
-AC_CHECK_FUNCS([vasprintf])
AC_CHECK_FUNCS([realpath])
# guess-rev.sh only exists in the repository, not in the released archives
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:15: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 320043c054dc0c9f274d462014bd7aafff86fe02 (commit)
from 5d6be673c36b00eb962cbb441dd557d3cc8eb03c (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 320043c054dc0c9f274d462014bd7aafff86fe02
Author: Antonio Borneo <bor...@gm...>
Date: Tue Sep 6 14:44:57 2022 +0200
openocd: fix for polling during "expr" computation
Commit c7eaaf620488 ("openocd: prepare for jimtcl 0.81 'expr'
syntax change") replaces the jimtcl command "expr" with an openocd
version that detects the TCL syntax change and prints a warning.
The openocd "expr" command will be dropped after v0.12.0,
One side effect is that openocd invokes polling the target after
every openocd command, causing scripts that use several "expr"
commands to run much slower; see [1].
The proper fix would require openocd to invoke polling only at the
time period deadline, instead of at each command. Such fix is too
risky to be applied now, due to short time before v0.12.0-rc1.
As a temporarily workaround, let openocd to detect the "expr"
command and skip the polling.
This will be dropped together with the openocd "expr" command.
Change-Id: I8151aa28694817001046165a15475d64896f985e
Signed-off-by: Antonio Borneo <bor...@gm...>
Fixes: https://sourceforge.net/p/openocd/tickets/362/ [1]
Fixes: c7eaaf620488 ("openocd: prepare for jimtcl 0.81 'expr' syntax change")
Reviewed-on: https://review.openocd.org/c/openocd/+/7174
Tested-by: jenkins
Reviewed-by: Tomas Vanek <va...@fb...>
diff --git a/src/helper/command.c b/src/helper/command.c
index 52f9eb6bf..b5c5459a1 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -936,7 +936,19 @@ static int jim_command_dispatch(Jim_Interp *interp, int argc, Jim_Obj * const *a
if (!command_can_run(cmd_ctx, c, Jim_GetString(argv[0], NULL)))
return JIM_ERR;
- target_call_timer_callbacks_now();
+ /*
+ * TODO: to be removed after v0.12.0
+ * workaround for https://sourceforge.net/p/openocd/tickets/362/
+ * After syntax change of "expr" in jimtcl 0.81
+ * the replacement of jimtcl "expr" with openocd version in
+ * https://review.openocd.org/6510/
+ * introduces too many target polling during math expressions with
+ * "expr" commands.
+ * After v0.12.0 replace the following two lines with
+ * target_call_timer_callbacks();
+ */
+ if (strcmp(c->name, "expr"))
+ target_call_timer_callbacks_now();
/*
* Black magic of overridden current target:
-----------------------------------------------------------------------
Summary of changes:
src/helper/command.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:14:32
|
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 5d6be673c36b00eb962cbb441dd557d3cc8eb03c (commit)
via efa2068f1a2b1d6e96c9aa4067174787207ff2bc (commit)
from a79927dd925362850169c500058f457e1ad4e457 (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 5d6be673c36b00eb962cbb441dd557d3cc8eb03c
Author: Antonio Borneo <bor...@gm...>
Date: Tue Sep 6 01:28:09 2022 +0200
target: don't export local symbols
Symbols that are not used outside the file should not be exported
and should be declared as static.
Change-Id: Icbe7f7bce287b903edec9dc9db3370722c51fbd5
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7173
Tested-by: jenkins
Reviewed-by: Tomas Vanek <va...@fb...>
diff --git a/src/target/arm.h b/src/target/arm.h
index bcfa85c79..de46ffb4b 100644
--- a/src/target/arm.h
+++ b/src/target/arm.h
@@ -310,7 +310,4 @@ void arm_set_cpsr(struct arm *arm, uint32_t cpsr);
struct reg *arm_reg_current(struct arm *arm, unsigned regnum);
struct reg *armv8_reg_current(struct arm *arm, unsigned regnum);
-extern struct reg arm_gdb_dummy_fp_reg;
-extern struct reg arm_gdb_dummy_fps_reg;
-
#endif /* OPENOCD_TARGET_ARM_H */
diff --git a/src/target/arm946e.c b/src/target/arm946e.c
index d2bccad22..3f8a88105 100644
--- a/src/target/arm946e.c
+++ b/src/target/arm946e.c
@@ -44,7 +44,7 @@ static int arm946e_post_debug_entry(struct target *target);
static void arm946e_pre_restore_context(struct target *target);
static int arm946e_read_cp15(struct target *target, int reg_addr, uint32_t *value);
-int arm946e_init_arch_info(struct target *target,
+static int arm946e_init_arch_info(struct target *target,
struct arm946e_common *arm946e,
struct jtag_tap *tap)
{
@@ -173,7 +173,7 @@ static int arm946e_read_cp15(struct target *target, int reg_addr, uint32_t *valu
return ERROR_OK;
}
-int arm946e_write_cp15(struct target *target, int reg_addr, uint32_t value)
+static int arm946e_write_cp15(struct target *target, int reg_addr, uint32_t value)
{
int retval = ERROR_OK;
struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
@@ -720,7 +720,7 @@ static const struct command_registration arm946e_exec_command_handlers[] = {
COMMAND_REGISTRATION_DONE
};
-const struct command_registration arm946e_command_handlers[] = {
+static const struct command_registration arm946e_command_handlers[] = {
{
.chain = arm9tdmi_command_handlers,
},
diff --git a/src/target/arm946e.h b/src/target/arm946e.h
index 741687869..0196c2b37 100644
--- a/src/target/arm946e.h
+++ b/src/target/arm946e.h
@@ -32,10 +32,4 @@ static inline struct arm946e_common *target_to_arm946(struct target *target)
arm7_9_common.arm);
}
-int arm946e_init_arch_info(struct target *target,
- struct arm946e_common *arm946e, struct jtag_tap *tap);
-int arm946e_write_cp15(struct target *target, int reg_addr, uint32_t value);
-
-extern const struct command_registration arm946e_command_handlers[];
-
#endif /* OPENOCD_TARGET_ARM946E_H */
diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c
index 321772699..66e276f16 100644
--- a/src/target/armv4_5.c
+++ b/src/target/armv4_5.c
@@ -535,7 +535,7 @@ static struct reg_feature arm_gdb_dummy_fp_features = {
* Modern ARM cores use Vector Floating Point (VFP), if they
* have any floating point support. VFP is not FPA-compatible.
*/
-struct reg arm_gdb_dummy_fp_reg = {
+static struct reg arm_gdb_dummy_fp_reg = {
.name = "GDB dummy FPA register",
.value = (uint8_t *) arm_gdb_dummy_fp_value,
.valid = true,
@@ -552,7 +552,7 @@ static const uint8_t arm_gdb_dummy_fps_value[4];
* Dummy FPA status registers are required to support GDB on ARM.
* Register packets require an obsolete FPA status register.
*/
-struct reg arm_gdb_dummy_fps_reg = {
+static struct reg arm_gdb_dummy_fps_reg = {
.name = "GDB dummy FPA status register",
.value = (uint8_t *) arm_gdb_dummy_fps_value,
.valid = true,
diff --git a/src/target/dsp5680xx.c b/src/target/dsp5680xx.c
index 621caaf37..9a6e8dbe7 100644
--- a/src/target/dsp5680xx.c
+++ b/src/target/dsp5680xx.c
@@ -16,7 +16,7 @@
#include "target_type.h"
#include "dsp5680xx.h"
-struct dsp5680xx_common dsp5680xx_context;
+static struct dsp5680xx_common dsp5680xx_context;
#define _E "DSP5680XX_ERROR:%d\nAt:%s:%d:%s"
#define err_check(r, c, m) if (r != ERROR_OK) {LOG_ERROR(_E, c, __func__, __LINE__, m); return r; }
diff --git a/src/target/dsp5680xx.h b/src/target/dsp5680xx.h
index 3c03ac269..152f44697 100644
--- a/src/target/dsp5680xx.h
+++ b/src/target/dsp5680xx.h
@@ -278,8 +278,6 @@ struct dsp5680xx_common {
bool debug_mode_enabled;
};
-extern struct dsp5680xx_common dsp5680xx_context;
-
static inline struct dsp5680xx_common *target_to_dsp5680xx(struct target
*target)
{
diff --git a/src/target/mips32_pracc.c b/src/target/mips32_pracc.c
index 79d929c54..9f5840e55 100644
--- a/src/target/mips32_pracc.c
+++ b/src/target/mips32_pracc.c
@@ -150,7 +150,7 @@ static int mips32_pracc_clean_text_jump(struct mips_ejtag *ejtag_info)
return ERROR_OK;
}
-int mips32_pracc_exec(struct mips_ejtag *ejtag_info, struct pracc_queue_info *ctx,
+static int mips32_pracc_exec(struct mips_ejtag *ejtag_info, struct pracc_queue_info *ctx,
uint32_t *param_out, bool check_last)
{
int code_count = 0;
@@ -323,7 +323,7 @@ void pracc_add(struct pracc_queue_info *ctx, uint32_t addr, uint32_t instr)
ctx->store_count++;
}
-void pracc_add_li32(struct pracc_queue_info *ctx, uint32_t reg_num, uint32_t data, bool optimize)
+static void pracc_add_li32(struct pracc_queue_info *ctx, uint32_t reg_num, uint32_t data, bool optimize)
{
if (LOWER16(data) == 0 && optimize)
pracc_add(ctx, 0, MIPS32_LUI(ctx->isa, reg_num, UPPER16(data))); /* load only upper value */
diff --git a/src/target/mips32_pracc.h b/src/target/mips32_pracc.h
index a736e668a..1b0076867 100644
--- a/src/target/mips32_pracc.h
+++ b/src/target/mips32_pracc.h
@@ -53,7 +53,6 @@ struct pracc_queue_info {
void pracc_queue_init(struct pracc_queue_info *ctx);
void pracc_add(struct pracc_queue_info *ctx, uint32_t addr, uint32_t instr);
-void pracc_add_li32(struct pracc_queue_info *ctx, uint32_t reg_num, uint32_t data, bool optimize);
void pracc_queue_free(struct pracc_queue_info *ctx);
int mips32_pracc_queue_exec(struct mips_ejtag *ejtag_info,
struct pracc_queue_info *ctx, uint32_t *buf, bool check_last);
@@ -68,9 +67,6 @@ int mips32_pracc_fastdata_xfer(struct mips_ejtag *ejtag_info, struct working_are
int mips32_pracc_read_regs(struct mips_ejtag *ejtag_info, uint32_t *regs);
int mips32_pracc_write_regs(struct mips_ejtag *ejtag_info, uint32_t *regs);
-int mips32_pracc_exec(struct mips_ejtag *ejtag_info, struct pracc_queue_info *ctx,
- uint32_t *param_out, bool check_last);
-
/**
* \b mips32_cp0_read
*
diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c
index 8d13447a0..247570289 100644
--- a/src/target/mips_m4k.c
+++ b/src/target/mips_m4k.c
@@ -1357,7 +1357,7 @@ static const struct command_registration mips_m4k_exec_command_handlers[] = {
COMMAND_REGISTRATION_DONE
};
-const struct command_registration mips_m4k_command_handlers[] = {
+static const struct command_registration mips_m4k_command_handlers[] = {
{
.chain = mips32_command_handlers,
},
diff --git a/src/target/mips_m4k.h b/src/target/mips_m4k.h
index 8026de232..f63d72f73 100644
--- a/src/target/mips_m4k.h
+++ b/src/target/mips_m4k.h
@@ -43,6 +43,5 @@ static inline void mips_m4k_isa_filter(enum mips32_isa_imp isa_imp, target_addr_
}
}
}
-extern const struct command_registration mips_m4k_command_handlers[];
#endif /* OPENOCD_TARGET_MIPS_M4K_H */
commit efa2068f1a2b1d6e96c9aa4067174787207ff2bc
Author: Antonio Borneo <bor...@gm...>
Date: Tue Sep 6 00:57:11 2022 +0200
flash/nor: move variable's declaration in C file
Variables should not be declared in the include file, otherwise
multiple include will cause multiple instances.
Move the declaration in the C file and make it static.
Change-Id: I8b4884cba643a792a78df4e123aa324b19d92279
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7172
Reviewed-by: Tomas Vanek <va...@fb...>
Tested-by: jenkins
diff --git a/src/flash/nor/cc26xx.c b/src/flash/nor/cc26xx.c
index b8d18a7d9..9fbb880b4 100644
--- a/src/flash/nor/cc26xx.c
+++ b/src/flash/nor/cc26xx.c
@@ -34,6 +34,16 @@ struct cc26xx_bank {
uint32_t params_addr[2];
};
+/* Flash helper algorithm for CC26x0 Chameleon targets */
+static const uint8_t cc26x0_algo[] = {
+#include "../../../contrib/loaders/flash/cc26xx/cc26x0_algo.inc"
+};
+
+/* Flash helper algorithm for CC26x2 Agama targets */
+static const uint8_t cc26x2_algo[] = {
+#include "../../../contrib/loaders/flash/cc26xx/cc26x2_algo.inc"
+};
+
static int cc26xx_auto_probe(struct flash_bank *bank);
static uint32_t cc26xx_device_type(uint32_t icepick_id, uint32_t user_id)
diff --git a/src/flash/nor/cc26xx.h b/src/flash/nor/cc26xx.h
index fdba73939..83fc94024 100644
--- a/src/flash/nor/cc26xx.h
+++ b/src/flash/nor/cc26xx.h
@@ -77,14 +77,4 @@ struct cc26xx_algo_params {
uint8_t status[4];
};
-/* Flash helper algorithm for CC26x0 Chameleon targets */
-const uint8_t cc26x0_algo[] = {
-#include "../../../contrib/loaders/flash/cc26xx/cc26x0_algo.inc"
-};
-
-/* Flash helper algorithm for CC26x2 Agama targets */
-const uint8_t cc26x2_algo[] = {
-#include "../../../contrib/loaders/flash/cc26xx/cc26x2_algo.inc"
-};
-
#endif /* OPENOCD_FLASH_NOR_CC26XX_H */
diff --git a/src/flash/nor/cc3220sf.c b/src/flash/nor/cc3220sf.c
index b639bd109..6493d6c83 100644
--- a/src/flash/nor/cc3220sf.c
+++ b/src/flash/nor/cc3220sf.c
@@ -22,6 +22,11 @@ struct cc3220sf_bank {
struct armv7m_algorithm armv7m_info;
};
+/* Flash helper algorithm for CC3220SF */
+static const uint8_t cc3220sf_algo[] = {
+#include "../../../contrib/loaders/flash/cc3220sf/cc3220sf.inc"
+};
+
static int cc3220sf_mass_erase(struct flash_bank *bank)
{
struct target *target = bank->target;
diff --git a/src/flash/nor/cc3220sf.h b/src/flash/nor/cc3220sf.h
index 7e935f23a..eb2a6c648 100644
--- a/src/flash/nor/cc3220sf.h
+++ b/src/flash/nor/cc3220sf.h
@@ -26,9 +26,4 @@
#define FMC_ERASE_VALUE (FMC_DEFAULT_VALUE | FMC_ERASE_BIT)
#define FMC_MERASE_VALUE (FMC_DEFAULT_VALUE | FMC_MERASE_BIT)
-/* Flash helper algorithm for CC3220SF */
-const uint8_t cc3220sf_algo[] = {
-#include "../../../contrib/loaders/flash/cc3220sf/cc3220sf.inc"
-};
-
#endif /* OPENOCD_FLASH_NOR_CC3220SF_H */
diff --git a/src/flash/nor/msp432.c b/src/flash/nor/msp432.c
index 931c4ff66..6adf6c34b 100644
--- a/src/flash/nor/msp432.c
+++ b/src/flash/nor/msp432.c
@@ -45,6 +45,21 @@ struct msp432_bank {
struct armv7m_algorithm armv7m_info;
};
+/* Flash helper algorithm for MSP432P401x targets */
+static const uint8_t msp432p401x_algo[] = {
+#include "../../../contrib/loaders/flash/msp432/msp432p401x_algo.inc"
+};
+
+/* Flash helper algorithm for MSP432P411x targets */
+static const uint8_t msp432p411x_algo[] = {
+#include "../../../contrib/loaders/flash/msp432/msp432p411x_algo.inc"
+};
+
+/* Flash helper algorithm for MSP432E4x targets */
+static const uint8_t msp432e4x_algo[] = {
+#include "../../../contrib/loaders/flash/msp432/msp432e4x_algo.inc"
+};
+
static int msp432_auto_probe(struct flash_bank *bank);
static int msp432_device_type(uint32_t family_type, uint32_t device_id,
diff --git a/src/flash/nor/msp432.h b/src/flash/nor/msp432.h
index 504e7a8ec..d0a62c488 100644
--- a/src/flash/nor/msp432.h
+++ b/src/flash/nor/msp432.h
@@ -101,19 +101,4 @@ struct msp432_algo_params {
uint8_t unlock_bsl[4];
};
-/* Flash helper algorithm for MSP432P401x targets */
-const uint8_t msp432p401x_algo[] = {
-#include "../../../contrib/loaders/flash/msp432/msp432p401x_algo.inc"
-};
-
-/* Flash helper algorithm for MSP432P411x targets */
-const uint8_t msp432p411x_algo[] = {
-#include "../../../contrib/loaders/flash/msp432/msp432p411x_algo.inc"
-};
-
-/* Flash helper algorithm for MSP432E4x targets */
-const uint8_t msp432e4x_algo[] = {
-#include "../../../contrib/loaders/flash/msp432/msp432e4x_algo.inc"
-};
-
#endif /* OPENOCD_FLASH_NOR_MSP432_H */
-----------------------------------------------------------------------
Summary of changes:
src/flash/nor/cc26xx.c | 10 ++++++++++
src/flash/nor/cc26xx.h | 10 ----------
src/flash/nor/cc3220sf.c | 5 +++++
src/flash/nor/cc3220sf.h | 5 -----
src/flash/nor/msp432.c | 15 +++++++++++++++
src/flash/nor/msp432.h | 15 ---------------
src/target/arm.h | 3 ---
src/target/arm946e.c | 6 +++---
src/target/arm946e.h | 6 ------
src/target/armv4_5.c | 4 ++--
src/target/dsp5680xx.c | 2 +-
src/target/dsp5680xx.h | 2 --
src/target/mips32_pracc.c | 4 ++--
src/target/mips32_pracc.h | 4 ----
src/target/mips_m4k.c | 2 +-
src/target/mips_m4k.h | 1 -
16 files changed, 39 insertions(+), 55 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:12:56
|
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 a79927dd925362850169c500058f457e1ad4e457 (commit)
via 933cbd9156e878ca90d58f0a12e9e14060c11ca7 (commit)
from d112a1282e8a13b0a85d73e127620e651186e663 (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 a79927dd925362850169c500058f457e1ad4e457
Author: Antonio Borneo <bor...@gm...>
Date: Tue Sep 6 00:43:17 2022 +0200
usbprog: remove unused variable
Change-Id: I96b2c0ad36073f7e5bed37b96e0244f1760472bc
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7171
Tested-by: jenkins
Reviewed-by: Tomas Vanek <va...@fb...>
diff --git a/src/jtag/drivers/usbprog.c b/src/jtag/drivers/usbprog.c
index 061c0161f..0e9fb577c 100644
--- a/src/jtag/drivers/usbprog.c
+++ b/src/jtag/drivers/usbprog.c
@@ -335,8 +335,6 @@ static void usbprog_reset(int trst, int srst)
/*************** jtag lowlevel functions ********************/
-struct usb_bus *busses;
-
struct usbprog_jtag *usbprog_jtag_open(void)
{
const uint16_t vids[] = { VID, 0 };
commit 933cbd9156e878ca90d58f0a12e9e14060c11ca7
Author: Antonio Borneo <bor...@gm...>
Date: Tue Sep 6 00:20:41 2022 +0200
riscv: don't export local symbols
Symbols that are not used outside the file should not be exported
and should be declared as static.
Move the existing comments to the static declarations.
Change-Id: Idf208e3fda4b3f8df789553cf03ebf5f20d811bb
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7170
Reviewed-by: Jan Matyas <ma...@co...>
Reviewed-by: Tim Newsome <ti...@si...>
Tested-by: jenkins
diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c
index f46e157e3..bee487614 100644
--- a/src/target/riscv/riscv.c
+++ b/src/target/riscv/riscv.c
@@ -109,30 +109,30 @@ typedef enum slot {
#define MAX_HWBPS 16
#define DRAM_CACHE_SIZE 16
-uint8_t ir_dtmcontrol[4] = {DTMCONTROL};
+static uint8_t ir_dtmcontrol[4] = {DTMCONTROL};
struct scan_field select_dtmcontrol = {
.in_value = NULL,
.out_value = ir_dtmcontrol
};
-uint8_t ir_dbus[4] = {DBUS};
+static uint8_t ir_dbus[4] = {DBUS};
struct scan_field select_dbus = {
.in_value = NULL,
.out_value = ir_dbus
};
-uint8_t ir_idcode[4] = {0x1};
+static uint8_t ir_idcode[4] = {0x1};
struct scan_field select_idcode = {
.in_value = NULL,
.out_value = ir_idcode
};
-bscan_tunnel_type_t bscan_tunnel_type;
+static bscan_tunnel_type_t bscan_tunnel_type;
int bscan_tunnel_ir_width; /* if zero, then tunneling is not present/active */
static const uint8_t bscan_zero[4] = {0};
static const uint8_t bscan_one[4] = {1};
static uint8_t ir_user4[4];
-struct scan_field select_user4 = {
+static struct scan_field select_user4 = {
.in_value = NULL,
.out_value = ir_user4
};
@@ -256,6 +256,11 @@ static const virt2phys_info_t sv48 = {
.pa_ppn_mask = {0x1ff, 0x1ff, 0x1ff, 0x1ffff},
};
+static enum riscv_halt_reason riscv_halt_reason(struct target *target, int hartid);
+static void riscv_info_init(struct target *target, struct riscv_info *r);
+static void riscv_invalidate_register_cache(struct target *target);
+static int riscv_step_rtos_hart(struct target *target);
+
static void riscv_sample_buf_maybe_add_timestamp(struct target *target, bool before)
{
RISCV_INFO(r);
@@ -861,7 +866,7 @@ int riscv_read_by_any_size(struct target *target, target_addr_t address, uint32_
return ERROR_FAIL;
}
-int riscv_add_breakpoint(struct target *target, struct breakpoint *breakpoint)
+static int riscv_add_breakpoint(struct target *target, struct breakpoint *breakpoint)
{
LOG_DEBUG("[%d] @0x%" TARGET_PRIxADDR, target->coreid, breakpoint->address);
assert(breakpoint);
@@ -941,7 +946,7 @@ static int remove_trigger(struct target *target, struct trigger *trigger)
return ERROR_OK;
}
-int riscv_remove_breakpoint(struct target *target,
+static int riscv_remove_breakpoint(struct target *target,
struct breakpoint *breakpoint)
{
if (breakpoint->type == BKPT_SOFT) {
@@ -1019,7 +1024,7 @@ int riscv_remove_watchpoint(struct target *target,
* The GDB server uses this information to tell GDB what data address has
* been hit, which enables GDB to print the hit variable along with its old
* and new value. */
-int riscv_hit_watchpoint(struct target *target, struct watchpoint **hit_watchpoint)
+static int riscv_hit_watchpoint(struct target *target, struct watchpoint **hit_watchpoint)
{
struct watchpoint *wp = target->watchpoints;
@@ -1462,7 +1467,7 @@ static int resume_finish(struct target *target)
* @par single_hart When true, only resume a single hart even if SMP is
* configured. This is used to run algorithms on just one hart.
*/
-int riscv_resume(
+static int riscv_resume(
struct target *target,
int current,
target_addr_t address,
@@ -3199,7 +3204,8 @@ struct target_type riscv_target = {
/*** RISC-V Interface ***/
-void riscv_info_init(struct target *target, struct riscv_info *r)
+/* Initializes the shared RISC-V structure. */
+static void riscv_info_init(struct target *target, struct riscv_info *r)
{
memset(r, 0, sizeof(*r));
@@ -3244,7 +3250,9 @@ static int riscv_resume_go_all_harts(struct target *target)
return ERROR_OK;
}
-int riscv_step_rtos_hart(struct target *target)
+/* Steps the hart that's currently selected in the RTOS, or if there is no RTOS
+ * then the only hart. */
+static int riscv_step_rtos_hart(struct target *target)
{
RISCV_INFO(r);
if (riscv_select_current_hart(target) != ERROR_OK)
@@ -3302,7 +3310,8 @@ int riscv_set_current_hartid(struct target *target, int hartid)
return ERROR_OK;
}
-void riscv_invalidate_register_cache(struct target *target)
+/* Invalidates the register cache. */
+static void riscv_invalidate_register_cache(struct target *target)
{
LOG_DEBUG("[%d]", target->coreid);
register_cache_invalidate(target->reg_cache);
@@ -3452,7 +3461,7 @@ bool riscv_is_halted(struct target *target)
return r->is_halted(target);
}
-enum riscv_halt_reason riscv_halt_reason(struct target *target, int hartid)
+static enum riscv_halt_reason riscv_halt_reason(struct target *target, int hartid)
{
RISCV_INFO(r);
if (riscv_set_current_hartid(target, hartid) != ERROR_OK)
diff --git a/src/target/riscv/riscv.h b/src/target/riscv/riscv.h
index fcb1380d4..e7e4c650b 100644
--- a/src/target/riscv/riscv.h
+++ b/src/target/riscv/riscv.h
@@ -278,19 +278,14 @@ static inline bool is_riscv(const struct riscv_info *riscv_info)
return riscv_info->common_magic == RISCV_COMMON_MAGIC;
}
-extern uint8_t ir_dtmcontrol[4];
extern struct scan_field select_dtmcontrol;
-extern uint8_t ir_dbus[4];
extern struct scan_field select_dbus;
-extern uint8_t ir_idcode[4];
extern struct scan_field select_idcode;
-extern struct scan_field select_user4;
extern struct scan_field *bscan_tunneled_select_dmi;
extern uint32_t bscan_tunneled_select_dmi_num_fields;
typedef enum { BSCAN_TUNNEL_NESTED_TAP, BSCAN_TUNNEL_DATA_REGISTER } bscan_tunnel_type_t;
extern int bscan_tunnel_ir_width;
-extern bscan_tunnel_type_t bscan_tunnel_type;
uint32_t dtmcontrol_scan_via_bscan(struct target *target, uint32_t out);
void select_dmi_via_bscan(struct target *target);
@@ -300,15 +295,6 @@ int riscv_openocd_poll(struct target *target);
int riscv_halt(struct target *target);
-int riscv_resume(
- struct target *target,
- int current,
- target_addr_t address,
- int handle_breakpoints,
- int debug_execution,
- bool single_hart
-);
-
int riscv_openocd_step(
struct target *target,
int current,
@@ -321,13 +307,6 @@ int riscv_openocd_deassert_reset(struct target *target);
/*** RISC-V Interface ***/
-/* Initializes the shared RISC-V structure. */
-void riscv_info_init(struct target *target, struct riscv_info *r);
-
-/* Steps the hart that's currently selected in the RTOS, or if there is no RTOS
- * then the only hart. */
-int riscv_step_rtos_hart(struct target *target);
-
bool riscv_supports_extension(struct target *target, char letter);
/* Returns XLEN for the given (or current) hart. */
@@ -356,7 +335,6 @@ int riscv_get_register(struct target *target, riscv_reg_t *value,
/* Checks the state of the current hart -- "is_halted" checks the actual
* on-device register. */
bool riscv_is_halted(struct target *target);
-enum riscv_halt_reason riscv_halt_reason(struct target *target, int hartid);
/* These helper functions let the generic program interface get target-specific
* information. */
@@ -371,18 +349,11 @@ void riscv_fill_dmi_write_u64(struct target *target, char *buf, int a, uint64_t
void riscv_fill_dmi_read_u64(struct target *target, char *buf, int a);
int riscv_dmi_write_u64_bits(struct target *target);
-/* Invalidates the register cache. */
-void riscv_invalidate_register_cache(struct target *target);
-
int riscv_enumerate_triggers(struct target *target);
-int riscv_add_breakpoint(struct target *target, struct breakpoint *breakpoint);
-int riscv_remove_breakpoint(struct target *target,
- struct breakpoint *breakpoint);
int riscv_add_watchpoint(struct target *target, struct watchpoint *watchpoint);
int riscv_remove_watchpoint(struct target *target,
struct watchpoint *watchpoint);
-int riscv_hit_watchpoint(struct target *target, struct watchpoint **hit_wp_address);
int riscv_init_registers(struct target *target);
-----------------------------------------------------------------------
Summary of changes:
src/jtag/drivers/usbprog.c | 2 --
src/target/riscv/riscv.c | 35 ++++++++++++++++++++++-------------
src/target/riscv/riscv.h | 29 -----------------------------
3 files changed, 22 insertions(+), 44 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:12:22
|
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 d112a1282e8a13b0a85d73e127620e651186e663 (commit)
from 07d84bca32702f1c8405f7dc20dc18cc448ce39d (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 d112a1282e8a13b0a85d73e127620e651186e663
Author: Antonio Borneo <bor...@gm...>
Date: Tue Sep 6 00:43:44 2022 +0200
flash/nor/npcx: make local symbols static
Symbols that are not exported should be declared as static.
Change-Id: I6a059080bbba9b3559d26c641b217be8be3b199e
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7169
Reviewed-by: Tomas Vanek <va...@fb...>
Tested-by: jenkins
diff --git a/src/flash/nor/npcx.c b/src/flash/nor/npcx.c
index a4d639524..ec999e24a 100644
--- a/src/flash/nor/npcx.c
+++ b/src/flash/nor/npcx.c
@@ -17,7 +17,7 @@
#include "../../../contrib/loaders/flash/npcx/npcx_flash.h"
/* NPCX flash loader */
-const uint8_t npcx_algo[] = {
+static const uint8_t npcx_algo[] = {
#include "../../../contrib/loaders/flash/npcx/npcx_algo.inc"
};
-----------------------------------------------------------------------
Summary of changes:
src/flash/nor/npcx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:12:01
|
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 07d84bca32702f1c8405f7dc20dc18cc448ce39d (commit)
via a21489e9b92c3be75f7526525a3753633b732525 (commit)
from 8310a238dce3b1cd203127365dec5545c2d36ab2 (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 07d84bca32702f1c8405f7dc20dc18cc448ce39d
Author: Antonio Borneo <bor...@gm...>
Date: Mon Sep 5 23:56:18 2022 +0200
target: make local symbols static
Symbols that are not exported should be declared as static.
Change-Id: I2475524f4c14520e3163572560f4a9f276356ed5
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7168
Tested-by: jenkins
Reviewed-by: Tomas Vanek <va...@fb...>
diff --git a/src/target/aarch64.c b/src/target/aarch64.c
index 20e212e2b..8b0cf3b63 100644
--- a/src/target/aarch64.c
+++ b/src/target/aarch64.c
@@ -1837,7 +1837,7 @@ static int aarch64_remove_watchpoint(struct target *target,
* find out which watchpoint hits
* get exception address and compare the address to watchpoints
*/
-int aarch64_hit_watchpoint(struct target *target,
+static int aarch64_hit_watchpoint(struct target *target,
struct watchpoint **hit_watchpoint)
{
if (target->debug_reason != DBG_REASON_WATCHPOINT)
diff --git a/src/target/arc.c b/src/target/arc.c
index 63de3f930..2761bfa80 100644
--- a/src/target/arc.c
+++ b/src/target/arc.c
@@ -93,7 +93,7 @@ struct reg *arc_reg_get_by_name(struct reg_cache *first,
*
* @param target Target for which to reset caches states.
*/
-int arc_reset_caches_states(struct target *target)
+static int arc_reset_caches_states(struct target *target)
{
struct arc_common *arc = target_to_arc(target);
@@ -283,7 +283,7 @@ static int arc_set_register(struct reg *reg, uint8_t *buf)
return ERROR_OK;
}
-const struct reg_arch_type arc_reg_type = {
+static const struct reg_arch_type arc_reg_type = {
.get = arc_get_register,
.set = arc_set_register,
};
@@ -1401,7 +1401,7 @@ static int arc_target_create(struct target *target, Jim_Interp *interp)
* little endian, so different type of conversion should be done.
* Middle endian: instruction "aabbccdd", stored as "bbaaddcc"
*/
-int arc_write_instruction_u32(struct target *target, uint32_t address,
+static int arc_write_instruction_u32(struct target *target, uint32_t address,
uint32_t instr)
{
uint8_t value_buf[4];
@@ -1428,7 +1428,7 @@ int arc_write_instruction_u32(struct target *target, uint32_t address,
* case of little endian ARC instructions are in middle endian format, so
* different type of conversion should be done.
*/
-int arc_read_instruction_u32(struct target *target, uint32_t address,
+static int arc_read_instruction_u32(struct target *target, uint32_t address,
uint32_t *value)
{
uint8_t value_buf[4];
@@ -1694,7 +1694,7 @@ static int arc_remove_breakpoint(struct target *target,
return ERROR_OK;
}
-void arc_reset_actionpoints(struct target *target)
+static void arc_reset_actionpoints(struct target *target)
{
struct arc_common *arc = target_to_arc(target);
struct arc_actionpoint *ap_list = arc->actionpoints_list;
@@ -1965,7 +1965,7 @@ static int arc_hit_watchpoint(struct target *target, struct watchpoint **hit_wat
/* Helper function which switches core to single_step mode by
* doing aux r/w operations. */
-int arc_config_step(struct target *target, int enable_step)
+static int arc_config_step(struct target *target, int enable_step)
{
uint32_t value;
@@ -2001,7 +2001,7 @@ int arc_config_step(struct target *target, int enable_step)
return ERROR_OK;
}
-int arc_step(struct target *target, int current, target_addr_t address,
+static int arc_step(struct target *target, int current, target_addr_t address,
int handle_breakpoints)
{
/* get pointers to arch-specific information */
@@ -2165,7 +2165,7 @@ int arc_cache_invalidate(struct target *target)
* values directly from memory, bypassing cache, so if there are unflushed
* lines debugger will read invalid values, which will cause a lot of troubles.
* */
-int arc_dcache_flush(struct target *target)
+static int arc_dcache_flush(struct target *target)
{
uint32_t value, dc_ctrl_value;
bool has_to_set_dc_ctrl_im;
diff --git a/src/target/arc_cmd.c b/src/target/arc_cmd.c
index 8c859f2d4..5b99cffd7 100644
--- a/src/target/arc_cmd.c
+++ b/src/target/arc_cmd.c
@@ -975,7 +975,7 @@ static int jim_handle_actionpoints_num(Jim_Interp *interp, int argc,
/* ----- Exported target commands ------------------------------------------ */
-const struct command_registration arc_l2_cache_group_handlers[] = {
+static const struct command_registration arc_l2_cache_group_handlers[] = {
{
.name = "auto",
.handler = arc_l2_cache_disable_auto_cmd,
@@ -986,7 +986,7 @@ const struct command_registration arc_l2_cache_group_handlers[] = {
COMMAND_REGISTRATION_DONE
};
-const struct command_registration arc_cache_group_handlers[] = {
+static const struct command_registration arc_cache_group_handlers[] = {
{
.name = "auto",
.handler = arc_l1_cache_disable_auto_cmd,
diff --git a/src/target/breakpoints.c b/src/target/breakpoints.c
index b03136786..2653cbd7b 100644
--- a/src/target/breakpoints.c
+++ b/src/target/breakpoints.c
@@ -392,7 +392,7 @@ struct breakpoint *breakpoint_find(struct target *target, target_addr_t address)
return NULL;
}
-int watchpoint_add_internal(struct target *target, target_addr_t address,
+static int watchpoint_add_internal(struct target *target, target_addr_t address,
uint32_t length, enum watchpoint_rw rw, uint32_t value, uint32_t mask)
{
struct watchpoint *watchpoint = target->watchpoints;
@@ -500,7 +500,7 @@ static void watchpoint_free(struct target *target, struct watchpoint *watchpoint
free(watchpoint);
}
-int watchpoint_remove_internal(struct target *target, target_addr_t address)
+static int watchpoint_remove_internal(struct target *target, target_addr_t address)
{
struct watchpoint *watchpoint = target->watchpoints;
diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c
index 8e9264b79..d0c6376a1 100644
--- a/src/target/cortex_m.c
+++ b/src/target/cortex_m.c
@@ -1914,7 +1914,7 @@ int cortex_m_remove_watchpoint(struct target *target, struct watchpoint *watchpo
return ERROR_OK;
}
-int cortex_m_hit_watchpoint(struct target *target, struct watchpoint **hit_watchpoint)
+static int cortex_m_hit_watchpoint(struct target *target, struct watchpoint **hit_watchpoint)
{
if (target->debug_reason != DBG_REASON_WATCHPOINT)
return ERROR_FAIL;
diff --git a/src/target/mem_ap.c b/src/target/mem_ap.c
index 29229588b..08a188324 100644
--- a/src/target/mem_ap.c
+++ b/src/target/mem_ap.c
@@ -185,7 +185,7 @@ static struct reg_arch_type mem_ap_reg_arch_type = {
.set = mem_ap_reg_set,
};
-const char *mem_ap_get_gdb_arch(struct target *target)
+static const char *mem_ap_get_gdb_arch(struct target *target)
{
return "arm";
}
commit a21489e9b92c3be75f7526525a3753633b732525
Author: Antonio Borneo <bor...@gm...>
Date: Mon Sep 5 23:55:25 2022 +0200
xtensa: make local symbols static
Symbols that are not exported should be declared as static.
Change-Id: Ieb627f7f896e4663b0d5b18c4ab1853b39d23d03
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7167
Reviewed-by: Erhan Kurubas <erh...@es...>
Reviewed-by: Ian Thompson <ia...@ca...>
Tested-by: jenkins
diff --git a/src/target/espressif/esp32.c b/src/target/espressif/esp32.c
index 8ad8bad83..9f36ca5a4 100644
--- a/src/target/espressif/esp32.c
+++ b/src/target/espressif/esp32.c
@@ -101,7 +101,7 @@ static inline struct esp32_common *target_to_esp32(struct target *target)
* 6. restore initial PC and the contents of ESP32_SMP_RTC_DATA_LOW
* TODO: some state of RTC_CNTL is not reset during SW_SYS_RST. Need to reset that manually. */
-const uint8_t esp32_reset_stub_code[] = {
+static const uint8_t esp32_reset_stub_code[] = {
#include "../../../contrib/loaders/reset/espressif/esp32/cpu_reset_handler_code.inc"
};
@@ -365,7 +365,7 @@ static int esp32_target_create(struct target *target, Jim_Interp *interp)
return ERROR_OK;
}
-COMMAND_HELPER(esp32_cmd_flashbootstrap_do, struct esp32_common *esp32)
+static COMMAND_HELPER(esp32_cmd_flashbootstrap_do, struct esp32_common *esp32)
{
int state = -1;
diff --git a/src/target/espressif/esp32s2.c b/src/target/espressif/esp32s2.c
index 4aef3791b..089534cfe 100644
--- a/src/target/espressif/esp32s2.c
+++ b/src/target/espressif/esp32s2.c
@@ -122,7 +122,7 @@ static int esp32s2_deassert_reset(struct target *target)
return ERROR_OK;
}
-int esp32s2_soft_reset_halt(struct target *target)
+static int esp32s2_soft_reset_halt(struct target *target)
{
LOG_TARGET_DEBUG(target, "begin");
diff --git a/src/target/espressif/esp32s3.c b/src/target/espressif/esp32s3.c
index 0da8552a3..58267956a 100644
--- a/src/target/espressif/esp32s3.c
+++ b/src/target/espressif/esp32s3.c
@@ -96,7 +96,7 @@ struct esp32s3_common {
* PRO CPU is halted, APP CPU is in reset.
*/
-const uint8_t esp32s3_reset_stub_code[] = {
+static const uint8_t esp32s3_reset_stub_code[] = {
#include "../../../contrib/loaders/reset/espressif/esp32s3/cpu_reset_handler_code.inc"
};
diff --git a/src/target/espressif/esp_semihosting.c b/src/target/espressif/esp_semihosting.c
index b1edef31d..f9e8b0200 100644
--- a/src/target/espressif/esp_semihosting.c
+++ b/src/target/espressif/esp_semihosting.c
@@ -15,7 +15,7 @@
#include "esp_semihosting.h"
#include "esp_xtensa.h"
-struct esp_semihost_data *target_to_esp_semihost_data(struct target *target)
+static struct esp_semihost_data __attribute__((unused)) *target_to_esp_semihost_data(struct target *target)
{
const char *arch = target_get_gdb_arch(target);
if (arch) {
@@ -27,7 +27,7 @@ struct esp_semihost_data *target_to_esp_semihost_data(struct target *target)
return NULL;
}
-int esp_semihosting_sys_seek(struct target *target, uint64_t fd, uint32_t pos, size_t whence)
+static int esp_semihosting_sys_seek(struct target *target, uint64_t fd, uint32_t pos, size_t whence)
{
struct semihosting *semihosting = target->semihosting;
diff --git a/src/target/xtensa/xtensa.c b/src/target/xtensa/xtensa.c
index 2e978b387..a6e50ccc7 100644
--- a/src/target/xtensa/xtensa.c
+++ b/src/target/xtensa/xtensa.c
@@ -300,7 +300,7 @@ union xtensa_reg_val_u {
uint8_t buf[4];
};
-const struct xtensa_keyval_info_s xt_qerr[XT_QERR_NUM] = {
+static const struct xtensa_keyval_info_s xt_qerr[XT_QERR_NUM] = {
{ .chrval = "E00", .intval = ERROR_FAIL },
{ .chrval = "E01", .intval = ERROR_FAIL },
{ .chrval = "E02", .intval = ERROR_COMMAND_ARGUMENT_INVALID },
@@ -519,7 +519,7 @@ static int xtensa_queue_pwr_reg_write(struct xtensa *xtensa, unsigned int reg, u
}
/* NOTE: Assumes A3 has already been saved */
-int xtensa_window_state_save(struct target *target, uint32_t *woe)
+static int xtensa_window_state_save(struct target *target, uint32_t *woe)
{
struct xtensa *xtensa = target_to_xtensa(target);
int woe_dis;
@@ -547,7 +547,7 @@ int xtensa_window_state_save(struct target *target, uint32_t *woe)
}
/* NOTE: Assumes A3 has already been saved */
-void xtensa_window_state_restore(struct target *target, uint32_t woe)
+static void xtensa_window_state_restore(struct target *target, uint32_t woe)
{
struct xtensa *xtensa = target_to_xtensa(target);
if (xtensa->core_config->windowed) {
@@ -2983,7 +2983,7 @@ const char *xtensa_get_gdb_arch(struct target *target)
}
/* exe <ascii-encoded hexadecimal instruction bytes> */
-COMMAND_HELPER(xtensa_cmd_exe_do, struct target *target)
+static COMMAND_HELPER(xtensa_cmd_exe_do, struct target *target)
{
struct xtensa *xtensa = target_to_xtensa(target);
diff --git a/src/target/xtensa/xtensa_chip.c b/src/target/xtensa/xtensa_chip.c
index c609245a2..6e1931349 100644
--- a/src/target/xtensa/xtensa_chip.c
+++ b/src/target/xtensa/xtensa_chip.c
@@ -120,7 +120,7 @@ static int xtensa_chip_target_create(struct target *target, Jim_Interp *interp)
return ERROR_OK;
}
-void xtensa_chip_target_deinit(struct target *target)
+static void xtensa_chip_target_deinit(struct target *target)
{
struct xtensa *xtensa = target_to_xtensa(target);
xtensa_target_deinit(target);
@@ -136,7 +136,7 @@ static int xtensa_chip_examine(struct target *target)
return retval;
}
-int xtensa_chip_jim_configure(struct target *target, struct jim_getopt_info *goi)
+static int xtensa_chip_jim_configure(struct target *target, struct jim_getopt_info *goi)
{
static bool dap_configured;
int ret = adiv5_jim_configure(target, goi);
-----------------------------------------------------------------------
Summary of changes:
src/target/aarch64.c | 2 +-
src/target/arc.c | 16 ++++++++--------
src/target/arc_cmd.c | 4 ++--
src/target/breakpoints.c | 4 ++--
src/target/cortex_m.c | 2 +-
src/target/espressif/esp32.c | 4 ++--
src/target/espressif/esp32s2.c | 2 +-
src/target/espressif/esp32s3.c | 2 +-
src/target/espressif/esp_semihosting.c | 4 ++--
src/target/mem_ap.c | 2 +-
src/target/xtensa/xtensa.c | 8 ++++----
src/target/xtensa/xtensa_chip.c | 4 ++--
12 files changed, 27 insertions(+), 27 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:11:50
|
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 8310a238dce3b1cd203127365dec5545c2d36ab2 (commit)
from 8f725fea2502d538f69487fd21aa979611cea4f6 (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 8310a238dce3b1cd203127365dec5545c2d36ab2
Author: Antonio Borneo <bor...@gm...>
Date: Mon Sep 5 23:54:41 2022 +0200
riscv: make local symbols static
Symbols that are not exported should be declared as static.
Change-Id: Ie3bd17535c8cb2a0fec5d3bedfe7de3e0a702613
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7166
Tested-by: jenkins
Reviewed-by: Tim Newsome <ti...@si...>
Reviewed-by: Jan Matyas <ma...@co...>
diff --git a/src/target/riscv/riscv-011.c b/src/target/riscv/riscv-011.c
index e2ae5b51a..79d952694 100644
--- a/src/target/riscv/riscv-011.c
+++ b/src/target/riscv/riscv-011.c
@@ -2297,7 +2297,7 @@ static int arch_state(struct target *target)
return ERROR_OK;
}
-COMMAND_HELPER(riscv011_print_info, struct target *target)
+static COMMAND_HELPER(riscv011_print_info, struct target *target)
{
/* Abstract description. */
riscv_print_info_line(CMD, "target", "memory.read_while_running8", 0);
diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c
index b666f5246..d513df7ca 100644
--- a/src/target/riscv/riscv-013.c
+++ b/src/target/riscv/riscv-013.c
@@ -67,9 +67,9 @@ static int write_memory(struct target *target, target_addr_t address,
uint32_t size, uint32_t count, const uint8_t *buffer);
static int riscv013_test_sba_config_reg(struct target *target, target_addr_t legal_address,
uint32_t num_words, target_addr_t illegal_address, bool run_sbbusyerror_test);
-void write_memory_sba_simple(struct target *target, target_addr_t addr, uint32_t *write_data,
+static void write_memory_sba_simple(struct target *target, target_addr_t addr, uint32_t *write_data,
uint32_t write_size, uint32_t sbcs);
-void read_memory_sba_simple(struct target *target, target_addr_t addr,
+static void read_memory_sba_simple(struct target *target, target_addr_t addr,
uint32_t *rd_buf, uint32_t read_size, uint32_t sbcs);
/**
@@ -221,7 +221,7 @@ typedef struct {
dm013_info_t *dm;
} riscv013_info_t;
-LIST_HEAD(dm_list);
+static LIST_HEAD(dm_list);
static riscv013_info_t *get_info(const struct target *target)
{
@@ -236,7 +236,7 @@ static riscv013_info_t *get_info(const struct target *target)
* global list of DMs. If it's not in there, then create one and initialize it
* to 0.
*/
-dm013_info_t *get_dm(struct target *target)
+static dm013_info_t *get_dm(struct target *target)
{
RISCV013_INFO(info);
if (info->dm)
@@ -683,7 +683,7 @@ static int dmi_write_exec(struct target *target, uint32_t address,
return dmi_op(target, NULL, NULL, DMI_OP_WRITE, address, value, true, ensure_success);
}
-int dmstatus_read_timeout(struct target *target, uint32_t *dmstatus,
+static int dmstatus_read_timeout(struct target *target, uint32_t *dmstatus,
bool authenticated, unsigned timeout_sec)
{
int result = dmi_op_timeout(target, dmstatus, NULL, DMI_OP_READ,
@@ -705,7 +705,7 @@ int dmstatus_read_timeout(struct target *target, uint32_t *dmstatus,
return ERROR_OK;
}
-int dmstatus_read(struct target *target, uint32_t *dmstatus,
+static int dmstatus_read(struct target *target, uint32_t *dmstatus,
bool authenticated)
{
return dmstatus_read_timeout(target, dmstatus, authenticated,
@@ -721,7 +721,7 @@ static void increase_ac_busy_delay(struct target *target)
info->ac_busy_delay);
}
-uint32_t abstract_register_size(unsigned width)
+static uint32_t __attribute__((unused)) abstract_register_size(unsigned width)
{
switch (width) {
case 32:
@@ -1873,7 +1873,7 @@ static unsigned riscv013_data_bits(struct target *target)
return 32;
}
-COMMAND_HELPER(riscv013_print_info, struct target *target)
+static COMMAND_HELPER(riscv013_print_info, struct target *target)
{
RISCV013_INFO(info);
@@ -4701,7 +4701,7 @@ static int riscv013_test_sba_config_reg(struct target *target,
}
-void write_memory_sba_simple(struct target *target, target_addr_t addr,
+static void write_memory_sba_simple(struct target *target, target_addr_t addr,
uint32_t *write_data, uint32_t write_size, uint32_t sbcs)
{
RISCV013_INFO(info);
@@ -4731,7 +4731,7 @@ void write_memory_sba_simple(struct target *target, target_addr_t addr,
dmi_write(target, DM_SBDATA0+i, write_data[i]);
}
-void read_memory_sba_simple(struct target *target, target_addr_t addr,
+static void read_memory_sba_simple(struct target *target, target_addr_t addr,
uint32_t *rd_buf, uint32_t read_size, uint32_t sbcs)
{
RISCV013_INFO(info);
diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c
index 42fc3742f..f46e157e3 100644
--- a/src/target/riscv/riscv.c
+++ b/src/target/riscv/riscv.c
@@ -131,15 +131,15 @@ int bscan_tunnel_ir_width; /* if zero, then tunneling is not present/active */
static const uint8_t bscan_zero[4] = {0};
static const uint8_t bscan_one[4] = {1};
-uint8_t ir_user4[4];
+static uint8_t ir_user4[4];
struct scan_field select_user4 = {
.in_value = NULL,
.out_value = ir_user4
};
-uint8_t bscan_tunneled_ir_width[4] = {5}; /* overridden by assignment in riscv_init_target */
-struct scan_field _bscan_tunnel_data_register_select_dmi[] = {
+static uint8_t bscan_tunneled_ir_width[4] = {5}; /* overridden by assignment in riscv_init_target */
+static struct scan_field _bscan_tunnel_data_register_select_dmi[] = {
{
.num_bits = 3,
.out_value = bscan_zero,
@@ -162,7 +162,7 @@ struct scan_field _bscan_tunnel_data_register_select_dmi[] = {
}
};
-struct scan_field _bscan_tunnel_nested_tap_select_dmi[] = {
+static struct scan_field _bscan_tunnel_nested_tap_select_dmi[] = {
{
.num_bits = 1,
.out_value = bscan_zero,
@@ -184,11 +184,11 @@ struct scan_field _bscan_tunnel_nested_tap_select_dmi[] = {
.in_value = NULL,
}
};
-struct scan_field *bscan_tunnel_nested_tap_select_dmi = _bscan_tunnel_nested_tap_select_dmi;
-uint32_t bscan_tunnel_nested_tap_select_dmi_num_fields = ARRAY_SIZE(_bscan_tunnel_nested_tap_select_dmi);
+static struct scan_field *bscan_tunnel_nested_tap_select_dmi = _bscan_tunnel_nested_tap_select_dmi;
+static uint32_t bscan_tunnel_nested_tap_select_dmi_num_fields = ARRAY_SIZE(_bscan_tunnel_nested_tap_select_dmi);
-struct scan_field *bscan_tunnel_data_register_select_dmi = _bscan_tunnel_data_register_select_dmi;
-uint32_t bscan_tunnel_data_register_select_dmi_num_fields = ARRAY_SIZE(_bscan_tunnel_data_register_select_dmi);
+static struct scan_field *bscan_tunnel_data_register_select_dmi = _bscan_tunnel_data_register_select_dmi;
+static uint32_t bscan_tunnel_data_register_select_dmi_num_fields = ARRAY_SIZE(_bscan_tunnel_data_register_select_dmi);
struct trigger {
uint64_t address;
@@ -205,7 +205,7 @@ int riscv_command_timeout_sec = DEFAULT_COMMAND_TIMEOUT_SEC;
/* Wall-clock timeout after reset. Settable via RISC-V Target commands.*/
int riscv_reset_timeout_sec = DEFAULT_RESET_TIMEOUT_SEC;
-bool riscv_enable_virt2phys = true;
+static bool riscv_enable_virt2phys = true;
bool riscv_ebreakm = true;
bool riscv_ebreaks = true;
bool riscv_ebreaku = true;
@@ -217,7 +217,7 @@ static enum {
RO_REVERSED
} resume_order;
-const virt2phys_info_t sv32 = {
+static const virt2phys_info_t sv32 = {
.name = "Sv32",
.va_bits = 32,
.level = 2,
@@ -230,7 +230,7 @@ const virt2phys_info_t sv32 = {
.pa_ppn_mask = {0x3ff, 0xfff},
};
-const virt2phys_info_t sv39 = {
+static const virt2phys_info_t sv39 = {
.name = "Sv39",
.va_bits = 39,
.level = 3,
@@ -243,7 +243,7 @@ const virt2phys_info_t sv39 = {
.pa_ppn_mask = {0x1ff, 0x1ff, 0x3ffffff},
};
-const virt2phys_info_t sv48 = {
+static const virt2phys_info_t sv48 = {
.name = "Sv48",
.va_bits = 48,
.level = 4,
@@ -256,7 +256,7 @@ const virt2phys_info_t sv48 = {
.pa_ppn_mask = {0x1ff, 0x1ff, 0x1ff, 0x1ffff},
};
-void riscv_sample_buf_maybe_add_timestamp(struct target *target, bool before)
+static void riscv_sample_buf_maybe_add_timestamp(struct target *target, bool before)
{
RISCV_INFO(r);
uint32_t now = timeval_ms() & 0xffffffff;
@@ -1162,7 +1162,7 @@ int riscv_select_current_hart(struct target *target)
return riscv_set_current_hartid(target, target->coreid);
}
-int halt_prep(struct target *target)
+static int halt_prep(struct target *target)
{
RISCV_INFO(r);
@@ -1182,7 +1182,7 @@ int halt_prep(struct target *target)
return ERROR_OK;
}
-int riscv_halt_go_all_harts(struct target *target)
+static int riscv_halt_go_all_harts(struct target *target)
{
RISCV_INFO(r);
@@ -1200,7 +1200,7 @@ int riscv_halt_go_all_harts(struct target *target)
return ERROR_OK;
}
-int halt_go(struct target *target)
+static int halt_go(struct target *target)
{
RISCV_INFO(r);
int result;
@@ -1284,7 +1284,7 @@ static int riscv_deassert_reset(struct target *target)
return tt->deassert_reset(target);
}
-int riscv_resume_prep_all_harts(struct target *target)
+static int riscv_resume_prep_all_harts(struct target *target)
{
RISCV_INFO(r);
@@ -1742,7 +1742,7 @@ static int riscv_write_memory(struct target *target, target_addr_t address,
return tt->write_memory(target, address, size, count, buffer);
}
-const char *riscv_get_gdb_arch(struct target *target)
+static const char *riscv_get_gdb_arch(struct target *target)
{
switch (riscv_xlen(target)) {
case 32:
@@ -2105,7 +2105,7 @@ static enum riscv_poll_hart riscv_poll_hart(struct target *target, int hartid)
return RPH_NO_CHANGE;
}
-int set_debug_reason(struct target *target, enum riscv_halt_reason halt_reason)
+static int set_debug_reason(struct target *target, enum riscv_halt_reason halt_reason)
{
switch (halt_reason) {
case RISCV_HALT_BREAKPOINT:
@@ -2131,7 +2131,7 @@ int set_debug_reason(struct target *target, enum riscv_halt_reason halt_reason)
return ERROR_OK;
}
-int sample_memory(struct target *target)
+static int sample_memory(struct target *target)
{
RISCV_INFO(r);
@@ -2458,7 +2458,7 @@ COMMAND_HANDLER(riscv_set_enable_virtual)
return ERROR_OK;
}
-int parse_ranges(struct list_head *ranges, const char *tcl_arg, const char *reg_type, unsigned int max_val)
+static int parse_ranges(struct list_head *ranges, const char *tcl_arg, const char *reg_type, unsigned int max_val)
{
char *args = strdup(tcl_arg);
if (!args)
@@ -3117,7 +3117,7 @@ static const struct command_registration riscv_exec_command_handlers[] = {
* sense, but for now all semihosting commands are prefixed with `arm`.
*/
-const struct command_registration riscv_command_handlers[] = {
+static const struct command_registration riscv_command_handlers[] = {
{
.name = "riscv",
.mode = COMMAND_ANY,
-----------------------------------------------------------------------
Summary of changes:
src/target/riscv/riscv-011.c | 2 +-
src/target/riscv/riscv-013.c | 20 ++++++++++----------
src/target/riscv/riscv.c | 44 ++++++++++++++++++++++----------------------
3 files changed, 33 insertions(+), 33 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:10:48
|
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 8f725fea2502d538f69487fd21aa979611cea4f6 (commit)
via bf74007d37e9487c719ac74b80462cf23254ebbc (commit)
from 97f47e8c9486377affac7af3c3d260613c6d06f2 (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 8f725fea2502d538f69487fd21aa979611cea4f6
Author: Antonio Borneo <bor...@gm...>
Date: Mon Sep 5 23:53:10 2022 +0200
jtag: make local symbols static
Symbols that are not exported should be declared as static.
Change-Id: I6224ae89ebda3230dfee2413e3823be9b8716bba
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7165
Tested-by: jenkins
Reviewed-by: Tomas Vanek <va...@fb...>
diff --git a/src/jtag/adapter.c b/src/jtag/adapter.c
index 76a2aaba6..a0432b692 100644
--- a/src/jtag/adapter.c
+++ b/src/jtag/adapter.c
@@ -844,7 +844,7 @@ static int get_gpio_index(const char *signal_name)
return -1;
}
-COMMAND_HELPER(helper_adapter_gpio_print_config, enum adapter_gpio_config_index gpio_idx)
+static COMMAND_HELPER(helper_adapter_gpio_print_config, enum adapter_gpio_config_index gpio_idx)
{
struct adapter_gpio_config *gpio_config = &adapter_config.gpios[gpio_idx];
const char *active_state = gpio_config->active_low ? "low" : "high";
diff --git a/src/jtag/drivers/linuxgpiod.c b/src/jtag/drivers/linuxgpiod.c
index e8e93a55b..35494cb7a 100644
--- a/src/jtag/drivers/linuxgpiod.c
+++ b/src/jtag/drivers/linuxgpiod.c
@@ -275,7 +275,7 @@ static int linuxgpiod_quit(void)
return ERROR_OK;
}
-int helper_get_line(enum adapter_gpio_config_index idx)
+static int helper_get_line(enum adapter_gpio_config_index idx)
{
if (!is_gpio_config_valid(idx))
return ERROR_OK;
commit bf74007d37e9487c719ac74b80462cf23254ebbc
Author: Antonio Borneo <bor...@gm...>
Date: Tue Sep 6 00:24:39 2022 +0200
log: remove unused set_log_output()
The function set_log_output() has never been used after the drop
of eCos build with commit 39650e2273bc ("ecosboard: delete
bit-rotted eCos code") in 2012.
Drop it!
Change-Id: I070b688061776c7ced5db18f738d78a4a7623726
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7164
Reviewed-by: Tomas Vanek <va...@fb...>
Tested-by: jenkins
diff --git a/src/helper/log.c b/src/helper/log.c
index f3872b541..b49c9af94 100644
--- a/src/helper/log.c
+++ b/src/helper/log.c
@@ -295,12 +295,6 @@ void log_exit(void)
log_output = NULL;
}
-int set_log_output(struct command_context *cmd_ctx, FILE *output)
-{
- log_output = output;
- return ERROR_OK;
-}
-
/* add/remove log callback handler */
int log_add_callback(log_callback_fn fn, void *priv)
{
diff --git a/src/helper/log.h b/src/helper/log.h
index da1e652df..ee71bf03f 100644
--- a/src/helper/log.h
+++ b/src/helper/log.h
@@ -62,7 +62,6 @@ __attribute__ ((format (PRINTF_ATTRIBUTE_FORMAT, 5, 6)));
*/
void log_init(void);
void log_exit(void);
-int set_log_output(struct command_context *cmd_ctx, FILE *output);
int log_register_commands(struct command_context *cmd_ctx);
-----------------------------------------------------------------------
Summary of changes:
src/helper/log.c | 6 ------
src/helper/log.h | 1 -
src/jtag/adapter.c | 2 +-
src/jtag/drivers/linuxgpiod.c | 2 +-
4 files changed, 2 insertions(+), 9 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:10: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 97f47e8c9486377affac7af3c3d260613c6d06f2 (commit)
from 35b20195b86ceeda1300e0cc405cbbcbefc1f0fd (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 97f47e8c9486377affac7af3c3d260613c6d06f2
Author: Erhan Kurubas <erh...@es...>
Date: Sun Jul 3 12:28:12 2022 +0300
tcl/board: add ESP32-S3 config for ESP USB Bridge board
Signed-off-by: Erhan Kurubas <erh...@es...>
Change-Id: I97d0f01f342dddb31b2d454858fe854f002cf567
Reviewed-on: https://review.openocd.org/c/openocd/+/7077
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/tcl/board/esp32s3-bridge.cfg b/tcl/board/esp32s3-bridge.cfg
new file mode 100644
index 000000000..a42e257c5
--- /dev/null
+++ b/tcl/board/esp32s3-bridge.cfg
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# Example OpenOCD configuration file for ESP32-S3 connected via ESP USB Bridge board
+#
+# For example, OpenOCD can be started for ESP32-S3 debugging on
+#
+# openocd -f board/esp32s3-bridge.cfg
+#
+
+# Source the JTAG interface configuration file
+source [find interface/esp_usb_bridge.cfg]
+# ESP32S3 chip id defined in the idf esp_chip_model_t
+espusbjtag chip_id 9
+# Source the ESP32-S3 configuration file
+source [find target/esp32s3.cfg]
-----------------------------------------------------------------------
Summary of changes:
tcl/board/esp32s3-bridge.cfg | 15 +++++++++++++++
1 file changed, 15 insertions(+)
create mode 100644 tcl/board/esp32s3-bridge.cfg
hooks/post-receive
--
Main OpenOCD repository
|