summaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)AuthorFilesLines
2022-12-06global: Move remaining CONFIG_SYS_* to CFG_SYS_*Tom Rini2-10/+10
The rest of the unmigrated CONFIG symbols in the CONFIG_SYS namespace do not easily transition to Kconfig. In many cases they likely should come from the device tree instead. Move these out of CONFIG namespace and in to CFG namespace. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-12-06global: Move remaining CONFIG_SYS_SDRAM_* to CFG_SYS_SDRAM_*Tom Rini1-9/+9
The rest of the unmigrated CONFIG symbols in the CONFIG_SYS_SDRAM namespace do not easily transition to Kconfig. In many cases they likely should come from the device tree instead. Move these out of CONFIG namespace and in to CFG namespace. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-12-06global: Move remaining CONFIG_SYS_NUM_* to CFG_SYS_NUM_*Tom Rini1-3/+3
The rest of the unmigrated CONFIG symbols in the CONFIG_SYS_NUM namespace do not easily transition to Kconfig. In many cases they likely should come from the device tree instead. Move these out of CONFIG namespace and in to CFG namespace. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-12-05net: ping6: Add ping6 commandViacheslav Mitrofanov2-0/+33
Implement ping6 command to ping hosts using IPv6. It works the same way as an ordinary ping command. There is no ICMP request so it is not possible to ping our host. This patch adds options in Kconfig and Makefile to build ping6 command. Series-changes: 3 - Added structures and functions descriptions - Added to ping6_receive() return value instead of void Series-changes: 4 - Fixed structures and functions description style Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-12-05net: tftp: Add IPv6 support for tftpbootViacheslav Mitrofanov1-0/+35
The command tftpboot uses IPv4 by default. Add the possibility to use IPv6 instead. If an address in the command is an IPv6 address it will use IPv6 to boot or if there is a suffix -ipv6 in the end of the command it also force using IPv6. All other tftpboot features and parameters are left the same. Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-12-02eficonfig: use efi_get_next_variable_name_int()Masahisa Kojima1-24/+117
eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
2022-12-02efi_loader: utility function to check the variable name is "Boot####"Masahisa Kojima1-22/+1
Some commands need to enumerate the existing UEFI load option variable("Boot####"). This commit transfers some code from cmd/efidebug.c to lib/efi_loder/, then exposes efi_varname_is_load_option() function to check whether the UEFI variable name is "Boot####". Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-12-02eficonfig: use u16_strsize() to get u16 string buffer sizeMasahisa Kojima1-2/+1
Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-12-02eficonfig: fix going one directory up issueMasahisa Kojima1-1/+1
The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-12-02efi_loader: don't use EFI_LOADER_DATA internallyHeinrich Schuchardt1-1/+1
EFI_LOADER_DATA/CODE is reserved for EFI applications. Memory allocated by U-Boot for internal usage should be EFI_BOOT_SERVICES_DATA or _CODE or EFI_RUNTIME_SERVICES_DATA or _CODE. Reported-by: François-Frédéric Ozog <ff@ozog.com> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: François-Frédéric Ozog <ff@ozog.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-11-28net: Add wget applicationYing-Chun Liu (PaulLiu)2-0/+20
This commit adds a simple wget command that can download files from http server. The command syntax is wget ${loadaddr} <path of the file from server> Signed-off-by: Duncan Hare <DuncanCHare@yahoo.com> Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Christian Gmeiner <christian.gmeiner@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-11-25cmd: fix dependency for CMD_CLSJohn Keeping1-1/+1
It seems this symbol was missed when renaming DM_VIDEO -> VIDEO. Update it. Fixes: b86986c7b3 ("video: Rename CONFIG_DM_VIDEO to CONFIG_VIDEO") Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: John Keeping <john@metanate.com>
2022-11-23cmd: ubifs: Do not show usage when command failsPali Rohár1-4/+4
Return value -1 cause U-Boot to print usage message. Return value 1 (CMD_RET_FAILURE) indicates failure. So fix return value when ubifs command starts it execution and fails. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Dhruva Gole <d-gole@ti.com>
2022-11-23cmd: fdt: Fix iteration over elements above index 1 in fdt getMarek Vasut1-3/+6
Always increment both the iterator and pointer into the string property value by length of the current element + 1 (to cater for the string delimiter), otherwise the element extracted from the string property value would be extracted from an offset that is multiple of the length of the first element, instead of sum of element lengths until select index. This fixes 'fdt get value' operation for index above 1 (counting from index 0). Acked-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Fixes: 13982ced2cc ("cmd: fdt: Add support for reading stringlist property values") Signed-off-by: Marek Vasut <marex@denx.de>
2022-11-22eficonfig: add "Show Signature Database" menu entryMasahisa Kojima1-0/+235
This commit adds the menu-driven interface to show the signature list content. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-11-22eficonfig: add UEFI Secure Boot Key enrollment interfaceMasahisa Kojima3-0/+271
This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-11-22eficonfig: use protocol interface for file selectionMasahisa Kojima1-6/+7
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
2022-11-22eficonfig: expose eficonfig_create_device_path()Masahisa Kojima1-9/+11
Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
2022-11-22eficonfig: refactor change boot order implementationMasahisa Kojima1-62/+67
All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-11-22eficonfig: expose append entry functionMasahisa Kojima1-15/+17
Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-11-22eficonfig: refactor file selection handlingMasahisa Kojima1-26/+11
eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-11-16eficonfig: fix missing variable initializationMasahisa Kojima1-1/+1
The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-11-16cmd: remove superfluous if in eficonfig_edit_boot_optionHeinrich Schuchardt1-2/+0
Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-11-10global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespaceTom Rini1-1/+1
Migrate all of COFIG_SYS_FSL* to the CFG_SYS namespace. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-11-10Convert CONFIG_SYS_LOADS_BAUD_CHANGE et al to KconfigTom Rini1-7/+21
This converts the following to Kconfig: CONFIG_SYS_LOADS_BAUD_CHANGE CONFIG_LOADS_ECHO As part of this, we move CMD_SAVES to be after CMD_LOADS as they are logically related (load or save an s-record format file) and this makes grouping of CONFIG_SYS_LOADS_BAUD_CHANGE easier. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-11-08dm: sandbox: Switch over to using the new host uclassSimon Glass1-71/+133
Update the sandbox implementation to use UCLASS_HOST and adjust all the pieces to continue to work: - Update the 'host' command to use the new API - Replace various uses of UCLASS_ROOT with UCLASS_HOST - Disable test_eficonfig since it doesn't work (this should have a unit test to allow this to be debugged) - Update the blk test to use the new API - Drop the old header file Unfortunately it does not seem to be possible to split this change up further. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-11-08dm: sandbox: Drop non-BLK code from host implementationSimon Glass1-4/+0
This is not used anymore. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-11-02cmd: eeprom: don't truncate target address at 32-bitBaruch Siach1-2/+2
On 64-bit platforms where int is 32-bit wide, the eeprom command parse_numeric_param() routine truncates the memory address parameter to the lower 32-bit. Make parse_numeric_param() return long to allow read/write of addresses beyond the lower 4GB. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-11-02cyclic: switch to using hlist instead of listRasmus Villemoes1-2/+3
A hlist is headed by just a single pointer, so can only be traversed forwards, and insertions can only happen at the head (or before/after an existing list member). But each list node still consists of two pointers, so arbitrary elements can still be removed in O(1). This is precisely what we need for the cyclic_list - we never need to traverse it backwards, and the order the callbacks appear in the list should really not matter. One advantage, and the main reason for doing this switch, is that an empty list is represented by a NULL head pointer, so unlike a list_head, it does not need separate C code to initialize - a memset(,0,) of the containing structure is sufficient. This is mostly mechanical: - The iterators are updated with an h prefix, and the type of the temporary variable changed to struct hlist_node*. - Adding/removing is now just hlist_add_head (and not tail) and hlist_del(). - struct members and function return values updated. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de> Tested-by: Tim Harvey <tharvey@gateworks.com> # imx8mm-venice-*
2022-10-31FWU: cmd: Add a command to read FWU metadataSughosh Ganu3-0/+86
Add a command to read the metadata as specified in the FWU specification and print the fields of the metadata. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
2022-10-31vbe: Add a command to show the VBE stateSimon Glass1-1/+30
Add a VBE comment which shows the current state. Currently this is just the phases which booted via VBE. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-31Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASESimon Glass1-1/+1
The current name is inconsistent with SPL which uses CONFIG_SPL_TEXT_BASE and this makes it imposible to use CONFIG_VAL(). Rename it to resolve this problem. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-31Merge tag 'video-20221030' of ↵Tom Rini7-40/+170
https://source.denx.de/u-boot/custodians/u-boot-video - fix [hv]sync active vs back porch in dw_mipi_dsi - simplefb rotation support - support splash as raw image from MMC - enhancements to Truetype console (multiple fonts and sizes) - drop old LCD support
2022-10-30video: Rename CONFIG_DM_VIDEO to CONFIG_VIDEOSimon Glass3-4/+4
Now that all the old code is gone, rename this option. Driver model migration is now complete. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-30video: Drop CONFIG_LCDSimon Glass1-1/+1
This option is not used anymore. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-30video: Drop CONFIG_VIDEOSimon Glass1-1/+1
This option is not used anymore. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-30video: Drop remaining references to CONFIG_LCDSimon Glass1-3/+0
These rely on the old LCD implementation which is to be removed. Drop it all. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-30video: cmd: Drop old LCD codeSimon Glass1-9/+0
This relies on the old LCD implementation which is to be removed. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-30video: Move bmp_display() prototype to video.hSimon Glass1-10/+0
The lcd.h header is about to be deleted, so move this prototype. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-30video: Rename CONFIG_SYS_VIDEO_LOGO_MAX_SIZESimon Glass1-11/+8
This option should not have the SYS_ in it. Drop it so it fits in with the other video options. Also simplify the alignment code in gunzip_bmp(), since malloc() always returns a 32-bit-aligned pointer. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-30video: Split SPLASH_SCREEN_ALIGN from bmp commandSimon Glass1-3/+1
The bmp command already has a way to centre the image. Using this CONFIG option to also centre it makes it impossible to control where images are placed on the screen. Drop the extra check. Simplify the Kconfig file we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-30video: Add commands to list and change fontsSimon Glass2-0/+82
Add a new 'font' command which allows the fonts to be listed as well as selecting a different font and size. Allow the test to run on sandbox, where multiple font/size combinations are supported, as well as sandbox_flattree, where they are not. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-30video: Enable the cls command by defaultSimon Glass1-1/+1
This is enabled for LCD but not for VIDEO. Enable it since it is useful to be able to clear the screen and adds very little code. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-30video: Move the console commands to cmd/Simon Glass3-0/+75
Move these commands and the implementation to the cmd/ directory, which is where most commands are kept. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> [agust: keep vidconsole_position_cursor() in vidconsole uclass] Signed-off-by: Anatolij Gustschin <agust@denx.de>
2022-10-29dm: treewide: Do not use the return value of simple uclass iteratorMichal Suchanek1-6/+3
uclass_first_device/uclass_next_device return value will be removed, don't use it. With the current implementation dev is equivalent to !ret. It is redundant to check both, ret check can be replaced with dev check, and ret check inside the iteration is dead code. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-10-25Merge https://source.denx.de/u-boot/custodians/u-boot-spiTom Rini1-7/+11
- Add s28hl512t, s28hl01gt (Takahiro) - Rework s25hx_t_post_bfpt_fixup() (Takahiro)
2022-10-25cmd: sf: Handle unaligned 'update' start offsetMarek Vasut1-7/+11
Currently the 'sf update' command fails in case the 'start' offset is not aligned to SPI NOR erase block size. Add the missing alignment calculation. In case the start offset is in the middle of erase block, round start address down to the nearest aligned one, compare only the updated data between what is in the SPI NOR and what is being written, copy new data at offset of the compare buffer, and write back the entire erase block. This is useful e.g. on i.MX6Q where the u-boot-with-spl.imx is at offset 0x400 in the SPI NOR, while the SPI NOR may have erase block size e.g. 0x1000 bytes. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2022-10-22cmd: bcb: select user(0) hwpart in __bcb_load()Mattijs Korpershoek1-0/+11
For some blk operations, it's possible that a different hw partition gets selected via blk_dselect_hwpart(). In that case, only the region of the device covered by that partition is accessible. This breaks "bcb load" which attempts to read the gpt and assumes it's on the user(0) hw partition: => bcb load 2 misc GUID Partition Table Header signature is wrong: 0xDE7B17AD07D9E5D6 != 0x5452415020494645 find_valid_gpt: *** ERROR: Invalid GPT *** GUID Partition Table Header signature is wrong: 0x0 != 0x5452415020494645 find_valid_gpt: *** ERROR: Invalid Backup GPT *** Error: mmc 2:misc read failed (-2) Add a fail-safe in __bcb_load() to ensure we will always read from the user(0) hwpartition. This fixes the following fastboot sequence: $ fastboot erase mmc2boot1 # switch to hwpart1 $ fastboot reboot bootloader # switch to hwpart0, then reads GPT Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Reviewed-by: Sean Anderson <sean.anderson@seco.com>
2022-10-21qfw: return failure when no kernel could be loadedAndre Przywara1-2/+2
When we try to load a kernel via the QEMU firmware device, we currently "return -1;" if no kernel was specified on the QEMU command line. This leads to the usage output, which is confusing (since nothing on the command line was really wrong), but also somewhat hides the actual error message. Return CMD_RET_FAILURE (1), as it's a proper error, and make the message more clear that this is not only a "warning". This helps to call this command in boot scripts, and to gracefully continue if this doesn't work. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2022-10-21qfw: store loaded file size in environment variableAndre Przywara1-0/+2
At the moment the QEMU firmware command just prints the size of the loaded binaries on the console. To go with all the other load methods, and many boot scripts' expectations, also store the size of the file loaded last in the environment variable "filesize". We first put the kernel size in there, but overwrite this with the initrd size, should we have one, because this is probably the more prominent user of $filesize (in the booti or bootz command). Signed-off-by: Andre Przywara <andre.przywara@arm.com>