aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-02-23flash/nor/tcl.c: add filld command to write double-word with 64-bit valueTarek BOCHKATI2-6/+25
Change-Id: I2eeda7af7d855ed1284083d025994f8fa9531969 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/5443 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-02-23flash/nor/stm32l4x: lock flash after errorTomas Vanek1-22/+31
Also add locking after option write, it was missing at all. Change-Id: I0227c6a74866f0fe8e40aa58616f0b3115ad5af0 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5361 Tested-by: jenkins Reviewed-by: Andreas Bolsch <hyphen0break@gmail.com> Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
2020-02-23tcl/board: Add imx8mp-evkLeonard Crestez1-0/+15
Board includes an internal adapter (interface/ftdi/imx8mp-evk.cfg) and a standard external ARM-10 connector. Change-Id: Ibb301011665b1edfb95be1213d8100143f6839dd Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-on: http://openocd.zylin.com/5427 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-02-23tcl/interface/ftdi: Add imx8mp-evk internal JTAG interfaceLeonard Crestez1-0/+28
The imx8mp-evk board has a FT4232H chip connected to the chip's JTAG pins. Switching between this on-board interface and the external ARM-10 connector is controlled by an GPIO which is behind an i2c expander connected to the same FTDI chip. Switching can be performed using the NXP bcu tool: https://github.com/NXPmicro/bcu Change-Id: Ic910515f76eaf09ea6d0f755b026fb09cf09ccfc Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-on: http://openocd.zylin.com/5426 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-02-23flash/stm32h7x: use alignment infrastructureChristopher Head1-24/+8
Report the 32-byte alignemnt requirement via the bank structure rather than enforcing it ad-hoc in the write routine. This allows people to do non-32-byte-aligned writes if they want, with the infrastructure fixing up the addresses passed to the low-level driver. Change-Id: I2c4f532f2000435954a900224dbc9f2c30d1cc94 Signed-off-by: Christopher Head <chead@zaber.com> Reviewed-on: http://openocd.zylin.com/5388 Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-02-23flash/nor/stm32f1x: Some small code cleanupsMarc Schink1-9/+6
Change-Id: I1fc08b96b179a1376af233b713ae50d6ad7867a0 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/5404 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2020-02-23flash/nor/stm32h7x: check OPTCHANGEERRChristopher Head1-1/+8
Without this, a failed attempt to change option bytes will silently appear to succeed but without actually changing the option bytes (confusingly, the option bytes will still read back as if they had been changed until a reboot as well!). Change-Id: Id529c6c384a8a16be75f5702310670d99d8fac79 Signed-off-by: Christopher Head <chead@zaber.com> Reviewed-on: http://openocd.zylin.com/5418 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2020-02-23flash/nor/stm32h7x: fix incorrect array indexingChristopher Head1-1/+1
Change-Id: Iec2246df284953d1442dfefdad8e70041690dfe2 Signed-off-by: Christopher Head <chead@zaber.com> Reviewed-on: http://openocd.zylin.com/5417 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2020-02-15stlink: add trace support in DAP direct modeAntonio Borneo1-0/+17
Reuse the existing tracing functionality of HLA mode to support tracing in DAP direct mode. Change-Id: I75a01e88ba5d3e45717e4108b99697ac3225db9e Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5409 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-02-15armv8: check the core state to pass the correct arch to gdbAntonio Borneo1-1/+2
Commit 3799eded6761 ("target/aarch64: add support for multi-architecture gdb") passes the constant string "aarch64" as architecture to gdb. This is not working if the core is running in 32 bits mode; gdb reports: Truncated register 8 in remote 'g' packet then closes the connection with OpenOCD. Make the architecture string dependant from the current state of the core. Change-Id: I16e1614ea02ba29bf87f450b3dfe25c83c9a3612 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5234 Tested-by: jenkins Reviewed-by: Muhammad Omair Javaid <omair.javaid@linaro.org>
2020-02-15coding style: use ARRAY_SIZE() when possibleAntonio Borneo4-5/+4
We have the macro ARRAY_SIZE() already available. Use it! Issue identified by checkpatch script from Linux kernel v5.1 using the command find src/ -type f -exec ./tools/scripts/checkpatch.pl \ -q --types ARRAY_SIZE -f {} \; Change-Id: Ic7da9b710edf118eacb08f9e222f34208c580842 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5198 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-02-15coding style: remove unnecessary parenthesesAntonio Borneo2-2/+2
Identified by checkpatch script from Linux kernel v5.1 using the command find src/ -type f -exec ./tools/scripts/checkpatch.pl \ -q --types UNNECESSARY_PARENTHESES -f {} \; then fixed manually. Change-Id: Ia2d9a0953d9b89fc87dc1195aa05c7f63c068c48 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5196 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-02-15jtag/startup.tcl: remove trailing whitespacesAntonio Borneo1-5/+5
Change-Id: I1d6f4f47ee6f8985c84ddb2647e029c5f4e6a55a Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5194 Tested-by: jenkins Reviewed-by: Marc Schink <dev@zapb.de>
2020-02-15target/nds32: fix type of magic numberAntonio Borneo1-2/+2
The macro NDS32_COMMON_MAGIC was cast-ed to int to avoid compile time error for comparison type mismatch while comparing it with the field common_magic. This is incorrect because the macro value is a 32 bit unsigned value; better changing the type of the field common_magic to keep the unsigned value. Issue identified by checkpatch script from Linux kernel v5.1 using the command find src/ -type f -exec ./tools/scripts/checkpatch.pl \ -q --types TYPECAST_INT_CONSTANT -f {} \; Change-Id: Ib5924b6cecdffe70ab5c78d3b30a9c8e4deb7c7b Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5193 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-02-15flash/nor/stm32lx: Minor code cleanupsMarc Schink1-9/+6
Change-Id: I6440a4eb1f65a2f8ae2914b38f21a59955e85e0d Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/5438 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-02-15jtag_vpi: added an option to stop simulation on exitJan Matyas1-5/+46
Command CMD_STOP_SIMU had been defined in jtag_vpi for a long time (since the beginning?) but has not been utilized until now. Its purpose is to signal to the jtag_vpi server (i.e. the RTL simulation software) that the simulation shall be stopped. This commit adds a TCL configuration command that selects whether CMD_STOP_SIMU will be sent to the jtag_vpi server when OpenOCD is about to exit. This functionality is off by default to maintain identical behavior as in previous OpenOCD versions, unless the user enables it explicitly. Change-Id: If3894af6efa61038ccf6c9191f664e2128f2ef11 Signed-off-by: Jan Matyas <matyas@codasip.com> Reviewed-on: http://openocd.zylin.com/5407 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-02-15Include start-of-region addressPiotr Kasprzyk1-1/+1
When $ADDRESS == $BASE that address used to be excluded. After this commit $ADDRESS == $BASE is within the range. Now the rule for "iswithin" is: $BASE <= $ADDRESS < ($BASE + $LEN) Thanks to Antonio Borneo <borneo.antonio@gmail.com> for noticing this. Change-Id: I74373c6010e069372d886fa7ecd8120892616834 Signed-off-by: Piotr Kasprzyk <ciri@ciri.pl> Reviewed-on: http://openocd.zylin.com/4799 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-02-13flash/stm32lx: mention explicitly that this driver covers STM32 L0 and L1Tarek BOCHKATI3-2/+6
this is to avoid confusion with STM32 L4, L4+ and L5 families also: - a warning message is changed to error - stm32l0x and stm32l1x aliases has been created to permit the usage of either names Change-Id: If3f16d2a3b7d1369959aa7407da37a9076ea91d7 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/5437 Reviewed-by: Marc Schink <dev@zapb.de> Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-02-13flash/startup.tcl: update stm32 flash driver aliasesTarek BOCHKATI1-15/+8
This will enable us to use either name when calling flash driver commands. For example the stm32wbx family use the same flash driver as the stm32l4x, so the user has to use 'stm32l4x lock 0' which can be confusing. Now the user can also use 'stm32wbx lock 0' with the same result. Change-Id: Ic0d8da9afc202d7cc82d9b9949827e958a1cc824 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/5436 Tested-by: jenkins Reviewed-by: Marc Schink <dev@zapb.de> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-02-09jtag: Fix copy-paste error in 'irscan' helpMarek Vasut1-1/+1
Replace "Instruction Register (DR)" with "Instruction Register (IR)", that is sed "s@DR@IR@", which was likely a copy-paste error. Change-Id: I3e625872c855d655485b3efa5f50fe1c00ecbf52 Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Reviewed-on: http://openocd.zylin.com/5446 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2020-02-08tcl: Remove executable bitMarc Schink9-0/+0
Change-Id: Ib452435b13c3cb8d14453d983151936238b9601d Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/5419 Reviewed-by: Paul Fertser <fercerpav@gmail.com> Tested-by: Paul Fertser <fercerpav@gmail.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-02-08efm32: add EFR32ZG13P and EFR32ZG14P partsFrank Hunleth1-0/+2
This adds the EFR32 Zen Gecko Family parts. The device family values are found in table 4.7.11 of https://www.silabs.com/documents/public/reference-manuals/efr32xg14-rm.pdf. Change-Id: I3858b7ba815784b1150e2214a2833e8ff7d249e1 Signed-off-by: Frank Hunleth <fhunleth@troodon-software.com> Reviewed-on: http://openocd.zylin.com/5364 Tested-by: jenkins Reviewed-by: Marc Schink <dev@zapb.de>
2020-02-08stlink: fix max packet size for 8 bit R/W on stlink-v3Antonio Borneo1-2/+7
While ST internal documentation for STLINK-V3 reports that 8 bits read/write commands handle 512 bytes of data, a firmware bug makes it crashing on high data size. This is fixed with firmware V3J6 (shipped together with V2J36). Check for firmware version to use the proper data size. Change-Id: Iaba6cd26bbe130097c1c19de610680e0e8b69bfc Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Fixes: https://sourceforge.net/p/openocd/tickets/259/ Reviewed-on: http://openocd.zylin.com/5408 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-02-08jtag: flush jtag queue after jtag_add_tlr()Antonio Borneo1-0/+1
If the TLR sequence is sent as result of the command "adapter assert trst" while polling is off, the TLR sequence is not sent out until a following jtag operation. Flush the jtag queue before return. Change-Id: I20efd7137cb7b1d1c4f73c1362cbe4e57aeaae49 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5405 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-02-08Switch to HTTPS for submodulesChristopher Head1-3/+3
repo.or.cz already redirects HTTP requests to HTTPS. There is therefore no possible benefit to keeping the submodule URLs using HTTP—anyone who can’t access via HTTPS will fail anyway, immediately after the redirect. Changing the submodule URLs eliminates one unnecessary HTTP request and, more importantly, eliminates SSLStrip-style attacks. Change-Id: I9faf1ec8aa87bcfd1acafe2c445a0baf2abfbd09 Signed-off-by: Christopher Head <chead@zaber.com> Reviewed-on: http://openocd.zylin.com/5406 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-02-06tcl: fix remaining scripts after rework adapter commandsAntonio Borneo5-8/+8
Some script have been added or modified after the patches for reworking the adapter commands were pushed in gerrit. Such scripts use the old command syntax and trigger a "deprecated" warning at runtime. Fix them with the same sed commands used for the other scripts: sed -i 's/^interface /adapter driver /' $(find tcl/ -type f) sed -i 's/adapter_khz/adapter speed/g' $(find tcl/ -type f) sed -i 's/adapter_nsrst_delay/adapter srst delay/g' $(find tcl/ -type f) sed -i 's/adapter_nsrst_assert_width/adapter srst pulse_width/g' $(find tcl/ -type f) Change-Id: I0824d6c506a9af3eb9129b74c02a92b4eb1b100d Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5424 Reviewed-by: Oleksij Rempel <linux@rempel-privat.de> Tested-by: jenkins
2020-02-06tcl: Add interface config for isodebug isolated JTAG/SWD+UARTAndreas Fritiofson1-0/+27
Currently only used internally at Unjo. Change-Id: I7786e95e1bd755a73156ecad5b6d7f6273d8ddef Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/5251 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-02-06jtag: drivers: xlnx-pcie-xvc: fix build on Linux pre v4.10Antonio Borneo1-0/+5
The macro PCI_CFG_SPACE_EXP_SIZE is exposed to userspace from Linux kernel v4.10, with commit cc10385b6fde ("PCI: Move config space size macros to pci_regs.h") http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cc10385b6fde Define the macro in the driver code, if not already defined. Change-Id: I610219a2587eff2c142102b9f7830e3da882af78 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5435 Reviewed-by: Moritz Fischer <moritzf@google.com> Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Tested-by: jenkins
2020-02-06flash/nor: Add Renesas RPC HF driverMarek Vasut3-0/+651
Add driver for the RPC block in HF mode on Renesas R-Car Gen3 SoCs. This driver allows operating the on-SIP HF memory. Note that HF is CFI compliant flash, but it is not memory mapped, hence the need to replace all the memory accessors and read/write functions. The write function is entirely replaced to increase performance and is Spansion/AMD specific, since there is no known SIP with other HF from another vendor. Add the following two lines to board TCL file to bind the driver on R-Car Gen3 SoC using HyperFlash: set _FLASHNAME $_CHIPNAME.flash flash bank $_FLASHNAME rpchf 0x08000000 0x4000000 2 2 $_CHIPNAME.a57.0 Change-Id: Ie18729d017eeb46e1363333ffe002d010dfc5ead Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Reviewed-on: http://openocd.zylin.com/5149 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-02-06flash/nor: Export various functions from the CFI coreMarek Vasut2-26/+49
Export various functions needed by other driver, specifically the upcoming Renesas RPC HF driver. No functional change. Change-Id: I551258979a7221288fb4f4382f857db5cfe0b0de Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Reviewed-on: http://openocd.zylin.com/5148 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-01-29jtag: Fix jtag_reset fallbackLeonard Crestez1-1/+1
The fallback provided for the jtag_reset command always fails with a strange message: 'Error: invalid command name "de"' This is caused by incorrect quoting inside the warning message. Fixes: c07b774e8f49 ("jtag: replace command "jtag_reset" with "adapter [de]assert"") Change-Id: Icd47fca2b5a7b33474bfb0040e88193a0968f301 Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-on: http://openocd.zylin.com/5416 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-01-29tcl: replace the deprecated commands with "adapter ..."Antonio Borneo210-332/+332
Avoid annoying "deprecated" messages while running the scripts distributed with OpenOCD code. Change automatically created with commands sed -i 's/adapter_khz/adapter speed/g' $(find tcl/ -type f) sed -i 's/adapter_nsrst_delay/adapter srst delay/g' $(find tcl/ -type f) sed -i 's/adapter_nsrst_assert_width/adapter srst pulse_width/g' $(find tcl/ -type f) Minor indentation issue fixed manually in tcl/board/at91sam9g20-ek.cfg tcl/target/at91sam9260_ext_RAM_ext_flash.cfg Change-Id: I425fd56c0c88cd6b06124621306eeb89166dfe71 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5284 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-01-29doc: replace example command "interface" with "adapter driver"Antonio Borneo1-4/+4
Keep documentation consisted after commands renaming. Change-Id: I97b43887cae9d7c224b07e4ba0b7d04915a19fc4 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5285 Tested-by: jenkins Reviewed-by: Marc Schink <dev@zapb.de> Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-01-29tcl: replace command "interface" with "adapter driver"Antonio Borneo111-111/+111
Avoid annoying "deprecated" messages while running the scripts distributed with OpenOCD code. Change automatically created with command sed -i 's/^interface /adapter driver /' $(find tcl/ -type f) Change-Id: I2291dfb96e164beecbeb3366ce83f9df2ad6c197 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5283 Reviewed-by: Marc Schink <dev@zapb.de> Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-01-29openocd: fix minor inconsistencies after renaming "adapter" commandAntonio Borneo3-6/+6
Replace in the code any reference to the deprecated commands. Change-Id: I75d28064017d664990b4024967900f32e196230a Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5282 Tested-by: jenkins Reviewed-by: Marc Schink <dev@zapb.de> Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-01-29move ftdi_location deprecation helper to proper placeOleksij Rempel2-6/+5
Change-Id: I927d4e918acbf321aea1dd7a8de95fbaa8fbbbf0 Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-on: http://openocd.zylin.com/5278 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-01-29jtag: adapter: rework adapter related commandsOleksij Rempel3-89/+136
currently we have different types of same command group: - starting with adapter_* - starting with interface* - without adapter or interface prefix. Since interface name is already used, we can only use "adapter" command group by keeping old commands as well. Change-Id: Id0a1cb63a2ea6860c67ae1e7a3a06a37ddf464f4 Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-on: http://openocd.zylin.com/4774 Reviewed-by: Marc Schink <dev@zapb.de> Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-01-27flash/nor/stm32l4x: fix minor errors in flash write/async algoTomas Vanek2-12/+13
Fix comment of tested errors in asm src. List all relevant errors in FLASH_ERROR mask: FLASH_PROGERR was missing and any trial to re-program already programmed double word ended up in the error bit held uncleared and flash write permanetly repeating the error message until reset. Lock the bank also after unsuccesfull write_block run. Set async target algo block size to size of double word. Remove warning in case of write_block success. In case of error use LOG_ERROR instead of warning. Change-Id: Ibf6d5e306a4c2eaa43de67d636b4902c737f02f3 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5360 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
2020-01-27flash/nor/stm32l4x: use flash infrastructure to align writeTomas Vanek1-19/+8
The original code paded the write chunk with random bytes by overrunning the buffer. An user can easily regard the random bytes to be a programming error. Change-Id: Ib0f47b5bc406bc6a7c32f3d929bf324a17c7c1e1 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5359 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
2020-01-27tcl/board: Add config for STM32WB Nucleo boardMarc Schink1-0/+11
Change-Id: Ic29802306c706bcf3e261c60facd01d101c9e1ce Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/5358 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Ilya Kharin <akscram@gmail.com>
2020-01-27target/arm_cti: fix regression from Tcl_return_values seriesTomas Vanek1-20/+8
Since commit 7f260f5009a774f2d66b5f3037f8f595c6881d4d native OpenOCD command handlers should not directly use Jim_SetResult functions. The Tcl result of a native command is built as concatenation of command_print() strings and Jim_SetResult() is called after return of the command handler. Replace "wrong number of args" error messages (now not delivered to user) by simply return ERROR_COMMAND_SYNTAX_ERROR Change-Id: I40c1374a13859cefbdef68e0f1c13ab93538bd50 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5363 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
2020-01-27flash/nor/nrf5: Fix build error on OSXMarek Vasut1-1/+1
The chip->hwid is uint32_t , fix the print format. This was detected by TravisCI on OSX, where this triggers a build error. Change-Id: I776a7bb50e396c8fccc24500dec4750190da7982 Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Reviewed-on: http://openocd.zylin.com/5401 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Ilya Kharin <akscram@gmail.com>
2020-01-22jtag: drivers: xlnx-pcie-xvc: fix build after mergeAntonio Borneo2-9/+10
Commit [1] was submitted in gerrit well before the conflicting commit [2] get merged in master branch. While it was fine committing in master branch [1] alone, it should not be committed "as is" after [2]. Unfortunately gerrit did not complained committing [1] after [2]. The result is that master branch does not build anymore when the driver xlnx-pcie-xvc is enabled at configure time by the optional flag --enable-xlnx-pcie-xvc. Apply to the driver the required changes as in [2]. While there, remove the duplicated struct xlnx_pcie_xvc_transports and the struct field already implicitly initialized to zero. [1] ff6d0704ecd6 ("jtag: drivers: xlnx-pcie-xvc: Add support for Xilinx XVC/PCIe") [2] efd1d642220a ("adapter: switch from struct jtag_interface to adapter_driver") Change-Id: I5498479b802a231afbee1b845ae9775e1da7c728 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5402 Reviewed-by: Moritz Fischer <moritzf@google.com> Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2020-01-22flash/nor/sh_qspi: Add SH QSPI driverMarek Vasut7-0/+1308
Add driver for the SH QSPI controller. This SPI controller is often connected to the boot SPI NOR flash on R-Car Gen2 platforms. Add the following two lines to board TCL file to bind the driver on R-Car Gen2 SoC and make SRAM work area available: flash bank flash0 sh_qspi 0xe6b10000 0 0 0 ${_TARGETNAME}0 cs0 ${_TARGETNAME}0 configure -work-area-phys 0xe6300000 -work-area-virt 0xe6300000 -work-area-size 0x10000 -work-area-backup 0 To install mainline U-Boot on the board, use the following procedure: proc update_uboot {} { # SPL flash erase_sector 0 0x0 0x0 flash write_bank 0 /u-boot/spl/u-boot-spl.bin 0x0 # U-Boot flash erase_sector 0 0x5 0x6 flash write_bank 0 /u-boot/u-boot.img 0x140000 } Change-Id: Ief22f61e93bcabae37f6e371156dece6c4be3459 Signed-off-by: Marek Vasut <marek.vasut@gmail.com> --- V2: - Add Makefile and linker script for the SH QSPI IO algorithm - Include the algorithm code instead of hard-coding it Reviewed-on: http://openocd.zylin.com/5143 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-01-22jtag_libusb_bulk_read|write: return error code instead of sizeOleksij Rempel12-89/+186
A USB bulk write/read operation may fail with different errors: LIBUSB_ERROR_TIMEOUT if the transfer timed out (and populates transferred) LIBUSB_ERROR_PIPE if the endpoint halted LIBUSB_ERROR_OVERFLOW if the device offered more data, see Packets and overflows LIBUSB_ERROR_NO_DEVICE if the device has been disconnected another LIBUSB_ERROR code on other failures Current OpenOCD code is using the transfer size based error detection. Which may not always work. For example for LIBUSB_ERROR_OVERFLOW as libusb documentation says: "Problems may occur if the device attempts to send more data than can fit in the buffer. libusb reports LIBUSB_TRANSFER_OVERFLOW for this condition but other behaviour is largely undefined: actual_length may or may not be accurate, the chunk of data that can fit in the buffer (before overflow) may or may not have been transferred." This patch is refactoring code to use actual error return value for error detection instead of size. Change-Id: Iec0798438ca7b5c76e2e2912af21d9aa76ee0217 Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-on: http://openocd.zylin.com/4590 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-01-20mips_ejtag: there is no DCR.MIPS64 bitJiri Kastner2-2/+2
available revisions (2.60, 3.10, 5.06 and 6.10) of MD00047 (EJTAG specification), have only in IMPCODE MIPS32/MIPS64 bit/flag. Change-Id: If9191b6ced760c59bb7551bb041cd72b0a060bb1 Signed-off-by: Jiri Kastner <cz172638@gmail.com> Reviewed-on: http://openocd.zylin.com/4628 Reviewed-by: Oleksij Rempel <linux@rempel-privat.de> Tested-by: jenkins
2020-01-17jtag: drivers: xlnx-pcie-xvc: Add support for Xilinx XVC/PCIeMoritz Fischer5-1/+532
Add support for Xilinx Virtual Cable over PCIe JTAG controller. It is commonly used in Xilinx based PCI Express designs with JTAG IP in the FPGA fabric. Access to the JTAG registers happens via the PCI Express extended configuration space. This can be used to debug soft-cores instantiated in the FPGA fabric. The clang static checker doesn't find any new problems with this change. Change-Id: Ib12ede0d1f26dacfda808d5e05b947b640c5bde7 Signed-off-by: Moritz Fischer <moritzf@google.com> Reviewed-on: http://openocd.zylin.com/5314 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Marex Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-01-16flash/nor: Rename flash_address() to cfi_flash_address()Marek Vasut1-51/+51
This is a preparatory change, align the function name with the rest of the API, no functional change. Change-Id: I6a810d2a54edcd13ad9a87d24a7334802c41623b Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Reviewed-on: http://openocd.zylin.com/5391 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-01-16flash/nor: Rename get_cfi_info() to cfi_get_info()Marek Vasut1-2/+2
This is a preparatory change, align the function name with the rest of the API, no functional change. Change-Id: Ib967520f027b03eb1792b36ede52335df8e23941 Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Reviewed-on: http://openocd.zylin.com/5390 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-01-16flash/nor: Allow CFI memory read/write functions be overridenMarek Vasut2-4/+20
Add possibility to supply custom CFI memory accessors via cfi_info and override the default memory-mapped ones. Change-Id: I1b6bc1db69fc33e8cdef96c41742c40e6d8917e9 Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Reviewed-on: http://openocd.zylin.com/5147 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>