summaryrefslogtreecommitdiff
path: root/common/main.c
AgeCommit message (Collapse)Author
2010-10-21Replace MAX_CMDBUF_SIZE references with CONFIG_SYS_CBSIZEPeter Tyser
The MAX_CMDBUF_SIZE define is unneeded as it should always equal CONFIG_SYS_CBSIZE. Change-Id: I90a9dedb48478d39e3fd112a892f9dca73116b5e Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/6819 Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com> Tested-by: Michael BRANDT <michael.brandt@stericsson.com> Reviewed-by: Mikael LARSSON <mikael.xt.larsson@stericsson.com>
2010-10-21cmd editing: optimize/shrink output blankingMike Frysinger
No need to output spaces 1 char at a time in a loop when the printf code can do the same thing with the right format string. This shrinks things and gives a nice speed up when killing off lines more than a byte or two as printf will send out the buffer in one big chunk. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Change-Id: Ic1e4eb92b6d9c61efec585433152c907e449fe44 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/6818 Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com> Tested-by: Michael BRANDT <michael.brandt@stericsson.com>
2010-10-21FIX: watchdog timeout, while waiting for inputJens Scharsig
* add WATCHDOG_RESET to !tstc() loops * prevents watchdog timeout, while waiting for input, if CONFIG_BOOT_RETRY_TIME or CONFIG_SHOW_ACTIVITY defined Signed-off-by: Jens Scharsig <js_at_ng@scharsoft.de> Change-Id: I78493dddbae5293c4f0690ee05837c3818456c70 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/6817 Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com> Tested-by: Michael BRANDT <michael.brandt@stericsson.com>
2010-10-21cmd history: Match history buffer size to console bufferJohn Schmoller
Match history buffer size to console buffer size. History buffer size was hard coded to 256, artificially limiting the command buffer size. The history buffer now tracks CONFIG_SYS_CBSIZE. Signed-off-by: John Schmoller <jschmoller@xes-inc.com> Change-Id: I3001f40c7637fe4ed16b7ac7e05524d8905d66e5 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/6816 Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com> Tested-by: Michael BRANDT <michael.brandt@stericsson.com>
2010-10-21console: Fix console buffer overrunJohn Schmoller
When CONFIG_SYS_CBSIZE equals MAX_CMDBUF_SIZE, a command string of maximum length will overwrite part of the history buffer, causing the board to die. Expand the console_buffer and hist_lines buffer by one character each to hold the missing NULL char. Signed-off-by: John Schmoller <jschmoller@xes-inc.com> Change-Id: I6ec005d373e81353aa09d3cd3962f279629e7681 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/6815 Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com> Tested-by: Michael BRANDT <michael.brandt@stericsson.com>
2010-10-21Move CONFIG_UPDATE_TFTP code after CONFIG_PREBOOTWolfgang Denk
The auto-update feature (CONFIG_UPDATE_TFTP) requires that the env variable serverip be set for the TFTP access. If DHCP is to be used to get the serverip env variable, this doesn't work as DHCP happens after the auto-update attempt has run. A solution is to run DHCP in PREBOOT, but even this is too late. To solve this, we move update_tftp() below the PREBOOT stuff. Signed-off-by: Wolfgang Denk <wd@denx.de> Change-Id: I966d6c549e172c183f6ea894eb29440c1df4bf46 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/6814 Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com> Tested-by: Michael BRANDT <michael.brandt@stericsson.com> Reviewed-by: Mikael LARSSON <mikael.xt.larsson@stericsson.com> Reviewed-by: Joakim AXELSSON <joakim.axelsson@stericsson.com>
2010-07-23boottime: Minor clean up and added u-boot command for displaying the current ↵Jonas Aaberg
boot time status. Change-Id: Ifdfea22cc1d587469a18b22a20c0dc14aeaa49c9 Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/2502 Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com>
2010-07-23Boottime changes. Moved generic boottime code from lib_arm to common. ↵Jonas Aaberg
Boottime now internally uses us instead of ticks. Reviewed-by: Michael Brandt <michael.brandt@stericsson.com> Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Change-Id: If30d2eb384d6e82daa86c3cab7a6fd2a22baefb5 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/3053 Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com>
2009-10-27readline(): Add ability to modify a string bufferPeter Tyser
If the 'buf' parameter is a non-0-length string, its contents will be edited. Previously, the initial contents of 'buf' were ignored and the user entered its contents from scratch. This change is necessary to support the upcoming "editenv" command but could also be used for future commands which require a user to modify an existing string. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-10-27cread_line(): Remove unused variablesPeter Tyser
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-10-27Check for NULL prompt in readline_into_buffer()Peter Tyser
Previously, passing readline() or readline_into_buffer() a NULL 'prompt' parameter would result in puts() printing garbage when CONFIG_CMDLINE_EDITING was enabled. Note that no board currently triggers this bug. Enabling CONFIG_CMDLINE_EDITING on some boards (eg bab7xx) would result in the bug appearing. This change is only intended to prevent someone from running into this issue in the future. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-05-15Remove inline qualifier from show_boot_progress()Emil Medve
The 'inline' is conflicting with the semantic of 'weak' attribute and with the way the show_boot_progress() function is used. Also gcc 4.4 is complaining about it: main.c:51: error: inline function 'show_boot_progress' cannot be declared weak Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
2009-01-28Standardize command usage messages with cmd_usage()Peter Tyser
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-01-24common/main: support bootdelay=0 for CONFIG_AUTOBOOT_KEYEDPeter Korsgaard
Support bootdelay=0 in abortboot for the CONFIG_AUTOBOOT_KEYED case similar to the CONFIG_ZERO_BOOTDELAY_CHECK support for the !CONFIG_AUTOBOOT_KEYED case. Do this by reversing the loop so we do at least one iteration before checking for timeout. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2008-10-18rename CFG_ macros to CONFIG_SYSJean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-10-18hush: add showvar command for hush shell.Heiko Schocher
This new command shows the local variables defined in the hush shell: => help showvar showvar - print values of all hushshell variables showvar name ... - print value of hushshell variable 'name' Also make the set_local_var() and unset_local_var () no longer static, so it is possible to define local hush shell variables at boot time. If CONFIG_HUSH_INIT_VAR is defined, u-boot calls hush_init_var (), where boardspecific code can define local hush shell variables at boottime. Signed-off-by: Heiko Schocher <hs@denx.de>
2008-10-18Automatic software update from TFTP serverBartlomiej Sieka
The auto-update feature allows to automatically download software updates from a TFTP server and store them in Flash memory during boot. Updates are contained in a FIT file and protected with SHA-1 checksum. More detailed description can be found in doc/README.update. Signed-off-by: Rafal Czubak <rcz@semihalf.com> Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
2008-08-06Fix merge problemsStefan Roese
Signed-off-by: Stefan Roese <sr@denx.de>
2008-07-09Fix printf errors.Andrew Klossner
The compiler will help find mismatches between printf formats and arguments if you let it. This patch adds the necessary attributes to declarations in include/common.h, then begins to correct the resulting compiler warnings. Some of these were bugs, e.g., "$d" instead of "%d" and incorrect arguments. Others were just annoying, like int-long mismatches on a system where both are 32 bits. It's worth fixing the annoying errors to catch the real ones. Signed-off-by: Andrew Klossner <andrew@cesa.opbu.xerox.com>
2008-06-03Additional fix to readline_into_buffer() with CONFIG_CMDLINE_EDITING before ↵Peter Tyser
relocating Removed unneeded command line history initialization. Also, the original code would access the 'initted' variable before relocation to SDRAM which resulted in erratic behavior since the bss is not initialized when executing from flash. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2008-05-09Fix readline_into_buffer() with CONFIG_CMDLINE_EDITING before relocatingJames Yang
When CONFIG_CMDLINE_EDITING is enabled, readline_into_buffer() doesn't work before relocating to RAM because command history is written into a global array that is not writable before relocation. This patch defers to the no-editing and no-history code in readline_into_buffer() if it is called before relocation. Signed-off-by: James Yang <James.Yang@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-03-18The patch introduces the CRITICAL feature of POST tests. If the test marked ↵Yuri Tikhonov
as POST_CRITICAL fails then the alternative, post_critical, boot-command is used. If this command is not defined then U-Boot enters into interactive mode. Signed-off-by: Dmitry Rakhchev <rda@emcraft.com> Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
2008-01-12Make bootretry work when command line editing is enabledAndreas Engel
Currently, when CONFIG_CMDLINE_EDITING is set, bootretry doesn't work. This patch fixes the problem. Signed-off-by: Andreas Engel <andreas.engel@ericsson.com>
2008-01-11Fix compiler warningKumar Gala
main.c: In function 'readline_into_buffer': main.c:927: warning: unused variable 'p_buf' Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-01-09Expose parse_line() globally.James Yang
Add new function readline_into_buffer() that allows the output of readline to be put into a pointer to char buffer. This refactoring allows other functions besides the main command loop to also use the same input mechanism. Signed-off-by: James Yang <James.Yang@freescale.com> Acked-by: Jon Loeliger <jdl@freescale.com>
2008-01-09Allow CONFIG_AUTO_COMPLETE and command history CONFIG_CMDLINE_EDITING at the ↵Jean-Christophe PLAGNIOL-VILLARD
sametime Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2007-08-06Merge with /home/wd/git/u-boot/custodian/u-boot-testingWolfgang Denk
2007-07-13make show_boot_progress () weak.Heiko Schocher
Signed-off-by: Heiko Schocher <hs@denx.de>
2007-07-10common/: Remove lingering references to CFG_CMD_* symbols.Jon Loeliger
Fixed some broken instances of "#ifdef CMD_CFG_IDE" too. Those always evaluated TRUE, and thus were always compiled even when IDE really wasn't defined/wanted. Signed-off-by: Jon Loeliger <jdl@freescale.com>
2007-07-08common/* non-cmd*: Remove obsolete references to CONFIG_COMMANDSJon Loeliger
Signed-off-by: Jon Loeliger <jdl@freescale.com>
2007-07-04common/ non-cmd: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).Jon Loeliger
This is a compatibility step that allows both the older form and the new form to co-exist for a while until the older can be removed entirely. All transformations are of the form: Before: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) After: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT) Signed-off-by: Jon Loeliger <jdl@freescale.com>
2007-07-03Merge with /home/wd/git/u-boot/custodian/u-boot-testingWolfgang Denk
2007-06-22Coding stylke cleanup; rebuild CHANGELOGWolfgang Denk
2007-06-12Fix 'run' not to continue after interrupted commandDetlev Zundel
Signed-off-by: Detlev Zundel <dzu@denx.de>
2007-05-28Merge with /home/tur/git/u-boot#motionproWolfgang Denk
2007-05-27Fix: Add missing NULL termination in strings expanded by macros parser.Bartlomiej Sieka
Signed-off-by: Piotr Kruszynski <ppk@semihalf.com> Acked-by: Bartlomiej Sieka <tur@semihalf.com>
2007-05-05Merge with /home/git/u-bootWolfgang Denk
2007-05-05[PATCH] simplify silent consoleLadislav Michl
Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Acked-by: Stefan Roese <sr@denx.de>
2007-04-25[PATCH] simplify silent consoleLadislav Michl
Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Acked-by: Stefan Roese <sr@denx.de>
2006-10-28Minor code cleanup.Wolfgang Denk
2006-08-07Fix control-c handing in CONFIG_CMDLINE_EDITINGStefan Roese
Properly pass break code back from readline. Patch by Roger Blofeld, 31 Jul 2006
2006-07-27Fix CONFIG_CMDLINE_EDITING implementationStefan Roese
Patch by Stefan Roese, 27 Jul 2006
2006-07-21Minor code cleanup.Wolfgang Denk
2006-07-21Add readline cmdline-editing extensionWolfgang Denk
Patch by JinHua Luo, 01 Sep 2005
2006-03-31GCC-4.x fixes: clean up global data pointer initialization for all boards.Wolfgang Denk
2006-03-12Avoid dereferencing NULL in find_cmd() if no valid commands were foundWolfgang Denk
Patch by Andrew Dyer, 13 Jun 2005
2005-10-13Cleanup for GCC-4.xWolfgang Denk
2005-09-30Fix compiler warningWolfgang Denk
2005-09-25Remove unneeded #include <malloc.h>Wolfgang Denk
Patch by Ladislav Michl, 22 Feb 2005
2005-01-09* Patch by Sam Song, 11 October 2004:wdenk
- Add RESET/PREBOOT/AUTOBOOT support for RPXlite_DW board - Adjust CPU:BUS frequency ratio 1:1 when core frequency less than 50MHz * Patch by Sam Song, 10 Oct 2004: Fix a parameter error in run_command() in main.c