aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nor/pic32mx.c
AgeCommit message (Collapse)Author
2019-05-14helper/command: change prototype of command_print/command_print_samelineAntonio Borneo
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should switch to CMD as first parameter. Change prototype of command_print() and command_print_sameline() to pass CMD instead of CMD_CTX. Since the first parameter is currently not used, the change can be done though scripts without manual coding. This patch is created using the command: sed -i PATTERN $(find src/ doc/ -type f) with all the following patters: 's/\(command_print(cmd\)->ctx,/\1,/' 's/\(command_print(CMD\)_CTX,/\1,/' 's/\(command_print(struct command_\)context \*context,/\1invocation *cmd,/' 's/\(command_print_sameline(cmd\)->ctx,/\1,/' 's/\(command_print_sameline(CMD\)_CTX,/\1,/' 's/\(command_print_sameline(struct command_\)context \*context,/\1invocation *cmd,/' This change is inspired by http://openocd.zylin.com/1815 from Paul Fertser but is now done through scripting. Change-Id: I3386d8f96cdc477e7a2308dd18269de3bed04385 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/5081 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-03-27Constify struct flash_driver instancesChristopher Head
Instances of struct flash_driver are never written to at runtime. For a small amount of memory saving and also robustness (fewer things for stray pointer writes to hit), mark them const. Change-Id: Iadbbbc2fac0976d892699200000c5f02856729f3 Signed-off-by: Christopher Head <chead@zaber.com> Reviewed-on: http://openocd.zylin.com/4803 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-03-08flash/nor: use target_addr_t for flash bank baseTim Newsome
This should allow users to configure flash at >32-bit addresses. Change-Id: I7c9d3c5762579011a2d9708e5317e5765349845c Signed-off-by: Tim Newsome <tim@sifive.com> Reviewed-on: http://openocd.zylin.com/4919 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2018-04-04flash/nor: implement flash bank deallocation in drivers with simple allocTomas Vanek
All drivers which simply allocate one driver_priv memory block per each bank now use default_flash_free_driver_priv() Change-Id: I425bf4213c3632f02dbe11ab819c31eda9b2db62 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/4417 Tested-by: jenkins Reviewed-by: Liviu Dudau <liviu@dudau.co.uk> Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2017-04-24mips32, pic32 use uint8_t in 8 bit scan functionSalvador Arroyo
Makes code shorter. Change-Id: I6cc01adffbea063ccb071ddf3a3e3d81727b29ce Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/4004 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2016-08-14pic32mx: add new device ID, 17x/27x Flash supportSASANO Takayoshi
- add new device ID: 170F256B, 170F256D, 270F256B, 270F256D, 330F064H, 330F064L, 430F064H, 430F064L, 350F128H, 350F128L, 450F128H, 450F128L, 350F256H, 350F256L, 450F256H, 450F256L, 370F512H, 370F512L, 470F512H, 470F512L - add support for PIC32MX17x/27x 256kB Flash Change-Id: I65a304d2114fff80de3a24c1f6d0b5e955b22531 Signed-off-by: SASANO Takayoshi <uaa@uaa.org.uk> Reviewed-on: http://openocd.zylin.com/3186 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2016-05-24Remove FSF address from GPL noticesMarc Schink
Also make GPL notices consistent according to: https://www.gnu.org/licenses/gpl-howto.html Change-Id: I84c9df40a774958a7ed91460c5d931cfab9f45ba Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/3488 Tested-by: jenkins Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2016-02-29Cleanup: removal of obsolete semicolonsAlexander Kurz
Obsolete C source code semicolons were removed using the semantic patch semicolon/semicolon.cocci, see coccinellery.org Change-Id: I153b4995a9e028ebaf5f58c947821dc78345a777 Signed-off-by: Alexander Kurz <akurz@blala.de> Reviewed-on: http://openocd.zylin.com/3367 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2016-02-03flash: nor: {pic32mx,cfi}: fix register namesPaul Fertser
Commit fd43be07265b5f3cf3146f2bb80c1c2fc0a44fcf introduced a regression: since the register names were changed from those traditional for MIPS to common GDB scheme the code that makes use of them needs to be changed accordingly. This commit restores pic32mx flash driver functionality. Change-Id: Id18c739390fae36737a02dc30c363d0444f53b96 Reported-by: Louis Rannou <louson@users.sf.net> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/3206 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-17flash: Constify write bufferAndreas Fritiofson
Change-Id: Ic812098d3ed5a2992c26bb57d08ae350e2c5d5d8 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2040 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-10-31pic32mx: Fix byte order bugAndreas Fritiofson
Found by grepping for pointer casts. Change-Id: If73184a16904ec2958e7253ba98f44479fdcad3f Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1772 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-06-05update files to correct FSF addressSpencer Oliver
Change-Id: I429f7fd51f77b0e7c86d7a7f110ca31afd76c173 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1426 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2012-10-08flash/nor: make all working area pointers localAndreas Fritiofson
Working area pointers shouldn't be re-used, so there's no point in storing them in the flash bank struct. Make all such pointers local. Change-Id: Iab65b4e8b475fed7fc72fb8928f54590fa69d260 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/865 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-08-29Pic32mx: make row programming work with any offsetSalvador Arroyo
In function pic32mx_write_block() if the parameter offset is not a multiple of row size the row offset (offset % row_size) will be ignored by the flash controller, shifting the code to the beginning of the row. Word programming gets it right. Change-Id: I134913e3d533688f791bbcb0c6e8983524197f3c Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/796 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-29Patch: Make pic32mx unlock work at higher scan frequenciesSalvador Arroyo
For example in a pic32mx220, pic32mx unlock don't work if adapter_khz is set to 5000 or more. A short delay after asserting reset fix the problem. Change-Id: I62e493edfcea585c36c8de77a969cebac7227b96 Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/790 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-05-14flash: blank check use default_flash_blank_checkSpencer Oliver
Use default_flash_blank_check, this will use the much faster blank_check_memory handler if supported - 15x quicker on stm32f4. Otherwise it will fall back to using the slower default_flash_mem_blank_check. Change-Id: Ia231b3e95468c9e92594dbdbe1fa2d69e1506fc3 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/632 Tested-by: jenkins
2012-05-14flash: fix protect check for pic32mx1x/2x familySpencer Oliver
Change-Id: Ib2692d8b79e52cd40f429008047494aa7f552984 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/612 Tested-by: jenkins Reviewed-by: Xiaofan <xiaofanc@gmail.com>
2012-03-30topic: Flash support for Pic32mx1xx/2xxSalvador Arroyo
Change-Id: I496cb745fb1eb5c9159471838013b8d19418f5c0 Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es> Reviewed-on: http://openocd.zylin.com/500 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-02-27flash: add new devices to pic32mx flash driverSpencer Oliver
update as per DS61145 rev J Change-Id: I2b5da84248ff2f44c7ca9d2ed1c52db453714c05 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/461 Tested-by: jenkins
2012-02-06build: cleanup src/flash/nor directorySpencer Oliver
Change-Id: Ic299de969ce566282c055ba4dd8b94892c4c4311 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/420 Tested-by: jenkins
2012-01-12cmd: add missing usage varSpencer Oliver
Change-Id: I0f05d643b0801b19cc3beb88f0d12d7e4c83ef9c Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/356 Tested-by: jenkins
2012-01-04Change return value on error.Mathias K
On wrong parameters a error is signalized to the calling function. Change-Id: I484443fdb39938e20382edc9246d5ec546a5c960 Signed-off-by: Mathias K <kesmtp@freenet.de> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/282 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-11-02fix warning: remove assigned to variableØyvind Harboe
variable is subsequently not used Change-Id: I177d21c6ba9f1f2e3765feffdbf317ea375a8cfe Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/149 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-06-04Fix "unused variable" warnings (errors) detected with GCC 4.7.0 - trivial fixesFreddie Chopin
2011-04-14pic32: update pic32mx flash driverSpencer Oliver
Update devices as per the latest programming manual. We now use the full DEVID to identify the target. Previously we used a 8bit id but that has now been changed in the manual. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2011-04-01mips: illustrates how to improve performanceØyvind Harboe
Do not require unecessary roundtrips for clocking out data. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2011-01-03error handling: the error number is not part of the user interfaceØyvind Harboe
Do not propagate error number to user. This is for internal programming purposes only. Error messages to the user is reported as text via LOG_ERROR(). Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-12-29warnings: use more 'const' for char *Øyvind Harboe
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-11-17FLASH/NOR: Remove useless file pic32mx.hAntonio Borneo
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-10-28src: add loader src descriptionSpencer Oliver
- add comment where to find the various loaders src files. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-07-20flash: remove algorithm exit_point address for supported targetsSpencer Oliver
For the above targets the exit_point is optional when used with run_algorithm, so remove it. This makes updating the algorithm less error prone. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-05-29nor: fix memory leaks during probeSpencer Oliver
Fix similar memory leaks as per commit: ef72484b785ec7462a0415afea679d08b864c7fb Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-05-16NOR: add read() callback to struct flash_driverAntonio Borneo
Final target is to force bus_width size during CFI flash read. In this first step I need to replace default flash read with flash specific implementation. This patch introduces: - flash_driver_read() layer; - default_flash_read(), backward compatible; - read() callback in struct flash_driver; - proper initialization in every flash_driver instance. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-05-04flash: less bogus errorsØyvind Harboe
Removed bogus errors when trying to allocate a large a target memory buffer as possible. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-25change %x and %d to PRIx32 and PRId32 where needed for cygwinDaniel Bäder
2010-03-18PIC32MX: add unlock cmdSpencer Oliver
'unlock' performs a full unlock/erase of the device, removing any code protection. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-03-10PIC32: add flash algorithm supportSpencer Oliver
Add flash algorithm support for the PIC32MX. Still a few things todo but this dramatically decreases the programing time, eg. approx programming for 2.5k test file. - without fastload: 60secs - with fastload: 45secs - with fastload and algorithm: 2secs. Add new devices to supported list. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-01-29NOR: cleanup driver declsDavid Brownell
Fix goofy struct indents. Function names *are* their addresses. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-04remove target.h from flash.hZachary T Welch
The flash.h header does not require the target.h header file, but its implementation source files do. Move it to flash/nor/imp.h.
2009-12-03change #include "mips32.h" to <target/mips32.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "mips32.h" the following form should be used. #include <target/mips32.h> The exception is from .c files in the same directory.
2009-12-02move nor drivers to src/flash/norZachary T Welch
Moves NOR flash drivers to 'src/flash/nor/'. Adds 'src/flash/nor/Makefile.am'. Builds 'libocdflashnor.la'.