aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-09-22Some hack for MIPS, don't remember the detailsmips-hack-upstreamDavid Barksdale
2017-08-10Support for STM32F722, F723, F413 and F423Andreas Bolsch
IDs for STM32F722, F723, F413 and F423 added, handling of PCROP for F722/723 and additional nWPRT bits for F413/423 implemented. The additional protection bit positions for F413/423 conflict with other options bits for the F7xx variants, additionally the last two sectors share a common bit. Protection for F413 and F767/777 now use protection blocks rather sectors for dealing with protections bits. Checking for halted state in 'lock' and 'unlock' removed: When PCROP is activated in F723, halted state is not detected properly, but lock/unlock sequence is required to disable PCROP. Tested with STM32F723E-Disco, STM32F413ZH-Nucleo. Change-Id: Ie6ddab47a9ae8461087d369b4f289b7f9d1e031c Signed-off-by: Andreas Bolsch <hyphen0break@gmail.com> Reviewed-on: http://openocd.zylin.com/4045 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2017-08-10log: Add a new debug level (4) for verbose I/O debugAndreas Fritiofson
Change ftdi SWD driver and CMSIS-DAP to use it instead of LOG_DEBUG(). Change-Id: I17ba3de2086c7159209db61fba3faf067dfc5023 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3805 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2017-08-10stm32l1: Devid 0x429 only has 8bit flash size registerKarl Palsson
A footnote in RM0038r14. Change-Id: Ic31894d846fbbe917a7290b2b7ff8fb582bb65da Signed-off-by: Karl Palsson <karlp@tweak.net.au> Reviewed-on: http://openocd.zylin.com/4198 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2017-07-24flash Kinetis: fix probe for FlexNVM partitioned as EEPROM backupTomas Vanek
If a MCU has FlexNVM partitioned as EEPROM backup only (no data flash), kinetis_probe_chip() detects zero fcfg2_maxaddr1 and adjusts flash banks count to 1, what is obviously wrong. The change limits the test to devices without FlexNVM. Computation of program flash/FlexNVM blocks is now more robust. Missing case 0x07 is added to switch (fcfg1_depart) Change-Id: I0bd6030a0fe1ab62aeb0223bbdf2aee1505bf6a0 Reported-by: simon.haines@scalardata.com Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/4180 Tested-by: jenkins Reviewed-by: Simon Haines <simon.haines@scalardata.com> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2017-07-24flash Kinetis: fix devices with smallest program flash (8 and 16 kB)Tomas Vanek
Change-Id: I2692b9877a7f877104528f279a69e8cc1cfbcdbf Reported-by: David Miller Lowe <milhead@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/4173 Tested-by: jenkins Reviewed-by: Miller Lowe <miller.lowe@trailtech.net> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2017-07-07mips32: inline functions in headers must be staticAndreas Fritiofson
Change-Id: If1d0fc6766cadc2db33408ae5c0968de6b7a1b94 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/4178 Tested-by: jenkins Reviewed-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-by: Stian Skjelstad <stian@nixia.no>
2017-06-30rtos: better sanity checking for uCOS-IIISteven Stallion
This patch improves the OSRunning check. If the rtos_running check fails, update_threads will return an error rather than attempt to update the thread list using bad values. Change-Id: I8614c325504d3a9ab19aebb6862b1fe445a0c8e7 Signed-off-by: Steven Stallion <stallion@squareup.com> Reviewed-on: http://openocd.zylin.com/4166 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2017-06-30rtos: style corrections for uCOS-IIISteven Stallion
This patch corrects a number of style infractions in RTOS support for uC/OS-III. These were missed during initial review last year prior to the 0.10.0 release. Change-Id: Ia2139f6ca381d4087fd8ee989f7a03ac474d7440 Signed-off-by: Steven Stallion <stallion@squareup.com> Reviewed-on: http://openocd.zylin.com/4120 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2017-06-30zynq_7000: Add expected id for Zynq 7z100 devicesMoritz Fischer
As found on the NI Project Sulfur SDR board. Change-Id: I47bdd38ae85cf45cedad8797ea03bf3105153320 Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com> Reviewed-on: http://openocd.zylin.com/4176 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-06-30flash/nor/efm32: Support EZR32HG devices.Richard Watts
Recognise the family number for Silicon Labs EZR32HG devices and select the correct flash page size. Change-Id: I876e930f3a9f679557fa0d0acac33e9bbfb28c46 Signed-off-by: Richard Watts <rrw@kynesim.co.uk> Reviewed-on: http://openocd.zylin.com/3934 Tested-by: jenkins Reviewed-by: Fredrik Hederstierna <fredrik@hederstierna.com> Reviewed-by: Jonas Norling <jonas.norling@cyanconnode.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-06-30target: Fix snprintf format string and argument mismatch in md outputAndreas Fritiofson
Commit 47b8cf842 changed the fixed type of the value argument to snprint but didn't change the format string to match for sizes != 64 bit. Change-Id: I908b06f49ab69d04224282949190a0de883048e0 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/4167 Tested-by: jenkins Reviewed-by: Stian Skjelstad <stian@nixia.no> Reviewed-by: Philipp Guehring <pg@futureware.at>
2017-06-17flash/nor/tcl: Make read_bank parameters optionalMarc Schink
Make 'offset' and 'length' parameters optional, if both are omitted simply read the whole flash bank. Additionally, check if the 'offset' and 'length' arguments are out of bounds of the flash bank. Change-Id: Ib9c1b0538a2c78ebcf702e2da11468dff407f8ff Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/3862 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2017-06-17flash/nor/tcl: Respect flash bank boundary in write_bankMarc Schink
Respect the flash bank boundary and write only to the remaining part of the bank even if the file content is larger. Change-Id: I8f4c1b161c103a77bdb30c6bf052293b5ed48c41 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/3861 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2017-06-17flash/nor/tcl: Make write_bank parameter optionalMarc Schink
Make the 'offset' parameter optional, if omitted simply start at the beginning of the flash bank. Additionally, check if the argument is out of bounds of the flash bank. Change-Id: I8e9632b539ad9e83211e1ac6a06da4c8109cbc60 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/3860 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2017-06-17flash/nor/tcl: Respect flash bank boundary in verify_bankMarc Schink
Respect the flash bank boundary and compare only the remaining content of the bank even if the file content is larger. Change-Id: I4d75979c7893fdd4d18372fa6b0321a0486b4fa9 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/3859 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2017-06-17flash Kinetis: Add support for newer KW seriesJoakim Nohlgård
Add support for flashing newer members of the NXP Kinetis KW family Supported devices: - KW20Z - KW30Z - KW40Z - KW21Z - KW31Z - KW41Z The earlier KW2xD and KW01Z devices are already supported by the code for the older K-series. Verified working on the FRDM-KW41Z development board. Tested flashing both via GDB `load` and directly via OpenOCD flash write commands. Change-Id: I73eae477127a8b54a33005b3b526b5439450a808 Signed-off-by: Joakim Nohlgård <joakim.nohlgard@eistec.se> Reviewed-on: http://openocd.zylin.com/4104 Tested-by: jenkins Reviewed-by: Johann Fischer <johann_fischer@posteo.de> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2017-06-17flash Kinetis: add KL28 deviceTomas Vanek
This device differs a lot from others in KL series. Unfortunately the System Integration Module, where device identification resides, moved to a new address so probe now have to try both addresses of SIM_SDID. Introduce a new bank creation option: -sim-base to ensure error free probe. WDOG32 is slightly different from KE1x and on different address. System Mode Controler changed layout to word aligned. Change-Id: I2c9dca0c4ad4228fcc941d6078d15f5e394833ff Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/4059 Tested-by: jenkins Reviewed-by: Joakim Nohlgård <joakim.nohlgard@eistec.se> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-06-17flash Kinetis: handle all types of watchdog, disable in reset-initTomas Vanek
Active watchdog forces reset during armv7m_checksum_memory() in verify_image command if run just after reset init. COP watchdog in KL series and WDOG32 in KE1 series have longer timeout however they need to be disabled too. The change extends 'kinetis disable_wdog' command to optionally probe the chip and use appropriate algorithm to disable watchdog. Setting of cache type is also split from flash_support flags. Tcl command 'kinetis disable_wdog' is called in reset-init event. Change-Id: I3191e230f38b679ed74f2a97fe323ef8fb3fe22e Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/3901 Tested-by: jenkins Reviewed-by: Joakim Nohlgård <joakim.nohlgard@eistec.se> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-06-17flash Kinetis: implement automatic bank creation based on device probeTomas Vanek
Kinetis flash driver services huge number of MCU types. They have one, two or four flash banks with option of FlexNVM. It would require ~36 config files just for Kx series, more for KLx, KVx and KE1x. The change implements alternative approach: - configuration file creates just one pflash bank (common for all devices) - when a device is probed, additional pflash or flexnvm banks are created based on flash layout of the connected MCU - created banks have names with optional numbering e.g. kx.pflash0 kx.pflash1 kx.flexnvm0 kx.flexnvm1 - the first bank gets renamed if numbering is used Automatic bank creation is enabled by tcl command 'kinetis create_banks'. Used solution has a drawback: other banks than pflash0 are not accessible until pflash0 is probed. Fortunately gdb attach and standard programming accesses banks in right sequence. Change-Id: I5b9037cbefdb8a4176b7715fbcc3af4da4c1ab60 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/3925 Tested-by: jenkins Reviewed-by: Joakim Nohlgård <joakim.nohlgard@eistec.se> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-06-17flash Kinetis: split kinetis_chip from kinetis_flash_bankTomas Vanek
Kinetis flash driver probed and decoded chip repeatedly for each flash bank. Bank ordering used global bank number so multi-target configuration was broken. The change introduces kinetis_probe_chip() which reads SIM SDID and SIM FCFG registers, decodes Kinetis series and family and fills struct kinetis_chip. This probe runs once for all banks. struct kinetis_chip contains pointers to all flash banks embeded in the MCU. It simplifies iteration over all or specific MCU banks. kinetis_probe_chip() generates MCU name and some informational messages are improved. Change-Id: I990db5c63ba490667eec0e5459086d83936662fb Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/3924 Tested-by: jenkins Reviewed-by: Joakim Nohlgård <joakim.nohlgard@eistec.se> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-06-17flash Kinetis: add KV5x familyTomas Vanek
Real time control MCU has a Cortex-M7 and numerous changes in flash layout. Introduced a new ID of MDM-AP. While on it a LOG_DEBUG format error fixed. Change-Id: I1018660ce0c3dd63ac5e2563408fabff3c3daef7 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/3900 Tested-by: jenkins Reviewed-by: Joakim Nohlgård <joakim.nohlgard@eistec.se> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-06-17flash Kinetis: add KL8x family, fix erase checkTomas Vanek
Secure devices KL81Z7 and KL82Z7 have no SERIESID field in ID register so they have to be decoded in Kx branch (not KLx). The flash controller in KL8x and also in K8x devices does not implement FTFx_CMD_BLOCKSTAT command. Fix kinetis_blank_check() to work properly using FTFx_CMD_SECTSTAT command only. Introduce a new flag FS_NO_CMD_BLOCKSTAT to avoid use of FTFx_CMD_BLOCKSTAT on these devices. Change-Id: I3ff58718480acd8cce69f618f71667b6b1d9c4f3 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/3898 Tested-by: jenkins Reviewed-by: Joakim Nohlgård <joakim.nohlgard@eistec.se> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-06-17tcl/target: make sure kex.cfg is not used for Kinetis KE1x familiesTomas Vanek
Config file renamed to ke0x.cfg and a notice added to texi. While on ke0x.cfg CPUTAPID setting fixed: device has SWD port only, no JTAG. Removed per device configs as they set CHIPNAME and nothing more. Let's use reasonably universal chip name 'ke' set in family config. Change-Id: I313db87a59f25f968eb3c27df155780b67becee8 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/3897 Tested-by: jenkins Reviewed-by: Ivan Meleca <ivan@artekit.eu> Reviewed-by: Joakim Nohlgård <joakim.nohlgard@eistec.se> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-06-17flash Kinetis: add KE1xZ and KE1xF familiesTomas Vanek
The new Kinetis KE1x families use FTFE flash controller unlike KE0x. Also SDID coding corresponds to new K, KL and KV families. That's why KE1x is handled by kinetis driver instead of kinetis_ke Change-Id: Ibb73e28e41dfbb086e761e1f006b089825dab854 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/3896 Tested-by: jenkins Reviewed-by: Joakim Nohlgård <joakim.nohlgard@eistec.se> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-06-17flash/nor: at91samd modified to use real erase sector sizeTomas Vanek
Before this change SAMD driver defined "sector" equal to a flash protection block. Oversize sectors (16kB for the biggest flash size) made problems for flashing firmware split to two or more parts. Removed superfluous test of sector protection before erase. Change-Id: I8e6a6bda6ccd91eda2df67ec48270c69faa1bdd1 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/3546 Tested-by: jenkins Reviewed-by: Stian Skjelstad <stian@nixia.no> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-06-17flash/nor/at91sam4: remove FWS=6, rename at91samg to atsamgTomas Vanek
FWS=6 workaround removed, as this appears to be a copy-paste error from the SAM3X family. Originally addressed in http://openocd.zylin.com/3837 but not all occurences were removed. Atmel changed chip naming and removed 91 prefix for atsamg, samd... Change-Id: Ia2b43da82b2ff9b1c85fdb456a0a198ab095243d Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/3926 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-06-02flash: nor: ath79: fix build failure due to recent MIPS changesPaul Fertser
Change-Id: I7139b0658f048afea2d16216c93e8946356a630d Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/4151 Tested-by: jenkins Reviewed-by: Salvador Arroyo <sarroyofdez@yahoo.es>
2017-05-31flash: Add support for Atheros (ath79) SPI interfaceTobias Diedrich
Supported SoCs: AR71xx, AR724x, AR91xx, AR93xx, QCA9558 Extended and revised version of my original patch submitted by Dmytro here: http://openocd.zylin.com/#/c/3390 This driver is using pure SPI mode, so the flash base address is not used except some flash commands (e.g. "flash program") need it to distinguish the banks. Example config with all 3 chip selects: flash bank flash0 ath79 0 0 0 0 $_TARGETNAME cs0 flash bank flash1 ath79 0x10000000 0 0 0 $_TARGETNAME cs1 flash bank flash2 ath79 0x20000000 0 0 0 $_TARGETNAME cs2 Example usage: > flash probe flash0 Found flash device 'win w25q128fv' (ID 0x001840ef) flash 'ath79' found at 0x00000000 > flash probe flash1 No SPI flash found > flash probe flash2 No SPI flash found > flash banks > flash read_bank flash0 /tmp/test.bin 0x00000000 0x1000 reading 4096 bytes from flash @0x00000000 wrote 4096 bytes to file /tmp/test.bin from flash bank 0 at offset 0x00000000 in 28.688066s (0.139 KiB/s) Change-Id: I5feb697722c07e83a9c1b361a9db7b06bc699aa8 Signed-off-by: Tobias Diedrich <ranma+openocd@tdiedrich.de> Reviewed-on: http://openocd.zylin.com/3612 Tested-by: jenkins Reviewed-by: Dmytro <dioptimizer@hotmail.com> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2017-05-31imx_gpio: add mmap based jtag interface for IMX processorsGrzegorz Kostka
For some targets (like nrf51) sysfs driver is too slow. This patch implements memory maped driver for IMX processors. Mostly based on bcm2835gpio. Tested on imx6ul CPU. However, it should work on any NXP IMX CPU. Change-Id: Idace4c98181c6e9c64dd158bfa52631204b5c4a7 Signed-off-by: Grzegorz Kostka <kostka.grzegorz@gmail.com> Reviewed-on: http://openocd.zylin.com/4106 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2017-05-12jtag/drivers: Add Cypress KitProg driverForest Crossman
This patch adds a driver for the SWD-only Cypress KitProg programmer/debugger. Change-Id: I3a9a8011a762781d560ebb305597e782a4f9a8e5 Signed-off-by: Forest Crossman <cyrozap@gmail.com> Reviewed-on: http://openocd.zylin.com/3221 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2017-05-09tcl/cpld: add config file for Altera 5M570Z CPLD (MAXV family)Moritz Fischer
Change-Id: I229c746be27b7c4fa01f48a6ed54ab2679b50ab1 Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com> Reviewed-on: http://openocd.zylin.com/4109 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2017-05-08stm32l4: support flashing L45x/46x devicesJuha Niskanen
Also fixes incorrect comment about MSI range. Change-Id: If1339a00e50db44195dfcd5c767ba3f5d9035451 Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com> Reviewed-on: http://openocd.zylin.com/4122 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-05-08mips32, use scan32 function for reading impcode/idcode.Salvador Arroyo
There is no need to implement scan code in functions mips_ejtag_get_idcode/impcode(), use mips_ejtag_drscan_32(). Impcode/idcode saved in ejtag.info. Reorder the code in the callers of this functions. Change-Id: Ia829c783a0b24c6a65cade736113fa6f67b0a170 Signed-off-by: Salvador Arroyo <salvador@telecable.es> Reviewed-on: http://openocd.zylin.com/4003 Tested-by: jenkins Reviewed-by: Peter Mamonov <pmamonov@gmail.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-05-08mips32: add micromips breakpoints supportSalvador Arroyo
Breakpoint setting based on length (kind) only. Added 16bit aligned 32bit software breakpoints support and same filtering before setting breakpoint. Set the required isa bit in hardware breakpoints. Drop the isa bit in software breakpoints. Change-Id: I7020f27be16015194b76f385d9b8e5af496d0dfc Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/4124 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-05-08mips32: add micromips isa handlingSalvador Arroyo
Read and save configuration registers, up to 4. Config3 holds the micromips implementation info. Added isa implementation info to mips32_common. Added isa filter to avoid common mistakes, but only if one isa mode is implemented. When resuming the isa requested is set if more than one isa mode is implemented. Change-Id: I1d6526c5525bffac8d75e031b842b2edc6310e28 Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/4123 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-05-08mips32, convert miniprograms with code definitionSalvador Arroyo
Needed to run in micromips mode. Seems that if an isa is supported in debug mode it also supported in kernel mode. The contrary is not true. Change-Id: I1feb8e2c376f4db97089f05c20bc0cd177208fb3 Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/4033 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-05-08mips32, add support for micromips in debug modeSalvador Arroyo
Micromips is 16bit oriented, branch and jumps are 16 bit based. The upper half 16bits of a 32bit instruction with the major opcode, must go first in the instruction stream, hence the SWAP16 macro and swap16 array function, needed if the code is written as 32 bit word in little endian cores. Endianess info added to ejtag_iinfo. Pointer to ejtag_info and isa field added to pracc context. MIPS32 code are renamed to MIPS32_ISA_... To select the isa, the new code has an additional isa parameter (1 for micromips, 0 for mips32). In JR instruction the isa bit must be set to execute micromips code. The suffix u is added to the OP codes to avoid signed/unsigned comparison errors and to make sure the right shift is performed logically. The isa in debug mode is updated in the poll function. Code for miniprograms, in kernel mode, need to be converted. CFI code only for mips32. Change-Id: I79a8b637d49b0e2d92b6dd5eb5aa8aa0520bf938 Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/4032 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-05-08mips32, add microMips instruction subsetSalvador Arroyo
Only reencoded MIPS32 instructions. Added some instructions for crc code. Micromips isa in debug mode is only needed for pic32mm cores. Pic32mz seems that only works with MIPS32 isa when in debug mode. Change-Id: I07059e153a7000ea9204f20b6b37edf6a7623455 Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/4022 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-05-08mips32, add option to avoid check in last instructionSalvador Arroyo
This option is needed, for example, when exiting debug mode in bmips targets. The last instruction is a NOP, not a DERET. When working in async mode this check is not done, mips32_pracc_queue_exec() pass the parameter to mips32_pracc_exec() and never use it. Change-Id: I4c7ed4feb1588b62e2645b955b501b6671113b36 Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/4021 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-05-08mips32, add realloc codeSalvador Arroyo
If max_code is reached realloc memory. If fails to realloc the error is propagated and every call to pracc_add() returns immediately. The exec function logs the error. Change-Id: Idd4ed9d9b8b19b7d6842d0bc5ebb05f943726705 Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/4020 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-05-08mips32, change in pracc_list for dynamic allocationSalvador Arroyo
pracc_list points to an array with code in the lower half and addr in the upper half. Change it to a struct with an instruction field and an address field. Requiered to make reallocation easier. As a side effect the code is less quirky. Change-Id: Ibf904a33a2f35a7f69284d2a2114f4b4ae79219f Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/4019 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-05-02Fix compile failure on MacOSXMatthias Welwarsky
MacOSX tool chain defines __unused in "sys/cdefs.h", causing a collision. Remove the local define to avoid polluting the compilers internal symbol namespace. Change-Id: I16370c4518e6aeec482dd689e7db80628f846ee3 Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com> Reviewed-on: http://openocd.zylin.com/4118 Reviewed-by: Steven Stallion <sstallion@gmail.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Tested-by: jenkins
2017-04-25mips32, write handler code in a more compact waySalvador Arroyo
Less code and probably cleaner. Don't check if it is ever ERROR_OK. Change-Id: I1045b58fd4542ec24430332f49679364ae97b1dc Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/4018 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-04-25mips32, implement assembler li instructionSalvador Arroyo
Implement it as a function, the code was already in. Added optimize option. Change-Id: Ib9ad3f00d6c4f0b91c4e4960a50ec8d102f4e333 Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/4017 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-04-25mips32, in wait_for_pracc_rw() use ejtag_info->pa_ctrlSalvador Arroyo
Makes code shorter In fasdata transfer fuction declare variables locally. Avoid cast. Change-Id: I0367b66339560fc20521a0598488e7ff9076808e Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/4011 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-04-25mips32, mips32_pracc_finish() queued onlySalvador Arroyo
In most of the cases there is no need to request execution, the check for a new pracc access already does it. Requesting execution if not needed makes execution slower and code larger due the additional checks. Reduce code in fasdata transfer function. Call for execution when exiting debug. Change-Id: I3b45f6d1f62da5fad3e3db84f82a9299b16e1bd9 Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/4010 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-04-25mips32, drop unnecessary code in mips32_pracc.cSalvador Arroyo
Struct mips32_pracc_context no more in use. In current code cp0 reg/sel do not requires special handling. In sync mode ctx.store_count not used, drop check. In fasdata transfer function use mips32_pracc_read_ctrl_addr() to reduce code. Change-Id: Ibd4cfa5a44ebc106ed0db042f4e54a2e0b3d43cb Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/4007 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-04-25mips32, homogenize code in the scan functionsSalvador Arroyo
Change-Id: I32fed3332857737048dd12da94fcaba140acb726 Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/4006 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2017-04-25server/telnet: Remove exit() callMarc Schink
Change-Id: I8ce99d7d62dfe3cad63cf6bc68f2faf2234e395c Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/3224 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>