aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-04-10target/riscv: Free registers to avoid memory leakMarc Schink
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-10flash/stm32h7x: include IO_HSLV in user3_optionsChristopher Head
Bit 29 of OPTSR is IO_HSLV. It ought to be read in stm32x_read_options and written in stm32x_write_options. Adjust the bitmasks to do this. Change-Id: I785a5291c991c98b774177f960dc58f2b5e045e2 Signed-off-by: Christopher Head <chead@zaber.com> Reviewed-on: http://openocd.zylin.com/4745 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-04-10helper/command: log an error for commands without usageAntonio Borneo
Every command has been fixed with proper usage field. Change LOG_DEBUG with LOG_ERROR so a developer will get a visible alert for missing usage field when adds a new command. Change-Id: I077c3745fd6265aded8e54b3f9d202d4d6516966 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5026 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-04-10target/imx6: Update list of supported TAPIDsLeonard Crestez
Copy all SJC TAPIPs from imx6 reference manuals. Some imx6 chips are based on Cortex-A7 or have an additional Cortex-M4 and need separate scripts. Change-Id: I3b07d94058c2c5e6313cfc8bb43134a90682a62e Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-on: http://openocd.zylin.com/5034 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-04-10target/imx6: Fix indentation in DAP_TAPID handlingLeonard Crestez
OpenOCD scripts are usually indented with 4 spaces but here there are 8. Change-Id: Iaad53e3b377d246d99119bb7bb5fd75d4422f564 Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-on: http://openocd.zylin.com/5039 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-04-10target/imx6: Add -ignore-versionLeonard Crestez
Looking through imx6 manuals all of them claim that "In follow-on silicon revisions the ID value is subject to change by incrementing the first nibble". Handle this by passing -ignore-version to jtag newtap command. Change-Id: I7fc4779f9757d527ea20a5174a8c90f919580013 Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-on: http://openocd.zylin.com/5031 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-04-10target/imx7: Add ahb mem_apLeonard Crestez
This allows bus access even when CPU is off. Change-Id: I2d5c5581cd0169aecb92ac7b610810988a8dcef4 Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-on: http://openocd.zylin.com/5032 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-04-10jtag: tcl: Add cget -idcodeLeonard Crestez
This can be used to dynamically distinguish between similar chips in tcl code. Change-Id: Ic4dfb61693e78616355173142dc7f9b9683a9f73 Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-on: http://openocd.zylin.com/5033 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-04-10Fix incorrect commas in URLsChristopher Head
In Texinfo, a comma inside an @url separates parameters to the @url function rather than being included as part of a parameter. Use @comma{} instead to resolve this. Change-Id: I8b38939462cf4452e5bc2582ee484220aaf83ae0 Signed-off-by: Christopher Head <chead@zaber.com> Reviewed-on: http://openocd.zylin.com/5028 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-04-10Document the mem_ap target typeChristopher Head
Change-Id: I56e971b38f20db8c4ad0cdee5cc42b42a25319ea Signed-off-by: Christopher Head <chead@zaber.com> Reviewed-on: http://openocd.zylin.com/5029 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-04-10target: fix copy&paste error in cget -coreidTomas Vanek
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-09topic: Remapped Flash over ITCM region in STM32F7x scriptRocco Marco Guglielmi
This patch remaps the Flash over ITCM region as virtual to ensure that any breakpoint placed in this area will be automatically set as an hardware breakpoint. This patch is a fix to a regression introduced with changes #4429. Change-Id: I03d46d8537ef06b33a3d4a2328274667c6481969 Signed-off-by: Rocco Marco Guglielmi <roccomarco.guglielmi@gmail.com> Reviewed-on: http://openocd.zylin.com/5097 Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Tested-by: jenkins
2019-04-07helper/command: handle empty "usage" with add_help_text/add_usage_textAntonio Borneo
By using the command "add_help_text" to add a help text to a TCL procedure it implicitly creates a new command_registration struct that has field .usage set to NULL. This triggers a debug message BUG: command '%s' does not have the '.usage' field filled out Use an empty string if usage field is NULL. Plus, do not annoy the user with a LOG_INFO when the command "add_usage_text" replaces an empty usage. Change-Id: I4a72646e0fb704ba354f938d774055540cde3967 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5025 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-04-07Set empty usage field for commands that do not need parametersAntonio Borneo
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 Borneo
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-07drivers/at91rm9200: fix help and usage to command "at91rm9200_device"Antonio Borneo
Add usage and fix the help text of the command Change-Id: I0e157d76f5d87bcda80f82a110912994908c8e03 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5023 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2019-04-07flash/nor/str9xpec: fix help and usage for command "part_id"Antonio Borneo
Remove the numeric parameter <bank> from help and add it to usage Change-Id: I630ca5450955210299f54e16fe5c9e8e51b3b266 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5022 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2019-04-07flash/nor/at91samd: set usage for command "set-security"Antonio Borneo
The only allowed parameter is the string "enable" Change-Id: Iefdad38f1b4177e4194e58caf2be654357299ded Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5021 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-04-07drivers/vsllink: add help and usage to commandsAntonio Borneo
Change-Id: I4a8a68147011525191ca79e65fc3d7e760371ae1 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5020 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-04-07drivers/bcm2835gpio: fix usage messagesAntonio Borneo
The notation "(tck tms tdi tdo)* " is incorrect, because it means the quadruple of gpio can be repeated on the command-line. The correct syntax of the command requires instead to provide either all the four gpio numbers (in order to set the values) or to pass an empty command-line (to dump the values previously set). Change the .usage field to "[tck tms tdi tdo]". Change similarly the corresponding .usage field for SWD command. Add the .usage field for the commands that individually set each gpio or gpio property. Dump the previously set values when commands bcm2835gpio_speed_coeffs or bcm2835gpio_peripheral_base are executed with empty command-line. Change-Id: Ie45d8268c1de331aded0bb52d5e6b8f0e8766a5b Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5019 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2019-04-07drivers/imx_gpio: fix usage messagesAntonio Borneo
The notation "(tck tms tdi tdo)* " is incorrect, because it means the quadruple of gpio can be repeated on the command-line. The correct syntax of the command requires instead to provide either all the four gpio numbers (in order to set the values) or to pass an empty command-line (to dump the values previously set). Change the .usage field to "[tck tms tdi tdo]". Change similarly the corresponding .usage field for SWD command. Add the .usage field for the commands that individually set each gpio or gpio property. Dump the previously set values when commands imx_gpio_speed_coeffs or imx_gpio_peripheral_base are executed with empty command-line. Change-Id: Id56a68622817101bd0a46fed1fead6d2cd2b6ec6 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5018 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-04-07command_registration: add empty usage field to chained commandsAntonio Borneo
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 Borneo
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-07flash/xmc4xxx: use coherent indentation in struct initializationAntonio Borneo
Keep using the same indentation rules while initializing struct command_registration. Change-Id: I900924600753ee7a72ca45da13db4112ab4b1522 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5015 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2019-04-07flash/kinetis: use coherent indentation in struct initializationAntonio Borneo
Keep using the same indentation rules while initializing struct command_registration. Change-Id: Ie69d9d6a786e1ef0abbcfd3eef89a61206238ebe Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5014 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2019-04-07target/riscv: use coherent syntax in struct initializationAntonio Borneo
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 Borneo
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 Borneo
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 Borneo
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-07log: add const qualifier to commands structAntonio Borneo
The struct log_command_handlers[] is never modified. Add const qualifier to it. Change-Id: I5785aeb09ae9c23eaf7c34a05b88d0c7285f2d78 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5009 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2019-04-04contrib: rpc_examples: python: fix memory retrievalPaul Fertser
mem2array returns a Tcl (associative) array and so the order of elements is not guaranteed. Treat it as such. Change-Id: Ie4d1219faac1e60247ca13bc2eedf22041a9a9e9 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/4487 Tested-by: jenkins Reviewed-by: Christopher Head <chead@zaber.com>
2019-04-03tcl_server: fix minor typo in commentPeter Lawrence
ctrl-z usage is incorrectly commented as ctrl-d Change-Id: I54fe1775760ee984154bbae380baa38bcaffa04e Signed-off-by: Peter Lawrence <majbthrd@gmail.com> Reviewed-on: http://openocd.zylin.com/4863 Tested-by: jenkins Reviewed-by: Christopher Head <chead@zaber.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-04-03target/arm_adi_v5: fix typoMete Balci
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-03flash/nor/core.h: clarify comment flash_sector::is_erasedTomas Vanek
Setting of flash_sector::is_erased in flash erase and mass erase is popular folklore. Make clear it is useless. Change-Id: Ide397eb6d24fc8fa38931e6c8a0693d39668a5d2 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/4768 Tested-by: jenkins Reviewed-by: Christopher Head <chead@zaber.com>
2019-04-03helper/startup.tcl: remove proc exitAntonio Borneo
The TCL command exit is already replaced by the OpenOCD command exit in server/telnet_server.c, no need to redefine it in the script. Moreover, the implementation is broken because the proc ocd_throw has been removed in mid 2008 with pre-git-era commit dfbb9f3e89ae in svn rev 849. Remove completely the unused proc exit. Change-Id: I0365d740eccc47631eb459aab77b865b0877c1f7 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4986 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-04-03armv7a_mmu: Remove warning on va = paFlorian Fainelli
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 Vanek
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 Vanek
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>
2019-04-01target/cortex_m: simplify cortex_m_unset_breakpoint()Tomas Vanek
Cortex-M uses only 2 byte breakpoint instruction. cortex_m_unset_breakpoint() does not need to check breakpoint->length, use the length as the size argument in target_write_memory() Change-Id: I20bb869f6abce2fc61f0469e34a638bc4dc6f7ce Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/4889 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-03-27Constify struct flash_driver instancesChristopher Head
Instances of struct flash_driver are never written to at runtime. For a small amount of memory saving and also robustness (fewer things for stray pointer writes to hit), mark them const. Change-Id: Iadbbbc2fac0976d892699200000c5f02856729f3 Signed-off-by: Christopher Head <chead@zaber.com> Reviewed-on: http://openocd.zylin.com/4803 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-03-27smp: move sub-command "smp_gdb" in file smp.cAntonio Borneo
The code for this command is currently replicated in cortex_a and in mips_m4k and is going to be added again for cortex_m. Plus, it is going to be obsoleted by the HW thread pseudo RTOS. Consolidate in smp.c a single instance of the command. This will simplify both obsoleting it and adding it to cortex_m, whatever change comes first. Change-Id: I03cd857e21fa3f7202fdcee36bcbd5aae30a609d Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4991 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-03-27smp: replace commands smp_on/smp_off with "smp [on|off]"Antonio Borneo
Seams over-engineered having two separate commands to turn SMP on/off. Plus it is missing the possibility to dump the current status of SMP and would be weird adding an additional command for it. Moreover, such commands are replicated in few targets so it would make sense centralizing them. - Deprecate the commands "smp_on" and "smp_off". - Add a new command "smp" that accepts optional parameters "[on|off]" and prints the SMP status when run without parameters. This replaces the two commands above. - Put the deprecated and the new command handlers in smp.c - Update the documentation, except for mips_m4k, since it is not available yet. - Promote the macro foreach_smp_target to global context and use it where possible. Change-Id: Ia72841c1a3bd6edd4db4cc809046322f498617e6 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4615 Tested-by: jenkins Reviewed-by: Graham Sanderson <graham.sanderson@gmail.com> Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-03-27imx8m: add an m4 target to the imx8mAngus Ainslie
The imx8m also has a Cortex m4 so add a target for it. Change-Id: I2abf62b6232c547fe9b12507f459835b11c63a6d Signed-off-by: Angus Ainslie <angus@akkea.ca> Reviewed-on: http://openocd.zylin.com/4501 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-03-27flash/nor/core: adjust flash_iterate_address_range_inner() for 64-bitTomas Vanek
Use target_addr_t exclusively for comparison of sector boudaries and address range. Use the last addres for both address range end and sector end. It avoids problems with a flash bank mapped at the very end of target address space. Change-Id: Idf97c837453d97cbc4cf8a1c76ad799f4142f19e Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/4985 Tested-by: jenkins Reviewed-by: Tim Newsome <tim@sifive.com> Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-03-27Lots of RISC-V improvements.Tim Newsome
This represents months of continuing RISC-V work, with too many changes to list individually. Some improvements: * Fixed memory leaks. * Better handling of dbus timeouts. * Add `riscv expose_custom` command. * Somewhat deal with cache coherency. * Deal with more timeouts during block memory accesses. * Basic debug compliance test. * Tell gdb which watchpoint hit. * SMP support for use with -rtos hwthread * Add `riscv set_ir` Change-Id: Ica507ee2a57eaf51b578ab1d9b7de71512fdf47f Signed-off-by: Tim Newsome <tim@sifive.com> Reviewed-on: http://openocd.zylin.com/4922 Tested-by: jenkins Reviewed-by: Philipp Guehring <pg@futureware.at> Reviewed-by: Liviu Ionescu <ilg@livius.net> Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-03-26stlink: Set speed before entering JTAG/SWD modeFrans-Willem Hardijzer
Some boards require a slower clock speed because of passive components on the JTAG/SWD lines. The previous implementation would first try to discover the chips on the default speed, and only after discovery switch to the requested adapter_khz speed. This patch moves the speed change to just before entering the SWD/JTAG mode, which should alleviate this problem. Tested on an STLink V2 clone. Change-Id: I9734452dcc8bb28d6629e64d9a7e32ef92868cf9 Signed-off-by: Frans-Willem Hardijzer <fw@hardijzer.nl> Reviewed-on: http://openocd.zylin.com/4818 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-23mips32: pracc: Fix indentMarek Vasut
Fix indent of the macros in header file, no functional change. Change-Id: I4d1dba5725155200148d1543c45bad919f6cd37e Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Reviewed-on: http://openocd.zylin.com/4995 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2019-03-23mips32: pracc: Fix UPPER/LOWER macrosMarek Vasut
These macros are missing parenthesis around the argument, which can lead to side effects, add them. Replace the argument name to avoid conflict with uint32_t data type, since the macro can be applied to other data types as well. Change-Id: I32d2ffec6c062795d7c8bb23d1dfa3378bfc3a58 Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Reviewed-on: http://openocd.zylin.com/4994 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2019-03-14target/mips: Use 'bool' data typeMarc Schink
Change-Id: Ifb114bfc062ed7c0ff6e4f37a1a6d546f5415344 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4970 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-14target/xscale: Use 'bool' data typeMarc Schink
Change-Id: I4e117f4e6c8c0850f565587f68f41d88da0d6b0b Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4968 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>