Age | Commit message (Collapse) | Author | Files | Lines |
|
Merge up to afbd01b0a46f3a81fe6076c002ad66973dcfb64c from upstream
|
|
target/riscv: improve error messaging in case `sbasize` is zero
|
|
Add the necessary get_filed and add a comment to indicate
this section is for VU/VS mode
|
|
address translation don't need to care hstatus.HU
|
|
From: Sriram Shanmuga <sriramharshalee@gmail.com>
RISC-V Debug Specification v1.0 [3.14.22. System Bus Access Control and
Status (`sbcs`, at 0x38)] states in `sbasize` field description:
> Width of system bus addresses in bits. (0 indicates there is no bus
access support.)
Before the patch, the error message did not include the information
about `sbcs.sbasize` being zero wich made it quite undescriptive:
```
[riscv.cpu] Turning off memory sampling because it failed.
```
Fixes #1270
Change-Id: I5402dd57dc9a81f65ee4c67d24e11c366006427c
Signed-off-by: Sriram Shanmuga <sriramharshalee@gmail.com>
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
|
|
When abits not correctly configured, we hope to detect it
as soon as possible.
|
|
Change-Id: I719167dc34a1a29ae32f8d4f27f2d3cd7a04e47b
|
|
Move the transport's names in a local array in the transport
framework.
Replace the string struct transport::name, that identifies the
transport, with a bitmask where each bit corresponds to one of the
available transports.
Change-Id: I6bdf7264d5979c355299f63fcf80bf54dcd95cee
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8674
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
|
|
The file stm8.h is only included by stm8.c and provides some basic
declaration that can be simply part of the C file.
Drop the file stm8.h and move its content in stm8.c
Replace the macro 'STM8_NUM_CORE_REGS' with the existing macro
'STM8_NUM_REGS'.
While there:
- drop the useless include of "hello.h".
Change-Id: Iecd1a27f0630cdbbfd51033d34aa3d468aa63464
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8856
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
|
|
The parameter Jim_Interp to the target API target_create() is not
used by any target.
Drop it.
Change-Id: I67c492078a6c808db974505f9e297c45165f64d0
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8831
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
|
|
The function target_configure() is used by the commands
'target create', 'configure' and 'cget', already rewritten as
COMMAND_HANDLER.
Rewrite the common function as COMMAND_HELPER.
While there:
- fix the check on arguments, even if it should be coded better;
- keep jimtcl code for target_type::target_jim_configure() and for
rtos_create(); these would be rewritten later on.
Change-Id: I7e5699ca6d124e34d3b2199714e3ce584bfcce80
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8829
Tested-by: jenkins
|
|
Rewrite only the command, but still use the old jimtcl specific
code shared with 'target create'.
Change-Id: Ie5e1c9eb237531121c2d143d1732cf281dfdc9ff
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8828
Tested-by: jenkins
|
|
Rewrite only the command, but still use the old jimtcl specific
code shared with 'configure' and 'cget'.
Change-Id: I7cf220e494f0ebbf123f8075b1feb9251fd7f569
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8827
Tested-by: jenkins
|
|
The command shares with command 'target create' the
struct jim_nvp nvp_target_event[]
- Convert the 'struct jim_nvp' in 'struct nvp'.
- Create an alias 'struct jim_nvp' to decouple the commands
'invoke-event' and 'target create', abusing the fact that the
actual layout of the two struct's type is the same. This alias
will be dropped in a following change.
- Rewrite the command 'invoke-event' and the helper function
target_event_name().
Change-Id: I537732fe4c08042cc02bcd0f72142254d7968fa6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8826
Tested-by: jenkins
|
|
Since commit ef1cfb23947b ("Duane Ellis: "target as an [tcl]
object" feature.") merged in 2008, the commands:
$target_name configure -chain-position ...
target create ... -chain-position ...
cause the allocated working area to be freed.
There is no reason for this, it is probably caused by an incorrect
copy/paste from the author.
Drop the call to target_free_all_working_areas().
Change-Id: I61a9303afe7fee6953669218330635c0b965b20d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8825
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
|
|
Change-Id: Idaef3f5911bde237bd47d1d921acc186a06ea8f8
|
|
Current code allows replacing the body of an existing event, but
it doesn't provides a way to remove it.
Replacing the event with an empty string makes the event still
present and visible through
$target_name eventlist
The presence of empty events makes more complex checking for the
event not set or set to empty.
Remove the event when set to empty string.
While there, add 'Jim_Length' to the list of allowed CamelCase
symbols, avoiding the associated checkpatch error.
Change-Id: I1ec2e1a71d298a0eba0b6863902645bcc6c4cb09
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8814
Tested-by: jenkins
|
|
To simplify removing an event when it's set to an empty string,
switch event list from hardcoded simply linked list to helper's
double linked list.
While there, move the declaration of struct target_event_action
in 'target.c' as it is not anymore visible outside.
Change-Id: I799754c80055dc6d22db55aca483757e833714ff
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8813
Tested-by: jenkins
|
|
Commit f55ec6d44922 ("target: rewrite command 'write_memory' as
COMMAND_HANDLER") adds a new return statement without freeing the
allocated buffer.
Add the needed free().
Fixes: f55ec6d44922 ("target: rewrite command 'write_memory' as COMMAND_HANDLER")
Change-Id: I676d658118b32f4d7cc71eda3436bb52f1966cd8
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8822
Tested-by: jenkins
|
|
target/riscv: only update mstatus.*ie bits with set_maskisr steponly
|
|
Print one register per line. Repeated registers will be printed
each time.
While there, fix the 'usage' string.
Change-Id: I4eb21696705bdf15cd2cb7a4a9caa41f9ffdbf64
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8583
Tested-by: jenkins
Reviewed-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
|
|
Restore target configuration on exit so that OpenOCD get correct values
when restarting.
Change-Id: I8cbba1fdae1d3c4a580197b7a97691443780ed06
Signed-off-by: Adrien Grassein <agrassein@nanoxplore.com>
Signed-off-by: Adrien Charruel <acharruel@nanoxplore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8654
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
|
|
The helper function 'target_name()' or, better, the log functions
'LOG_TARGET_xxx(target, ...)' should be used in place of taking
the target name directly from 'target->cmd_name'.
Replace the remaining instances in the code.
While there:
- address some indentation,
- drop trailing punctuation in log message,
- replace one LOG WARNING with LOG_TARGET_WARNING.
Change-Id: Ie6cf4c174ffe91b975c983e4697c735766267041
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8806
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
|
|
Some armv8 target have separate i-cache and d-cache.
The actual code only handles the flush of the d-cache.
Change-Id: I61a223b43c71646bbbed8fa63825360c67700988
Signed-off-by: Adrien Grassein <agrassein@nanoxplore.com>
Signed-off-by: Adrien Charruel <acharruel@nanoxplore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8655
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
|
|
While there:
- drop the command name from the error messages;
- check the returned value from Jim_GetWide() to detect incorrect
numeric values.
Change-Id: I399402ac11b6d459f1771e59e44210aef3e2a637
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8582
Tested-by: jenkins
Reviewed-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
|
|
The error message should not report the command name as it
should be already clear from the context.
Change-Id: I219e31be808bf6ff1924ce60f3025fb48ed7b125
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8803
Tested-by: jenkins
|
|
target/riscv: implement abstract command cache
|
|
unsupported abstract commands. It's purpose is to replace set of caching variables to one. So this commit provides one ac_not_supported_cache instead of abstract_read_csr_supported, abstract_write_csr_supported, abstract_read_fpr_supported, abstract_write_fpr_supported, has_aampostincrement.
Dropped check for buggy aampostincrement
Fixes #1232
Change-Id: I9690d9d79e3d1f593b63740b989074dcf0285637
Signed-off-by: Farid Khaydari <f.khaydari@syntacore.com>
|
|
target/riscv: avoid `config` modification on `jim_getopt_obj()` failure
|
|
fix expose_csr for CSR with address "0"
|
|
Merge up to a168c634126e9e6bb95c6e68b2db5afbb099abf7 from upstream
|
|
Flushing all d-cache may be a long operation.
We need to send keep_alive regularly to keep the connection alive.
If not done a warning is emitted.
Change-Id: I52c3ee9a9f9b8a1dc0b8d5439e8b71212f56165a
Signed-off-by: Adrien Grassein <agrassein@nanoxplore.com>
Signed-off-by: Adrien Charruel <acharruel@nanoxplore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8659
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
|
|
If a DAP is not found, include its name in the error message.
Change-Id: Icffc52894a1c5573f938b1f3e3b53441167f085e
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8636
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
|
|
When value of mstatus CSR changes while stepping with
"set_maskisr steponly", OpenOCD should not write back
the old value to mstatus when reenabling interrupts.
Signed-off-by: Samuel Obuch <samuel.obuch@espressif.com>
|
|
Currently, `jim_getopt_obj()` only fails if `goi->argc` is zero,
Link: https://github.com/riscv-collab/riscv-openocd/blob/41a225460c3b9a6c1f61a0777f101ff009f56007/src/helper/jim-nvp.c#L174-L185
so the check at the start of `jim_configure_ebreak()`
Link: https://github.com/riscv-collab/riscv-openocd/blob/41a225460c3b9a6c1f61a0777f101ff009f56007/src/target/riscv/riscv.c#L526-L530
guarantees that the call will succeed.
However, the modification makes the code more robust and future-proof.
Change-Id: Ic8c2e057a285bf679d26e21bda138a1d2ae5d5ce
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
|
|
In riscv-011 target, the handle_halt() function, and thus also
riscv_semihosting(), can get called from within examine() before
the examination is actually complete!
The chain of the function calls is:
- examine() -> riscv011_poll() -> poll_target()
-> handle_halt() -> riscv_semihosting()
If the target is already halted due to a breakpoint (dcsr.cause = SWBP)
at the time OpenOCD connects to it, semihosting will be attempted before
completing the examination, and the examination will fail.
This issue was observed on HiFive1 Rev A01.
Hot-fix this by making shure that semihosting is not attempted
before the target gets successfully examined.
Change-Id: Iccfa0da35d47a430d8674131ebd2eb8e5e2922c0
Signed-off-by: Jan Matyas <jan.matyas@codasip.com>
|
|
src/target/riscv: error out of the `examine()` in case `abits` is zero
|
|
Assert checking was recently added to the "buf_get_u64()"
procedure for the buffer size argument.
For 128-bit register writes, instead of calling "buf_get_u64()" with
a 128-bit argument which fails the assert check, use two 64-bit calls.
Change-Id: I32ddbdb7bbe68c43f3b0a27738537391a227b08c
Signed-off-by: Daniel Goehring <dgoehrin@os.amperecomputing.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8801
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
|
|
This prior patch replaces "LOG_xxx()" with "LOG_TARGET_xxx()"
to indicate which target the message belongs to.
commit 7f2db80ebc16 ("rtos/hwthread: Use LOG_TARGET_xxx()")
To support this change for hardware thread awareness,
the target command name needs to be established before
calling the "target_configure()" routine.
Change-Id: I0dc70c23b84e983a2ee694fb5b9d01758f5c84a3
Signed-off-by: Daniel Goehring <dgoehrin@os.amperecomputing.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8800
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
|
|
while at it change the order of checks for requested region sizes to
get rid of potential overflow during multiplication.
Change-Id: I97dac68e7024591cfd7abb70c8c62dff791298fe
Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8572
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
|
|
JanMatCodasip/jm-codasip/fix-datatypes-around-program
Fix data types around opcodes.h and program.{c,h}
|
|
The spec requires `abits` to be no less then 7 ( [3.1. Debug Module
Interface (DMI)]):
> The DMI uses between 7 and 32 address bits
Commit a450a7d4966a19c48b2543810f5b8370af6383e5 ("Fix data types around
batch.{c,h}") introduced a check that issues a warning if `abits` is
less then 7. The reason it's a warning and not an error -- on Spike
`abits` is 6.
However, if the examination is to proceed when `abits` is zero, an
assert in `get_dmi_scan_length()` will trigger when attempting to
communicate over DMI.
Link: https://github.com/JanMatCodasip/riscv-openocd/blob/a450a7d4966a19c48b2543810f5b8370af6383e5/src/target/riscv/batch.c#L25
It's impossible to communicate over DMI with `abits == 0`, so an error
is returned instead of a warning in this case.
Change-Id: Ice4622adccfc8304b37bc678253cc19d8ac1457e
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
|
|
target/riscv: Fix SMP group is in inconsistent state
|
|
This change is a quick-and-dirty workaround for the problem when user
wants to expose CSR with address "0" and instead of user-specified name
"csr0" was used.
The problem looks as follows:
riscv013_reg_examine_all eventually calls init_cache_entry for all CSRs.
init_cache_entry eventually results in a call to riscv_reg_gdb_regno_name.
Then in case of non-standard CSRs we have the following logic:
```
// NULL when regno == 0, since names are not generated yet
if (info->reg_names[regno])
return info->reg_names[regno]
...
if (regno >= GDB_REGNO_CSR0 && regno <= GDB_REGNO_CSR4095) {
// generate names for all exposed CSRs (the function
// lazy-initializes all the required names)
init_custom_csr_names(target);
// And here we have an error, since we overwrite the name generated
// by init_custom_csr_names
info->reg_names[regno] =
init_reg_name_with_prefix("csr", regno - GDB_REGNO_CSR0);
...
```
The error happens because when initially this function is called with
regno = 0, the first condition false, so we have to go and generate all
the names.
|
|
There was a bunch of conflicts due to commit
297844cf46c7de5faa9de1c4a9f223b505dc3e9c ("target: Use 'bool' data type
in target_{step,resume}")
Resolved by updating the corresponding data types throughout the
codebase.
Change-Id: I9574deeda754b2843b69b4afe80b293d4b357ddd
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
|
|
If the harts are just in the process of halting due to
being members of the halt group, we should wait until
they finish halting, so that the true halt reason can
be discovered (e.g. semihosting request, and then
handled correctly).
|
|
The function init_reg_param() initializes a struct where the
pointer reg_name is assigned to a 'const char *'.
Change the prototype of init_reg_param() to make also the reg_name
parameter as 'const char *'.
Change-Id: Ib999eaa5786ad24aa2a361070162c6f362784758
Reported-by: Marek Kraus <gamelaster@outlook.com>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8797
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Marek Kraus <gamelaster@outlook.com>
|
|
SSIA
Change-Id: I3e0b2fad84411c530f56cdbe33f3d8b4dbf81cf6
Signed-off-by: Jan Matyas <jan.matyas@codasip.com>
|
|
Callers of functions from opcodes.h need to be updated accordingly, too.
Change-Id: Ic42156b2843be682bc1cf9c720b73687008a2aa6
Signed-off-by: Jan Matyas <jan.matyas@codasip.com>
|
|
This is to make it consistent with stdint.h.
Change-Id: Ibba824dad431b3a1675700ad4cc15f3e39a187f7
Signed-off-by: Jan Matyas <jan.matyas@codasip.com>
|