aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nand
AgeCommit message (Collapse)AuthorFilesLines
2019-05-14nand/tcl: pass CMD to nand_list_walker()Paul Fertser1-3/+3
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Pass CMD instead of CMD_CTX as parameter to nand_list_walker(). This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: Ia11887dfc6dc58d5458a88ba84780cd895b8c253 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5053 Tested-by: jenkins
2019-05-14nand/fileio: change prototype of nand_fileio_start()Paul Fertser3-6/+6
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of nand_fileio_start() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: I7993f6aba997a2d2917949563651c8d0c213730d Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5052 Tested-by: jenkins
2019-04-07Set empty usage field for commands that do not need parametersAntonio Borneo1-0/+1
The missing field causes runtime debug message BUG: command '%s' does not have the '.usage' field filled out While there, fix some minor typo in the help messages: s/deasert/deassert/ s/Deasert/Deassert/ Change-Id: If3dd18265cda103ca0d05609f67f4ca58e7cbb27 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5024 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-04-07command_registration: add empty usage field to chained commandsAntonio Borneo1-1/+2
Chained command require a subcommand as first argument. The usage field for chained commands is not really important because the "help" command will list all the subcommands with their respective usage. Add a empty usage field on all chained command. The command "jlink config" can be either followed by a subcommand or used alone, so use a dedicated usage string. Change-Id: I43c3f8a766f96a9bdab4e709e3c90713be41fcef Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5017 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-01-27command: initialize the command mode for every commandAntonio Borneo1-0/+1
All the commands in OpenOCD have been inspected and have the command mode initialize, apart for two of them. This is not critical, because the uninitialized value (0) is equivalent to the enum COMMAND_EXEC, that is also the correct value for the two mentioned commands. To keep the code consistent, initialize the command mode to COMMAND_EXEC. Change-Id: Iaf043364cbd1005418d787ed045a3ec653612382 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4861 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2017-10-23Fix GCC7 warnings about switch-case fallthroughsFreddie Chopin1-0/+1
GCC7 with -Wextra warns about switch-case blocks which fallthrough with "this statement may fall through [-Werror=implicit-fallthrough=]". This can be fixed by adding "special" comments: "/* fallthrough */". See https://gcc.gnu.org/gcc-7/changes.html Change-Id: Iba0be791dbdd86984489b2d9a0592bb59828da1e Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-on: http://openocd.zylin.com/4174 Tested-by: jenkins
2016-12-08Convert to non-recursive makeAndreas Fritiofson1-41/+38
Change-Id: I11f8bc8553957e2ff083c09e72e16881e4d3bb6f Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3865 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2016-11-04Tcl commands: Fix improper return status in flash commands and load_image.HarishKumar1-2/+4
Nand write command : nand_fileio_cleanup() always returns ERROR_OK. Due to this, handle_nand_write_command() retuns ERROR_OK in the case of nand failure. ERROR_FAIL should be returned. Flash erase_sector command : handle_flash_erase_command() always returns ERROR_OK even if the erase functionality of actual driver implementation fails. retval value should be returned. Flash write_bank command : handle_flash_write_bank_command() returns ERROR_OK even if fileio_open() and fileio_read fails. ERROR_FAIL should be returned. Load_image command : handle_load_image_command() retuns ERROR_OK even if image_open() fails. ERROR_FAIL should be returned. When the buffer is null, breaking the loop without setting retval = ERROR_FAIL would cause load_image to return ERROR_OK. Change-Id: Ice32f6036971ab5e8e4dd65edf54b394b001c80c Signed-off-by: HarishKumar <harishpresent@gmail.com> Reviewed-on: http://openocd.zylin.com/2431 Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Tested-by: jenkins
2016-05-24Make #include guard naming consistentMarc Schink12-33/+40
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 Schink34-99/+37
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-05-20nand: change use_raw to booleanIvo Manca2-2/+2
Change type of use_raw to boolean. This parameter was already assigned a boolean variable (in COMMAND_PARSE_ENABLE) and used as a boolean. Change-Id: I22f8308246cb25ec9ec2395599e406160410a2a8 Signed-off-by: Ivo Manca <pinkel@gmail.com> Reviewed-on: http://openocd.zylin.com/3496 Reviewed-by: Andreas Färber <afaerber@suse.de> Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2016-05-20nand: fix return valueIvo Manca1-1/+1
Return ERROR_NAND_DEVICE_NOT_PROBED to prevent calling functions from segfaulting when nand device has not yet been probed (ie nand verify) Change-Id: Ibc4da0aad00e6cc6c83008882b054d981453dc36 Signed-off-by: Ivo Manca <pinkel@gmail.com> Reviewed-on: http://openocd.zylin.com/3495 Tested-by: jenkins Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2016-02-29helper/fileio: Remove nested structMarc Schink3-8/+8
Change-Id: I1a3afbddcf950689da58e0df8850a05f558d7879 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/3222 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2015-11-03helper/fileio: Use size_t for file size.Marc Schink2-4/+4
Change-Id: Ie116b44ba15e8ae41ca9ed4a354a82b2c4a92233 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/2997 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-02-06flash: declare fixed arrays constSpencer Oliver1-4/+4
Change-Id: Id06b8b53ec59a7b3182f60f51dde5b16563aaeef Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1887 Tested-by: jenkins
2013-11-07target: use target_buffer_set_u32_arraySpencer Oliver1-3/+1
Attempt to use target_buffer_set_u32_array to convert to target endian arrays rather reimplementing code. This also removed cfi_fix_code_endian as its functionality is also repeated. Change-Id: I7c359dbe46ea791cd5f6fb18d8b0fb6895c599d3 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1783 Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2013-10-31Remove unnecessary castsAndreas Fritiofson1-1/+1
Change-Id: Ia97283707282ccccdc707c969f59337313b4e291 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1767 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-10-31nand/mx*: Remove unused host endianness flagAndreas Fritiofson4-21/+1
Probably shouldn't depend on that anyway. Change-Id: Ic27ead4cb82cff1ab187696439da4b93941e09d8 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1766 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-10-31Clean up many C99 integer types format specifiersPaul Fertser1-5/+5
This eliminates most of the warnings reported when building for arm-none-eabi (newlib). Hsiangkai, there're many similar warnings left in your nds32 files, I didn't have the nerve to clean them all, probably you could pick it up. Change-Id: Id3bbe2ed2e3f1396290e55bea4c45068165a4810 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1674 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-10-16flash: mxc nfc(v1) : fix incorrect address in spare area for biswap commandGaëtan Carlier1-2/+2
For NFC v1 (i.MX27), swapping must be done between offset 464 of Main buffer and offset 4 of Spare buffer. Change-Id: I09c2036e88770032da87d5846cd2094847f47b46 Signed-off-by: Gaetan Carlier <gcembed@gmail.com> Reviewed-on: http://openocd.zylin.com/1692 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-06-05update files to correct FSF addressSpencer Oliver33-34/+34
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>
2013-04-02Added support for ARMv7-M in arm io.Henrik Nilsson1-25/+87
Added support for ARMv7-M targets in arm_nandwrite and arm_nandread. Change-Id: Iab1d78d401f735e191c6a8519f3619035a300fae Signed-off-by: Henrik Nilsson <henrik.nilsson@bytequest.se> Reviewed-on: http://openocd.zylin.com/1188 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2013-03-15target: Retire target_bulk_write_memory()Andreas Fritiofson1-5/+1
The only caller was arm_nandwrite(). Replace that call with target_write_buffer() instead, which in turn may end up calling the same bulk_write_memory target API function. Change-Id: If34c7474df5cf14af3b732fb4774816818f28e79 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1214 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-08-24build: fix memory leaksSpencer Oliver1-4/+12
Fix the memory leaks found by clang-3.1 Change-Id: Iaae68627ef599c324c9c9ee5737c22e92512862d Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/775 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-02-22Sometime in the past, nand_fileio_finish started to return ERROR_OK (with ↵Stian Skjelsad1-1/+1
the value of zero) on success. Change-Id: Ifb743c1617e2a6071a87c901fae8165969efcdbf Signed-off-by: Stian Skjelstad <stian@nixia.no> Reviewed-on: http://openocd.zylin.com/468 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-02-06doxygen: use correct comment syntaxSpencer Oliver2-2/+2
This issue was caused by uncrustify not correctly converting the doxygen comments. Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Change-Id: Ie6dc3b057a08603b670cb27312e5f0d989426e6c Reviewed-on: http://openocd.zylin.com/431 Tested-by: jenkins
2012-02-06build: cleanup src/flash/nand directorySpencer Oliver32-2380/+2085
Change-Id: I21bb466a35168cf04743f5baafac9fef50d01707 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/419 Tested-by: jenkins
2012-01-23NAND: Misleading report of erased blocksTimo Ketola1-1/+1
For example, when blocks 2 and 3 were erased, openocd reported "erased blocks 2 to 4". That should be "2 to 3", I think. Change-Id: Icece63dedd3dd931b70fa73616819a19572e39de Signed-off-by: Timo Ketola <timo@exertus.fi> Reviewed-on: http://openocd.zylin.com/385 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-01-23i.MX25: Set OOB size (MXC NFC)Timo Ketola1-0/+4
SPAS register (OOB size) is left wrong after reset with respect to 2KiB page NAND chip. That will lead to ECC errors after 'reset halt'. Change-Id: If5a4685cb8d6be35879453951611ef1059da219c Signed-off-by: Timo Ketola <timo@exertus.fi> Reviewed-on: http://openocd.zylin.com/384 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-01-23i.MX25: Add support for i.MX25 NAND Flash ControllerTimo Ketola2-6/+21
This patch is based on Erik Ahlén's work on i.MX35 NFC support. Basically it redefines the CCM.RCSR register which is in a different address in i.MX25. Change-Id: Ia6faf9cb5efae5e564b72ef9a9b7c7f8bfde3ce0 Signed-off-by: Timo Ketola <timo@exertus.fi> Reviewed-on: http://openocd.zylin.com/383 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-01-23cleanup: rename armv4_5 to arm for readabilitySpencer Oliver1-4/+4
Nothing more than a name change, just to make reading the code a bit simpler. Change-Id: I73a16b7302b48ce07d9688162955aae71d11eb45 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/390 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-01-23flash: print bank usage on failureSpencer Oliver1-1/+3
This makes use of the newly introduced usage field in the flash bank structure. Also remove the assertion if usage field is null and lets print a DEBUG_LOG message instead. Change-Id: I384bf0e2c444fcc99deef73aec9ef01149a91c76 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/391 Tested-by: jenkins
2012-01-18cmd: add missing usage varsSpencer Oliver4-0/+6
we should have caught them all - hopefully. Change-Id: I35435317fccaf5ad0216244d69f76db6857bb582 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/381 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-01-04Change return value on error.Mathias K5-12/+8
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>
2012-01-04flash: introduce .usage field for nand and nor flash driver structureØyvind Harboe2-6/+10
Change-Id: I47e7ec8fa8c70d2addc3aa52d7c97e9e1e7bb662 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/301 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-01-04retire ERROR_INVALID_ARGUMENTS and replace with ERROR_COMMAND_SYNTAX_ERRORØyvind Harboe2-6/+6
Change-Id: I6dee51e1fab1944085391f274a343cdb9014c7a4 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/300 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-12-23Renamed mx2.{c,h} to mxc.{c,h} and added copyright noticeErik Ahlén3-3/+9
Change-Id: I07a280acdce58b8af4a145cd6beafccbb59f20d7 Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com> Reviewed-on: http://openocd.zylin.com/272 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-12-23Added support for i.MX35 NAND Flash Controller (v2)Erik Ahlén2-136/+285
Change-Id: I7237ec29792b6a7ee690751fa7e6cba0846d5aa8 Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com> Reviewed-on: http://openocd.zylin.com/271 Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-12-23Added command to enable/disable/query BI-swap for MXC NANDErik Ahlén1-0/+51
Change-Id: Ifa3eb739afe0760a974b57c5a17cc3bf7704ba79 Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com> Reviewed-on: http://openocd.zylin.com/270 Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-12-23Made BI-swap optional in mxc.Erik Ahlén2-18/+34
Change-Id: Ibdf3b1e415adcf1fdb38de25fe05da726ef58ca4 Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com> Reviewed-on: http://openocd.zylin.com/269 Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-12-23Added board type as a parameter to mx2 NFC as they have different base ↵Erik Ahlén2-43/+62
addresses. Change-Id: I7bc326e9a8d9f6817f046a7faeebede567c53dd2 Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com> Reviewed-on: http://openocd.zylin.com/268 Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-12-19Renamed mx2/imx27 to mxc.Erik Ahlén3-243/+244
Renamed all functions, enums, structs and defines from mx2/imx27 to mxc. This is in preparation of adding support for mx35 NFC(v2). Change-Id: I92ad23f0cfab605215bbf0d5846c5c288423facf Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com> Reviewed-on: http://openocd.zylin.com/267 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-12-19Indentation and white space fixes.Erik Ahlén2-135/+129
Change-Id: Iffbaefea4f3d5e9b56b3c36496b44969d7c07e82 Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com> Reviewed-on: http://openocd.zylin.com/266 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-11-04at91sam9: fix broken error propagationØyvind Harboe1-0/+1
Change-Id: I3288ce6f7642e519c26dd099be888a395fe1de94 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/159 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-10-23NAND/CORE: fix clang warningAntonio Borneo1-1/+2
The fix is inline with the Linux coding style that forbids assignment in if condition Change-Id: I42a371d6adfdf3b3fb867705211c47d89776ee2a Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/85 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-23mx2: add error propagation and remove warningsØyvind Harboe1-9/+14
Change-Id: Idd4fb452790e5d7921a749679dbd865586e5a4a9 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/48 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-07-10Fix typo in command outputLuca Bruno1-1/+1
Fix a bunch of minor typo in user facing output. Signed-off-by: Luca Bruno <lucab@debian.org>
2011-05-28Fixed values for Samung NAND chipsDamjan Marion1-2/+2
2011-05-28Improve NAND flash detectionDamjan Marion1-1/+3
Detect based on both manufacturer id and chip id if manufacturer id is defined in table
2011-05-28Reorganize NAND flash tableDamjan Marion2-76/+81
- added manufacturer field - name moved to the end for better text alignment