aboutsummaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)AuthorFilesLines
2020-01-17aes: add a define for the size of a blockPhilippe Reynes1-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>
2020-01-16cmd/blk_common: clarify no partition error messageAlexandre Besnard1-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>
2020-01-10cmd: adtimg: Refactor usage styleEugeniu Rosca1-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>
2020-01-10cmd: adtimg: Rename internal symbolsEugeniu Rosca1-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>
2020-01-10dtimg/am57xx_evm_defconfig: Rename dtimg to adtimgEugeniu Rosca3-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>
2020-01-10cmd/eeprom.c: prepend 0x to hex numbers in output message formatKlaus H. Sorensen1-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>
2020-01-09Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini1-7/+21
- DFU updates
2020-01-08Merge tag 'efi-2020-04-rc1' of ↵Tom Rini5-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
2020-01-08cmd/Kconfig: Add more dependencies to OSE bootm supportTom Rini1-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>
2020-01-07cmd: add rng commandHeinrich Schuchardt3-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>
2020-01-07bootm: Add a bootm command for type IH_OS_EFICristian Ciocaltea1-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>
2020-01-07cmd: efidebug: capitalize UEFIHeinrich Schuchardt1-4/+4
%s/uefi/UEFI/g Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-01-07cmd: efidebug: new sub-command tablesHeinrich Schuchardt1-1/+46
Provide sub-command for efidebug to list configuration tables. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-01-07cmd: efidebug: simplify get_guid_text()Heinrich Schuchardt1-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>
2020-01-07efi_loader: free load options after executionHeinrich Schuchardt1-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>
2020-01-07efi_loader: export efi_install_fdt()Heinrich Schuchardt1-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>
2020-01-07efi_loader: carve out efi_run_image()Heinrich Schuchardt1-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>
2020-01-07efi_loader: use hardware device tree by defaultHeinrich Schuchardt1-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>
2020-01-07efi_loader: pass address to efi_install_fdt()Heinrich Schuchardt1-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>
2020-01-07bdinfo: show multi_dtb_fitHeiko Schocher1-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>
2020-01-07dfu: Add optional timeout parameterAndy Shevchenko1-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>
2020-01-07dfu: Refactor do_dfu() to handle optional argumentAndy Shevchenko1-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>
2019-12-15x86: Update the fsp command for FSP2Simon Glass1-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>
2019-12-15x86: sandbox: Add a PMC emulator and testSimon Glass3-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>
2019-12-09cmd: pxe: Increase maximum path lengthBen Wolsieffer1-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>
2019-12-09cmd: mdio/mii: add Kconfig help and allow break dependencyRamon Fried2-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>
2019-12-09net: Always build the string_to_enetaddr() helperJoe Hershberger2-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>
2019-12-06rtc: move date.c from drivers/rtc/ to lib/AKASHI Takahiro1-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>
2019-12-06cmd: pxe: Fix checkpatch WARNING/CHECKPatrice Chotard1-7/+6
Fix checkpatch WARNING and CHECK issues Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2019-12-06cmd: sysboot: Fix checkpatch WARNING/CHECKPatrice Chotard1-13/+12
Fix checkpatch WARNING and CHECK issues Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2019-12-06cmd: pxe_utils: Fix checkpatch WARNING/CHECKPatrice Chotard1-47/+46
Fix checkpatch WARNING and CHECK issues Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2019-12-06cmd: sysboot: Create a sysboot command dedicated filePatrice Chotard4-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>
2019-12-06cmd: Prepare sysboot command independencePatrice Chotard4-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>
2019-12-06cmd: Migrate from_env() from pxe.c to nvedit.cPatrice Chotard2-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>
2019-12-05cmd: cp: add missing map_sysmemPhilippe Reynes1-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>
2019-12-05iminfo: add missing map_sysmemPhilippe Reynes1-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>
2019-12-04cmd: make MTD commands depend on MTDMiquel Raynal1-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>
2019-12-04cmd: nand/sf: isolate legacy codeMiquel Raynal5-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>
2019-12-04cmd: mtdparts: Kconfig: join mtdparts command entry with its optionsMiquel Raynal1-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>
2019-12-03mtd: rename CONFIG_MTD_DEVICE -> CONFIG_MTDMiquel Raynal1-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>
2019-12-03mtd: rename CONFIG_NAND -> CONFIG_MTD_RAW_NANDMiquel Raynal1-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>
2019-12-03Merge tag 'efi-2020-01-rc5' of ↵Tom Rini1-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.
2019-12-03cmd: efidebug: fix a build error in show_efi_boot_opt()AKASHI Takahiro1-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>
2019-12-03cmd: pxe: Fix bootm argument countAbhishek Shah1-0/+1
pxe command parses the init ramfs address(through initrd lable in pxe config file), but is not passing it to bootm command as argument as bootm_argc count is not increased. Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com> Signed-off-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-12-03blk: Make use of CONFIG_HAVE_BLOCK_DEVICE moreTom Rini2-3/+1
When we do not have CONFIG_BLK (or SPL/TPL) enabled there are very few cases where we need the blk_legacy code linked in. To catch these, build when we have CONFIG_HAVE_BLOCK_DEVICE set. In addition, we only need cmd/blk_common.o to be linked in when we have CONFIG_HAVE_BLOCK_DEVICE set, so make use of that directly. Signed-off-by: Tom Rini <trini@konsulko.com>
2019-12-02common: Move old EEPROM functions into a new headerSimon Glass1-0/+1
These functions do not use driver model but are still used. Move them to a new eeprom.h header file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-12-02common: Drop board_show_dram()Simon Glass1-7/+2
This function is not defined by any boards so the feature is not used. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-12-02common: Move enable/disable_interrupts out of common.hSimon Glass4-0/+4
Move these two functions into the irq_funcs.h header file. Also move interrupt_handler_t as this is used by the irq_install_handler() function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-12-02common: Move ARM cache operations out of common.hSimon Glass3-0/+3
These functions are CPU-related and do not use driver model. Move them to cpu_func.h Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-12-02common: Move some cache and MMU functions out of common.hSimon Glass2-0/+2
These functions belong in cpu_func.h. Another option would be cache.h but that code uses driver model and we have not moved these cache functions to use driver model. Since they are CPU-related it seems reasonable to put them here. Move them over. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>