aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nor/cfi.h
AgeCommit message (Collapse)AuthorFilesLines
2022-07-23openocd: src/flash: replace the GPL-2.0-or-later license tagAntonio Borneo1-13/+2
Replace the FSF boilerplate with the SPDX tag. The SPDX tag on files *.c is incorrect, as it should use the C99 single line comment using '//'. But current checkpatch doesn't allow C99 comments, so keep using standard C comments, by now. Change-Id: Ic7db91fe37d1139d42c99e303b3243b6c8fe3ea2 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7067 Tested-by: jenkins
2021-07-02flash/nor/cfi: fix CamelCase symbols in cfi_spansion_pri_extAntonio Borneo1-11/+11
The struct cfi_spansion_pri_ext has few symbols in CamelCase. Change all them accordingly to OpenOCD coding style. Patch created automatically with the script below: %<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<--- (cat << EOF VppMin vpp_min VppMax vpp_max TopBottom top_bottom TmpBlkUnprotect tmp_blk_unprotected SimultaneousOps simultaneous_ops SiliconRevision silicon_revision PageMode page_mode EraseSuspend erase_suspend BurstMode burst_mode BlkProtUnprot blk_prot_unprot BlkProt blk_prot EOF ) | while read a b; do sed -i "s/$a/$b/g" src/flash/nor/*cfi* done %<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<--- Change-Id: I135331539ca9aa84765fdffc51c87a07a46ee77a Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6298 Tested-by: jenkins
2021-06-13flash/nor: improved API of flash_driver.info & fixed buffer overrunsJan Matyas1-1/+1
1) The API of "info" callback in "struct flash_driver" has been improved. Fixed buffers for strings 2) Removed the calls to snprintf() from the flash_driver.info implementations. Many of them were used in an unsafe manner (buffer overruns were possible). Change-Id: I42ab8a8018d01f9af43c5ba49f650c3cb5d31dcb Signed-off-by: Jan Matyas <matyas@codasip.com> Reviewed-on: http://openocd.zylin.com/6182 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-07-08flash/nor/cfi: Use 'bool' data typeMarc Schink1-5/+5
Change-Id: I25198223175c26aded9ad667b802da09883e94ee Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/5738 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-07-07flash/nor: Use proper data types in driver APIMarc Schink1-2/+3
Use 'unsigned int' and 'bool' instead of 'int' where appropriate. While at it, fix some coding style issues. No new Clang analyzer warnings. Change-Id: I700802c9ee81c3c7ae73108f0f8f06b15a4345f8 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/4929 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-02-06flash/nor: Export various functions from the CFI coreMarek Vasut1-0/+21
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-16flash/nor: Allow CFI memory read/write functions be overridenMarek Vasut1-0/+6
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>
2016-06-23cfi: Add support for strangely endianness broken SoC implementationsEsben Haabendal1-0/+1
This adds the 'data_swap' parameter to the CFI driver, which enables swapping of data bytes when writing/programming words to the flash. Note, that this specifically means that bytes are not swapped when writing command words to the flash chip. Unless you are using the SAP in an LS102x chip to program an attached 16-bit NOR flash, you hopefully do not need this! Change-Id: I1e6f7169da36f373c880d1756d9c21c9957acc50 Signed-off-by: Esben Haabendal <esben@haabendal.dk> Reviewed-on: http://openocd.zylin.com/3109 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2016-05-24Make #include guard naming consistentMarc Schink1-3/+3
Change-Id: Ie13e8af0bb74ed290f811dcad64ad06c9d8cb4fa Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/2956 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2016-05-24Remove FSF address from GPL noticesMarc Schink1-3/+1
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-13cfi: support for 16-bit flash with reversed endiannessEsben Haabendal1-0/+2
This is for targets where flash controller has reverse endianness compared to target. For these, the 'bus_swap' parameter can be given to the CFI driver, which will cause command CFI commands to be written with bytes swapped. This is only for x16 CFI flash. Change-Id: I698b768e92e65d160232e90b0e81a824e3c81a46 Signed-off-by: Esben Haabendal <esben@haabendal.dk> Reviewed-on: http://openocd.zylin.com/3041 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-07-01Support for SST 39VF3201C NOR flashIS2T1-2/+2
* Add Thumb-2 code to write flash memories that don't support DQ5 polling * Make sure default values for unlock commands are set even if there is no PRI information given by the flash * Add a fixup to disable DQ5 polling for the SST 39VF3201C Change-Id: Ib08cf20547d0f500d5f78241521e6b49050c3d40 Signed-off-by: IS2T development team <dev.is2t@gmail.com> Reviewed-on: http://openocd.zylin.com/1449 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-06-05update files to correct FSF addressSpencer Oliver1-1/+1
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 Fritiofson1-2/+0
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-02-06build: cleanup src/flash/nor directorySpencer Oliver1-12/+7
Change-Id: Ic299de969ce566282c055ba4dd8b94892c4c4311 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/420 Tested-by: jenkins
2011-08-18cfi: add EN29LV800BB supportGunnar Henne1-0/+1
Posted by telekatz@gmx.de in the bettyhacks forum for openocd 0.4.0 and integrated into 0.5.0 by Gunnar Henne. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-12-10cfi: disable buffer writes for M29W128GSpencer Oliver1-1/+1
For some reason buffer writes for the M29W128G do not work reliably, so disable them. See: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=504a3e72208fc6a65924426ff5693982590bccdc Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-12-10cfi: calculate correct timeoutsSpencer Oliver1-0/+6
The existing code used incorrect timeout values for the various cfi operations. We now calculate the timeouts and convert to msecs if necessary. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-06-11cfi: fix error propagationØyvind Harboe1-2/+2
any read/write operation to memory can fail. block write algorithm error propagation was broken in that it would continue after an error was reported writing data to ram or the algorithm failing. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-12-04remove flash.h from treeZachary T Welch1-2/+0
Remove the now vestigial <flash/flash.h> header from the tree, replacing a few references with <flash/nor/core.h>
2009-12-03change #include "flash.h" to <flash/flash.h>Zachary T Welch1-1/+1
Changes from the flat namespace to heirarchical one. Instead of writing: #include "flash.h" the following form should be used. #include <flash/flash.h> The exception is from .c files in the same directory.
2009-12-02move nor drivers to src/flash/norZachary T Welch1-0/+164
Moves NOR flash drivers to 'src/flash/nor/'. Adds 'src/flash/nor/Makefile.am'. Builds 'libocdflashnor.la'.