aboutsummaryrefslogtreecommitdiff
path: root/src/flash/mflash.c
AgeCommit message (Collapse)AuthorFilesLines
2019-07-28mflash: Remove this broken flash driverAndreas Fritiofson1-1450/+0
This is causing repeated build failures. Its design is so fundamentally broken that if someone actually wants to use it, a full rewrite is the only option. So it's not even worth deprecating in the hope that someone will notice and fix it, just get rid of it. Change-Id: I513069919a3873bd69253110f7fb6f622ee7d061 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/5243 Tested-by: jenkins Reviewed-by: Jeffrey Booher-Kaeding <Jeff.Booher-Kaeding@arm.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-05-14helper/command: change prototype of command_print/command_print_samelineAntonio Borneo1-3/+3
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-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>
2017-10-23Fix GCC7 warnings about switch-case fallthroughsFreddie Chopin1-2/+2
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-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-29helper/fileio: Remove nested structMarc Schink1-14/+14
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 Schink1-3/+3
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>
2013-10-31Remove unnecessary (void *)Andreas Fritiofson1-7/+7
When pointer casts are needed, cast directly to the correct type, instead of going via void*. Don't explicitly cast to void* if it would have been done implicitly. Change-Id: I4093209200051c5eb62847d00a4b9c8567480068 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1669 Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de> 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-08-24build: fix clang warningsMartin Nowak1-1/+1
Change-Id: I3c6a63a18034535f0a8c2c62ba8a708f09d7839b Signed-off-by: Martin Nowak <dawg@dawgfoto.de> Reviewed-on: http://openocd.zylin.com/765 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-24build: fix memory leaksSpencer Oliver1-0/+1
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-06doxygen: use correct comment syntaxSpencer Oliver1-1/+1
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 directorySpencer Oliver1-228/+272
Change-Id: I33c32a884095cff139546f760bc8fa6586e8c5b0 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/417 Tested-by: jenkins
2012-01-18cmd: add missing usage varsSpencer Oliver1-0/+2
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-04retire ERROR_INVALID_ARGUMENTS and replace with ERROR_COMMAND_SYNTAX_ERRORØyvind Harboe1-2/+2
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>
2010-09-29fileio: fileio_size() can now failØyvind Harboe1-4/+10
Part of making the fileio API more robust. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-29fileio: refactor struct fileio to be an opaque structureØyvind Harboe1-4/+4
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-20warnings: fix alignment warningsØyvind Harboe1-2/+2
These warnings are for architectures that do not support non-aligned word access. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-22flash: fix shadow issues on MacEdgar Grimberg1-4/+4
Wait is declared in /usr/include/sys/wait.h Signed-off-by: Edgar Grimberg <edgar.grimberg@zylin.com>
2010-06-16mflash: -Wshadow warning fixØyvind Harboe1-3/+3
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-04-10MFLASH: review scope of functionsAntonio Borneo1-1/+1
Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-01-08MFLASH: help/usage updatesDavid Brownell1-15/+18
Make "usage" messages use the same EBNF as the User's Guide; no angle brackets. Improve and correct various helptexts. Don't use "&function"; a function's name is its address. Remove a couple instances of pointless whitespace. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-28MinGW build fixesFreddie Chopin1-2/+2
Print "ssize_t" as "%ld" (+ cast to long) not as "%zu". Official MinGW (gcc 3.4.5) doesn't understand "z" flag. Signed-off-by: Freddie Chopin <freddie_chopin@op.pl> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-26cygwin 1.7 build fixesDavid Brownell1-1/+2
It's less accepting of signed char ... insisting that e.g. tolower() not receive one as a parameter. It's probably good to phase out such usage, given the number of bugs that lurk in the vicinity (assumptions that char is unsigned), so fix these even though such usage is actually legal. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-05misc code review updatesDavid Brownell1-2/+4
More updates from the code review by Steve Grubb <sgrubb@redhat.com>. The Jim float-comparision bug just gets a comment not a fix, though. Cc: Steve Grubb <sgrubb@redhat.com>. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-03change #include "target.h" to <target/target.h>Zachary T Welch1-1/+1
Changes from the flat namespace to heirarchical one. Instead of writing: #include "target.h" the following form should be used. #include <target/target.h> The exception is from .c files in the same directory.
2009-12-03change #include "time_support.h" to <helper/time_support.h>Zachary T Welch1-1/+1
Changes from the flat namespace to heirarchical one. Instead of writing: #include "time_support.h" the following form should be used. #include <helper/time_support.h> The exception is from .c files in the same directory.
2009-12-03change #include "log.h" to <helper/log.h>Zachary T Welch1-1/+1
Changes from the flat namespace to heirarchical one. Instead of writing: #include "log.h" the following form should be used. #include <helper/log.h> The exception is from .c files in the same directory.
2009-12-03change #include "fileio.h" to <helper/fileio.h>Zachary T Welch1-1/+1
Changes from the flat namespace to heirarchical one. Instead of writing: #include "fileio.h" the following form should be used. #include <helper/fileio.h> The exception is from .c files in the same directory.
2009-12-02mflash: factor init to 'mflash init'Zachary T Welch1-0/+23
Splits mflash initialiation to 'mflash init', called from 'init'.
2009-11-24mflash: use register_commands()Zachary T Welch1-17/+54
2009-11-24use COMMAND_REGISTER macroZachary T Welch1-6/+6
Replaces direct calls to register_command() with a macro, to allow its parameters to be changed and callers updated in phases.
2009-11-17command_handler: change 'cmd_ctx' to CMD_CTXZachary T Welch1-3/+3
Convert all command handler 'cmd_ctx' parameter usage with CMD_CTX.
2009-11-17command_handler: change 'args' to CMD_ARGVZachary T Welch1-17/+17
This patch converts all instances of 'args' in COMMAND_HANDLER routines to use CMD_ARGV macro.
2009-11-17command_handler: change to 'argc' to CMD_ARGCZachary T Welch1-4/+4
This patch converts all instances of 'argc' in COMMAND_HANDLER routines to use CMD_ARGC.
2009-11-16fileio: improve API typesZachary T Welch1-2/+4
Use size_t instead of uint32_t when specifying file sizes. Update all consumers up through the layers to use size_t when required. These changes should be safe, but the higher-levels will need to be updated further to receive the intended benefits (i.e. large file support). Add error checking for fileio_read and file_write. Previously, all errors were being silently ignored, so this change might cause some problems for some people in some cases. However, it gives us the chance to handle any errors that do occur at higher-levels, rather than burying our heads in the sand.
2009-11-16struct fileio: improve member typesZachary T Welch1-1/+1
Add const keyword to file url and cast to free(). Make size an ssize_t and chase all format strings that use it.
2009-11-16#include "target.h" less wildlyDavid Brownell1-0/+1
Don't include "target.h" from more headers than necessary. This avoids needless interdependencies and duplicated include paths. Don't needlessly include it in source files, either. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-13command_t -> struct commandZachary T Welch1-1/+1
Remove misleading typedef and redundant suffix from struct command.
2009-11-13command_context_t -> struct command_contextZachary T Welch1-2/+2
Remove misleading typedef and redundant suffix from struct command_context.
2009-11-13target_t -> struct targetZachary T Welch1-13/+13
Remove misleading typedef and redundant suffix from struct target.
2009-11-13mflash_bank_t -> struct mflash_bankZachary T Welch1-2/+2
Remove misleading typedef and redundant suffix from struct mflash_bank.
2009-11-13mg_drv_info_t -> struct mg_drv_infoZachary T Welch1-1/+1
Remove misleading typedef and redundant suffix from struct mg_drv_info.
2009-11-13mflash_gpio_drv_t -> struct mflash_gpio_drvZachary T Welch1-4/+4
Remove misleading typedef and redundant suffix from struct mflash_gpio_drv.
2009-11-13mflash_gpio_num_t -> struct mflash_gpio_numZachary T Welch1-8/+8
Remove misleading typedef and redundant suffix from struct mflash_gpio_num.
2009-11-13fileio_t -> struct fileioZachary T Welch1-2/+2
Remove useless structure typedef.
2009-11-13use COMMAND_HANDLER macro to define all commandsZachary T Welch1-6/+5
2009-11-09Overhaul time support APIZachary T Welch1-40/+34
This patch changes the duration_* API in several ways. First, it updates the API to use better names. Second, string formatting has been removed from the API (with its associated malloc). Finally, a new function added to convert the time into seconds, which can be used (or formatted) by the caller. This eliminates hidden calls to malloc that require associated calls to free(). This patch also removes the useless extern keyword from prototypes, and it eliminates the duration_t typedef (use 'struct duration'). These API also allows proper error checking, as it is possible for gettimeofday to fail in certain circumstances. The consumers have all been chased to use this new API as well, as there were relatively few cases doing this type of measurement. In most cases, the code performs additional checks for errors, but the calling code looks much cleaner in every case.
2009-11-05Improve mflash.c command argument parsing.Zachary T Welch1-6/+9
2009-10-14another portability updateDavid Brownell1-4/+4
Just use "%p" instead of consing up some integral type for pointer printf. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>