summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2010-09-23ppc4xx/fdt/flash: Change fdt_fixup_nor_flash_node() to not rely on cs sizeStefan Roese
This patch changes the behaviour of the fdt_fixup_nor_flash_node() function. Now it doesn't patch the size of the "reg" property with the chip-select size, but with the size returned from the new function flash_get_bank_size(). This function will return per weak default the flash size of the bank (bank = chip-select numer) detected by the flash driver. If this does not fit your needs, this function may be overridden by a board specific one. For this the parameters needed to be changed. So I intentionally squashed the PPC4xx stuff using this routine into this patch. Otherwise it would not be git-bisectable anymore. The board specific function for the AMCC/APM Ebony eval board is now included in this patch version. Signed-off-by: Stefan Roese <sr@denx.de> Tested-by: Detlev Zundel <dzu@denx.de> Cc: Gerald Van Baren <vanbaren@cideas.com> Cc: Wolfgang Denk <wd@denx.de>
2010-09-21cmd_mmc: use common usage functionMike Frysinger
Rather than using a custom "Usage:", use the common cmd_usage() function, and tail into it now that it returns 1 for us. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-09-19Save environment data to mmc.Terry Lv
This patch is to save environment data to mmc card. It uses interfaces defined in generic mmc. Signed-off-by: Terry Lv <r65388@freescale.com> Acked-by: Stefano Babic <sbabic@denx.de>
2010-09-18mmc: print out partition tableLei Wen
Signed-off-by: Lei Wen <leiwen@marvell.com>
2010-09-13x86: Add do_bdinfo()Graeme Russ
x86 failed to compile with a message "a case for this architecture does not exist!" - Add do_bdinfo() for this arch
2010-09-10Prepare v2010.09-rc1v2010.09-rc1Wolfgang Denk
Coding style cleanup. Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-09-08Merge branch 'master' of git://git.denx.de/u-boot-samsungWolfgang Denk
2010-09-07Merge branch 'master' of /home/wd/git/u-boot/masterWolfgang Denk
2010-09-07Merge branch 'master' of git://git.denx.de/u-boot-shWolfgang Denk
2010-09-07Merge branch 'master' of git://git.denx.de/u-boot-i2cWolfgang Denk
2010-08-30sh: Add support do_bdinfo functionNobuhiro Iwamatsu
SH did not support do_bdinfo fuction. This code based avr32 stuff. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
2010-08-26ARMV7: S5P: rename from CONFIG_S5PC1XX to CONFIG_S5PMinkyu Kang
Use the same configuration around S5P SoCs. (s5pc100, s5pc110, s5pc210 and so on) Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2010-08-26CMD_I2C: make alen=0 workReinhard Meyer
Signed-off-by: Reinhard Meyer <u-boot@emk-elektronik.de>
2010-08-19fdt: call fdt_parent_offset fewer times while translating addressesScott Wood
fdt_parent_offset() is an expensive operation, so we'd like to reduce unnecessary calls to it. Further, the practice of iterating up to the root if address/size cells aren't found was apparently done for Linux for compatibility with certain buggy Open Firmware implementations, and U-Boot inherited the code. The compliant behavior is to treat a missing #address-cells as 2, and a missing #size-cells as 1 -- never looking anywhere but the immediate parent of the node of interest. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-08-18Merge branch 'master' of /home/wd/git/u-boot/masterWolfgang Denk
2010-08-13env_nand: return error when no device is foundMike Frysinger
Currently, if there is an error probing the NAND chip and the env is based in NAND, the readenv() function will use a NULL function pointer and thus jump to address 0. Here I just check for a non-zero value of blocksize as that shouldn't be zero when a valid device is found, but perhaps there is a better way for someone familiar with the NAND internals to suggest. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Tested-by: Ben Gardiner <bengardiner@nanometrics.ca>
2010-08-12Merge branch 'master' of git://git.denx.de/u-boot-tiWolfgang Denk
2010-08-12Fixed clobbered output of the "help usb" commandSergei Poselenov
The "usb help" doesn't format the output correctly: => help usb usb - USB sub-system Usage: usb reset - reset (rescan) USB controller usb stop [f] - stop USB [f]=force stop usb tree - show USB device tree usb info [dev] - show available USB devices usb storage - show details of USB storage devices usb dev [dev] - show or set current USB storage device usb part [dev] - print partition table of one or all USB storage devices usb read addr blk# cnt - read `cnt' blocks starting at block `blk#' to memory address `addr'usb write addr blk# cnt - write `cnt' blocks starting at block `blk#' from memory address `addr' => With fix below applied, the output is correct: => help usb usb - USB sub-system Usage: usb reset - reset (rescan) USB controller usb stop [f] - stop USB [f]=force stop usb tree - show USB device tree usb info [dev] - show available USB devices usb storage - show details of USB storage devices usb dev [dev] - show or set current USB storage device usb part [dev] - print partition table of one or all USB storage devices usb read addr blk# cnt - read `cnt' blocks starting at block `blk#' to memory address `addr' usb write addr blk# cnt - write `cnt' blocks starting at block `blk#' from memory address `addr' => Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
2010-08-10ARM: Add support for MB86R0x SoCsMatthias Weisser
Signed-off-by: Matthias Weisser <weisserm@arcor.de>
2010-08-10Merge branch 'master' of git://git.denx.de/u-boot-armWolfgang Denk
2010-08-10Merge branch 'master' of git://git.denx.de/u-boot-imxWolfgang Denk
2010-08-10Merge branch 'master' of git://git.denx.de/u-boot-marvellWolfgang Denk
2010-08-10fix cmd_mmc.c, line 136 missing "Reinhard Meyer
Remove warning for missing " at the end of line 136 Signed-off-by: Reinhard Meyer <u-boot@emk-elektronik.de>
2010-08-09miiphy: leverage current_mii cache moreMike Frysinger
For code that uses miiphy_{read,write}, every call invokes a full look up of the mii list. There is already a "current_mii" cache that is used by some code, but have the miiphy_{read,write} function use it as well. This does increase the code size slightly, but I think it's worth it. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2010-08-09miiphy: unify device list lookupMike Frysinger
Rather than have every func re-implement the list walking code, do it one local function. This shrinks the resulting object code a little while making the source much more manageable. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2010-08-09miiphy: constify device nameMike Frysinger
The driver name does not need to be writable, so constify it. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2010-08-09fdt: Fix bug in size calculation in fdt_resize() with initrd useFeng Wang
Original bug description from Feng (fdt_resize() bug caused "WARNING: could not set linux, initrd-start FDT_ERR_NOSPACE."): What I got is an error: "WARNING: could not set linux,initrd-start FDT_ERR_NOSPACE." after loading Device Tree blob. This in turn caused linux to miss init part. After some digging, I found out the reason for this error, it is caused by fdt_resize(). FDT blob got resized after filling in all board specific information of PowerPC. (in boot_body_linux()). It reduced blob size with only extra space for two fdt_reserve_entry, one for fdt itself, and one for initrd. Then it's aligned to a 0x1000 page boundary. However, later in fdt_initrd(), it could add two more properties, initrd-start AND initrd-end, each one needs at least two fdt_reserve_entry sizes done by _fdt_add_property() (name and value). Thus, the two fdt_reserve_entry extra space is not sufficient. So for some specific fdt size which is just under the page boundary after resizing, this will cause an error of FDT_ERR_NOSPACE in fdt_initrd() when setting those two properties, and failed to pass initrd information to linux. My fix is in fdt_resize(), leave at least 4 fdt_reserve_entry for initrd. So instead of 2*sizeof(struct fdt_reserve_entry) for actual_totalsize, use 5*sizeof(struc fdt_reserve_entry). Stefan: I got this same error on katmai, when trying to boot with initrd (run flash_self). This patch fixes this issue. Signed-off-by: Feng Wang <fwang02@harris.com> Tested-by: Stefan Roese <sr@denx.de> Cc: Jerry Van Baren <gvb.uboot@gmail.com> Acked-by: Gerald Van Baren <vanbaren@cideas.com>
2010-08-09various cmd_* files: fixed layout a little bitFrans Meulenbroeks
Most of the files have U_BOOT_CMD on a separate line, but a few didn't and had the first line on the same line as U_BOOT_CMD. This changes these files by adding a line break and a tab Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
2010-08-09various cmd_* files: remove the command name from the help messageFrans Meulenbroeks
removed the command name from the help message as it is already printed. for cmd_mmc also rewrote the message a little bit Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
2010-08-09flash_protect: check for NULL flash infoMike Frysinger
If a flash is unable to be detected, and then someone calls flash_protect on it (like the common code does in flash_init), the flash_protect logic will dereference a NULL pointer. Since flash_protect already does sanity checking on the info structs, add a NULL pointer check in there. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-08-09getenv_f(): fix handling of too short buffersWolfgang Denk
Fix error handling in getenv_f() when the user provided buffer is too short to hold the variable name; make sure to truncate and NUL-terminate without overwriting the buffer limits. Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-08-09dataflash mmc mux: use common cmd_usage functionMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-08-09mflash: use common cmd_usage functionMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-08-09cmd 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>
2010-08-08fdt relocate: have more attention to use a bootmap or notStephan Linz
Platforms with flat device tree support can use a bootmap to relocate the fdt_blob. This is not a must. That's why the relocation function boot_relocate_fdt() should be use only if CONFIG_OF_LIBFDT was defined together with CONFIG_SYS_BOOTMAPSZ (see common/cmd_bootm.c). On MicroBlaze platforms there is no need to use a bootmap to relocate a fdt blob. So we need a more precise focus on the compilation and usage of boot_relocate_fdt(). In general it is valid to exclude the function boot_relocate_fdt() if the bootmap size CONFIG_SYS_BOOTMAPSZ is not defined. Signed-off-by: Stephan Linz <linz@li-pro.net>
2010-08-08cmd_ide: add support for KirkwoodPrafulla Wadaskar
Added MVSATAC definitions to Kirkwood. Added support for Kirkwood in cmd_ide. Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com>
2010-08-08cmd_ide: add support for orion5xAlbert Aribaud
Add MVSATAHC definitions to orion5x. Add support for orion5x in cmd_ide. Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
2010-08-08ide: add configurationAlbert Aribaud
CONFIG_IDE_SWAP_IO This configuration option replaces a complex conditional in cmd_ide.c with an explicit define to be added to SoC or board configs. Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
2010-08-07LZMA and LZO causes compile errorMatthias Weisser
If both LZMA and LZO compressions are used there is a compile error in cmd_bootm.c Signed-off-by: Matthias Weisser <weisserm@arcor.de>
2010-08-07Fix condition where bootm_size not set and wrong memory size reportedMatthew McClintock
If the user sets bootm_low and does not set bootm_size, u-boot will report the memory node in the flat device tree incorrectly. Instead of reporting the remaining size of memory, it will report the total available memory which is incorrect. Specifically this fixes the situation when booting a relocatable kernel and the memory is reported as an offset and size in the device tree, and the size needs to be adjusted accordingly. Signed-off-by: Matthew McClintock <msm@freescale.com> Acked-by: Kumar Gala <galak@kernel.crashing.org>
2010-08-04Rename getenv_r() into getenv_f()Wolfgang Denk
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>
2010-08-04bootm: fix pointer warning with lzmaMike Frysinger
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>
2010-07-26fdt: Add function to alloc phandle valuesKumar Gala
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>
2010-07-24fs/fat: Big code cleanup.Wolfgang Denk
- reformat - throw out macros like FAT_DPRINT and FAT_DPRINT - remove dead code Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-07-24usb_storage.c: change progress output in debug() messageWolfgang Denk
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>
2010-07-24usb_storage.c: initialize device typeWolfgang Denk
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>
2010-07-24cmd_usage(): simplify return code handlingWolfgang Denk
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>
2010-07-20fdt: Add fdt_node_offset_by_compat_reg helperKumar Gala
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>
2010-07-20fdt: Add fdt_translate_address to convert reg node to cpu phys addrKumar Gala
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>
2010-07-17Drop support for GTH boardWolfgang Denk
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>