summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeLines
* cmd_nvedit.c: make error message more helpfulWolfgang Denk2011-05-12-1/+2
| | | | | | | | | | | | | | | | | When calling getenv_f() with a too small buffer, it would print an error message like this: env_buf too small [32] This is not really helpful as it does not give any indication which of the calls might have failed. Change this into: env_buf [32 bytes] too small for value of "hwconfig" so we know at least which variable caused the overflow; this usually allows to quickly find the related code as well. Signed-off-by: Wolfgang Denk <wd@denx.de>
* common/hush: make get_local_var visible for other usersHolger Brunck2011-05-10-2/+1
| | | | | | | | | Signed-off-by: Holger Brunck <holger.brunck@keymile.com> Acked-by: Heiko Schocher <hs@denx.de> cc: Wolfgang Denk <wd@denx.de> cc: Detlev Zundel <dzu@denx.de> cc: Valentin Longchamp <valentin.longchamp@keymile.com> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
* cramfs: make cramfs usable without a NOR flashHeiko Schocher2011-05-10-2/+8
| | | | | | | | cc: Wolfgang Denk <wd@denx.de> cc: Detlev Zundel <dzu@denx.de> cc: Valentin Longchamp <valentin.longchamp@keymile.com> cc: Holger Brunck <holger.brunck@keymile.com> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
* cramfs: fix bug in using CONFIG_CRAMFS_CMDLINEHeiko Schocher2011-05-10-1/+1
| | | | | | | | | | | | do not define own flash_info variable, instead use the flash_info variable defined in your flash driver. Signed-off-by: Heiko Schocher <hs@denx.de> cc: Wolfgang Denk <wd@denx.de> cc: Detlev Zundel <dzu@denx.de> cc: Valentin Longchamp <valentin.longchamp@keymile.com> cc: Holger Brunck <holger.brunck@keymile.com> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
* IDE: fix compiler warningsWolfgang Denk2011-04-30-4/+4
| | | | | | | | | | | | The changes introduced by commit 0abddf8 ``cmd_ide: enhance new feature "CONFIG_IDE_AHB"'' caused compiler warnings like cmd_ide.c: In function 'ide_init': cmd_ide.c:716: warning: assignment from incompatible pointer type Constify the respective function arguments to fix this. Signed-off-by: Wolfgang Denk <wd@denx.de>
* common/cmd_mdio.c: fix compile warningAnatolij Gustschin2011-04-30-2/+2
| | | | | | | | cmd_mdio.c: In function 'mdio_read_ranges': cmd_mdio.c:97: warning: comparison is always false due to limited range of data type Signed-off-by: Anatolij Gustschin <agust@denx.de> Cc: Andy Fleming <afleming@freescale.com>
* miiphy: miiphyutil.c: fix compile warningAnatolij Gustschin2011-04-30-4/+8
| | | | | | | | | | Fix warning introduced while recent PHY Lib changes: miiphyutil.c: In function 'miiphy_read': miiphyutil.c:304: warning: comparison is always false due to limited range of data type Signed-off-by: Anatolij Gustschin <agust@denx.de> Cc: Andy Fleming <afleming@freescale.com>
* cmd_nvedit.c: clean up with checkpatchMacpaul Lin2011-04-30-75/+73
| | | | | | | Code clean up of cmd_nvedit.c by using checkpatch.pl. Signed-off-by: Macpaul Lin <macpaul@andestech.com> Acked-by: Detlev Zundel <dzu@denx.de>
* cmd_ide: enhance new feature "CONFIG_IDE_AHB"Macpaul Lin2011-04-30-1/+28
| | | | | | | | | | | | | Although most IDE controller is designed to be connected to PCI bridge, there are still some IDE controller support AHB interface for SoC design. The driver implementation of these IDE-AHB controllers differ from other IDE-PCI controller, some additional registers and commands access is required during CMD/DATA I/O. Hence a configuration "CONFIG_IDE_AHB" in cmd_ide.c is required to be defined to support these kinds of SoC controllers. Such as Faraday's FTIDE020 series and Global Unichip's UINF-0301. Signed-off-by: Macpaul Lin <macpaul@andestech.com>
* Merge branch 'master' of git://git.denx.de/u-boot-mmcWolfgang Denk2011-04-29-0/+1
|\
| * mmc_spi: add mmc_init callThomas Chou2011-04-29-0/+1
| | | | | | | | | | | | | | As Andy Fleming suggested, we can call mmc_init() in mmc_spi command. So that we don't need to run mmcinfo command next. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* | i2c: add i2c deblock sequence before and after every mux configStefan Bigler2011-04-28-0/+12
|/ | | | | | | | | | | | | | | To make sure that the mux can be configured a deblocking sequence is done before the mux configuration. After the mux switch the new leaf of, the i2c tree must be again deblocked. Signed-off-by: Stefan Bigler <stefan.bigler@keymile.com> Acked-by: Heiko Schocher <hs@denx.de> cc: Wolfgang Denk <wd@denx.de> cc: Detlev Zundel <dzu@denx.de> cc: Prafulla Wadaskar <prafulla@marvell.com> cc: Valentin Longchamp <valentin.longchamp@keymile.com> cc: Holger Brunck <holger.brunck@keymile.com> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
* common: add a grepenv commandKim Phillips2011-04-28-3/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | u-boot environments, esp. when boards are shared across multiple users, can get pretty large and time consuming to visually parse. The grepenv command this patch adds can be used in lieu of printenv to facilitate searching. grepenv works like printenv but limits its output only to environment strings (variable name and value pairs) that match the user specified substring. the following examples are on a board with a 5313 byte environment that spans multiple screen pages: Example 1: summarize ethernet configuration: => grepenv eth TSEC etact=FM1@DTSEC2 eth=FM1@DTSEC4 ethact=FM1@DTSEC2 eth1addr=00:E0:0C:00:8b:01 eth2addr=00:E0:0C:00:8b:02 eth3addr=00:E0:0C:00:8b:03 eth4addr=00:E0:0C:00:8b:04 eth5addr=00:E0:0C:00:8b:05 eth6addr=00:E0:0C:00:8b:06 eth7addr=00:E0:0C:00:8b:07 eth8addr=00:E0:0C:00:8b:08 eth9addr=00:E0:0C:00:8b:09 ethaddr=00:E0:0C:00:8b:00 netdev=eth0 uprcw=setenv ethact $eth;setenv filename p4080ds/R_PPSXX_0xe/rcw_0xe_2sgmii_rev2_high.bin;setenv start 0xe8000000;protect off all;run upimage;protect on all upuboot=setenv ethact $eth;setenv filename u-boot.bin;setenv start eff80000;protect off all;run upimage;protect on all upucode=setenv ethact $eth;setenv filename fsl_fman_ucode_P4080_101_6.bin;setenv start 0xef000000;protect off all;run upimage;protect on all usdboot=setenv ethact $eth;tftp 1000000 $dir/$bootfile;tftp 2000000 $dir/initramfs.cpio.gz.uboot;tftp c00000 $dir/p4080ds-usdpaa.dtb;setenv bootargs root=/dev/ram rw console=ttyS0,115200 $othbootargs;bootm 1000000 2000000 c00000; => Example 2: detect unused env vars: => grepenv etact etact=FM1@DTSEC2 => Example 3: reveal hardcoded variables; e.g., for fdtaddr: => grepenv fdtaddr fdtaddr=c00000 nfsboot=setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off console=$consoledev,$baudrate $othbootargs;tftp $loadaddr $bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr - $fdtaddr ramboot=setenv bootargs root=/dev/ram rw console=$consoledev,$baudrate $othbootargs;tftp $ramdiskaddr $ramdiskfile;tftp $loadaddr $bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr $ramdiskaddr $fdtaddr => grep $fdtaddr fdtaddr=c00000 my_boot=bootm 0x40000000 0x41000000 0x00c00000 my_dtb=tftp 0x00c00000 $prefix/p4080ds.dtb nohvboot=tftp 1000000 $dir/$bootfile;tftp 2000000 $dir/$ramdiskfile;tftp c00000 $dir/$fdtfile;setenv bootargs root=/dev/ram rw ramdisk_size=0x10000000 console=ttyS0,115200;bootm 1000000 2000000 c00000; => This patch also enables the grepenv command by default on corenet_ds based boards (and repositions the DHCP command entry to keep the list sorted). Signed-off-by: Kim Phillips <kim.phillips@freescale.com> Cc: Kumar Gala <kumar.gala@freescale.com> Cc: Andy Fleming <afleming@freescale.com>
* fix redundant environment for serial flashthomas.langer@lantiq.com2011-04-28-27/+12
| | | | | | | | | | | | This patch fixes problems in the handling of redundant environment in env_sf.c The major problem are double calls of free() on the allocated buffers, which damages the internal data of malloc and crashes on next call. In addition, the selection of the active environment had errors and compiler warnings, which are corrected by this patch. Signed-off-by: Thomas Langer <thomas.langer@lantiq.com>
* Merge branch 'master' of git://git.denx.de/u-boot-armWolfgang Denk2011-04-27-0/+153
|\
| * Add 'led' commandJason Kridner2011-04-27-0/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows any board implementing the coloured LED API to control the LEDs from the console. led [green | yellow | red | all ] [ on | off ] or led [ 1 | 2 | 3 | all ] [ on | off ] Adds configuration item CONFIG_CMD_LED enabling the command. Partially based on patch from Ulf Samuelsson: http://www.mail-archive.com/u-boot@lists.denx.de/msg09593.html. Updated based on feedback: http://www.mail-archive.com/u-boot@lists.denx.de/msg41847.html https://groups.google.com/d/topic/beagleboard/8Wf1HiK_QBo/discussion * Fixed a handful of style issues. * Significantly reduced the number of #ifdefs and redundant code * Converted redundant code into loops test against a structure * Made use of cmd_usage() * Introduced a str_onoff() function, but haven't yet put it in common * Eliminated trailing newline Signed-off-by: Jason Kridner <jkridner@beagleboard.org> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* | Respect memreserve regions specified in the device treeGrant Likely2011-04-25-1/+30
| | | | | | | | | | | | | | | | If a regions is reserved in the fdt, then it should not be used. Add the memreserve regions to the lmb so that u-boot doesn't use them to store the initrd. Signed-off-by: Grant Likely <grant.likely@linaro.org>
* | Fix off-by-one error in passing initrd end address via device treeGrant Likely2011-04-25-1/+1
| | | | | | | | | | | | | | | | The initrd_end variable contains the address immediately *after* the initrd blob, not the last address containing data. This patch fixes an inadvertent off-by-one when setting up the initrd reserved map. Signed-off-by: Grant Likely <grant.likely@linaro.org>
* | Remove device tree booting dependency on CONFIG_SYS_BOOTMAPSZGrant Likely2011-04-25-3/+3
| | | | | | | | | | | | | | | | | | The previous patch makes u-boot use the full accessible size of ram as the default boot mapped size if CONFIG_SYS_BOOTMAPSZ is not defined, which means boot_relocate_fdt() can be changed to depend solely on CONFIG_OF_LIBFDT. Signed-off-by: Grant Likely <grant.likely@linaro.org>
* | Default to bootm_size() when CONFIG_SYS_BOOTMAPSZ is not definedGrant Likely2011-04-25-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a function getenv_bootm_mapsize() for obtaining the size of the early mapped region accessible by the kernel during early boot. It defaults to CONFIG_SYS_BOOTMAPSZ, or if not defined, defaults to getenv_bootm_size(), which in turn defaults to the size of RAM. getenv_bootm_mapsize() can also be overridden with a "bootm_mapsize" environmental variable. Signed-off-by: Grant Likely <grant.likely@linaro.org>
* | Stop passing around bootmem_base value.Grant Likely2011-04-25-18/+10
|/ | | | | | | | | | For the calls to boot_relocate_fdt(), boot_get_cmdline(), and boot_get_kbd(), the value of bootmem_base is always obtained by calling getenv_bootm_low(). Since the value always comes from the same source, the calling signature for those functions can be simplified by making them call getenv_bootm_low() directly. Signed-off-by: Grant Likely <grant.likely@linaro.org>
* Fix typo in #error: IS_IN_NOWHERE vs. IS_NOWHERELoïc Minier2011-04-26-1/+1
| | | | Signed-off-by: Loïc Minier <loic.minier@linaro.org>
* Merge branch 'phylib' of git://git.denx.de/u-boot-mmcWolfgang Denk2011-04-20-101/+500
|\
| * Add mdio command for new PHY infrastructureAndy Fleming2011-04-20-0/+289
| | | | | | | | | | | | | | | | | | | | | | The new mdio command doesn't have all of the features of the mii command, but it provides the necessary read/write primitives, and allows users to interact with 10G PHYs, and other PHYs which use Clause 45 of 802.3. This means that the mdio command requires a "Device Address" argument, though for clause 22 PHYs, the argument can be "-". Signed-off-by: Andy Fleming <afleming@freescale.com> Acked-by: Detlev Zundel <dzu@denx.de>
| * Create PHY Lib for U-BootAndy Fleming2011-04-20-36/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extends the mii_dev structure to participate in a full-blown MDIO and PHY driver scheme. The mii_dev structure and miiphy calls are modified in such a way to allow the original mii command and miiphy infrastructure to work as before, but also to support a new set of APIs which allow (among other things) sharing of PHY driver code and 10G support The mii command will continue to support normal PHY management functions (Clause 22 of 802.3), but will not be changed to support 10G (Clause 45). The basic design is similar to PHY Lib from Linux, but simplified for U-Boot's network and driver infrastructure. We now have MDIO drivers and PHY drivers An MDIO driver provides: read write reset A PHY driver provides: (optionally): probe config - initial setup, starting of auto-negotiation startup - waiting for AN, and reading link state shutdown - any cleanup needed The ethernet drivers interact with the PHY Lib using these functions: phy_connect() phy_config() phy_startup() phy_shutdown() Each PHY driver can be configured separately, or all at once using config_phylib_all_drivers.h (added in the patch which adds the drivers) We also provide generic drivers for Clause 22 (10/100/1000), and Clause 45 (10G) PHYs. We also implement phy_reset(), and call it in phy_connect(). Because phy_reset() is essentially the same as miiphy_reset, but: a) must support 10G PHYs, and b) should use the phylib primitives, we implement miiphy_reset, using phy_reset(), but only when CONFIG_PHYLIB is set. Otherwise, we just use the old version. In this way, we save on compile size, even if we don't manage to save code size. Pulled ethtool.h and mdio.h from: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 782d640afd15af7a1faf01cfe566ca4ac511319d With many, many deletions so as to enable compilation under u-boot Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Detlev Zundel <dzu@denx.de>
| * miiphy: Fix some formatting issuesAndy Fleming2011-04-20-72/+72
| | | | | | | | | | | | | | | | Mostly putting a space between function name and "(", and doing return (foo) Signed-off-by: Andy Fleming <afleming@freescale.com> Acked-by: Detlev Zundel <dzu@denx.de>
* | Merge branch 'misc' of git://git.denx.de/u-boot-blackfinWolfgang Denk2011-04-20-102/+276
|\ \
| * | gpio: check request resultMike Frysinger2011-04-13-1/+4
| | | | | | | | | | | | | | | | | | Make sure the pin request passed before attempting to use it later on. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
| * | gpio: generalize for all generic gpio providersMike Frysinger2011-04-13-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Blackfin gpio command isn't terribly Blackfin-specific. So generalize the few pieces into two new optional helpers: name_to_gpio() - turn a string name into a GPIO # gpio_status() - display current pin bindings (think /proc/gpio) Once these pieces are pulled out, we can relocate the cmd_gpio.c into the common directory. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
| * | md5sum/sha1sum/unzip: split out of mondo mem fileMike Frysinger2011-04-13-104/+168
| | | | | | | | | | | | | | | | | | | | | | | | There's no real need to keep these functions in the cmd_mem file since they do not use any of the common global mem variables. So split them out into their own dedicated cmd files. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
| * | crc32: make command optionalMike Frysinger2011-04-13-0/+8
| | | | | | | | | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
| * | make `go` optionalMike Frysinger2011-04-13-0/+4
| | | | | | | | | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
| * | env: make import/export optionalMike Frysinger2011-04-13-0/+8
| | | | | | | | | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* | | Merge branch 'master' of git://git.denx.de/u-boot-fdtWolfgang Denk2011-04-20-1/+1
|\ \ \
| * | | fdt_support: Fix buffer overflow in fdt_fixup_memory_banksKyle Moffett2011-04-17-1/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When fdt_fixup_memory_banks is called with 2-cell address and size fields in the device-tree (IE: 64-bit address and size), then it will overflow its on-stack "tmp" buffer. This fixes the buffer size and adds a comment explaining how many bytes need to be allocated per record. Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com> Cc: Jerry Van Baren <vanbaren@cideas.com> Acked-by: Gerald Van Baren <vanbaren@cideas.com>
* | | Merge branch 'master' of git://git.denx.de/u-boot-mmcWolfgang Denk2011-04-20-1/+91
|\ \ \ | |/ / |/| |
| * | mmc: show mmc capacity using print_sizeMinkyu Kang2011-04-13-1/+2
| | | | | | | | | | | | | | | Signed-off-by: Minkyu Kang <mk7.kang@samsung.com> Signed-off-by: Andy Fleming <afleming@freescale.com>
| * | mmc: add generic mmc spi driverThomas Chou2011-04-13-0/+89
| |/ | | | | | | | | | | | | | | | | | | | | | | | | This patch supports mmc/sd card with spi interface. It is based on the generic mmc framework. It works with SDHC and supports multi blocks read/write. The crc checksum on data packet is enabled with the def, There is a subcomamnd "mmc_spi" to setup spi bus and cs at run time. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Signed-off-by: Andy Fleming <afleming@freescale.com>
* | Merge branch 'sf' of git://git.denx.de/u-boot-blackfinWolfgang Denk2011-04-13-36/+75
|\ \
| * | cmd_sf: use cmd_usage() in more placesMike Frysinger2011-04-12-30/+29
| | | | | | | | | | | | | | | | | | | | | Requires a little reworking of the code flow with sub-functions, but not a big deal. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
| * | cmd_sf: drop device status message when probingMike Frysinger2011-04-12-3/+0
| | | | | | | | | | | | | | | | | | | | | The common spi flash layer displays useful info when probing, so no need for us to duplicate that. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
| * | cmd_sf: add handler for +len arg for erase commandRichard Retanubun2011-04-12-4/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds [+]len handler for the erase command that will automatically round up the requested erase length to the flash's sector_size. Signed-off-by: Richard Retanubun <RichardRetanubun@RuggedCom.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* | | x86: Rename i386 to x86Graeme Russ2011-04-13-1/+1
| |/ |/| | | | | Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
* | common/cmd_bdinfo.c: fix do_bdinfo() for AVR32Andreas Bießmann2011-04-12-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes following warning message: ---8<--- cmd_bdinfo.c:458: warning: initialization from incompatible pointer type --->8--- There was a prototype change in 54841ab50c20d6fa6c9cc3eb826989da3a22d934 for argv[] pointer type to const. This change was not made for AVR32 cause this code came in later by a merge. Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
* | cmd_nvedit: use explicit typecast for printfAndreas Bießmann2011-04-12-2/+2
| | | | | | | | | | | | | | | | | | | | | | This patch fixes warnings in MAKEALL for avr32: ---8<--- cmd_nvedit.c: In function 'do_env_export': cmd_nvedit.c:663: warning: format '%zX' expects type 'size_t', but argument 3 has type 'ssize_t' --->8--- Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
* | Fix misc spelling errors found by lintianLoïc Minier2011-04-12-2/+2
|/ | | | Signed-off-by: Loïc Minier <loic.minier@linaro.org>
* bootm: replace blob_start with image_startLei Wen2011-04-11-1/+1
| | | | | | | | | | | For uImage always has a 64 bytes header, we couldn't expect to do the xip from the header but should xip from the image start. The latter logic in that section is also move the image from image_start to the load address, so sync this logic to the xip operation. Signed-off-by: Lei Wen <leiwen@marvell.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: ldrinfo: new commandMike Frysinger2011-04-08-0/+193
| | | | | | Simple command to decode/check an LDR image before we try to boot it. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: bootldr: use common definesMike Frysinger2011-04-08-13/+8
| | | | | | | Now that the common bootrom.h sets up defines for us, switch to them rather than our own local set. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Merge branch 'master' of git://git.denx.de/u-boot-mpc85xxWolfgang Denk2011-04-05-5/+28
|\ | | | | | | | | | | | | Conflicts: drivers/usb/host/ehci-pci.c Signed-off-by: Wolfgang Denk <wd@denx.de>