summaryrefslogtreecommitdiffstats
path: root/cmd
Commit message (Collapse)AuthorAgeFilesLines
* image: Rename load_addr, save_addr, save_sizeSimon Glass2020-01-1717-35/+39
| | | | | | | | | These global variables are quite short and generic. In fact the same name is more often used locally for struct members and function arguments. Add a image_ prefix to make them easier to distinguish. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Move reset_cpu() to the CPU headerSimon Glass2020-01-171-0/+1
| | | | | | Move this function out of common.h and into a relevant header file. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop floppy disk supportSimon Glass2020-01-173-758/+0
| | | | | | | | | This seems pretty old now. It has not been converted to driver model and is not used by any boards. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Move functions for loading from fat/ext2 to fs.hSimon Glass2020-01-172-1/+2
| | | | | | | These are filesystem functions and belong in the filesystem header file. Move them. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Move do_tftpb() to net.hSimon Glass2020-01-171-0/+1
| | | | | | This function belongs in the network header file. Move it. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Move flash_perror() to flash.hSimon Glass2020-01-172-2/+4
| | | | | | | | This function belongs more in flash.h than common.h so move it. Also remove the space before the bracket in some calls. Signed-off-by: Simon Glass <sjg@chromium.org>
* aes: add support of aes192 and aes256Philippe Reynes2020-01-171-12/+26
| | | | | | | | Until now, we only support aes128. This commit add the support of aes192 and aes256. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* aes: add a define for the size of a blockPhilippe Reynes2020-01-171-1/+1
| | | | | | | | | | | In the code, we use the size of the key for the size of the block. It's true when the key is 128 bits, but it become false for key of 192 bits and 256 bits. So to prepare the support of aes192 and 256, we introduce a constant for the iaes block size. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* cmd/blk_common: clarify no partition error messageAlexandre Besnard2020-01-161-1/+2
| | | | | | | | When no partition table is found, users should be warned so. Warning that no device is available in this case could be misleading, especially as it is the same error when no device is selected. Signed-off-by: Alexandre Besnard <alexandre.besnard@softathome.com>
* cmd: adtimg: Refactor usage styleEugeniu Rosca2020-01-101-59/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trying to extend 'adtimg' functionality [1], we've been severely hit by a major limitation in the command's usage scheme. Specifically, the command's user interface appears to be too centric to getting the DTB/DTBO entry [3] based on the index of the desired DT in the image, which makes it really difficult retrieving the DT entry based on alternative criteria (e.g. filtering by id/rev fields), the latter being demanded by real life customer use-cases [1]. This went to the point of receiving below feedback from Sam [2]: -- snip -- As for 'dtimg' command: after giving it some thought, I think not much people using it yet. So in this particular case I don't have some strong preference, and if you think the 'dtimg' interface is ugly, and it overcomes "don't break interfaces" rule, maybe now is a good time to rework it (before it gets widely used). -- snip -- Given the above, rework the usage pattern from [4] to [5], in order to allow an intuitive enablement of "by id|rev" DT search [6]. [1] https://patchwork.ozlabs.org/cover/1202575/ ("cmd: dtimg: Enhance with --id and --rev options (take #1)") [2] https://patchwork.ozlabs.org/patch/1182207/#2317020 [3] https://source.android.com/devices/architecture/dto/partitions [4] Old usage adtimg dump <addr> - Print image contents adtimg start <addr> <index> <varname> - Get DT address by index adtimg size <addr> <index> <varname> - Get DT size by index [5] New usage adtimg addr <addr> - Set image location to <addr> adtimg dump - Print out image contents adtimg get dt --index=<i> [avar [svar]] - Get DT address and size by index [6] Soon-to-be-provided "by id|rev" add-on functionality adtimg get dt --id=<id> --rev=<rev> [avar [svar [ivar]]] - Get DT address/size/index by id|rev fields Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
* cmd: adtimg: Rename internal symbolsEugeniu Rosca2020-01-101-25/+26
| | | | | | | | | | | With 'dtimg.c' renamed to 'adtimg.c', now ensure the naming consistency in the internal implementation of 'adtimg.c'. No functional change intended. Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* dtimg/am57xx_evm_defconfig: Rename dtimg to adtimgEugeniu Rosca2020-01-103-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Rename the existing 'dtimg' command to 'adtimg', in order to: - Suggest the Android origins and scope - Be consistent with the upcoming 'abootimg' command (naming suggested by Simon [*]) The change in _not_ backward compatible, but its benefits outweigh its downsides, given that we don't expect active users of 'dtimg' today. Perform the rename in several steps: 1. Rename *.c file and Kconfig symbol. This should allow 'git log --follow' to properly track the history of 'adtimg.c' 2. 's/dtimg/adtimg/g' in the internal namespace of 'adtimg.c' ELF comparison [**] before and after shows no functional change. [*] https://patchwork.ozlabs.org/patch/1182212/#2291600 [**] diff -u <(objdump -d cmd/dtimg.o) <(objdump -d cmd/adtimg.o) Cc: Tom Rini <trini@konsulko.com> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Reviewed-by: Simon Glass<sjg@chromium.org> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
* cmd/eeprom.c: prepend 0x to hex numbers in output message formatKlaus H. Sorensen2020-01-101-1/+1
| | | | | | | | | | If the numbers do not happen to contain any digits from [a-f], it's not clear that they are base 16. Signed-off-by: Klaus H. Sorensen <khso@prevas.dk> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Heiko Schocher <hs@denx.de>
* Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini2020-01-091-7/+21
|\ | | | | | | - DFU updates
| * dfu: Add optional timeout parameterAndy Shevchenko2020-01-071-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the `dfu` command is called from the U-Boot environment, it now accepts an optional parameter that specifies a timeout (in seconds). If a DFU connection is not made within that time the `dfu` command exits (as it would if Ctrl+C was pressed). If the timeout is left empty or being zero the `dfu` command behaves as it does now. This is useful for allowing U-Boot to check to see if anything wants to upload new firmware before continuing to boot. The patch is based on the commit https://github.com/01org/edison-u-boot/commit/5e966ccc3c65c18c9783741fa04e0c45e021780c by Sebastien Colleur, which has been heavily reworked due to U-Boot changes in the past. Signed-off-by: Brad Campbell <bradjc5@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| * dfu: Refactor do_dfu() to handle optional argumentAndy Shevchenko2020-01-071-7/+10
| | | | | | | | | | | | | | | | In the future we may utilize optional argument in 'dfu' command line. As a preparation for this, refactor do_dfu(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Lukasz Majewski <lukma@denx.de>
* | Merge tag 'efi-2020-04-rc1' of ↵Tom Rini2020-01-085-68/+216
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2020-04-rc1 This pull request provides: * support for FIT images for UEFI binaries * drivers for hardware random number generators * an implementation of the EFI_RNG_PROTOCOL * a sub-command for efidebug to display configuration tables
| * | cmd: add rng commandHeinrich Schuchardt2020-01-073-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | For the RNG uclass we currently only have a test working on the sandbox. Provide a command to test the hardware random number generator on non-sandbox systems. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | bootm: Add a bootm command for type IH_OS_EFICristian Ciocaltea2020-01-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for booting EFI binaries contained in FIT images. A typical usage scenario is chain-loading GRUB2 in a verified boot environment. Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | cmd: efidebug: capitalize UEFIHeinrich Schuchardt2020-01-071-4/+4
| | | | | | | | | | | | | | | | | | %s/uefi/UEFI/g Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | cmd: efidebug: new sub-command tablesHeinrich Schuchardt2020-01-071-1/+46
| | | | | | | | | | | | | | | | | | Provide sub-command for efidebug to list configuration tables. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | cmd: efidebug: simplify get_guid_text()Heinrich Schuchardt2020-01-071-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we hit a matching GUID we can directly return the text. There is no need for a check after the loop. efi_guid_t is defined as 8 byte aligned but GUIDs in packed structures do not follow this alignment. Do not require the argument of get_guid_text() to be correctly aligned. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | efi_loader: free load options after executionHeinrich Schuchardt2020-01-071-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | When be launch a binary via bootefi the bootargs environment variable is used to set the load options in the loaded image protocol. Free memory allocated for load options when the UEFI binary exits. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | efi_loader: export efi_install_fdt()Heinrich Schuchardt2020-01-071-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use a pointer to addressable memory instead of a "physical" address in the virtual address space of the sandbox to efi_install_fdt(). Export the efi_install_fdt() function. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | efi_loader: carve out efi_run_image()Heinrich Schuchardt2020-01-071-19/+32
| | | | | | | | | | | | | | | | | | | | | Provide public function efi_run_imager() which can be used to run an UEFI image from memory. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | efi_loader: use hardware device tree by defaultHeinrich Schuchardt2020-01-071-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | If the bootefi command is called without passing the address of a device tree, the internal device tree is used. For devices with a hardware device tree it is preferable to used the hardware device tree in this case. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | efi_loader: pass address to efi_install_fdt()Heinrich Schuchardt2020-01-071-14/+18
| |/ | | | | | | | | | | | | | | | | | | | | As part of moving the parsing of command line arguments to do_bootefi() call efi_install_fdt() with the address of the device tree instead of a string. If the address is EFI_FDT_USE_INTERNAL (= 0), the internal device tree is used. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | cmd/Kconfig: Add more dependencies to OSE bootm supportTom Rini2020-01-081-0/+1
| | | | | | | | | | | | | | Per Enea OSE documentation, it supports some classes of ARM, PowerPC and X86. Limit the option to those platforms. Signed-off-by: Tom Rini <trini@konsulko.com>
* | bdinfo: show multi_dtb_fitHeiko Schocher2020-01-071-0/+3
|/ | | | | | | | if MULTI_DTB_FIT is enabled it is helpful to display the value of gd->multi_dtb_fit in bdinfo. Signed-off-by: Heiko Schocher <hs@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* x86: Update the fsp command for FSP2Simon Glass2019-12-151-21/+44
| | | | | | | | The current 'fsp' command only works with FSP1. Update it to handle FSP2 as well. Convert everything to hex which is what U-Boot uses. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: sandbox: Add a PMC emulator and testSimon Glass2019-12-153-0/+90
| | | | | | | Add a simple PMC for sandbox to permit tests to run. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* cmd: pxe: Increase maximum path lengthBen Wolsieffer2019-12-091-1/+1
| | | | | | | | | | On NixOS, cross compiled kernels have long suffixes that cause them to exceed the current maximum path length. The PXE/TFTP max path length is used for extlinux.conf support as well, which is where this problem usually manifest's itself. Signed-off-by: Ben Wolsieffer <benwolsieffer@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* cmd: mdio/mii: add Kconfig help and allow break dependencyRamon Fried2019-12-092-5/+17
| | | | | | | | | | | * Add Kconfig help describing the purpose of each command. * Add CONFIG_CMD_MDIO so it could be selected individually, as it doesn't depend on the mii command. * Add Kconfig imply to mii to automatically select the mdio command. Signed-off-by: Ramon Fried <rfried.dev@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* net: Always build the string_to_enetaddr() helperJoe Hershberger2019-12-092-2/+2
| | | | | | | | | | | | Part of the env cleanup moved this out of the environment code and into the net code. However, this helper is sometimes needed even when the net stack isn't included. Move the helper to lib/net_utils.c like it's similarly-purposed string_to_ip(). Also rename the moved function to similar naming. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reported-by: Ondrej Jirman <megous@megous.com>
* rtc: move date.c from drivers/rtc/ to lib/AKASHI Takahiro2019-12-061-0/+1
| | | | | | | | In the next commit, rtc_mktime(), for compatibility with linux, will be implemented using rtc_mktime(), which is no longer drivers/rtc specific. So move this file under lib/. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
* cmd: pxe: Fix checkpatch WARNING/CHECKPatrice Chotard2019-12-061-7/+6
| | | | | | Fix checkpatch WARNING and CHECK issues Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* cmd: sysboot: Fix checkpatch WARNING/CHECKPatrice Chotard2019-12-061-13/+12
| | | | | | Fix checkpatch WARNING and CHECK issues Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* cmd: pxe_utils: Fix checkpatch WARNING/CHECKPatrice Chotard2019-12-061-47/+46
| | | | | | Fix checkpatch WARNING and CHECK issues Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* cmd: sysboot: Create a sysboot command dedicated filePatrice Chotard2019-12-064-132/+142
| | | | | | | | Extract all sysboot command related code from pxe.c to new sysboot.c Update Kconfig to insure that DISTRO_DEFAULT select new CMD_SYSBOOT command. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* cmd: Prepare sysboot command independencePatrice Chotard2019-12-064-1417/+1444
| | | | | | | | As sysboot and pxe commands are sharing piece of code, migrate this common code into a new file pxe_utils.c to prepare sysboot command code extraction from pxe.c Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* cmd: Migrate from_env() from pxe.c to nvedit.cPatrice Chotard2019-12-062-17/+17
| | | | | | Migrate from_env() from pxe.c to nvedit.c as it's not pxe specific. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* cmd: cp: add missing map_sysmemPhilippe Reynes2019-12-051-3/+13
| | | | | | | | The command cp fails on sandbox because the address is used directly. To fix this issue, we call the function map_sysmem to translate the address. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
* iminfo: add missing map_sysmemPhilippe Reynes2019-12-051-1/+11
| | | | | | | | The command iminfo fails on sandbox because the address is used directly. To fix this issue, we call the function map_sysmem to translate the address. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
* cmd: make MTD commands depend on MTDMiquel Raynal2019-12-041-3/+7
| | | | | | | Defconfigs have been fixed, now we can add proper dependencies in Kconfig. SPI FLASH is still not dependent on MTD (deeper rework needed). Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
* cmd: nand/sf: isolate legacy codeMiquel Raynal2019-12-045-0/+118
| | | | | | | | | | | | | | | | | The 'sf' command is not supposed to rely on the MTD stack, but both 'sf' and 'nand' commands use helpers located in mtd_uboot.c. Despite their location, these functions do not depend at all on the MTD stack. This file (drivers/mtd/mtd_uboot.c) is only compiled if CONFIG_MTD is selected, which is inconsistent with the current situation. Solve this by moving these three functions (which are only used by the above two commands) out of mtd_uboot.c and put them in a C file only compiled with cmd/sf.c and cmd/nand.c. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> [trini: Don't export get_part function now] Signed-off-by: Tom Rini <trini@konsulko.com>
* cmd: mtdparts: Kconfig: join mtdparts command entry with its optionsMiquel Raynal2019-12-041-14/+14
| | | | | | | Move the Kconfig entry of the option right after the entry of the mtdparts command. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
* mtd: rename CONFIG_MTD_DEVICE -> CONFIG_MTDMiquel Raynal2019-12-031-1/+1
| | | | | | | Like in Linux, just use CONFIG_MTD to compile the MTD stack. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
* mtd: rename CONFIG_NAND -> CONFIG_MTD_RAW_NANDMiquel Raynal2019-12-031-1/+1
| | | | | | | | | Add more clarity by changing the Kconfig entry name. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> [trini: Re-run migration, update a few more cases] Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
* Merge tag 'efi-2020-01-rc5' of ↵Tom Rini2019-12-031-2/+2
|\ | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2020-01-rc5 A type error in the implementation of the efidebug command is fixed.
| * cmd: efidebug: fix a build error in show_efi_boot_opt()AKASHI Takahiro2019-12-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I detected the following error in sandbox with Clang on Travis CI: +cmd/efidebug.c:703:15: error: result of comparison of constant 9223372036854775822 with expression of type 'int' is always false [-Werror,-Wtautological-constant-out-of-range-compare] + else if (ret == EFI_NOT_FOUND) + ~~~ ^ ~~~~~~~~~~~~~ Simply changing a type of 'ret' to efi_status_t will fix this error. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>