aboutsummaryrefslogtreecommitdiff
path: root/src/flash
AgeCommit message (Collapse)AuthorFilesLines
2024-06-25Merge up to ad87fbd1cf28760795c4e18f3318a2d720e5a8a6 from upstreamEvgeniy Naydanov12-181/+431
Conflicts: * `doc/openocd.texi`: due to d382c95d57c0ad9ed2dcc83c95404babb7647708, resolved by selecting the upstream version. * `src/server/gdb_server.c`: between 944fe66f104e356c5fcd2b5c25200cebef9b389c and 92e8823ebdb6d01b41bb5d79af49501d525acd1d. Resolved by adopting the use of `LOG_TARGET_*`. * `src/target/target.c`: between 639e68a621b7ae8c4a296ca7e45b47075268fded and c5358c84ad0d3e7497498e0457cec7785f72910a, selected the version from `riscv-openocd`. Change-Id: Ic1327f25e147945e0ec82947a82452501e8ee5de
2024-06-23Remove other '_s' suffix from structsAntonio Borneo3-10/+10
Most of the work is already done by [1]. Remove few more '_s' suffix and also fix some comment referring to the old name of the struct. Link: https://review.openocd.org/c/openocd/+/8340 Change-Id: Ifddc401c3b05e62ece3aa7926af1e78f0c4a671e Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8341 Reviewed-by: zapb <dev@zapb.de> Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2024-06-15fix GCC's `-Wcalloc-transposed-args` warningEvgeniy Naydanov7-9/+9
GCC 14.1.0 warns about calls to `calloc()` with element size as the first argument. Link: https://gcc.gnu.org/onlinedocs/gcc-14.1.0/gcc/Warning-Options.html#index-Wcalloc-transposed-args Change-Id: I7d44a74a003ee6ec49d165f91727972478214587 Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8301 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2024-06-08flash/nor/nrf5: handle ERROR_WAIT during nRF91 flash eraseTomas Vanek1-0/+22
Erase is initiated by write to a flash address. Due to the silicon errata of nRF91 the write stalls the bus until the page erase is finished (takes up to 87ms). If the adapter does not handle SWD WAIT properly, the following read in nrf5_wait_for_nvmc() returns ERROR_WAIT. Wait for fixed time before accessing AP. Not nice, but the only working solution until all adapters handle SWD WAIT. If the fixed wait does not suffice, continue the wait loop after a delay. It makes some unnecessary noise however erase works. Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Change-Id: I63faf38dad79440a0117ed79930442bd2843c6db Reviewed-on: https://review.openocd.org/c/openocd/+/8115 Reviewed-by: Tomáš Beneš <tomas@dronetag.cz> Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-06-08flash/nor/nrf5: show proper SoC type on newer nRF91 devicesTomas Vanek1-4/+38
Since nRF9160 Product Specification v2.1 the new UICR SIPINFO fields should be preferred over UICR INFO. Tested on nRF9161. Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Change-Id: Ib8005b3b6292aa20fa83c1dcebd2de27df58b661 Reviewed-on: https://review.openocd.org/c/openocd/+/8114 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-06-08flash/nor/nrf5: add basic nRF53 and nRF91 supportTomas Vanek1-33/+174
Probes all flash and UICR areas. Flash erase and write tested. On nRF53 mass erase works on the application core flash bank only. The Tcl script nrf53_recover can serve as the workaround on the network core. TODO: mass erase of the nRF53 network core flash. Some ideas taken from [1] and [2]. Change-Id: I8e27a780f4d82bcabf029f79b87ac46cf6a531c7 Link: [1] 7404: flash: nor: add support for Nordic nRF9160 | https://review.openocd.org/c/openocd/+/7404 Link: [2] 8062: flash: nor: add support for Nordic nRF9160 | https://review.openocd.org/c/openocd/+/8062 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/8112 Reviewed-by: Tomáš Beneš <tomas@dronetag.cz> Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-06-08flash/nor/nrf5: make flash erase little fasterTomas Vanek1-50/+35
Enable and disable erase mode only once instead of toggling it for each sector. Refactor to decrease the number of call levels. Change-Id: Ie546a4fc24da0eea2753a2bebaa63d941ef7aa1d Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/8111 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-06-08flash/nor/nrf5: introduce address mapsTomas Vanek1-85/+152
Preparatory change before extending support to nRF53 and 91. While on it, rename nRF51 and 52 specific routines and constants. Change-Id: I46bc496cef5cbde46d6755a4b908c875351f6612 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/8110 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-06-08flash/nor/tcl: Fix memory leak of flash bank nameMarc Schink1-0/+1
Change-Id: I54cd1ee479a0570ae849a71be47c82eebd1ae454 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/8303 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2024-05-30Merge up to 437dde701c13e707e5fd912ef6403e09052e4d9b from upstreamEvgeniy Naydanov1-1/+0
Conflict in src/rtos/FreeRTOS.c due to fbea7d5d38d0dcbdd71cb574da9bd12c78b568cf -- resolved by replacing `target->type->name` with a call to `target_type_name()`. Change-Id: I56702c6133894458903de7a4d764903004aa8b86
2024-05-26openocd: drop include of target_type.hAntonio Borneo1-1/+0
Few files include target_type.h even if it is not needed. Drop the include. Other files access directly to target type's name instead of using the proper API target_type_name(). Use the API and drop the include. Change-Id: I86c0e0bbad51db93500c0efa27b7d6f1a67a02c2 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8260 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2024-04-27Merge up to 04154af5d6cd5fe76a2583778379bdacb5aa6fb0 from upstreamEvgeniy Naydanov4-0/+436
Change-Id: I84c1566472e5416bc2a71afa5adaf63c6c7a4a75
2024-04-01flash/nor/eneispif: support ENE KB1200 ispi flashSteven Chang4-0/+436
Change-Id: I03bccceb1956ee121e6a3728b7d647ef1262fa23 Signed-off-by: Steven Chang <steven@ene.com.tw> Reviewed-on: https://review.openocd.org/c/openocd/+/8136 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2024-03-28Merge up to a35e254c5383008cdacf7838a777f7f17af5eeb1 from upstreamEvgeniy Naydanov1-246/+86
Checkpatch-ignore: MACRO_ARG_REUSE, MACRO_ARG_PRECEDENCE Change-Id: Icd10f44d162054f8f32019a579ccbdda2cee7a91
2024-03-10flash/nor/nrf5: drop useless for cycle conditionTomas Vanek1-1/+1
Commit [1] added a break on error to the nrf5_erase() sector loop and the checking of the res value became useless in the for loop condition. Removing nrf5_get_probed_chip_if_halted() later in [2] dropped res initialization and clang static analyser complains "The left operand of '==' is a garbage value" Drop the useless test! Fixes: [1] commit 491636c8b832 ("flash/nor/nrf5: check protection before flash erase/write on nRF51") Fixes: [2] commit 2db325f5395f ("flash/nor/nrf5: drop nrf5_get_probed_chip_if_halted()") Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Change-Id: Ife6071c509719f8d7dc312fe9a780bdcf2575f69 Reviewed-on: https://review.openocd.org/c/openocd/+/8174 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-03-09flash/nor/nrf5: use BIT() instead of << operatorTomas Vanek1-4/+5
for features flags. Change-Id: I8bff0f5fac41c50180c847f36c6d2a075eca32ca Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/8109 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2024-03-09flash/nor/nrf5: drop nrf5 info commandTomas Vanek1-166/+0
The command substantially complicates support of nRF53/91 series. It was not even properly ported to nRF52. The informative value is disputable. Who wants to see e.g. override trim values for radio or unique device ID? Drop it and simplify the driver. Change-Id: Ia7fb20ce2ebf16065705c5d18deaf934e58db426 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/8108 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-03-09flash/nor/nrf5: drop nrf5_get_probed_chip_if_halted()Tomas Vanek1-44/+53
nrf5_get_probed_chip_if_halted() was somewhat bizarre combination of functions: - test if the target is halted is appropriate for flash erase/write only, certainly not for getting chip info - getting chip pointer takes place more frequently and using one temporary variable for dereference makes no harm - probing chip is useless at all as the flash infrastructure always calls auto_probe() before entering a flash operation Replace the function by ordinary and readable code. Change-Id: Ic31f4e33d8b7b36687be3f40bfd0fe913d17b75f Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/8107 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-03-09flash/nor/nrf5: add missing device typesTomas Vanek1-0/+4
from nRF52 family. Change-Id: I6d2b4586700bb4014c0b77dbf4ea26d1b5dc9715 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/8106 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2024-03-09flash/nor/nrf5: add missing package codesTomas Vanek1-4/+9
from Product Specification of nRF52805, 810, 811 820, 833 and 840. While on it, rename the table to make sure the codes are valid for nRF52 series only. Change-Id: Id8f78fd214c5d345d1769378ae546a6be5a183ba Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/8105 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-03-09flash/nor/nrf5, target/nrf51: deprecate nrf51 flash driverTomas Vanek1-0/+3
Use the newer driver name 'nrf5' instead. While on it set the unused parameters of flash bank creation to zero. While on it remove 2 empty comments. Change-Id: I9cf0eadc5b696e6c8b7e6aec0ea3345967523e87 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/8103 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2024-03-09flash/nor/nrf5: drop unused part of HWIDs tableTomas Vanek1-32/+16
While on it update table comment and drop not working URLs. Change-Id: I9e21c72aa75a908c644460e43c148d3240c49b2d Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/8102 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2024-03-07Merge up to 07141132a7d787005c0829618a60b4a842be7847 from upstreamEvgeniy Naydanov1-3/+3
Change-Id: Ibca0c8093e2983e1ee199f79ed777f5136794195
2024-02-15portability fix: Switch binary literals to hexSevan Janiyan1-3/+3
Allows build with legacy toolchains which do not support C23 nor GCC extension for binary literals. Change-Id: I742d3a8a86bf16f81421d11c59d3cb155ee17aed Signed-off-by: Sevan Janiyan <venture37@geeklan.co.uk> Reviewed-on: https://review.openocd.org/c/openocd/+/8123 Tested-by: jenkins Reviewed-by: Jörg Wunsch <openocd@uriah.heep.sax.de> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2024-01-10Merge commit 'adcc8ef87bc1ed47c95f1f2d23072b2b916e1555' into en-sc/from_upstreamEvgeniy Naydanov2-17/+244
Change-Id: I6a718561985acf398ee47cec95c6ee6e24b9c9b7
2024-01-06flash/nor/kinetis: add support for NXP S32K seriesDavid Vidrie Leon1-17/+243
S32K General-Purpose Microcontrollers Scalable, low-power Arm® Cortex®-M series-based microcontrollers AEC-Q100 qualified with advanced safety and security and software support for industrial and automotive ASIL B/D applications in body, zone control, and electrification. Change-Id: I4143258535437c18b81802436267bfd561de9d31 Signed-off-by: David Vidrie Leon <davidvidrie@geotab.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8012 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2023-12-30flash/nor/stm32f1x: Add support for Geehy APM32F0 seriesMarc Schink1-0/+1
Tested with APM32F030C8T. Change-Id: I63cd8b66424135dae481a96ba560e6f0b1f9544e Suggested-by: Christian U <info@cu-tec.de> Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/8014 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-12-22Merge commit '16e9b9c44fa62ea6eec99d1fb7bc43a8f1cc2f7e' into from_upstreamTim Newsome6-61/+32
Conflicts: configure.ac tcl/target/gd32vf103.cfg Change-Id: I72bbb973249b7bbfa720696fa2c76a87a41a2e9c
2023-12-16jtag: Rename 'hasidcode' to 'has_idcode'Marc Schink1-1/+1
While at it, fix some coding style issues. Change-Id: I8196045f46ce043ed0d28cb95470132b3a7de1bb Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/8039 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-12-05Merge commit 'd4575b647a3603200a9bb4a784d170f792ab88d0' into from_upstreamTim Newsome1-2/+4
Change-Id: Iaa299c50b338089f1b3b7ff7d89fad39ac20a7c1
2023-12-05Merge commit 'a9080087d82688043ca216d50926228d09631297' into from_upstreamTim Newsome1-4/+21
Change-Id: I83a33c1022f8d1a7670ded62f16ec999fc4ef525
2023-11-27Merge commit '4b1ea8511a7da9d7201df40302e3341c6e97ffdd' into from_upstreamTim Newsome7-54/+175
Change-Id: I59366e08a4ac7e443e426b5fd6727c649f1ac9d5
2023-11-18flash/nor/stmqspi: Use correct command errorsMarc Schink1-10/+10
Change-Id: I796b4e350653117bf63d18ad274a1d3d3d1337db Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/8004 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-11-18flash/nor/pic32mx: Remove redundant error messageMarc Schink1-4/+2
The correct syntax is already suggested due to the return value used. While at it, apply some minor code improvements. Change-Id: I990c0f7a0871f4b1a0fcdd13afc190149302443c Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/8003 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-11-18flash/nor/stm32l4x: Remove redundant error messagesMarc Schink1-12/+6
The correct syntax is already suggested due to the return value used. While at it, apply some minor code improvements. Change-Id: Id32440cdd531077008abd679add32246c4249eb2 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/8001 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-11-18flash/nor/stm32h7x: Remove redundant error messagesMarc Schink1-9/+3
The correct syntax is already suggested due to the return value used. While at it, apply some minor code improvements. Change-Id: Idf3d7a46ddecd70823e06bc3997f41fcdb8e501f Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/8000 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2023-11-18flash/nor/stm32f2x: Remove redundant error messagesMarc Schink1-25/+10
The correct syntax is already suggested due to the return value used. While at it, apply some minor code improvements. Change-Id: I676e2ebf5714c850a436854a32c2e9d2f181d537 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/7999 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-11-18nor: rsl10: fix minor coding styleAntonio Borneo1-2/+4
I use a script to compare the commands in the code with the ones in the documentation. Fix the style of the data to simplify the parsing. Change-Id: I0f1d7e9ff5e2928312ca1a2f3424f82d2910580a Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7960 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de>
2023-11-06Merge commit '05ee88915520d1dd82da94a016a9374a1f3a8129' into from_upstreamTim Newsome6-16/+6
Conflicts: src/jtag/drivers/xds110.c src/target/riscv/riscv.c src/target/riscv/riscv_semihosting.c tcl/target/esp_common.cfg Change-Id: If0c02817df03b7fd700cc84b4da2c02d36737d28
2023-11-03Merge pull request #947 from riscv/from_upstreamTim Newsome15-54/+1311
From upstream
2023-10-30Removed deprecated gd32vf103_flashJan Matyas3-54/+0
Removing flash driver "gd32vf103_flash". This driver has been deprecated since June-1-2022, and was scheduled for removal in June 2023. Change-Id: Ib6f4dcba11e91a095b3a20eedd864589084b7fa9 Signed-off-by: Jan Matyas <jan.matyas@codasip.com>
2023-10-27Merge commit '9f23a1d7c1e27c556ef9787b9d3f263f5c1ecf24' into from_upstreamTim Newsome15-54/+1311
Conflicts: HACKING src/target/riscv/riscv-013.c Change-Id: I43ccb143cae8daa39212d66a8824ae3ad2af6fef
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-10-23Fix build.Tim Newsome1-0/+1
Change-Id: I20bd0356c63745423e23aec71f272fe2e32db88e Signed-off-by: Tim Newsome <tim@sifive.com>
2023-10-23Merge commit 'e17fe4db0f256ee4fb97dcfd6b9f7f55c966b190' into from_upstreamTim Newsome17-118/+106
Conflicts: src/flash/nor/drivers.c src/target/riscv/riscv.c Change-Id: Ide3eded7e0d5b0b446bfd0873a32c00cc9f128bd
2023-10-23Merge pull request #935 from riscv/from_upstreamTim Newsome1-30/+19
Merge down up to 0384fe5 from upstream.
2023-10-17flash/stm32lx: Revert to upstream version.Tim Newsome1-2/+3
Reintroduce checkpatch problem, because now we can handle them better. Change-Id: Ib81b9910433ae1a240630b898edb19da8d2d5d83 Signed-off-by: Tim Newsome <tim@sifive.com>
2023-10-16Merge commit '0384fe5d596f42388f8b84d42959d899f29388ab' into from_upstreamTim Newsome1-30/+19
Conflicts: .github/workflows/snapshot.yml src/rtos/FreeRTOS.c Change-Id: I4c9ff887b69140e0f61cb3f75a2f2c1a12071320
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>