summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* Rename getenv_r() into getenv_f()Wolfgang Denk2010-08-041-1/+1
| | | | | | | | | | | | | | | | | | | While running from flash, i. e. before relocation, we have only a limited C runtime environment without writable data segment. In this phase, some configurations (for example with environment in EEPROM) must not use the normal getenv(), but a special function. This function had been called getenv_r(), with the idea that the "_r" suffix would mean the same as in the _r_eentrant versions of some of the C library functions (for example getdate vs. getdate_r, getgrent vs. getgrent_r, etc.). Unfortunately this was a misleading name, as in U-Boot the "_r" generally means "running from RAM", i. e. _after_ relocation. To avoid confusion, rename into getenv_f() [as "running from flash"] Signed-off-by: Wolfgang Denk <wd@denx.de> Acked-by: Detlev Zundel <dzu@denx.de>
* bootm: fix pointer warning with lzmaMike Frysinger2010-08-041-2/+5
| | | | | | | | | | | | | Avoid warning: cmd_bootm.c: In function 'bootm_load_os': cmd_bootm.c:394: warning: passing argument 2 of 'lzmaBuffToBuffDecompress' from incompatible pointer type For 32 bit systems, this change shouldn't make a difference to code size since sizeof(size_t) and sizeof(unsigned int) are equal. But it does fix the warning. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* fdt: Add function to alloc phandle valuesKumar Gala2010-07-261-0/+18
| | | | | | | | | | If we are creating reference (handles) to nodes in a device tree we need to first create a new phandle in node and this needs a new phandle value. So we search through the whole dtb to find the max phandle value and return the next greater value for a new phandle allocation. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Gerald Van Baren <vanbaren@cideas.com>
* fs/fat: Big code cleanup.Wolfgang Denk2010-07-241-172/+38
| | | | | | | | - reformat - throw out macros like FAT_DPRINT and FAT_DPRINT - remove dead code Signed-off-by: Wolfgang Denk <wd@denx.de>
* usb_storage.c: change progress output in debug() messageWolfgang Denk2010-07-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dots printed by common/usb_storage.c as progress meter corrupt the output for example of "fatls usb" commands like this: => fatls usb 0 . <<==== here 29 file.001 29 file.002 29 file.003 29 file.004 29 file.005 29 file.006 29 file.007 29 file.008 29 file.009 29 file.010 29 file.011 29 file.012 29 file.013 29 file.014 29 file.015 29 file.016 . <<==== here 29 file.017 29 file.018 29 file.019 ... Turn the progress output into a debug message. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Remy Bohmer <linux@bohmer.net>
* usb_storage.c: initialize device typeWolfgang Denk2010-07-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The device type was left uninitialized which caused later tests against DEV_TYPE_UNKNOWN to fail. In the result, "usb part" would attempt to print information about non-existent devices like this: => usb part print_part of 0 Partition Map for USB device 0 -- Partition Type: DOS Partition Start Sector Num Sectors Type 1 0 2031616 f8 print_part of 1 ## Unknown partition table print_part of 2 ## Unknown partition table print_part of 3 ## Unknown partition table print_part of 4 ## Unknown partition table => By initializing the type as DEV_TYPE_UNKNOWN we avoid all the "Unknown partition table" messages. [Note: the "print_part of ?" messages is left over debug code that will be removed in another patch.] Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Remy Bohmer <linux@bohmer.net>
* cmd_usage(): simplify return code handlingWolfgang Denk2010-07-2447-498/+270
| | | | | | | | | | | | | | | | Lots of code use this construct: cmd_usage(cmdtp); return 1; Change cmd_usage() let it return 1 - then we can replace all these ocurrances by return cmd_usage(cmdtp); This fixes a few places with incorrect return code handling, too. Signed-off-by: Wolfgang Denk <wd@denx.de>
* fdt: Add fdt_node_offset_by_compat_reg helperKumar Gala2010-07-201-0/+27
| | | | | | | | | | | Given a compatible string and physical address try and find a node that matches. This is useful when we want to find a specific device node to update (for example if we have multiple PCI nodes we can use the physical address to distinguish them when trying to update the device tree). Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Gerald Van Baren <vanbaren@cideas.com>
* fdt: Add fdt_translate_address to convert reg node to cpu phys addrKumar Gala2010-07-201-0/+264
| | | | | | | | | | | | | This code is extracted out of the Linux Kernel code from arch/powerpc/kernel/prom_parse.c. We maintain some of the same structure to support multiple bus types even though we only have one in the current code. In the future we might want to translate across a PCI bus and thus it will be easier to add that functionality back in. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Gerald Van Baren <vanbaren@cideas.com>
* Drop support for GTH boardWolfgang Denk2010-07-171-1/+1
| | | | | | | | | | | | | | | The board maintainer states: The GTH board is obsolete and has not been manufactured for several years. To my knowledge, no recent U-Boot build has been tested on that card. So drop support for this board. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Thomas Lange <thomas@corelatus.se> Acked-by: Thomas Lange<thomas@corelatus.se>
* Merge branch 'master' of git://git.denx.de/u-boot-mpc85xxWolfgang Denk2010-07-162-129/+5
|\
| * mpc85xx: Add reginfo commandBecky Bruce2010-07-161-0/+5
| | | | | | | | | | | | | | | | The new command dumps the TLBCAM, the LAWs, and the BR/OR regs. Add CONFIG_CMD_REGINFO to the config for all MPC85xx parts. Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
| * fdt: move fsl specific code from common fdt area to mpc8xxx/fdt.cKim Phillips2010-07-161-129/+0
| | | | | | | | | | Signed-off-by: Kim Phillips <kim.phillips@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* | Enable PXAFB for PXA27X and PXA3XXMarek Vasut2010-07-141-6/+6
|/
* NAND: formatting cleanups from env.oob supportScott Wood2010-07-122-40/+40
| | | | | | | | | | | | | | | | | | | | Change if (ok) { bunch of stuff } else { error } to if (error) { get out } proceed with bunch of stuff Plus a few whitespace cleanups. Signed-off-by: Scott Wood <scottwood@freescale.com>
* NAND: environment offset in OOB (CONFIG_ENV_OFFSET_OOB)Ben Gardiner2010-07-122-1/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a re-submission of the patch by Harald Welte <laforge@openmoko.org> with minor modifications for rebase and changes as suggested by Scott Wood <scottwood@freescale.com> [1] [2]. This patch enables the environment partition to have a run-time dynamic location (offset) in the NAND flash. The reason for this is simply that all NAND flashes have factory-default bad blocks, and a fixed compile time offset would mean that sometimes the environment partition would live inside factory bad blocks. Since the number of factory default blocks can be quite high (easily 1.3MBytes in current standard components), it is not economic to keep that many spare blocks inside the environment partition. With this patch and CONFIG_ENV_OFFSET_OOB enabled, the location of the environment partition is stored in the out-of-band (OOB) data of the first block in flash. Since the first block is where most systems boot from, the vendors guarantee that the first block is not a factory default block. This patch introduces the 'nand env.oob' command, which can be called from the u-boot command line. 'nand env.oob get' reads the address of the environment partition from the OOB data, 'nand env.oob set {offset,partition-name}' allows the setting of the marker by specifying a numeric offset or a partition name. [1] http://article.gmane.org/gmane.comp.boot-loaders.u-boot/43916 [2] http://article.gmane.org/gmane.comp.boot-loaders.u-boot/79195 Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca> Acked-by: Harald Welte <laforge@gnumonks.org>
* Make sure that argv[] argument pointers are not modified.Wolfgang Denk2010-07-0483-267/+268
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Wolfgang Denk <wd@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
* Redundant environment: move flag definitions to header fileWolfgang Denk2010-07-042-8/+0
| | | | | | | Instead of defining the flags sevaral times in different source files (which is error prone), move them to a central place in a header file. Signed-off-by: Wolfgang Denk <wd@denx.de>
* Make *printf() return "int" instead of "void"Wolfgang Denk2010-07-041-4/+8
| | | | | | | | | | Change the return type of the *printf() functions to the standard "int"; no changes are needed but returning the already available length count. This will save a few additional strlen() calls later... Signed-off-by: Wolfgang Denk <wd@denx.de>
* exports.c: fix warning: 'dummy' defined but not usedWolfgang Denk2010-07-041-1/+1
| | | | | | | Also get rid of the #ifdef's while doing this. Suggested-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Wolfgang Denk <wd@denx.de>
* cmd_ide.c: fix unused variable warning for SC3 boardWolfgang Denk2010-07-041-1/+0
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* shannon/INFERNO: fix special handling of environment configurationWolfgang Denk2010-07-042-16/+0
| | | | | | | | | | | Remove some INFERNO related #ifdef's from common environment code by fixing the board configuration settings (add CONFIG_ENV_SECT_SIZE). While we are at it, fix comment which incorrectly talks about 4 KB environment size, while it's actually 0x4000 = 16 KiB. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Rolf Offermanns <rof@sysgo.de>
* add redundant environment for env_sf.cWolfgang Wegner2010-06-301-0/+232
| | | | | | | | | | | | | | | | | | | | This patch adds redundant environment for environment in SPI flash. I took env_flash.c as an example and slightly modified it. Apart from adapting things to SF, I also slightly changed the decision logic to use area 2 as a default in case the flags are wrong because not having a default path worried me. I did not add a section for CONFIG_ENV_IS_IN_SPI_FLASH in environment.h because I did not understand if this is desired and/or needed. So to use the feature, one has to set CONFIG_ENV_OFFSET_REDUND _and_ CONFIG_SYS_REDUNDAND_ENVIRONMENT. I checked it by powering off my board several times during flash erase or write, because I do not know if there are other stress test scenarios. Signed-off-by: Wolfgang Wegner <w.wegner@astro-kom.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
* Merge branch 'master' into nextWolfgang Denk2010-06-301-1/+1
|\
| * Fix console_buffer size conflict error.Remy Bohmer2010-06-291-1/+1
| | | | | | | | | | | | | | | | The console_buffer size is declared in common/main.c as -- char console_buffer[CONFIG_SYS_CBSIZE + 1]; so this extern definition is wrong. Signed-off-by: Remy Bohmer <linux@bohmer.net>
* | Fix #if chain and added AVR32 case in cmd_bdinfo.cReinhard Meyer2010-06-291-9/+35
| | | | | | | | | | | | | | | | | | | | | | AVR32 case was missing in cmd_bdinfo, resulting in compiler warning (bd->bi_baudrate declared unsigned int at AVR32, but printf used %d) At the same time slightly reordered #if #elif #endif to make ARM one of the cases and not an extra case surrounding all others Signed-off-by: Reinhard Meyer <info@emk-elektronik.de> Tested-by: Andreas Bießmann <biessmann@corscience.de>
* | hwconfig: Add some unit testsAnton Vorontsov2010-06-291-0/+55
| | | | | | | | | | | | | | I use this for testing, and I think this might be useful in the future. Signed-off-by: Anton Vorontsov <avorontsov@mvista.com>
* | hwconfig: Fix stop characters parsing for subkeysAnton Vorontsov2010-06-291-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the following hwconfig string: key1:subkey1=value1,subkey2=value2;key2:value3 The subkey2 cannot be extracted correctly. The parsing code looks for comma as a stopch, but there may be two kind of stop characters: a comma and a semicolon. Currently the code would return "value2;key2:value3", while just "value2" is the correct answer. This patch fixes the issue by making the code aware of multiple stop characters. For old U-Boots, the issue can be workarounded by placing a comma before a semicolon, i.e.: hwconfig=key1:subkey1=value1,subkey2=value2,;key2:value3 Reported-by: York Sun <yorksun@freescale.com> Signed-off-by: Anton Vorontsov <avorontsov@mvista.com>
* | Remove AmigaOneG3SE boardWolfgang Denk2010-06-238-253/+7
|/ | | | | | | | | | The AmigaOneG3SE board has been orphaned or a very long time, and broken for more than 12 releases resp. more than 3 years. As nobody seems to be interested any more in this stuff we may as well ged rid of it, especially as it clutters many areas of the code so it is a continuous pain for all kinds of ongoing work. Signed-off-by: Wolfgang Denk <wd@denx.de>
* Prepare v2010.06-rc3Wolfgang Denk2010-06-231-1/+1
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* fdt_support: add entry for sec3.1 and fix sec3.3Kim Phillips2010-05-301-1/+2
| | | | | | | | | | | | | | Add sec3.1 h/w geometry for fdt node fixups. Also, technically, whilst SEC v3.3 h/w honours the tls_ssl_stream descriptor type, it lacks the ARC4 algorithm execution unit required to be able to execute anything meaningful with it. Change the node to agree with the documentation that declares that the sec3.3 really doesn't have such a descriptor type. Reported-by: Haiying Wang <Haiying.Wang@freescale.com> Signed-off-by: Kim Phillips <kim.phillips@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* nios: remove nios-32 archThomas Chou2010-05-283-22/+0
| | | | | | The nios-32 arch is obsolete and broken. So it is removed. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* Fix "par[t]ition" typo.Wolfgang Denk2010-05-212-4/+4
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Enabled support for Rev 1.3 SPD for DDR2 DIMMsYork Sun2010-05-121-1/+5
| | | | | | | | | | | | | | SPD has minor change from Rev 1.2 to 1.3. This patch enables Rev 1.3. The difference has ben examined and the code is compatible. Speed bins is not verified on hardware for CL7 at this moment. This patch also enables SPD Rev 1.x where x is up to "F". According to SPD spec, the lower nibble is optionally used to determine which additinal bytes or attribute bits have been defined. Software can safely use defaults. However, the upper nibble should always be checked. Signed-off-by: York Sun <yorksun@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* cmd_usb.c: show cmd usage if no args givenSerge Ziryukin2010-05-061-0/+5
| | | | Signed-off-by: Serge Ziryukin <ftrvxmtrx@gmail.com>
* Move test for unnecessary memmove to memmove_wd()Larry Johnson2010-05-062-5/+5
| | | | Signed-off-by: Larry Johnson <lrj@acm.org>
* command.c: Enable auto tab for the editenv commandTrübenbach, Ralf2010-05-061-0/+3
| | | | | | | Enable the auto completion (with TAB) of the environment variable name after the editenv command. Signed-off-by: Ralf Trübenbach <ralf.truebenbach@men.de>
* x86: Use CONFIG_SERIAL_MULTIGraeme Russ2010-05-061-1/+2
| | | | Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
* cmd_onenand.c: moved to standard subcommand handlingFrans Meulenbroeks2010-05-051-115/+192
| | | | | | | | | | | | | | | | | | | | | On the fly also fixed the following things: - write help talked about a parameter oob, but that one was not used, so removed it from the help message. - the test command also allowed a force subcommand but didn't use it. eliminated the code. - do_onenand made static - do_onenand contained int blocksize; ... mtd = &onenand_mtd; this = mtd->priv; blocksize = (1 << this->erase_shift); As blocksize was not used the last two statements were unneeded so removed them. The first statement (mtd = ....) assigns to a global. Not sure if it is needed, and since I could not test this, left the line for now Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
* Merge branch 'master' of git://git.denx.de/u-boot-armWolfgang Denk2010-05-041-8/+8
|\
| * SAMSUNG: serial: modify name from s5pc1xx to s5pMinkyu Kang2010-04-301-8/+8
| | | | | | | | | | | | | | Because of other s5p series SoC will use these serial functions, modify function's name and structure's name. Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* | mtdparts: get rid of custom DEBUG macro, use debug()Wolfgang Denk2010-04-281-50/+40
| | | | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* | mtdparts: fix write through NULL pointerWolfgang Denk2010-04-281-7/+12
|/ | | | | | | | | | | The "mtdparts add" command wrote through a NULL pointer - on many systems this went unnoticed (PowerPC has writable RAM there, some ARM systems have ROM where a write has no effect), but on arm1136 (i.MX31) it crashed the system. Add appropriate checks. Signed-off-by: Wolfgang Denk <wd@denx.de>
* mpc512x: add multi serial PSC supportAnatolij Gustschin2010-04-241-0/+23
| | | | | | | | | | | | | | | | | | Extend mpc512x serial driver to support multiple PSC ports. Subsequent patches for PDM360NG board support make use of this functionality by defining CONFIG_SERIAL_MULTI in the board config file. Additionally the used PSC devices are specified by defining e.g. CONFIG_SYS_PSC1, CONFIG_SYS_PSC4 and CONFIG_SYS_PSC6. Support for PSC devices other than 1, 3, 4 and 6 is not added by this patch because these aren't used currently. In the future it can be easily added using DECLARE_PSC_SERIAL_FUNCTIONS(N) and INIT_PSC_SERIAL_STRUCTURE(N) macros in cpu/mpc512x/serial.c. Additionally you have to add code for registering added devices in serial_initialize() in common/serial.c. Signed-off-by: Anatolij Gustschin <agust@denx.de>
* Move arch/ppc to arch/powerpcStefan Roese2010-04-211-1/+1
| | | | | | | | | | | | | | | | | As discussed on the list, move "arch/ppc" to "arch/powerpc" to better match the Linux directory structure. Please note that this patch also changes the "ppc" target in MAKEALL to "powerpc" to match this new infrastructure. But "ppc" is kept as an alias for now, to not break compatibility with scripts using this name. Signed-off-by: Stefan Roese <sr@denx.de> Acked-by: Wolfgang Denk <wd@denx.de> Acked-by: Detlev Zundel <dzu@denx.de> Acked-by: Kim Phillips <kim.phillips@freescale.com> Cc: Peter Tyser <ptyser@xes-inc.com> Cc: Anatolij Gustschin <agust@denx.de>
* FIX: watchdog timeout, while waiting for inputJens Scharsig2010-04-101-0/+3
| | | | | | | | * 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>
* malloc: sbrk() should return MORECORE_FAILURE instead of NULL on failurekarl.beldan@gmail.com2010-04-101-1/+1
| | | | Signed-off-by: Karl Beldan <karl.beldan@gmail.com>
* cmd_bmp.c: add standard subcommand handlingFrans Meulenbroeks2010-04-091-25/+56
| | | | | Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com> Acked-by: Detlev Zundel <dzu@denx.de>
* Merge branch 'master' of git://git.denx.de/u-boot-ubiWolfgang Denk2010-04-091-1/+1
|\
| * cmd_ubi: Fix uninitialized variable warningPeter Tyser2010-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | gcc 3.4.6 previously reported the following error on many MIPS boards which utilize UBI: cmd_ubi.c:193: warning: 'vol' might be used uninitialized in this function The current code is structured such that 'vol' will never be used when it is NULL anyway, but gcc isn't smart enough to figure this out. Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Signed-off-by: Stefan Roese <sr@denx.de>
OpenPOWER on IntegriCloud