aboutsummaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)AuthorFilesLines
2023-03-07video console: move vidconsole_get_font_size() logic to driver opsDzmitry Sankouski1-1/+5
Since multiple vidconsole drivers exists, vidconsole_get_font_size() implementation cannot longer live in vidconsole_uclass.c file. Move current vidconsole_get_font_size logic to truetype driver ops. Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-01cmd: mvebu/bubt: Enable command by defaultPali Rohár1-0/+1
This makes updating of u-boot/firmware on Marvell boards easier. Signed-off-by: Pali Rohár <pali@kernel.org>
2023-03-01cmd: mvebu/bubt: Fix warnings: unused variable 'secure_mode' and ↵Pali Rohár1-2/+5
'fuse_read_u64' defined but not used 'secure_mode' and 'fuse_read_u64' are used only on A38x and A37xx. Fixes: f7b0bbca2b62 ("cmd: mvebu/bubt: Check for A38x/A37xx OTP secure bits and secure boot") Signed-off-by: Pali Rohár <pali@kernel.org>
2023-03-01cmd: mvebu/bubt: Better guess default MVEBU_*_BOOT optionPali Rohár1-0/+4
For 32-bit Armada boards which use SPL we can determinate boot device from existing MVEBU_SPL_BOOT_DEVICE_* option. For all other boards (e.g. 64-bit Armada) default option still needs to be set manually. Signed-off-by: Pali Rohár <pali@kernel.org>
2023-03-01cmd: mvebu/bubt: Set correct default image name for 32-bit Armada SoCsPali Rohár1-0/+1
32-bit Armada SoCs uses u-boot binary packed in kwbimage format. Name of the image is in CONFIG_BUILD_TARGET option. So use it as a default option in Kconfig. Signed-off-by: Pali Rohár <pali@kernel.org>
2023-03-01cmd: mvebu/bubt: Check also A8K boot image checksumPali Rohár1-3/+11
Signed-off-by: Pali Rohár <pali@kernel.org>
2023-03-01cmd: mvebu/bubt: Do not modify image in A8K check_image_header()Pali Rohár1-5/+1
Change checksum verification code so it does require to modify image. Signed-off-by: Pali Rohár <pali@kernel.org>
2023-03-01cmd: mvebu/bubt: Mark all local symbols as staticPali Rohár1-4/+4
There is no need to export these local functions and structures. Signed-off-by: Pali Rohár <pali@kernel.org>
2023-03-01cmd: mvebu/bubt: Rename variable image_size to hdr_sizePali Rohár1-5/+5
Variable image_size contains size of the header, not size of the whole image. Rename this variable to reflect content. Signed-off-by: Pali Rohár <pali@kernel.org>
2023-03-01cmd: mvebu/bubt: Add support for reading image from the SATA disk partitionPali Rohár1-2/+37
This change allows to load boot image from the first SATA/SCSI device partition and burn it to board boot location (e.g. SPI-NOR). This is particularly when storage device is not handled by U-Boot as USB mass storage (which is already supported by bubt) but as SATA/SCSI device. Signed-off-by: Pali Rohár <pali@kernel.org>
2023-03-01cmd: mvebu/bubt: Add support for writing image to SATA diskPali Rohár2-1/+120
All 32-bit Armada SoCs and also 64-bit Armada 3720 SoC can load and boot firmware from SATA disk. This adds support for updating firmware binary for these SoCs. On 32-bit Armada SoC is firmware stored at sector 1 and on Armada 3720 is stored at MBR partition 0x4d or GPT partition with type GUID 6828311A-BA55-42A4-BCDE-A89BB5EDECAE (Marvell Armada 3700 Boot partition). Signed-off-by: Pali Rohár <pali@kernel.org>
2023-03-01cmd: mvebu/bubt: Add support for selecting eMMC HW partitionPali Rohár1-5/+48
Support for burning into the correct eMMC HW boot partition was broken and removed in commit 96be2f072768 ("mvebu: bubt: Drop dead code"). Reimplement this functionality and bring it back again. Fixes: 96be2f072768 ("mvebu: bubt: Drop dead code") Signed-off-by: Pali Rohár <pali@kernel.org>
2023-03-01cmd: mvebu/bubt: Fix parsing SATA kwbimagePali Rohár1-7/+1
Despite the official specification, Marvell BootROM does not interpret srcaddr from SATA image as number of sectors the beginning of the hard drive, but as number of sectors relative to the main header. Reject invalid and accept valid SATA images. Fixes: 5a0653493307 ("cmd: mvebu/bubt: Check for A38x image data checksum") Signed-off-by: Pali Rohár <pali@kernel.org>
2023-03-01cmd: mvebu/bubt: Fix parsing SDIO kwbimagePali Rohár1-3/+0
Despite the official specification, Marvell BootROM does not interpret srcaddr from SDIO image as offset in number of sectors (like for SATA image), but as offset in bytes (like for all other images except SATA). To ensure that we do not store invalid SDIO image to the boot location (read by the Marvell BootROM), we need to check that image is valid and srcaddr is intepreted in bytes, in the same way as it is done by Marvell BootROM. This fixes rejecting valid and accepting invalid SDIO images by bubt command. Fixes: 5a0653493307 ("cmd: mvebu/bubt: Check for A38x image data checksum") Signed-off-by: Pali Rohár <pali@kernel.org>
2023-02-27mtd: nand: Mark reserved blocksAshok Reddy Soma1-3/+6
Reserved blocks are used for storing bad block tables. With "nand bad" command, these reserved blocks are shown as bad blocks. This is leading to confusion when compared with Linux bad blocks. Hence, display "bbt reserved" when printing reserved blocks with "nand bad" command. To acheive this, return 2 which represents reserved from nand_isbad_bbt() instead of 1 in case of reserved blocks and catch it in cmd/nand.c. "nand bad" command display's hexadecimal numbers, so add "0x" prefix. Example log will show up as below. ZynqMP> nand bad Device 0 bad blocks: 0x00400000 0x16800000 0x16c00000 0x17000000 0x3d800000 0x3e400000 0xe8400000 0xff000000 (bbt reserved) 0xff400000 (bbt reserved) 0xff800000 (bbt reserved) 0xffc00000 (bbt reserved) 0x116800000 0x116c00000 0x1ff000000 (bbt reserved) 0x1ff400000 (bbt reserved) 0x1ff800000 (bbt reserved) 0x1ffc00000 (bbt reserved) Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com> Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com> Acked-By: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2023-02-19efi_loader: Measure the loaded DTBEtienne Carriere1-0/+8
Measures the DTB passed to the EFI application upon new boolean config switch CONFIG_EFI_TCG2_PROTOCOL_MEASURE_DTB. For platforms where the content of the DTB passed to the OS can change across reboots, there is not point measuring it hence the config switch to allow platform to not embed this feature. Co-developed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-02-13Merge https://source.denx.de/u-boot/custodians/u-boot-marvellTom Rini1-7/+4
- mvebu: Support for 2 new Armada 385 boards (Tony) - mvebu: Minor misc board enhancements (Tony) - kirkwood: Serial driver fixes (Kconfig & dtsi) (Tony) - cmd: return code when tlv_eeprom incorrectly called (Heinrich)
2023-02-13cmd: return code when tlv_eeprom incorrectly calledHeinrich Schuchardt1-7/+4
A command called with incorrect parameters should set $? to 1 (false). Instead of calling cmd_usage(cmdtp) and then returning 0 just return CMD_RET_FAILURE. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Acked-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Stefan Roese <sr@denx.de>
2023-02-12cmd: fdt: allow standalone "fdt move"Andre Przywara1-11/+17
At the moment every subcommand of "fdt", except "addr" itself, requires the DT address to be set first. We explicitly check for that before even comparing against the subcommands' string. This early bailout also affects the "move" subcommand, even though that does not require or rely on a previous call to "fdt addr". In fact it even sets the FDT address to the target of the move command, so is a perfect beginning for a sequence of fdt commands. Move the check for a previously set FDT address to after we handle the "move" command also, so we don't need a dummy call to "fdt addr" first, before being able to move the devicetree. This skips one pointless "fdt addr" call in scripts which aim to alter the control DT, but need to copy it to a safe location first (for instance to $fdt_addr_r). Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-02-12cmd: fdt: move: Use map_sysmem to convert pointersAndre Przywara1-3/+3
The "fdt move" subcommand was using the provided DTB addresses directly, without trying to "map" them into U-Boot's address space. This happened to work since on the vast majority of "real" platforms there is a simple 1:1 mapping of VA to PAs, so either value works fine. However this is not true on the sandbox, so the "fdt move" command fails there miserably: => fdt addr $fdtcontroladdr => cp.l $fdtcontroladdr $fdt_addr_r 40 # simple memcpy works => fdt move $fdtcontroladdr $fdt_addr_r Segmentation fault Use the proper "map_sysmem" call to convert PAs to VAs, to make this more robust in general and to enable operation in the sandbox. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-02-12cmd: clk: probe the clock before dump themPatrick Delaunay1-10/+5
The clock UCLASS need to be probed to allow availability of the private data (struct clk *), get in show_clks() with dev_get_clk_ptr() before use them. Without this patch the clock dump can cause crash because all the private data are not available before calling the API clk_get_rate(). It is the case for the SCMI clocks, priv->channel is needed for scmi_clk_get_rate() and it is initialized only in scmi_clk_probe(). This issue causes a crash for "clk dump" command on STM32MP135F-DK board for SCMI clock not yet probed. Fixes: 1a725e229096 ("clk: fix clock tree dump to properly dump out every registered clock") Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Sean Anderson <seanga2@gmail.com> Link: https://lore.kernel.org/r/20221213145708.v2.1.Ia0bc6b272f1e2e3f37873c61d79138c2663c4055@changeid
2023-02-10Merge tag 'efi-2023-04-rc2' of ↵WIP/10Feb2023Tom Rini4-12/+16
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2023-04-rc2 Documentation: * Provide page with links to talks on U-Boot UEFI: * Enable CTRL+S to save the boot order in eficonfig command * Run attribute check for QueryVariableInfo() only for the file store * Bug fixes Others: * Improve output formatting of the coninfo command # -----END PGP SIGNATURE----- # gpg: Signature made Fri 10 Feb 2023 12:15:45 PM EST # gpg: using RSA key 6DC4F9C71F29A6FA06B76D33C481DBBC2C051AC4 # gpg: Good signature from "Heinrich Schuchardt <xypron.glpk@gmx.de>" [unknown] # gpg: aka "[jpeg image of size 1389]" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 6DC4 F9C7 1F29 A6FA 06B7 6D33 C481 DBBC 2C05 1AC4
2023-02-10Correct SPL use of EFI_SECURE_BOOTSimon Glass1-1/+1
This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-10Correct SPL use of EFI_MM_COMM_TEESimon Glass1-1/+1
This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-10Correct SPL use of VIDEO_ANSISimon Glass1-1/+1
This converts 1 usage of this option to the non-SPL form, since there is no SPL_VIDEO_ANSI defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-10Correct SPL uses of VIDEOSimon Glass1-1/+1
This converts 2 usages of this option to the non-SPL form, since there is no SPL_VIDEO defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-10Correct SPL use of USB_FUNCTION_FASTBOOTSimon Glass1-1/+1
This converts 1 usage of this option to the non-SPL form, since there is no SPL_USB_FUNCTION_FASTBOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2023-02-10Correct SPL use of UDP_FUNCTION_FASTBOOTSimon Glass1-1/+1
This converts 1 usage of this option to the non-SPL form, since there is no SPL_UDP_FUNCTION_FASTBOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2023-02-10Correct SPL uses of SYS_LONGHELPSimon Glass4-5/+5
This converts 5 usages of this option to the non-SPL form, since there is no SPL_SYS_LONGHELP defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-10efi_loader: enable eficonfig command by defaultHeinrich Schuchardt1-0/+1
The eficonfig command is required to set boot options. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-02-10cmd: CONFIG_CMD_EFICONFIG requires CONFIG_MENUHeinrich Schuchardt1-0/+1
The eficonfig command invokes functions implemented in common/menu.c like * menu_default_set() * menu_get_choice() * menu_destroy() * menu_item_add() Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-02-10eficonfig: CTRL+S to save the boot orderMasahisa Kojima1-1/+5
The change boot order menu in eficonfig can have at most INT_MAX lines and it is troublesome to scroll down to the "Save" entry. This commit assigns CTRL+S to save the boot order. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-02-10menu: remove CTRL+C to quitMasahisa Kojima2-4/+4
On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-02-10cmd: improve coninfo output formattingHeinrich Schuchardt1-8/+6
Device name are typically longer than 8 characters. This leads to ragged output. Only the I and O bit of the device flags are of interest for the user. Writing a hexadecimal number is just confusing. Before the patch the output looked like this: => coninfo List of available devices: pl011@9000000 00000007 IO stdin stdout stderr serial 00000003 IO usbkbd 00000001 I. With the patch the output looks like this: => coninfo List of available devices |-- pl011@9000000 (IO) | |-- stdin | |-- stdout | |-- stderr |-- serial (IO) |-- usbkbd (I) Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-02-09Correct SPL uses of CMD_TFTPPUTSimon Glass1-3/+3
This converts 3 usages of this option to the non-SPL form, since there is no SPL_CMD_TFTPPUT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-09Correct SPL use of CMD_NVEDIT_EFISimon Glass1-1/+1
This converts 1 usage of this option to the non-SPL form, since there is no SPL_CMD_NVEDIT_EFI defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-09Correct SPL uses of CMD_EFICONFIGSimon Glass1-2/+2
This converts 2 usages of this option to the non-SPL form, since there is no SPL_CMD_EFICONFIG defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-07env: Drop ENV_IS_IN_SATASimon Glass1-1/+0
This is not used anywhere, so drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-07Drop dataflash_mmc_mux commandSimon Glass2-49/+0
This is not used. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2023-02-07cmd: Drop mfsl commandSimon Glass2-388/+0
This is not used anywhere. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-07cmd: Add an option to enable the ini commandSimon Glass1-0/+7
This command has no Kconfig option at present, but seems useful enough to keep around. Add one. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-06cmd: Add a SEAMA image load commandLinus Walleij3-0/+165
Add a command to load SEAMA (Seattle Image), a NAND flash on-flash storage format. This type of flash image is found in some D-Link routers such as DIR-645, DIR-842, DIR-859, DIR-860L, DIR-885L, DIR890L and DCH-M225, as well as in WD and NEC routers on the ath79 (MIPS), Broadcom BCM53xx, and RAMIPS platforms. This U-Boot command will read and decode a SEAMA image from raw NAND flash on any platform. As it is always using big endian format for the data decoding is always necessary on platforms such as ARM. The command is needed to read a SEAMA-encoded boot image on the D-Link DIR-890L router for boot from NAND flash in an upcoming port of U-Boot to the Broadcom Northstar (BCM4709, BCM53xx) architecture. A basic test and documentation is added as well. The test must be run on a target with NAND flash support and at least one resident SEAMA image in flash. Cc: Rafał Miłecki <rafal@milecki.pl> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-02-06qemu: Move qfw kernel setup into a common fileSimon Glass1-68/+1
This is currently in the cmd/ file but we want to call it from a driver. Move it into a common place. Tidy up the header-file order while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-06qemu: Update qfw command to use addressesSimon Glass1-21/+21
This uses casts all over the place. Use the correct type so that these can be avoided, as is done with other commands. Also simplify a few conditionals. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-06bootstd: Allow enabling BOOTSTD_FULL without needing EXPOSimon Glass1-8/+13
It is sometimes useful to have one without the other, e.g. on a device without a display, since at present the expo feature requires CONFIG_VIDEO to be enabled. Update the Makefile and bootflow command to support this, as well as the EXPO dependency. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-31Merge https://source.denx.de/u-boot/custodians/u-boot-mmcWIP/31Jan2023Tom Rini1-8/+41
2023-01-31Merge tag 'u-boot-amlogic-20230131' of ↵Tom Rini4-0/+206
https://source.denx.de/u-boot/custodians/u-boot-amlogic - jethub j100: add rescue boot from microSD - move meson sm command to cmd/meson and add efusedump sub-command - switch dwc2 otg to DM for G12A, GXL & AXG - Add new boards: - Odroid Go Ultra - Odroid-N2L
2023-01-31cmd: mmc: Expand bkops handlingMarek Vasut1-8/+41
Add more capable "bkops" command which allows enabling and disabling both manual and automatic bkops. The existing 'mmc bkops-enable' subcommand is poorly named to cover all the possibilities, hence the new-ish subcommand. Note that both commands are wrappers around the same common code. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2023-01-27eficonfig: add vertical scroll supportMasahisa Kojima1-17/+75
The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-01-27eficonfig: refactor change boot order implementationMasahisa Kojima1-95/+151
This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>