summaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)Author
2017-09-26GPT: incomplete initialization in allocate_disk_partHeinrich Schuchardt
memset(newpart, '\0', sizeof(newpart)); only initializes the firest 4 or 8 bytes of *newpart and not the whole structure disk_part. We should use sizeof(struct disk_part). Instead of malloc and memset we can use calloc. Identified by cppcheck. Fixes: 09a49930e41 GPT: read partition table from device into a data structure Reported-by: Coverity (CID: 167228) Cc: Stefan Roese <sr@denx.de> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-09-15Merge git://git.denx.de/u-boot-fdtTom Rini
2017-09-15Merge git://git.denx.de/u-boot-ubiTom Rini
2017-09-15cmd: blk: Use LBAFU in the common block commandBin Meng
There is already a macro LBAFU to aid formatted print with lbaint_t variables. Let's use it in the common block command codes. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-09-15blk: Remove various places that do flush cache after readBin Meng
All these places seem to inherit the codes from the MMC driver where a FIXME was put in the comment. However the correct operation after read should be cache invalidate, not flush. The underlying drivers should be responsible for the cache operation. Remove these codes completely. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: York Sun <york.sun@nxp.com> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: York Sun <york.sun@nxp.com>
2017-09-15fdt: Switch to using the verbose overlay application methodPantelis Antoniou
The verbose overlay application method prints out more helpful messages, so switch to it. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Acked-by: Simon Glass <sjg@chromium.org>
2017-09-12cmd: set filesize variable in ubi readHolger Dengler
After a successful read of a UBI volume, the variable filesize is set to the number of read bytes. To boot linux with a raw initramfs/initrd, you must specify the exact size of the initramfs/initrd image in boot command. If the initramfs/inird is read from UBI volume, $filesize is required to access the number of read bytes. Example: ubi read ${loadaddr} kernelvol ubi read ${fdtaddr} dtbvol ubi read ${initrd_addr} initrdvol bootz ${loadaddr} ${initrd_addr}:${filesize} ${fdt_addr} Signed-off-by: Holger Dengler <dengler@linutronix.de> Reviewed-by: Heiko Schocher <hs@denx.de>
2017-09-11cmd: spl: Fix compiling warningYork Sun
Fix warning "cast from pointer to integer of different size". Signed-off-by: York Sun <york.sun@nxp.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2017-09-10cmd: ide: Make the first device the default oneBin Meng
At present the IDE device number is initialized to -1, which means we cannot type "ide read" command before setting the device number via "ide device #". For convenience, let's set the first device as the default one. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-09-04fdt: fix 'prop (...) not found!' error in 'fdt set' commandHannes Schmelzer
This commit brings things back to the well known working state of the command. - With commit 9620d87259572ef21f0df60988d9a932ca673779 (cmd/fdt: support single value replacement within an array) there was an error introduced modifying (inserting) a property to a device-tree node. fdt_getprop(...) returnes a len with -1 for a non-existing property, but a memcpy with len -1 isn't a good idea and things went wrong (crash). - Some times later Tom did repair this with commit 99bb38e2cce9d99238458e0f6d1880c6d2e80a4d (fdt: Check for NULL return from fdt_getprop in 'fdt set') This repairs the crash but the behaviour of the command isn't like before, it makes it impossible to insert a property. - Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at> Acked-by: Simon Glass <sjg@chromium.org>
2017-09-01Kconfig: Migrate all of cmd/fastboot/Kconfig to defconfigsTom Rini
- Move ANDROID_IMAGE_SUPPORT to top level Kconfig under images as it's not strictly part of fastboot. - Add some defaults for the fastboot buffer location and size - Migrate all options listed in cmd/fastboot/Kconfig - Cleanup the README Signed-off-by: Tom Rini <trini@konsulko.com>
2017-09-01Merge git://git.denx.de/u-boot-imxTom Rini
Signed-off-by: Tom Rini <trini@konsulko.com> Conflicts: configs/imx6qdl_icore_mmc_defconfig configs/imx6qdl_icore_rqs_defconfig
2017-08-28nvme: Adjust the 'nvme' command to use blk_common_cmd()Bin Meng
Instead of having separate code in the 'nvme' command, adjust it to use the common function. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-08-26cmd/spl.c: Include <libfdt.h> for fdt_totalsizeTom Rini
In order to be able to reliably use fdt_totalsize, we must have <libfdt.h> included. Fixes: 767cb74a0028 ("cmd: spl: provide address and size of prepared FDT ...") Signed-off-by: Tom Rini <trini@konsulko.com>
2017-08-26mtdparts: Fix uninitialized scalar usageTom Rini
When reworking this code to fix other issues found by Coverity, I forgot to ensure tmp_ep was always cleared before use. Reported-by: Coverity (CID: 166612) Fixes: bc028345acc4 ("mtdparts: Fix final outstanding issue reported by Coverity") Signed-off-by: Tom Rini <trini@konsulko.com>
2017-08-26mtdparts: Fix final outstanding issue reported by CoverityTom Rini
As part of fixing the previously reported issues, it was missed that in the case of mtdparts_init() we need to make sure that tmp_ep is long enough to contain PARTITION_MAXLEN and a NULL termination. Then, to be sure the buffer is NULL terminated, zero the entire buffer rather than just ensuring the first character is NULL. Cc: Lothar Waßmann <LW@KARO-electronics.de> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Reported-by: Coverity (CID: 166329) Signed-off-by: Tom Rini <trini@konsulko.com>
2017-08-26cmd: spl: provide address and size of prepared FDT in environmentAnatolij Gustschin
Writing prepared FDT to persistent storage should be possible in scripts. Create environment variables containing address and size of the updated FDT. Scripts can use these variables after running 'spl export fdt ...' command to write the new blob to persistent storage. Signed-off-by: Anatolij Gustschin <agust@denx.de>
2017-08-23cmd: add sdp commandStefan Agner
Add a new command to start USB Serial Download Protocol (SDP) state machine. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Reviewed-by: Łukasz Majewski <lukma@denx.de> Reviewed-by: Stefano Babic <sbabic@denx.de>
2017-08-20cmd/read.c: Fix checking blk_dread return valueTom Rini
The function blk_dread will return -ENOSYS on failure or on success the number of blocks read, which must be the number asked to read (otherwise it failed somewhere). Correct this check. Reported-by: Coverity (CID: 166335) Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2017-08-20mtdparts: Fix various issues reported by CoverityTom Rini
Now that sandbox is building cmd/mtdparts.c Coverity has looked at the code and found a number of issues. In index_partitions() it is possible that part will be NULL, so re-work the checks and debug statements to take this into account. We have a number of string buffers that we print to in the exact size of, and use string functions on, so we need to ensure they are large enough to be NULL terminated. In device_parse() it is not possible for num_partitions to be 0 (we would have hit a different error first) so remove logically dead code. Finally, in parse_mtdparts() if we have an error we need to free the memory allocated to dev. Cc: Lothar Waßmann <LW@KARO-electronics.de> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Reported-by: Coverity (CID: 166334, 166333, 166332, 166329, 166328) Signed-off-by: Tom Rini <trini@konsulko.com>
2017-08-18Merge tag 'signed-efi-next' of git://github.com/agraf/u-bootTom Rini
EFI Fixes for 2017.09: - Fix GOP w/o display - Fix LocateHandle - Fix exit return value truncation - Fix missing EFIAPI in efi_locate_handle (for x86)
2017-08-18Merge branch 'master' of git://git.denx.de/u-boot-mmcTom Rini
2017-08-17cmd: mmc: add mmc partconf read capabilityAngelo Dureghello
This patch allows to show the EXT_CSD[179] partition_config register info, just by specifying the dev param: U-Boot> mmc partconf 0 EXT_CSD[179], PARTITION_CONFIG: BOOT_ACK: 0x0 BOOT_PARTITION_ENABLE: 0x0 PARTITION_ACCESS: 0x0 Signed-off-by: Angelo Dureghello <angelo@sysam.it> Signed-off-by: Anatolij Gustschin <agust@denx.de>
2017-08-17dm: sata: Support driver model with the 'sata' commandSimon Glass
Update this command to support driver model. This has a different way of starting and stopping SATA. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-17dm: usb: Adjust the 'usb' command to use blk_common_cmd()Simon Glass
Instead of having separate code in the 'usb' command, adjust it to use the common function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-08-17dm: ide: Adjust the 'ide' command to use blk_common_cmd()Simon Glass
Instead of having separate code in the 'ide' command, adjust it to use the common function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-08-17dm: scsi: Adjust the 'scsi' command to use blk_common_cmd()Simon Glass
Instead of having separate code in the 'scsi' command, adjust it to use the common function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-08-17dm: sata: Adjust the 'sata' command to use blk_common_cmd()Simon Glass
Instead of having separate code in the 'sata' command, adjust it to use the common function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-08-17dm: blk: Add a generic function for block device commandsSimon Glass
Most block devices provide a command (e.g. 'sata', 'scsi', 'ide') and these commands generally do the same thing. This makes it harder to maintain this code and keep it consistent. We now have a block device interface which is either implemented by driver model (when CONFIG_BLK is enabled) or with a legacy interface. Therefore it is possible to handle most of what these commands do with generic code. Add a new generic function to process block-device commands using the interface type and the current device number for that type. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16env: Rename some other getenv()-related functionsSimon Glass
We are now using an env_ prefix for environment functions. Rename these other functions as well, for consistency: getenv_vlan() getenv_bootm_size() getenv_bootm_low() getenv_bootm_mapsize() env_get_default() Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16env: Rename eth_getenv_enetaddr() to eth_env_get_enetaddr()Simon Glass
Rename this function for consistency with env_get(). Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16env: Rename getenv_hex(), getenv_yesno(), getenv_ulong()Simon Glass
We are now using an env_ prefix for environment functions. Rename these for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16env: Rename getenv/_f() to env_get()Simon Glass
We are now using an env_ prefix for environment functions. Rename these two functions for consistency. Also add function comments in common.h. Quite a few places use getenv() in a condition context, provoking a warning from checkpatch. These are fixed up in this patch also. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16env: Rename common functions related to setenv()Simon Glass
We are now using an env_ prefix for environment functions. Rename these commonly used functions, for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16env: Rename setenv() to env_set()Simon Glass
We are now using an env_ prefix for environment functions. Rename setenv() for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-15env: Drop saveenv() in favour of env_save()Simon Glass
Use the env_save() function directly now that there is only one implementation of saveenv(). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Denk <wd@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
2017-08-15env: Drop the env_name_spec globalSimon Glass
Add a name to the driver and use that instead of the global variable declared by each driver. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2017-08-13cmd/bdinfo: correct comment in board_detailChris Packham
This appears to be a simple typo that dates back to the original implementation of board_detail in commit e79394643b26 ("common: Update cmd_bdinfo for PPC"). Signed-off-by: Chris Packham <judge.packham@gmail.com>
2017-08-13nvme: Add nvme commandsZhikang Zhang
Add nvme commands in U-Boot command line. 1. "nvme scan" - scan NVMe blk devices 2. "nvme list" - show all available NVMe blk devices 3. "nvme info" - show current or a specific NVMe blk device 4. "nvme device" - show or set current device 5. "nvme part" - print partition table 6. "nvme read" - read data from NVMe blk device 7. "nvme write" - write data to NVMe blk device Signed-off-by: Zhikang Zhang <zhikang.zhang@nxp.com> Signed-off-by: Wenbin Song <wenbin.song@nxp.com> Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2017-08-12efi_loader: use EFI_PAGE_SIZE instead of 4096xypron.glpk@gmx.de
We should use constant EFI_PAGE_SIZE instead of 4096 where the coding relies on 4096 being EFI_PAGE_SIZE. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-08-11README: Drop information about commandsSimon Glass
Most of this is duplicated in Kconfig help. Add some of that which is not, and remove the help from the README. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-08-11Convert CONFIG_CMD_ZFS to KconfigSimon Glass
This converts the following to Kconfig: CONFIG_CMD_ZFS Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-08-11Convert CONFIG_CMD_ZBOOT to KconfigSimon Glass
This converts the following to Kconfig: CONFIG_CMD_ZBOOT Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-08-11Convert CONFIG_CMD_UUID to KconfigSimon Glass
This converts the following to Kconfig: CONFIG_CMD_UUID Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-08-11Convert CONFIG_CMD_UNIVERSE to KconfigSimon Glass
This converts the following to Kconfig: CONFIG_CMD_UNIVERSE Since no board uses this, perhaps we should drop this command? Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-08-11Convert CONFIG_CMD_TSI148 to KconfigSimon Glass
This converts the following to Kconfig: CONFIG_CMD_TSI148 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-08-11Convert CONFIG_CMD_TRACE to KconfigSimon Glass
This converts the following to Kconfig: CONFIG_CMD_TRACE Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-08-11Convert CONFIG_CMD_YAFFS2 to KconfigSimon Glass
This converts the following to Kconfig: CONFIG_CMD_YAFFS2 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-08-11Convert CONFIG_CMD_THOR_DOWNLOAD to KconfigSimon Glass
This converts the following to Kconfig: CONFIG_CMD_THOR_DOWNLOAD Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-08-11Convert CONFIG_CMD_TERMINAL to KconfigSimon Glass
This converts the following to Kconfig: CONFIG_CMD_TERMINAL Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>