summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2011-06-01common/cmd_fdt.c: fix wrong data displayed in fdt printHaojian Zhuang
All data in dtb is big endian. Some ARM devices are little-endian. In print_data(), it displays data with big-endian format. For ARM device, data should be converted to little-endian first. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Cc: Gerald Van Baren <vanbaren@cideas.com>
2011-06-01sntp: avoid use of uninitialized variableLuuk Paulussen
When we use the ntpserverip environment variable argv[1] may not be set. Printing the error message using the NetNtpServerIP variable ensures the correct output in both cases. Signed-off-by: Luuk Paulussen <luuk.paulussen@alliedtelesis.co.nz> Acked-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Cc: Ben Warren <biggerbadderben@gmail.com> Acked-by: Detlev Zundel <dzu@denx.de>
2011-05-24cmd_nand: fix help of nand erase subcommandDaniel Hobi
Since commit 30486322 (nand erase: .spread, .part, .chip subcommands) the arguments off and size are no longer optional. Signed-off-by: Daniel Hobi <daniel.hobi@schmid-telecom.ch> Cc: Scott Wood <scottwood@freescale.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
2011-05-24env_nand: zero-initialize variable nand_erase_optionsDaniel Hobi
Commit 30486322 (nand erase: .spread, .part, .chip subcommands) added a new field to struct nand_erase_options, but forgot to update common/env_nand.c. Depending on the stack state and bad block distribution, saveenv() can thus erase more than CONFIG_ENV_RANGE bytes which may corrupt the following NAND sectors/partitions. Signed-off-by: Daniel Hobi <daniel.hobi@schmid-telecom.ch> Signed-off-by: Scott Wood <scottwood@freescale.com>
2011-05-19Minor coding style cleanup.Wolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-05-19TFTP: add tftpsrv commandLuca Ceresoli
Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it> Cc: Wolfgang Denk <wd@denx.de> Acked-by: Detlev Zundel <dzu@denx.de>
2011-05-18mmc: enable partition switch function for emmcLei Wen
For emmc, it may have up to 7 partitions: two boot partitions, one user partition, one RPMB partition and four general purpose partitions. (Refer to JESD84-A44.pdf/page 154) As bootloader may need to read out or reflashing images on those different partitions, it is better to enable the partition switch with console command support. Also for partition would be restore to user partition(part 0) when CMD0 is used, so change mmc_init routine to perform normal initialization only once for each slot, unless use the rescan command to force init again. Signed-off-by: Lei Wen <leiwen@marvell.com> Acked-by: Andy Fleming <afleming@freescale.com>
2011-05-18cmd_mmc: eliminate device num in the mmc commandLei Wen
mmc command applied device, like ide and usb... Signed-off-by: Lei Wen <leiwen@marvell.com> Acked-by: Andy Fleming <afleming@freescale.com>
2011-05-12cosmetic: cmd_bdinfo.c: clean up by using checkpatch.plMacpaul Lin
cmd_bdinfo.c: clean up with 2.6.38 checkpatch.pl Signed-off-by: Macpaul Lin <macpaul@andestech.com> Acked-by: Detlev Zundel <dzu@denx.de>
2011-05-12cmd_nvedit.c: make error message more helpfulWolfgang Denk
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>
2011-05-10common/hush: make get_local_var visible for other usersHolger Brunck
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>
2011-05-10cramfs: make cramfs usable without a NOR flashHeiko Schocher
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>
2011-05-10cramfs: fix bug in using CONFIG_CRAMFS_CMDLINEHeiko Schocher
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>
2011-04-30IDE: fix compiler warningsWolfgang Denk
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>
2011-04-30common/cmd_mdio.c: fix compile warningAnatolij Gustschin
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>
2011-04-30miiphy: miiphyutil.c: fix compile warningAnatolij Gustschin
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>
2011-04-30cmd_nvedit.c: clean up with checkpatchMacpaul Lin
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>
2011-04-30cmd_ide: enhance new feature "CONFIG_IDE_AHB"Macpaul Lin
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>
2011-04-29Merge branch 'master' of git://git.denx.de/u-boot-mmcWolfgang Denk
2011-04-29mmc_spi: add mmc_init callThomas Chou
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>
2011-04-28i2c: add i2c deblock sequence before and after every mux configStefan Bigler
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>
2011-04-28common: add a grepenv commandKim Phillips
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>
2011-04-28fix redundant environment for serial flashthomas.langer@lantiq.com
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>
2011-04-27Merge branch 'master' of git://git.denx.de/u-boot-armWolfgang Denk
2011-04-27Add 'led' commandJason Kridner
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>
2011-04-25Respect memreserve regions specified in the device treeGrant Likely
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>
2011-04-25Fix off-by-one error in passing initrd end address via device treeGrant Likely
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>
2011-04-25Remove device tree booting dependency on CONFIG_SYS_BOOTMAPSZGrant Likely
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>
2011-04-25Default to bootm_size() when CONFIG_SYS_BOOTMAPSZ is not definedGrant Likely
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>
2011-04-25Stop passing around bootmem_base value.Grant Likely
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>
2011-04-26Fix typo in #error: IS_IN_NOWHERE vs. IS_NOWHERELoïc Minier
Signed-off-by: Loïc Minier <loic.minier@linaro.org>
2011-04-20Merge branch 'phylib' of git://git.denx.de/u-boot-mmcWolfgang Denk
2011-04-20Merge branch 'misc' of git://git.denx.de/u-boot-blackfinWolfgang Denk
2011-04-20Merge branch 'master' of git://git.denx.de/u-boot-fdtWolfgang Denk
2011-04-20Merge branch 'master' of git://git.denx.de/u-boot-mmcWolfgang Denk
2011-04-20Add mdio command for new PHY infrastructureAndy Fleming
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>
2011-04-20Create PHY Lib for U-BootAndy Fleming
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>
2011-04-20miiphy: Fix some formatting issuesAndy Fleming
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>
2011-04-17fdt_support: Fix buffer overflow in fdt_fixup_memory_banksKyle Moffett
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>
2011-04-13Merge branch 'sf' of git://git.denx.de/u-boot-blackfinWolfgang Denk
2011-04-13gpio: check request resultMike Frysinger
Make sure the pin request passed before attempting to use it later on. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-13gpio: generalize for all generic gpio providersMike Frysinger
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>
2011-04-13md5sum/sha1sum/unzip: split out of mondo mem fileMike Frysinger
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>
2011-04-13crc32: make command optionalMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-13make `go` optionalMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-13env: make import/export optionalMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-13mmc: show mmc capacity using print_sizeMinkyu Kang
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com> Signed-off-by: Andy Fleming <afleming@freescale.com>
2011-04-13mmc: add generic mmc spi driverThomas Chou
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>
2011-04-13x86: Rename i386 to x86Graeme Russ
Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
2011-04-12common/cmd_bdinfo.c: fix do_bdinfo() for AVR32Andreas Bießmann
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>