aboutsummaryrefslogtreecommitdiff
path: root/src/target
AgeCommit message (Collapse)AuthorFilesLines
2019-05-14target/esirisc_trace: change prototype of trace dump functionsPaul Fertser1-14/+14
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of esirisc_trace_dump*() functions to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: Ia43bff112372cbb76e1aea9f59f4a9b6df05c15d Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5079 Tested-by: jenkins Reviewed-by: Steven Stallion <sstallion@gmail.com>
2019-05-14target/esirisc_trace: change prototype of trace analyse functionsPaul Fertser1-36/+36
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of esirisc_trace_analyze*() functions to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: Ie7cfd323fe591a987ea648a20be2bb9c7273dde8 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5078 Tested-by: jenkins Reviewed-by: Steven Stallion <sstallion@gmail.com>
2019-05-14target: change prototype of binprint()Paul Fertser1-8/+8
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of binprint() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: I5ebdc50417d97c791c98ac0cfe2218319809eb7f Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5077 Tested-by: jenkins
2019-05-14target: change prototype of handle_bp_command_set()Paul Fertser1-9/+9
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of handle_bp_command_set() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: If00f9cfb784b53bb3df92d4469178e2f930a146a Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5076 Tested-by: jenkins
2019-05-14target: change prototype of handle_bp_command_list()Paul Fertser1-8/+8
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of handle_bp_command_list() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: Ibff636d476bcd59784ce3da5409d930225cfe637 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5075 Tested-by: jenkins
2019-05-14target: change prototype of handle_md_output()Paul Fertser1-3/+3
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of handle_md_output() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: I2150201fad3fd3bc0be89249dcbd314b38a6f860 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5074 Tested-by: jenkins
2019-05-14target/arm_adi_v5: change prototype of dap_rom_display()Paul Fertser3-34/+34
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of dap_rom_display() and dap_info_command() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: Idb97b20759c03fcecbac1184c354966f469caa5f Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5073 Tested-by: jenkins
2019-05-14target/etm: change prototype of etmv1_analyze_trace()Paul Fertser1-14/+14
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of etmv1_analyze_trace() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: Ic923af5480a54c7272d2ff1abbe235ba941cf1a0 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5072 Tested-by: jenkins
2019-05-14target/x86_32_common: change prototype of handle_iod_output()Paul Fertser1-3/+3
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of handle_iod_output() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: I67f594c80d6bbbbf6c9567069a545f16877b1e94 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5071 Tested-by: jenkins
2019-05-14target/armv7a_cache_l2x: change prototype of ↵Paul Fertser1-4/+4
arm7a_handle_l2x_cache_info_command() To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of arm7a_handle_l2x_cache_info_command() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: Ib926cd7380ac8b6fb89f64e0a85d81d124633315 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5070 Tested-by: jenkins
2019-05-14target/armv7a: change prototype of armv7a_handle_cache_info_command()Paul Fertser4-8/+8
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of armv7a_handle_cache_info_command() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: I27f507869cb41c74722a759e69dfd45658fcd4be Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5069 Tested-by: jenkins
2019-05-14target/armv4_5_cache: change prototype of armv4_5_handle_cache_info_command()Paul Fertser5-10/+10
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of armv4_5_handle_cache_info_command() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: Ib6ab3ec2fc6504c2a0635b654697a4b6e12a3750 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5068 Tested-by: jenkins
2019-05-14target/dsp563xx: change prototype of handle_md_output()Paul Fertser1-3/+3
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of handle_md_output() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: Ib0b84c933689ac8c940c9bbe62d9c95fd015c4f5 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5067 Tested-by: jenkins
2019-05-14target/armv8: change prototype of display_cache_info()Paul Fertser4-10/+10
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of display_cache_info(), armv8_handle_inner_cache_info_command() and armv8_handle_cache_info_command() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: I13519c79af82cdba57d5205ba84a5a27fce65a36 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5066 Tested-by: jenkins
2019-05-14target/xscale: change prototype of xscale_display_instruction()Paul Fertser1-11/+11
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of xscale_display_instruction() and of xscale_analyze_trace() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: I8420f19c1b2ff0d2a2f2a8d3627767f7acda437c Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5065 Tested-by: jenkins
2019-05-14target/xscale: change prototype of xscale_verify_pointer()Paul Fertser1-14/+14
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of xscale_verify_pointer() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: Id047fab41ec4f673a46756b0ab901e659e088544 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5064 Tested-by: jenkins
2019-05-14target/mips_m4k: change prototype of mips_m4k_verify_pointer()Paul Fertser1-3/+3
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of mips_m4k_verify_pointer() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: I9fa3e883d2ca9cc858caaefd33586f78638702f5 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5063 Tested-by: jenkins
2019-05-14target/mips32: change prototype of mips32_verify_pointer()Paul Fertser1-3/+3
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of mips32_verify_pointer() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: Ic4a4de10518ee009d6df420e7278fd028e1f22ca Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5062 Tested-by: jenkins
2019-05-14target/cortex_m: change prototype of cortex_m_verify_pointer()Paul Fertser1-5/+5
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of cortex_m_verify_pointer() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: Icf6d1e5f8b4a3ce115c4253e49769df19a5211ae Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5061 Tested-by: jenkins
2019-05-14target/arm946e: change prototype of arm946e_verify_pointer()Paul Fertser1-4/+4
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of arm946e_verify_pointer() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: Ib7119e2b009d05eec47b50c3b9d32feaebc97538 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5060 Tested-by: jenkins
2019-05-14target/arm720t: change prototype of arm720t_verify_pointer()Paul Fertser1-3/+3
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of arm720t_verify_pointer() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: I7fa0628fabacd9ceb62ce921192f88edca659c15 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5059 Tested-by: jenkins
2019-05-14target/arm966e: change prototype of arm966e_verify_pointer()Paul Fertser1-3/+3
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of arm966e_verify_pointer() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: I92745591256ad56a588b6386842028e0b18dec96 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5058 Tested-by: jenkins
2019-05-14target/arm926ejs: change prototype of arm926ejs_verify_pointer()Paul Fertser1-3/+3
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of arm926ejs_verify_pointer() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: Ibbb03429a7fe8b9979f9bb9e513f9eb86aee3b5b Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5057 Tested-by: jenkins
2019-05-14target/arm920t: change prototype of arm920t_verify_pointer()Paul Fertser1-7/+7
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of arm920t_verify_pointer() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: I9a603d7c032df91b3913aadb242de89dbed0358e Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5056 Tested-by: jenkins
2019-05-14target_request: replace command_print() with command_output_text()Antonio Borneo1-2/+2
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. When dumping traces or semihosting text, the command that enabled it is already completed, so CMD is not a valid value. Plus, we want the dump to be printed in the command context where the enable command was executed. Replace command_print() with command_output_text(). Change-Id: I297a2b799a914233499641062407cf6e8b9fe012 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5051 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-05-14target: unify memory read/write commandsAntonio Borneo1-231/+23
Current code provides two independent implementations for the memory read/write commands: a) jim_target_md()/jim_target_mw() for the target specific commands "<target> m[dw][bhw]" b) handle_md_command()/handle_mw_command() for the current target commands "m[dw][bhwd]" The case a) misses the handling of doubleword and calls functions command_print_sameline() with first parameter NULL because defined as jim handler. Remove the code in jim_target_md()/jim_target_mw() and use the same code in b) for the target specific memory read/write. This approach also provides support for 64-bit data size, not present in the implementation in a). The only drawback is that the implementation of memory read in b) prints the data also as human readable ASCII characters, feature missing in the implementation in a). This could introduced later if it's really needed. Update the documentation to: - add 64-bit support - add phys parameter - add the count parameter Add attribute "unused" to target_buffer_get_u8(), now not used anymore. Change-Id: Ib11ff924c409ad87e77fe708d628b2cc82b74d6a Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5050 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-05-14target: use LOG_USER to print errors in eventsAntonio Borneo1-1/+6
Events are supposed to be executed asynchronously and not linked with any command, so it's incorrect printing out an eventual error using command_print(). Even in the case of events triggered by the command <target> invoke-event <event-name> the eventual error in the event handler is not propagated to the command, so the command_print() is still not appropriate. Replace command_print() with LOG_USER() in target_handle_event(). Add further info in the log to identify which event has generated the error and its associated target. Before return, clean-up the error message and the stacktrace from the error already displayed, to avoid propagate them. Change-Id: I5966aa25e7c81348f4ad4d6e7ce5d4dee44ea4c8 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5049 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-05-14target: change prototype of target_process_reset()Antonio Borneo1-5/+5
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of target_process_reset() to pass CMD instead of CMD_CTX. Replace NULL parameter of command_print(). Remove extra newline, already added by command_print(). Change-Id: Ieb820c2586e1ff74a0c2b63a9c8693ca7710dfb7 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5048 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-05-14target/arm946e: rewrite jim_arm946e_cp15 to arm945e_handle_cp15Tomas Vanek1-38/+22
jim_arm946e_cp15() used command_print() in the jim handler. Change-Id: I0a258aad5a60f45672b9b6fa6819691507d4f0f6 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5000 Tested-by: jenkins
2019-05-14target: rewrite jim_target_event_list to handle_target_event_listTomas Vanek1-12/+11
jim_target_event_list handler used command_print() in jim handler. Rewriting the jim handler to the OpenOCD command is easy as get_current_target() returns proper target for prefixed commands since bb9d9c60264a905926e0d15f84842858d0de80b7 Change-Id: I3e937249386ca5dbd7a5dd6ebb0ccde0911325d8 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4993 Tested-by: jenkins
2019-04-24armv7a: Improve parsing of MPIDR register to avoid error message for Cortex R5Tommy Vestermark2-13/+16
References: - ARM DDI0406C ARMv7 Architecture Reference Manual, section B4.1.106 - ARM DDI0460D Cortex-R5 Technical Reference Manual section 4.3.6 - ARM 100048_0002_0 Cortex-A73 Technical Reference Manual section 4.5.2 Tested on: TMS570LC4357 Change-Id: Ie0d45fb697697f78cc4ad4e7a0116be9772590ba Signed-off-by: Tommy Vestermark <tov@vestermark.dk> Reviewed-on: http://openocd.zylin.com/5108 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-04-24target/cortex_a: use extensively cortex_a_wait_dscr_bits()Antonio Borneo1-71/+39
We have the function to wait for bits in dscr. Use it whenever possible. When the bit to test is DSCR_INSTR_COMP, use instead the wrapper function cortex_a_wait_instrcmpl(). Change-Id: I5c54c239a00f489712af448eb97752210b4b38b8 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5113 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-04-24target/cortex_a: check dscr before timeoutAntonio Borneo1-3/+11
In function cortex_a_wait_dscr_bits() the last read on dscr gets ignored in case of timeout, even if it finally provides the value that would trigger a successful return. Check the returned value before testing the timeout. Also, print a message on failure reading dscr. Change-Id: I261ac1545113db39374833a55be911a4da71d893 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5112 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-04-24target/cortex_a: fix waiting for target halted after stepAntonio Borneo1-0/+2
Depending on adapter speed, the function cortex_a_poll() can take time to execute and can complete successfully when the timeout is already expired. Checking the timeout at function return causes a timeout error while that could be avoided. Check the target status at cortex_a_poll() return, before checking for the timeout. Change-Id: I4c1581f6e718298c566df7b1359255e16e3955d5 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5111 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-04-10target/cortex_m: Implement maskisr steponly optionChristopher Head2-25/+121
`maskisr steponly` disables interrupts during single-stepping but enables them during normal execution. This can be used as a partial workaround for 702596 erratum in Cortex-M7 r0p1. See "Cortex-M7 (AT610) and Cortex-M7 with FPU (AT611) Software Developer Errata Notice" from ARM for further details. Change-Id: I797a14e4d43f6dcb3706528ee4ab452846ebf133 Signed-off-by: Christopher Head <chead@zaber.com> Reviewed-on: http://openocd.zylin.com/4673 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2019-04-10fix for sanitizer errors in left shiftsMete Balci1-1/+1
The modified lines cause "runtime error: left shift of <X> by <Y> places cannot be represented in type 'int'", because integer literal is cast to int by default. Change-Id: Ie38119b5eb46ee470e0d149959e523b48ac4d66d Signed-off-by: Mete Balci <metebalci@gmail.com> Reviewed-on: http://openocd.zylin.com/5005 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-04-10target/riscv: Free registers to avoid memory leakMarc Schink1-14/+17
Tested with SiFive HiFive1 development board. Change-Id: I96a9a528057fcf9fc54d3da46a672d2cd54c3d5f Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4885 Tested-by: jenkins Reviewed-by: Tim Newsome <tim@sifive.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-04-10target: fix copy&paste error in cget -coreidTomas Vanek1-1/+1
Command should return target->coreid, not target->working_area_size Solution appeared as an off topic fix in http://openocd.zylin.com/4935 Change-Id: Ic9701ce2001c75060dbaa75fbd013ed475a352e5 Suggested-by: Graham Sanderson <graham.sanderson@gmail.com> Reported-by: Tim Newsome <tim@sifive.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5035 Tested-by: jenkins Reviewed-by: Tim Newsome <tim@sifive.com> Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-04-07Set empty usage field for commands that do not need parametersAntonio Borneo2-0/+2
The missing field causes runtime debug message BUG: command '%s' does not have the '.usage' field filled out While there, fix some minor typo in the help messages: s/deasert/deassert/ s/Deasert/Deassert/ Change-Id: If3dd18265cda103ca0d05609f67f4ca58e7cbb27 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5024 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-04-07target/adi_v5_swd: add "usage" field to command "swd"Antonio Borneo1-0/+1
The missing field causes runtime debug message BUG: command 'swd' does not have the '.usage' field filled out Change-Id: I5a36c0fc822c4d5d74ef2d1c75e369648c6f7d4d Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4830 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-04-07command_registration: add empty usage field to chained commandsAntonio Borneo6-2/+6
Chained command require a subcommand as first argument. The usage field for chained commands is not really important because the "help" command will list all the subcommands with their respective usage. Add a empty usage field on all chained command. The command "jlink config" can be either followed by a subcommand or used alone, so use a dedicated usage string. Change-Id: I43c3f8a766f96a9bdab4e709e3c90713be41fcef Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5017 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-04-07target/armv7a: simplify help description of command "l2x"Antonio Borneo1-2/+1
There is no need to split the string in two lines. Change-Id: Ifc574904acd06c31fab589643334e86f4dd0a122 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5016 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-04-07target/riscv: use coherent syntax in struct initializationAntonio Borneo1-4/+4
While initializing struct command_registration, the field's name "name" is not specified, thus relying on the fact that it is the first field declared in the struct and it's initialization value can be listed as the first one. Be coherent in the struct initialization and always use the field's name. Change-Id: Iefaeb15cc051db9f1e0f0140fe2f231b45f5bb12 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5013 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins Reviewed-by: Tim Newsome <tim@sifive.com>
2019-04-07target/openrisc: use coherent syntax in struct initializationAntonio Borneo1-5/+5
While initializing struct command_registration, the field's name "name" is not specified, thus relying on the fact that it is the first field declared in the struct and it's initialization value can be listed as the first one. Be coherent in the struct initialization and always use the field's name. Change-Id: I65d32870bf4d3df845db69682fe445c71642f976 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5012 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2019-04-07target/armv4_5: use coherent syntax in struct initializationAntonio Borneo1-4/+4
While initializing struct command_registration, the field's name "name" is not specified, thus relying on the fact that it is the first field declared in the struct and it's initialization value can be listed as the first one. Be coherent in the struct initialization and always use the field's name. Change-Id: I9ef7ac08e7cd5b82a6a7896c47017943d668925f Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5011 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2019-04-07target/arm7_9_common: use coherent syntax in struct initializationAntonio Borneo1-3/+3
While initializing struct command_registration, the field's name "name" is not specified, thus relying on the fact that it is the first field declared in the struct and it's initialization value can be listed as the first one. Be coherent in the struct initialization and always use the field's name. Change-Id: I743457acf7757df4646c9bc4e5ea1a6f9c841516 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5010 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2019-04-03target/arm_adi_v5: fix typoMete Balci1-1/+1
Fixed the small typo. Change-Id: Ia8834b23302d25e92cb2fa0802bebb2a9416595b Signed-off-by: Mete Balci <metebalci@gmail.com> Reviewed-on: http://openocd.zylin.com/5001 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-04-03armv7a_mmu: Remove warning on va = paFlorian Fainelli1-2/+0
Depending on how the MMU is configured it is possible to have a 1:1 mapping between virtual and physical addresses, thus making this warning bogus. We already check that the MMU is enabled in the caller: cortex_a_virt2phys(). Change-Id: I09f4c53ef933c8d1e268da5215a769449be014bc Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-on: http://openocd.zylin.com/5007 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Kamal Dasu <kdasu.kdev@gmail.com> Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-04-03target/cortex_m: remove target halted check when removing a breakpointTomas Vanek1-9/+3
Remove the target halted check from cortex_m_remove_breakpoint() as there is no such check in cortex_m_set_breakpoint() and bp can be safely removed from the running target. While on it return the error code from cortex_m_unset_breakpoint() to higher level. Change-Id: I2b358c3661feed84297913e9f589bdf1e4de7e64 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/4887 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de> Reviewed-by: Jānis Skujenieks <janis.skujenieks@gmail.com> Reviewed-by: Christopher Head <chead@zaber.com>
2019-04-01target/cortex_m: remove fp_code_available countingTomas Vanek2-18/+1
fp_code_available looses sync with the real number of free comparators as soon as cortex_m_set_breakpoint() returns an error. Remove the counter and always go through the fp_comparator_list to find a free one. Change-Id: I9f6e06c36d8a57ad11df5155e8a1a3aff6d833a5 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/4870 Tested-by: jenkins Reviewed-by: Jānis Skujenieks <janis.skujenieks@gmail.com> Reviewed-by: Christopher Head <chead@zaber.com> Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>