1. 19 7月, 2018 1 次提交
  2. 07 5月, 2018 1 次提交
    • T
      SPDX: Convert all of our single license tags to Linux Kernel style · 83d290c5
      Tom Rini 提交于
      When U-Boot started using SPDX tags we were among the early adopters and
      there weren't a lot of other examples to borrow from.  So we picked the
      area of the file that usually had a full license text and replaced it
      with an appropriate SPDX-License-Identifier: entry.  Since then, the
      Linux Kernel has adopted SPDX tags and they place it as the very first
      line in a file (except where shebangs are used, then it's second line)
      and with slightly different comment styles than us.
      
      In part due to community overlap, in part due to better tag visibility
      and in part for other minor reasons, switch over to that style.
      
      This commit changes all instances where we have a single declared
      license in the tag as both the before and after are identical in tag
      contents.  There's also a few places where I found we did not have a tag
      and have introduced one.
      Signed-off-by: NTom Rini <trini@konsulko.com>
      83d290c5
  3. 30 11月, 2017 1 次提交
  4. 02 4月, 2016 1 次提交
  5. 20 11月, 2015 1 次提交
  6. 28 8月, 2015 1 次提交
  7. 05 8月, 2015 1 次提交
  8. 28 10月, 2014 1 次提交
  9. 05 3月, 2014 2 次提交
    • Y
      Add 64-bit data support for memory commands · 4d1fd7f1
      York Sun 提交于
      Add 64-bit data for memory commands, such as md, mw, mm, cmp. The new
      size ".q " is introduced.
      
      For 64-bit architecture, 64-bit data is enabled by default, by detecting
      compiler __LP64__. It is optional for other architectures.
      Signed-off-by: NYork Sun <yorksun@freescale.com>
      4d1fd7f1
    • S
      Add cmd_process_error() to report and process errors · 16ff9902
      Simon Glass 提交于
      U-Boot now uses errors defined in include/errno.h which are negative
      integers. Commands which fail need to report the error and return 1
      to indicate failure. Add this functionality in cmd_process_error().
      
      For now this merely reports the error number. It would be possible
      also to produce a helpful error message by storing the error strings
      in U-Boot.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      16ff9902
  10. 14 1月, 2014 1 次提交
  11. 24 7月, 2013 1 次提交
  12. 04 2月, 2013 1 次提交
  13. 08 11月, 2012 1 次提交
  14. 05 11月, 2012 1 次提交
    • K
      common/misc: sparse fixes · 199adb60
      Kim Phillips 提交于
      command.c:44:38: error: bad constant expression
      dlmalloc.c:1468:2: warning: Using plain integer as NULL pointer
      dlmalloc.c:1468:5: warning: Using plain integer as NULL pointer
      dlmalloc.c:2176:12: warning: Using plain integer as NULL pointer
      dlmalloc.c:2179:31: warning: Using plain integer as NULL pointer
      dlmalloc.c:2382:14: warning: Using plain integer as NULL pointer
      dlmalloc.c:2436:14: warning: Using plain integer as NULL pointer
      dlmalloc.c:2582:31: warning: Using plain integer as NULL pointer
      dlmalloc.c:2585:17: warning: Using plain integer as NULL pointer
      dlmalloc.c:2646:14: warning: Using plain integer as NULL pointer
      dlmalloc.c:2659:19: warning: Using plain integer as NULL pointer
      dlmalloc.c:2692:19: warning: Using plain integer as NULL pointer
      dlmalloc.c:2707:19: warning: Using plain integer as NULL pointer
      dlmalloc.c:2708:14: warning: Using plain integer as NULL pointer
      dlmalloc.c:2786:31: warning: Using plain integer as NULL pointer
      dlmalloc.c:2801:12: warning: Using plain integer as NULL pointer
      dlmalloc.c:2801:22: warning: Using plain integer as NULL pointer
      dlmalloc.c:2926:27: warning: Using plain integer as NULL pointer
      dlmalloc.c:2928:14: warning: Using plain integer as NULL pointer
      dlmalloc.c:2929:12: warning: Using plain integer as NULL pointer
      dlmalloc.c:3075:14: warning: Using plain integer as NULL pointer
      hush.c:292:14: warning: symbol 'last_return_code' was not declared. Should it be static?
      hush.c:293:5: warning: symbol 'nesting_level' was not declared. Should it be static?
      hush.c:2175:20: warning: Using plain integer as NULL pointer
      hush.c:2175:34: warning: Using plain integer as NULL pointer
      hush.c:2210:41: warning: Using plain integer as NULL pointer
      hush.c:2216:45: warning: Using plain integer as NULL pointer
      hush.c:2249:25: warning: Using plain integer as NULL pointer
      hush.c:2332:13: warning: symbol 'new_pipe' was not declared. Should it be static?
      hush.c:2390:5: warning: symbol 'reserved_word' was not declared. Should it be static?
      hush.c:2927:5: warning: symbol 'parse_stream' was not declared. Should it be static?
      hush.c:3127:6: warning: symbol 'mapset' was not declared. Should it be static?
      hush.c:3133:6: warning: symbol 'update_ifs_map' was not declared. Should it be static?
      hush.c:3161:5: warning: symbol 'parse_stream_outer' was not declared. Should it be static?
      hush.c:3295:34: warning: Using plain integer as NULL pointer
      hush.c:3631:5: warning: symbol 'do_showvar' was not declared. Should it be static
      image.c:1282:29: warning: Using plain integer as NULL pointer
      image.c:1315:41: warning: Using plain integer as NULL pointer
      image.c:1330:25: warning: Using plain integer as NULL pointer
      image.c:1706:25: warning: Using plain integer as NULL pointer
      main.c:510:10: warning: symbol 'hist_num' was not declared. Should it be static?
      main.c:512:5: warning: symbol 'hist_list' was not declared. Should it be static?
      main.c:513:6: warning: symbol 'hist_lines' was not declared. Should it be static?
      usb_storage.c:195:6: warning: symbol 'usb_show_progress' was not declared. Should it be static?
      usb_storage.c:440:48: warning: Using plain integer as NULL pointer
      usb_storage.c:503:5: warning: symbol 'usb_stor_BBB_comdat' was not declared. Should it be static?
      usb_storage.c:551:5: warning: symbol 'usb_stor_CB_comdat' was not declared. Should it be static?
      usb_storage.c:629:55: warning: Using plain integer as NULL pointer
      usb_storage.c:620:5: warning: symbol 'usb_stor_CBI_get_status' was not declared. Should it be static?
      usb_storage.c:675:43: warning: Using plain integer as NULL pointer
      usb_storage.c:668:5: warning: symbol 'usb_stor_BBB_clear_endpt_stall' was not declared. Should it be static?
      usb_storage.c:679:5: warning: symbol 'usb_stor_BBB_transport' was not declared. Should it be static?
      usb_storage.c:801:5: warning: symbol 'usb_stor_CB_transport' was not declared. Sh
      xyzModem.c:104:1: warning: symbol 'CYGACC_COMM_IF_GETC_TIMEOUT' was not declared. Should it be static?
      xyzModem.c:122:1: warning: symbol 'CYGACC_COMM_IF_PUTC' was not declared. Should it be static?
      xyzModem.c:169:1: warning: symbol 'parse_num' was not declared. Should it be stat
      
      note: hush.c's nesting_level deleted because not used.
      Signed-off-by: NKim Phillips <kim.phillips@freescale.com>
      199adb60
  15. 22 10月, 2012 1 次提交
    • M
      common: Convert the U-Boot commands to LG-arrays · 6c7c946c
      Marek Vasut 提交于
      This patch converts the old method of creating a list of command
      onto the new LG-arrays code. The old u_boot_cmd section is converted
      to new u_boot_list_cmd subsection and LG-array macros used as needed.
      
      Minor adjustments had to be made to the common code to work with the
      LG-array macros, mostly the fixup_cmdtable() calls are now passed the
      ll_entry_start and ll_entry_count instead of linker-generated symbols.
      
      The command.c had to be adjusted as well so it would use the newly
      introduced LG-array API instead of directly using linker-generated
      symbols.
      Signed-off-by: NMarek Vasut <marex@denx.de>
      Cc: Joe Hershberger <joe.hershberger@gmail.com>
      Cc: Mike Frysinger <vapier@gentoo.org>
      6c7c946c
  16. 07 3月, 2012 2 次提交
  17. 24 10月, 2011 1 次提交
  18. 18 10月, 2011 1 次提交
  19. 16 10月, 2011 1 次提交
  20. 26 7月, 2011 1 次提交
  21. 10 1月, 2011 1 次提交
  22. 29 11月, 2010 1 次提交
    • M
      autocomplete: remove runtime handler install · 722b061b
      Mike Frysinger 提交于
      Rather than add runtime overhead of installing completion handlers, do it
      statically at build time.  This requires a new build time helper macro to
      declare a command and the completion handler at the same time.  Then we
      convert the env related funcs over to this.
      
      This gives an opportunity to also unify the U_BOOT_CMD macros.
      Signed-off-by: NMike Frysinger <vapier@gentoo.org>
      722b061b
  23. 28 11月, 2010 1 次提交
  24. 30 10月, 2010 1 次提交
  25. 20 9月, 2010 2 次提交
    • H
      relocation: fixup cmdtable · 620f1f6a
      Heiko Schocher 提交于
      fixup_cmdtable() did all work for fixing up the cmdtable,
      if CONFIG_RELOC_FIXUP_WORKS is not defined.
      
      CONFIG_RELOC_FIXUP_WORKS is missing for i386! I talked
      with Graeme Russ, and he will fix this soon.
      
      Portions of this work were supported by funding from
      the CE Linux Forum.
      Signed-off-by: NHeiko Schocher <hs@denx.de>
      620f1f6a
    • W
      New implementation for internal handling of environment variables. · ea882baf
      Wolfgang Denk 提交于
      Motivation:
      
      * Old environment code used a pessimizing implementation:
        - variable lookup used linear search => slow
        - changed/added variables were added at the end, i. e. most
          frequently used variables had the slowest access times => slow
        - each setenv() would calculate the CRC32 checksum over the whole
          environment block => slow
      * "redundant" envrionment was locked down to two copies
      * No easy way to implement features like "reset to factory defaults",
        or to select one out of several pre-defined (previously saved) sets
        of environment settings ("profiles")
      * No easy way to import or export environment settings
      
      ======================================================================
      
      API Changes:
      
      - Variable names starting with '#' are no longer allowed
      
        I didn't find any such variable names being used; it is highly
        recommended to follow standard conventions and start variable names
        with an alphanumeric character
      
      - "printenv" will now print a backslash at the end of all but the last
        lines of a multi-line variable value.
      
        Multi-line variables have never been formally defined, allthough
        there is no reason not to use them. Now we define rules how to deal
        with them, allowing for import and export.
      
      - Function forceenv() and the related code in saveenv() was removed.
        At the moment this is causing build problems for the only user of
        this code (schmoogie - which has no entry in MAINTAINERS); may be
        fixed later by implementing the "env set -f" feature.
      
      Inconsistencies:
      
      - "printenv" will '\\'-escape the '\n' in multi-line variables, while
        "printenv var" will not do that.
      
      ======================================================================
      
      Advantages:
      
      - "printenv" output much better readable (sorted)
      - faster!
      - extendable (additional variable properties can be added)
      - new, powerful features like "factory reset" or easy switching
        between several different environment settings ("profiles")
      
      Disadvantages:
      
      - Image size grows by typically 5...7 KiB (might shrink a bit again on
        systems with redundant environment with a following patch series)
      
      ======================================================================
      
      Implemented:
      
      - env command with subcommands:
      
        - env print [arg ...]
      
          same as "printenv": print environment
      
        - env set [-f] name [arg ...]
      
          same as "setenv": set (and delete) environment variables
      
          ["-f" - force setting even for read-only variables - not
          implemented yet.]
      
        - end delete [-f] name
      
          not implemented yet
      
          ["-f" - force delete even for read-only variables]
      
        - env save
      
          same as "saveenv": save environment
      
        - env export [-t | -b | -c] addr [size]
      
          export internal representation (hash table) in formats usable for
          persistent storage or processing:
      
      	-t:	export as text format; if size is given, data will be
      		padded with '\0' bytes; if not, one terminating '\0'
      		will be added (which is included in the "filesize"
      		setting so you can for exmple copy this to flash and
      		keep the termination).
      	-b:	export as binary format (name=value pairs separated by
      		'\0', list end marked by double "\0\0")
      	-c:	export as checksum protected environment format as
      		used for example by "saveenv" command
      	addr:	memory address where environment gets stored
      	size:	size of output buffer
      
      	With "-c" and size is NOT given, then the export command will
      	format the data as currently used for the persistent storage,
      	i. e. it will use CONFIG_ENV_SECT_SIZE as output block size and
      	prepend a valid CRC32 checksum and, in case of resundant
      	environment, a "current" redundancy flag. If size is given, this
      	value will be used instead of CONFIG_ENV_SECT_SIZE; again, CRC32
      	checksum and redundancy flag will be inserted.
      
      	With "-b" and "-t", always only the real data (including a
      	terminating '\0' byte) will be written; here the optional size
      	argument will be used to make sure not to overflow the user
      	provided buffer; the command will abort if the size is not
      	sufficient. Any remainign space will be '\0' padded.
      
              On successful return, the variable "filesize" will be set.
              Note that filesize includes the trailing/terminating '\0'
              byte(s).
      
              Usage szenario: create a text snapshot/backup of the current
      	settings:
      
      		=> env export -t 100000
      		=> era ${backup_addr} +${filesize}
      		=> cp.b 100000 ${backup_addr} ${filesize}
      
      	Re-import this snapshot, deleting all other settings:
      
      		=> env import -d -t ${backup_addr}
      
        - env import [-d] [-t | -b | -c] addr [size]
      
          import external format (text or binary) into hash table,
          optionally deleting existing values:
      
      	-d:	delete existing environment before importing;
      		otherwise overwrite / append to existion definitions
      	-t:	assume text format; either "size" must be given or the
      		text data must be '\0' terminated
      	-b:	assume binary format ('\0' separated, "\0\0" terminated)
      	-c:	assume checksum protected environment format
      	addr:	memory address to read from
      	size:	length of input data; if missing, proper '\0'
      		termination is mandatory
      
        - env default -f
      
          reset default environment: drop all environment settings and load
          default environment
      
        - env ask name [message] [size]
      
          same as "askenv": ask for environment variable
      
        - env edit name
      
          same as "editenv": edit environment variable
      
        - env run
      
          same as "run": run commands in an environment variable
      
      ======================================================================
      
      TODO:
      
      - drop default env as implemented now; provide a text file based
        initialization instead (eventually using several text files to
        incrementally build it from common blocks) and a tool to convert it
        into a binary blob / object file.
      
      - It would be nice if we could add wildcard support for environment
        variables; this is needed for variable name auto-completion,
        but it would also be nice to be able to say "printenv ip*" or
        "printenv *addr*"
      
      - Some boards don't link any more due to the grown code size:
        DU405, canyonlands, sequoia, socrates.
      
      	=> cc: Matthias Fuchs <matthias.fuchs@esd-electronics.com>,
      	       Stefan Roese <sr@denx.de>,
      	       Heiko Schocher <hs@denx.de>
      
      - Dropping forceenv() causes build problems on schmoogie
      
      	=> cc: Sergey Kubushyn <ksi@koi8.net>
      
      - Build tested on PPC and ARM only; runtime tested with NOR and NAND
        flash only => needs testing!!
      Signed-off-by: NWolfgang Denk <wd@denx.de>
      Cc: Matthias Fuchs <matthias.fuchs@esd-electronics.com>,
      Cc: Stefan Roese <sr@denx.de>,
      Cc: Heiko Schocher <hs@denx.de>
      Cc: Sergey Kubushyn <ksi@koi8.net>
      ea882baf
  26. 25 7月, 2010 1 次提交
  27. 05 7月, 2010 1 次提交
    • W
      Make sure that argv[] argument pointers are not modified. · 54841ab5
      Wolfgang Denk 提交于
      The hush shell dynamically allocates (and re-allocates) memory for the
      argument strings in the "char *argv[]" argument vector passed to
      commands.  Any code that modifies these pointers will cause serious
      corruption of the malloc data structures and crash U-Boot, so make
      sure the compiler can check that no such modifications are being done
      by changing the code into "char * const argv[]".
      
      This modification is the result of debugging a strange crash caused
      after adding a new command, which used the following argument
      processing code which has been working perfectly fine in all Unix
      systems since version 6 - but not so in U-Boot:
      
      int main (int argc, char **argv)
      {
      	while (--argc > 0 && **++argv == '-') {
      /* ====> */	while (*++*argv) {
      			switch (**argv) {
      			case 'd':
      				debug++;
      				break;
      			...
      			default:
      				usage ();
      			}
      		}
      	}
      	...
      }
      
      The line marked "====>" will corrupt the malloc data structures and
      usually cause U-Boot to crash when the next command gets executed by
      the shell.  With the modification, the compiler will prevent this with
      an
      	error: increment of read-only location '*argv'
      
      N.B.: The code above can be trivially rewritten like this:
      
      	while (--argc > 0 && **++argv == '-') {
      		char *arg = *argv;
      		while (*++arg) {
      			switch (*arg) {
      			...
      Signed-off-by: NWolfgang Denk <wd@denx.de>
      Acked-by: NMike Frysinger <vapier@gentoo.org>
      54841ab5
  28. 06 5月, 2010 1 次提交
  29. 23 11月, 2009 1 次提交
  30. 13 6月, 2009 2 次提交
    • W
      General help message cleanup · a89c33db
      Wolfgang Denk 提交于
      Many of the help messages were not really helpful; for example, many
      commands that take no arguments would not print a correct synopsis
      line, but "No additional help available." which is not exactly wrong,
      but not helpful either.
      
      Commit ``Make "usage" messages more helpful.'' changed this
      partially. But it also became clear that lots of "Usage" and "Help"
      messages (fields "usage" and "help" in struct cmd_tbl_s respective)
      were actually redundant.
      
      This patch cleans this up - for example:
      
      Before:
      	=> help dtt
      	dtt - Digital Thermometer and Thermostat
      
      	Usage:
      	dtt         - Read temperature from digital thermometer and thermostat.
      
      After:
      	=> help dtt
      	dtt - Read temperature from Digital Thermometer and Thermostat
      
      	Usage:
      	dtt
      Signed-off-by: NWolfgang Denk <wd@denx.de>
      a89c33db
    • W
      Make "usage" messages more helpful. · 94796d85
      Wolfgang Denk 提交于
      In case of incorrect command invocations U-Boot used to print pretty
      useless "usage" messages, for example:
      
      	=> nand markbad
      	Usage:
      	nand - NAND sub-system
      
      In the result, the user would have to run the "help" command to get
      the (available) information about correct command usage. Change this,
      so that this information gets always printed.
      
      Note that this changes the user interface of all commands, but
      hopefully to the better.
      Signed-off-by: NWolfgang Denk <wd@denx.de>
      94796d85
  31. 28 3月, 2009 1 次提交
  32. 28 1月, 2009 2 次提交
  33. 19 10月, 2008 2 次提交
  34. 11 9月, 2008 1 次提交