aboutsummaryrefslogtreecommitdiff
path: root/src/flash
AgeCommit message (Collapse)AuthorFilesLines
2023-10-27flash/nor/spi: add guide to select proper erase cmdTomas Vanek1-4/+21
Extend comments in flash_devices array. Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Change-Id: I7ab85a2d37803b6bc9fc7a2a91ae2effb6ec288d Reviewed-on: https://review.openocd.org/c/openocd/+/7925 Tested-by: jenkins Reviewed-by: Andreas Bolsch <hyphen0break@gmail.com>
2023-09-23jtagspi/pld: add interface to get support from pld driversDaniel Anselmi1-30/+89
Jtagspi is using a proxy bitstream to "connect" JTAG to the SPI pins. This is not possible with all FPGA vendors/families. In this cases a dedicated procedure is needed to establish such a connection. This patch adds a jtagspi-mode for these cases. It also adds the needed interfaces to jtagspi and the pld-driver so the driver can select the mode and provide the necessary procedures. For the cases where a proxy bitstream is needed, the pld driver will select the mode and provide instruction code needed in this case. Change-Id: I9563f26739589157b39a3664a73d91152cd13f77 Signed-off-by: Daniel Anselmi <danselmi@gmx.ch> Reviewed-on: https://review.openocd.org/c/openocd/+/7822 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-09-23flash/nor: remove useless bank->next = NULLTomas Vanek4-5/+0
struct flash_bank must be zeroed anyway, calloc() is always used. Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Change-Id: I7ab3b9c66f99688c6095a0a547a05448c9e37d68 Reviewed-on: https://review.openocd.org/c/openocd/+/7885 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-09-23flash/nor/at91sam7: fix flash bank allocationTomas Vanek1-4/+26
at91sam7 flash driver allocates a flash bank based on detected flash structure. Use calloc() instead of malloc() - struct flash_bank has to be zeroed. While on this: Return error in case of struct flash_bank or driver_priv allocation fail. Set default_padded_value and erased_value. Use strdup() on bank->name, pointer is freed in flash_free_all_banks() Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Change-Id: Id890496bfbadb7970ef583256aa4f30a7bff832f Reviewed-on: https://review.openocd.org/c/openocd/+/7884 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-09-19flash/stm32l4x: support STM32WBA5xx devicesTarek BOCHKATI2-0/+26
STM32WBA5x have a single bank flash up to 1MB Change-Id: I3d720e202f0fdd89ecd8aa7224653ca5a7ae187b Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@st.com> Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7694 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-09-17flash: npcx: fix memory leak in npcx_flash_bank_commandAntonio Borneo1-0/+1
Recent commit 62f76b216930 ("flash/nor: add support for Nuvoton NPCX4/K3 series flash") introduces a memory leak for a missing free() on early return for an error. Add the free() on the return path on error. Change-Id: Ica8568a986802e23df2ab7bed4e8cc4bbb6305a5 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Fixes: 62f76b216930 ("flash/nor: add support for Nuvoton NPCX4/K3 series flash") Reviewed-on: https://review.openocd.org/c/openocd/+/7894 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-09-08flash/nor: add support for Nuvoton NPCX4/K3 series flashLuca Hung1-15/+33
Added NPCX flash driver to support the Nuvoton NPCX4/K3 series microcontrollers. Add config file for these series. Change-Id: I0b6e128fa51146b561f422e23a98260594b1f138 Signed-off-by: Luca Hung <YCHUNG0@nuvoton.com> Signed-off-by: Mulin CHao <mlchao@nuvoton.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7794 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-08-26target/cortex_m: check core implementor fieldKarl Palsson4-4/+4
Presently, we only look at the Part Number field of the CPUID, and completely ignore the Implmentor field, simply assuming it to be ARM. Parts have since been found, with different implementors, that use overlapping part numbers, causing detection to fail. Expand the "part number" field to be a full implementor+part number, excluding the revision/patch fields, to make checking more reliable. Change-Id: Id81774f829104f57a0c105320d0d2e479fa01522 Signed-off-by: Karl Palsson <karlp@tweak.au> Reviewed-on: https://review.openocd.org/c/openocd/+/7845 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-08-26efm32: drop unnecessary and incomplete checksKarl Palsson1-12/+0
There's really no reason to try and add an extra layer of cpu verification here. Change-Id: If8c4aa03754607be6c089f514ae300b09b067ffa Signed-off-by: Karl Palsson <karlp@tweak.au> Reviewed-on: https://review.openocd.org/c/openocd/+/7844 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-08-12flash/nor/spi: Improve erase performance on zd25q16Nikolay Dimitrov1-1/+1
Use blocks (64 KiB) instead of sectors (4 KiB) when erasing the zd25Q16 SPI flash memory (thanks to Tomas Vanek!) Change-Id: I969a69ad35f51b84eb3e11b93f0d79db3e98613a Signed-off-by: Nikolay Dimitrov <nikolay.dimitrov@retrohub.org> Reviewed-on: https://review.openocd.org/c/openocd/+/7850 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2023-08-12flash/nor/spi: add zetta zd25q16Nikolay Dimitrov1-0/+1
* Zetta 16 Mbit (2 MiB) SPI flash * Tested on Olimex RP2040-PICO30 and Neo6502 boards Change-Id: I02224dd7a72a9b72f01b31edbd958daa23f28956 Signed-off-by: Nikolay Dimitrov <nikolay.dimitrov@retrohub.org> Reviewed-on: https://review.openocd.org/c/openocd/+/7849 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2023-07-14flash/nor/stm32l4x: Add revision 'V' for STM32L4R/S devicesMarc Schink1-0/+1
See section 57.6.1 in RM0432. Change-Id: Ic4977aee74d1838f420c1d9ff19925d09f8f6e2b Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/7763 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-06-10flash/nor: add support for NXP QN908xiosabi4-0/+1200
This patch adds support for the NXP QN908x family of Bluetooth microcontrollers, such as the QN9080. This chip features a Cortex-M4F with 512 KiB of flash on all the available versions, although the documentation suggests that there might be 256 kB versions as well. The initial support allows to read, erase and write the whole user flash area. Three new sub-commands under the new "qn908x" command are added in this patch as well: disable_wdog to disabled the watchdog, mass_erase to perform a mass erase and allow_brick to allow programming images that disable the SWD interface. Disabling the watchdog is required after a "reset halt" in order to run the CRC algorithm from RAM when verifying the chip. However, this is not done automatically on probing or other initialization since disabling the watchdog might interfere with debugging real applications. The "mass_erase" command allows to erase the whole flash without probing it, since in some scenarios the chip can be locked such that no flash or ram can be accessed from the SWD interface, allowing only to run a mass_erase to be able to flash the program. The flashing process allows to compute a checksum, similar to the lpc2000 driver "calc_checksum" but done over a different region of the memory. This checksum is required to be present for the QN908x bootloader ROM to boot, and otherwise is useless. As with the lpc2000 design, verification when using "calc_checksum" is expected to fail if the checksum was not valid in the image being verified. This was manually tested on a QN9080, including the scan-view, AddressSanitizer/UBSan and test coverage configurations. Change-Id: Ibd6d8f3608654294795085fcaaffb448b77cc58b Co-developed-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de> Signed-off-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de> Signed-off-by: iosabi <iosabi@protonmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/5584 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-06-02flash: jtagspi: fix clang build warningAntonio Borneo1-30/+22
Clang is unable to fully track the content of the array write_buffer[] and incorrectly complains that it could contain some uninitialized value. To help clang to track the execution flow, rewrite the handling of the buffer by using simpler indexing and by moving away cmd_byte from the first buffer's element to the variable cmd_byte. While there: - fix the error codes returned while parsing the command line and - use directly command_print_sameline() instead of passing through intermediate buffers. Change-Id: I1969e896887ea3a4abebee057cc04c03005fa57c Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7718 Tested-by: jenkins
2023-06-02flash: psoc4: fix clang errorAntonio Borneo1-1/+1
Clang 15.0.7 complains about snprintf output truncation due to output between 13 and 22 bytes into a destination of size 20. Increase the size of the buffer. Change-Id: I0369255ca1bc02a0cf494f765e91a608c960a0d6 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7717 Tested-by: jenkins
2023-05-27flash/jtagspi: sending command and setting parameters without probing.Daniel Anselmi3-12/+34
Change-Id: I6b9d90265ca5112b9ab2aae97bb4c6cf3ebc4112 Signed-off-by: Daniel Anselmi <danselmi@gmx.ch> Reviewed-on: https://review.openocd.org/c/openocd/+/7432 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2023-05-27target: use unsigned int for timeout_msAntonio Borneo1-2/+2
Change the prototype of functions: - target_run_algorithm() - target_wait_algorithm() - target_wait_state() - struct target_type::run_algorithm() - struct target_type::wait_algorithm() to use unsigned int for timeout_ms instead of int. Change accordingly the variables passed as parameter. Change-Id: I0b8d6e691bb3c749eeb2911dc5a86c38cc0cb65d Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7562 Tested-by: jenkins
2023-05-25flash/nor/stm32f2x: Show error message when unprotecting OTPMatthijs Kooijman1-1/+3
Trying to disable OTP write protection by running e.g. `flash protect 1 0 1 off` would already be rejected with an error code, but that would result in a generic "failed setting protection for blocks 0 to 1" message. Now a more specific error message is also printed, telling the user why it failed. Change-Id: I6d4974eb0bcd23a0a6cf68ff955d9e59b8b1b06a Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl> Reviewed-on: https://review.openocd.org/c/openocd/+/7615 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-05-25flash/nor/stm32f2x: Fix typos in log messagesMatthijs Kooijman1-2/+2
Change-Id: I0f27e1c64972a58ac146c391761008cdca610afe Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl> Reviewed-on: https://review.openocd.org/c/openocd/+/7614 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2023-05-24flash/stm32l4x: support STM32C0x devicesTarek BOCHKATI2-1/+44
this new STM32 series family introduces 2 devices: STM32C011xx (0x443) and STM32C031xx (0x453) both devices have 32 Kbytes single flash bank. Change-Id: I4e890789e44e3b174c0e9c0e1068383ecdbb865f Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6874 Reviewed-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp> Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-05-18flash/jtagspi: handle error return values where neededDaniel Anselmi1-2/+2
Change-Id: Id46c2799f954fb1d4353f652ba3115796c88936d Signed-off-by: Daniel Anselmi <danselmi@gmx.ch> Reviewed-on: https://review.openocd.org/c/openocd/+/7422 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2023-05-18flash: nand: move in include file the declaration of 'nand_devices'Antonio Borneo2-3/+1
The pointer nand_devices is used in two file. Move the extern prototype in code.h Detected through 'sparse' tool. Change-Id: I7237359fd1a008770a624725cd0b3d8632b4166e Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7674 Tested-by: jenkins
2023-05-18nand: declare exported function in core.hAntonio Borneo2-2/+2
Don't use 'extern' in a C file, but declare the exported function in a H file. This helps validating the function prototype across declaration and use. Detected through 'sparse' tool. Change-Id: I2c22b084fb513f4b3b1b1db96dfbc8fa4bfe7238 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7666 Tested-by: jenkins
2023-05-18nor: move in driver.h the flash_driver's declarationAntonio Borneo8-80/+74
The static analyser 'sparse' complains, while compiling a nor driver, that the struct flash_driver is declared in the file as non static, but it is not exposed through an include file. The message is: warning: symbol 'XXX' was not declared. Should it be static? Move the list of flash_driver's declaration in driver.h Fix some incorrect non-const declaration and remove redundant forward declarations. Change-Id: I5e41d094307aac4a57dfa9a70496ff3cf180bd92 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7662 Tested-by: jenkins
2023-05-18nand: move in driver.h the nand_flash_controller's declarationAntonio Borneo2-20/+15
The static analyser 'sparse' complains, while compiling a nand driver, that the struct nand_flash_controller is declared in the file as non static, but it is not exposed through an include file. The message is: warning: symbol 'XXX' was not declared. Should it be static? Move the list of nand_flash_controller's declaration in driver.h While there, drop the unused/commented boundary scan controller. Change-Id: I7dc32cef55be13ba537abe0f4c47b135d837126c Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7661 Tested-by: jenkins
2023-05-05flash: with pointers, use NULL instead of 0Antonio Borneo3-3/+3
Don't compare pointers with 0, use NULL when needed. Don't pass 0 ad pointer argument, pass NULL. Detected through 'sparse' tool. Change-Id: I118554fffde41c94cea9e1201ea941ff3c1ee762 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7595 Tested-by: jenkins
2023-05-05flash: nor: add static to local symbolsAntonio Borneo2-3/+3
Add static type to symbols that are not used elsewhere. Detected through 'sparse' tool. Change-Id: I2bdac5d2b06a6dbed5c27bfdb1cf36eee90ad823 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7594 Tested-by: jenkins
2023-05-05flash: nor: use 'ULL' suffix for long constantsAntonio Borneo2-11/+11
On 32 bit hosts, gcc should consider constants without suffix as 32 bits values. Adding a cast to convert it to 64 bits should not be enough. Use the suffix 'ULL' to guarantee it is a 64 bit. Detected through 'sparse' tool. Change-Id: If6be35bd3cbbc7c3a83e0da1407e611f07ff6e06 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7593 Tested-by: jenkins
2023-03-28flash/nor: missing fileio_close.panciyan1-0/+1
If the file read abnormally, need to close it which was opened before. Signed-off-by: panciyan <panciyan@eswincomputing.com> Change-Id: I6142f154741dcd38088b7add2793219ee4dd2ae9 Reviewed-on: https://review.openocd.org/c/openocd/+/7546 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-03-25flash: nor: rewrite command 'flash list' as COMMAND_HANDLERAntonio Borneo1-30/+18
The mixed use of jim commands and OpenOCD commands is error prone due to handling of errors through JIM_xx and ERROR_yy. Rewrite the jim command 'flash list' as OpenOCD command. While there: - format in a human readable way the output dictionary list, while preserving the structure of its TCL data; - add the mandatory 'usage' field. Change-Id: I1ee69870d3ab3c1cfc46cd2b8ec03de6b2300bd6 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7486 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2023-03-18flash/nor/at91samd: add missing SAMR34/35 part numbersAndrew Lalaev1-0/+4
All DIDs are taken from "SAM R34/R35 Errata Sheet" (DS80000834A). Signed-off-by: Andrew Lalaev <andrey.lalaev@gmail.com> Change-Id: Ie35f58e61bb02919c0676c91938c90192481d995 Reviewed-on: https://review.openocd.org/c/openocd/+/7521 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-03-18flash/nor/at91samd: fix RAM size for SAMR34/35Andrew Lalaev1-2/+2
According to the datasheets these MCUs have 40Kb RAM. Signed-off-by: Andrew Lalaev <andrey.lalaev@gmail.com> Change-Id: I52b8a0c86035bccd6f3c1a478bb2e558bca4ae86 Reviewed-on: https://review.openocd.org/c/openocd/+/7520 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-02-18flash/nor/spi: add 25pe{10/20/40/80/16}Daniel Anselmi1-0/+5
Change-Id: Ic5660bff83b8636ef397482a3313971ecdff72c0 Signed-off-by: Daniel Anselmi <danselmi@gmx.ch> Reviewed-on: https://review.openocd.org/c/openocd/+/7416 Tested-by: jenkins Reviewed-by: Andreas Bolsch <hyphen0break@gmail.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-02-12new SPI memory devices, continuation code for manufacturer idAndreas Bolsch1-9/+64
A bunch of new SPI flash (Adesto, Cypress, XTX Tech, mainly octal) IDs and SPI FRAM (Infineon) IDs added. Backward compatible change of ID interpretation: The previously unused 4th byte now acts as continuation code (0x7F) count for manufacturer id, cf. JEDEC JEP106BC. Currently this affects only some recent octal flash and FRAM devices, which are only supported by stmqspi and cmspi flash drivers. Change-Id: Ibdcac81a84c636dc68439add4461b959df429bca Signed-off-by: Andreas Bolsch <hyphen0break@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6929 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-02-03flash/nor/stm32l4x: Add revision 'Z' for STM32L552/562 devicesMarc Schink1-1/+1
Change-Id: Icc6058ef1f43e969a2a9baadfaf382ac820a7b76 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/7468 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-02-03flash/nor/spi: Add some zbit flash chips.Daniel Serpell1-0/+7
I have a RP2020 board from aliexpress that uses the ZB25VQ32 flash, this allows openocd to correctly identify it with the full flash size. I also added other models, the datasheets can be found at: Link: https://datasheet.lcsc.com/lcsc/2203210916_Zbit-Semi-ZB25VQ16ASIG_C2982491.pdf Link: https://datasheet.lcsc.com/lcsc/2003141132_Zbit-Semi-ZB25VQ32BSIG_C495744.pdf Link: https://datasheet.lcsc.com/lcsc/2003141132_Zbit-Semi-ZB25VQ64ASIG_C495745.pdf Link: https://datasheet.lcsc.com/lcsc/2006151421_Zbit-Semi-ZB25VQ128ASIG_C609616.pdf As noted by Andreas Bolsch, the devices supporting QSPI have different ID in QPI mode than SPI, so two entries are needed in the table for each one. Use 0x0B as qread command, as this does not need the dummy M7-0 parameters. Signed-off-by: Daniel Serpell <daniel.serpell@gmail.com> Change-Id: Id99187b1963b02ac1a786b66bb352f5f48ed0ac2 Reviewed-on: https://review.openocd.org/c/openocd/+/7445 Reviewed-by: Andreas Bolsch <hyphen0break@gmail.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2023-01-21flash/nor/psoc4: drop jtag_poll_mask() from flash writeTomas Vanek1-5/+0
Polling the target makes no harm during PSoC 4 flash write in the current OpenOCD code. Don't mask it. Change-Id: I6625ded0162ee3a96b92188844d0d2d6c30101c2 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/7162 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-15flash/nor/stm32l4x: Add revision 'X' and 'C' for STM32U575/585 devicesMarc Schink1-0/+1
Change-Id: I4d950dc0a1421036418f2e5c1f0ed8eca86efc1a Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/7390 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-15flash/nor, contrib/loaders: move numicro M0 write assembly to contrib/loadersJian-Hong Pan1-57/+2
Simply move numicro M0 flash write assembly to contrib/loaders. Also, modify corresponding Makefile and generated numicro_m0.inc. To make the path more general, this patch rename the path "contrib/loaders/flash/numicro_m4" to "contrib/loaders/flash/numicro" as well. Signed-off-by: Jian-Hong Pan <chienhung.pan@gmail.com> Change-Id: I9adea24c2b3c97319a9b015cf50257f3d131dc26 Reviewed-on: https://review.openocd.org/c/openocd/+/7346 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-15flash/nor, contrib/loaders: move numicro M4 write assembly to contrib/loadersJian-Hong Pan1-56/+1
Simply move numicro M4 flash write assembly to contrib/loaders. Also, add corresponding Makefile and generated numicro_m4.inc. Signed-off-by: Jian-Hong Pan <chienhung.pan@gmail.com> Change-Id: I22b8be0a245857335b11bd0b538db415fc34748d Reviewed-on: https://review.openocd.org/c/openocd/+/7343 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-15flash: support Nuvoton M541 & NUC442/472 seriesZale Yu1-81/+253
This patch is picked from the flash part of OpenOCD-Nuvoton's commit ("flash: supported Nuvoton M4 series. jtag: Used HW reset instead of auto reset. tcl: added a configuration file for Nuvoton M4 series.") [1] to support flashing Nuvoton's Cortex-M4 chips: M541 & NUC442/472 series. The code comes from the commit basically. Jian-Hong Pan tweaked for the compatibility with current OpenOCD. So, leave the author as Zale Yu. [1]: https://github.com/OpenNuvoton/OpenOCD-Nuvoton/commit/c2d5b8bfc705 Signed-off-by: Zale Yu <cyyu@nuvoton.com> Signed-off-by: Jian-Hong Pan <chienhung.pan@gmail.com> Change-Id: I9dc69eccb851df14c1b0ce2f619d7b3da0aa92aa Reviewed-on: https://review.openocd.org/c/openocd/+/7329 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-15flash/nor/numicro: reorder the parts listZale Yu1-998/+349
This patch is picked from the flash part of OpenOCD-Nuvoton's commit ("flash: supported Nuvoton M4 series. jtag: Used HW reset instead of auto reset. tcl: added a configuration file for Nuvoton M4 series.") [1] It reorders Nuvoton MCU part list and spreads out the way to define the banks' base address & size of the parts. The code comes from the commit basically. Jian-Hong Pan tweaked for the compatibility with current OpenOCD. So, leave the author as Zale Yu. [1]: https://github.com/OpenNuvoton/OpenOCD-Nuvoton/commit/c2d5b8bfc705 Signed-off-by: Zale Yu <cyyu@nuvoton.com> Signed-off-by: Jian-Hong Pan <chienhung.pan@gmail.com> Change-Id: I1f21f54dfdf53e5b8ea04d803347d1dbc8c321a0 Reviewed-on: https://review.openocd.org/c/openocd/+/7339 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-15flash/stm32l4x: avoid multiple assignmentsTarek BOCHKATI1-1/+2
Change-Id: I6d8e0fbfa7e05f26295fc22733c65c11f7460b51 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@st.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7282 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2023-01-15flash/nor/rp2040: make SPI flash ID detection optionalTomas Vanek1-22/+33
Do not read ID from SPI flash and suppress autodetection if non-zero flash bank size is configured. Change-Id: Idcf9ee6ca17f9fa89964a60da7bf11e47b4af5e7 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/7241 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-15flash/nor/spi: Add issi is25lq040b to device listFawaz Tirmizi1-0/+1
The HiFive Inventor uses this flash chip, so adding it will allow for openocd to be used to program it. These values were taken from the chip's documentation. Signed-off-by: Fawaz Tirmizi <fawaz@rivosinc.com> Change-Id: I15c9d35f99d4500f73134cdc2d1b9ab6279b491c Reviewed-on: https://review.openocd.org/c/openocd/+/7135 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-15flash/nor/avrf: add ATmega32U4 supportKyle Schwarz1-0/+1
Add new chip info and tcl target Change-Id: Ib9d33d1b145a8659857b7a6cc9c5acba047f41d1 Signed-off-by: Kyle Schwarz <zeranoe@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7081 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-12-17at91samd: wait for nvm readyDan Stahlke1-1/+25
Flashing a SAMD21J17D was failing during NVM erase. The samd21 datasheet specifies that one cause of error conditions is executing an NVM command while the previous command is still running. The solution is to wait for INTFLAG.READY after a command is issued. SAMD21J17A was not exhibiting this problem. Perhaps the later silicon revision has slower NVM erase times. Signed-off-by: Dan Stahlke <dan@stahlke.org> Change-Id: I19745dae4d3fc6e3a7611dcac628e067cb41e0f0 Reviewed-on: https://review.openocd.org/c/openocd/+/7391 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2022-12-03flash: lpc2900: fix clang error 'dead assignment'Antonio Borneo1-2/+2
The variable retval is assigned a value that is never used. Scan-build reports: Although the value stored to 'retval' is used in the enclosing expression, the value is never actually read from 'retval'. Drop the dead assignment. Change-Id: I11588dee748a55d52aa7f35bc1967b7df55af7fc Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7379 Tested-by: jenkins
2022-11-28flash/nor/stm32lx: Add revision '1, X' for Cat.2 devicesMarc Schink1-1/+1
Change-Id: I0ff1e2102175ee952b066b325c9acbcb598b3af7 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/7378 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-11-15Fix for segfault and some clang reported problems in stmqspiAndreas Bolsch1-16/+14
Change-Id: Id003adb574085cdd603cc13aeb6f2efec73593f1 Signed-off-by: Andreas Bolsch <hyphen0break@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7345 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>