summaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)Author
2023-06-09fwu: meta-data: switch to management by common codeJassi Brar
The common code can now read, verify and fix meta-data copies while exposing one consistent structure to users. Only the .read_mdata() and .write_mdata() callbacks of fwu_mdata_ops are needed. Get rid of .get_mdata() .update_mdata() .get_mdata_part_num() .read_mdata_partition() and .write_mdata_partition() and also the corresponding wrapper functions. Signed-off-by: Jassi Brar <[email protected]> Reviewed-by: Etienne Carriere <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Tested-by: Sughosh Ganu <[email protected]>
2023-06-06ubifs: allow loading to above 4GiBBen Dooks
The ubifsload command is truncating any address above 4GiB as it casts this address to an u32, instead of using an unsigned long which most of the other load commands do. Change this to an unsigned long to allow loading into high memory for boards which use these areas. Fixes the following error: => ubifsload 0x2100000000 /boot/Image.lzma Loading file '/boot/Image.lzma' to addr 0x00000000... Unhandled exception: Store/AMO access fault Signed-off-by: Ben Dooks <[email protected]> Signed-off-by: Ben Dooks <[email protected]>
2023-05-31cmd: sf/nand: Print and return failure when 0 length is passedAshok Reddy Soma
For sf commands, when '0' length is passed for erase, update, write or read, there might be undesired results. Ideally '0' length means nothing to do. So print 'ERROR: Invalid size 0' and return cmd failure when length '0' is passed to sf commands. Same thing applies for nand commands also. Example: ZynqMP> sf erase 0 0 ERROR: Invalid size 0 ZynqMP> sf write 10000 0 0 ERROR: Invalid size 0 ZynqMP> sf read 10000 0 0 ERROR: Invalid size 0 ZynqMP> sf update 1000 10000 0 ERROR: Invalid size 0 ZynqMP> Signed-off-by: Ashok Reddy Soma <[email protected]>
2023-05-31cmd: fs: document where 'size' stores its resultBaruch Siach
Make it a little bit easier for the user to utilize the 'size' command. Signed-off-by: Baruch Siach <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-05-31cmd: fdt: Correct checking of configuration nodeBin Meng
fit_conf_get_node() returns a negative value on error. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-05-31acpi: Put the version numbers in a central placeSimon Glass
At present two acpi files are built every time since they use a version number from version.h This is not necessary. Make use of the same technique as for the version string, so that they are build only when they change. Signed-off-by: Simon Glass <[email protected]>
2023-05-16Merge tag 'efi-2023-07-rc3' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request efi-2023-07-rc3 Documentation: * update the description of signature algorithms UEFI: * fix unaligned access to GUID in HII database protocol * fix launching EFI binaries loaded via semihosting * fix filling of file path in loaded image protocol for non-block devices
2023-05-13bootstd: Tidy up reporting of errorsSimon Glass
In a few cases the error handling is not quite right. Make sure we return the actual error in distro_efi_read_bootflow_file() rather than -EINVAL. Return -IO when a file cannot be read. Also show the error name if available. This does not change operation, but does make it easier to diagnose problems. Signed-off-by: Simon Glass <[email protected]>
2023-05-13bootstd: Correct default boot commandSimon Glass
The patch to relax flag requirements was not accepted[1], so we still have to have separate bootcommands depending on CMD_BOOTFLOW_FULL. The previous attempt at this did not work, since it used the wrong name for the options. Fix this and change the message to mention BOOTSTD_FULL since this affects not just the flags, but all functionality, so is more likely what the user wants. Drop the useless condition on CMD_BOOTFLOW_FULL while we are here. [1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/ Signed-off-by: Simon Glass <[email protected]> Fixes: a91492b6e9c ("bootstd: Provide a default command")
2023-05-13usb: Tidy up the usb_start flagSimon Glass
This should be declared in a header file so that type-checking works correctly. Add a single declaration to usb.h and remove the others. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Marek Vasut <[email protected]> Reviewed-by: Patrick Delaunay <[email protected]>
2023-05-13efi_loader: fix efi_dp_from_file()Heinrich Schuchardt
* When called from efi_dp_from_name() we miss to append the filename for non-block devices. * expand_media_path() could be simplified by using efi_dp_from_file to prepend the device path of the boot device. This can be avoided by passing a device path to efi_dp_from_file() instead of a block device descriptor and a partition number. Signed-off-by: Heinrich Schuchardt <[email protected]>
2023-05-11x86: coreboot: Show unimplemented sysinfo tagsSimon Glass
Sometimes coreboot adds new tags that U-Boot does not know about. These are silently ignored, but it is useful to at least know what we are missing. Add a way to collect this information. For Brya it shows: Unimpl. 38 41 37 34 42 40 These are: LB_TAG_PLATFORM_BLOB_VERSION LB_TAG_ACPI_CNVS LB_TAG_FMAP LB_TAG_VBOOT_WORKBUF LB_TAG_TYPE_C_INFO LB_TAG_BOARD_CONFIG Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Bin Meng <[email protected]> Tested-by: Bin Meng <[email protected]>
2023-05-11x86: coreboot: Collect the address of the ACPI tablesSimon Glass
At present any ACPI tables created by prior-stage firmware are ignored. It is useful to be able to view these in U-Boot. Pick this up from the sysinfo tables and display it with the cbsysinfo command. This allows the 'acpi list' command to work when booting from coreboot. Adjust the global_data condition so that acpi_start is available even if table-generation is disabled. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Bin Meng <[email protected]> Tested-by: Bin Meng <[email protected]>
2023-05-11acpi: Move the table-finding functions into the libarySimon Glass
This is useful for other features. Move the function into library code so it can be used outside just the 'acpi' command. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Bin Meng <[email protected]> Tested-by: Bin Meng <[email protected]>
2023-05-11acpi: Create a new Kconfig for ACPISimon Glass
We have several Kconfig options for ACPI, but all relate to specific functions, such as generating tables and AML code. Add a new option which controls including basic ACPI library code, including the lib/acpi directory. This will allow us to add functions which are available even if table generation is not supported. Adjust the command to avoid a build error when ACPIGEN is not enabled. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2023-05-11mtrr: Don't show an invalid CPU numberSimon Glass
When U-Boot did not do the MP init, we don't get an actual CPU number here. Skip printing it in that case. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2023-05-09cmd: nvedit: remove error check, handle with KconfigTroy Kisky
Avoid error messages when SPL,TPL,VPL build don't have the environment options of the main build. This is needed when defined(CONFIG_ENV_IS_IN_xxx) is changed to CONFIG_IS_ENABLED(ENV_IS_IN_xxx). Signed-off-by: Troy Kisky <[email protected]>
2023-05-08cmd: tlv_eeprom: enable 'dev' subcommand before 'read'Josua Mayer
Move the handler for "tlv_eeprom dev X" command to the beginning of do_tlv_eeprom, to allow using it before issuing a "read" command for currently selected eeprom. Also remove the check if eeprom exists, since that can only work after the first execution of read_eeprom triggered device lookup. Instead accept values up to the defined array size (MAX_TLV_DEVICES). Signed-off-by: Josua Mayer <[email protected]> Reviewed-by: Stefan Roese <[email protected]> Cc: Stefan Roese <[email protected]> Cc: Baruch Siach <[email protected]> Cc: Heinrich Schuchardt <[email protected]>
2023-05-08cmd: tlv_eeprom: handle -ENODEV error from read_eeprom functionJosua Mayer
When tlv eeprom does not exist, return error code instead of quietly making up tlv structure in memory. Signed-off-by: Josua Mayer <[email protected]> Reviewed-by: Stefan Roese <[email protected]> Cc: Stefan Roese <[email protected]> Cc: Baruch Siach <[email protected]> Cc: Heinrich Schuchardt <[email protected]>
2023-05-08cmd: tlv_eeprom: remove use of global variable has_been_readJosua Mayer
has_been_read is only used as an optimization for do_tlv_eeprom. Explicitly use and set inside this function, thus making read_eeprom stateless. Signed-off-by: Josua Mayer <[email protected]> Reviewed-by: Stefan Roese <[email protected]> Cc: Stefan Roese <[email protected]> Cc: Baruch Siach <[email protected]> Cc: Heinrich Schuchardt <[email protected]>
2023-05-08cmd: tlv_eeprom: remove use of global variable current_devJosua Mayer
Make tlv_eeprom command device selection an explicit parameter of all function calls. Signed-off-by: Josua Mayer <[email protected]> Cc: Stefan Roese <[email protected]> Cc: Baruch Siach <[email protected]> Cc: Heinrich Schuchardt <[email protected]>
2023-05-05net: ipv6: Add support for default gateway discovery.Ehsan Mohandesi
In IPv6, the default gateway and prefix length are determined by receiving a router advertisement as defined in - https://www.rfc-editor.org/rfc/rfc4861. Add support for sending router solicitation (RS) and processing router advertisements (RA). If the RA has prefix info option and following conditions are met, then gatewayip6 and net_prefix_length of ip6addr env variables are initialized. These are later consumed by IPv6 code for non-local destination IP. - "Router Lifetime" != 0 - Prefix is NOT link-local prefix (0xfe80::/10) - L flag is 1 - "Valid Lifetime" != 0 Timing Parameters: - MAX_RTR_SOLICITATION_DELAY (0-1s) - RTR_SOLICITATION_INTERVAL (4s) (min retransmit delay) - MAX_RTR_SOLICITATIONS (3 RS transmissions) The functionality is enabled by CONFIG_IPV6_ROUTER_DISCOVERY and invoked automatically from net_init_loop(). Signed-off-by: Ehsan Mohandesi <[email protected]> Tested-by: Viacheslav Mitrofanov <[email protected]>Reviewed-by: Tested-by: Viacheslav Mitrofanov <[email protected]> Reviewed-by: Viacheslav Mitrofanov <[email protected]> Tested-by: Sergei Antonov <[email protected]> Reviewed-by: Sergei Antonov <[email protected]>
2023-05-05net: add fastboot TCP supportDmitrii Merkurev
Known limitations are 1. fastboot reboot doesn't work (answering OK but not rebooting) 2. flashing isn't supported (TCP transport only limitation) The command syntax is fastboot tcp Signed-off-by: Dmitrii Merkurev <[email protected]> Cc: Ying-Chun Liu (PaulLiu) <[email protected]> Cc: Simon Glass <[email protected]> Сс: Joe Hershberger <[email protected]> Сс: Ramon Fried <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-05-05net: dhcp6: pxe: Add DHCP/PXE commands for IPv6Sean Edmond
Adds commands to support DHCP and PXE with IPv6. New configs added: - CMD_DHCP6 - DHCP6_PXE_CLIENTARCH - DHCP6_PXE_DHCP_OPTION - DHCP6_ENTERPRISE_ID New commands added (when IPv6 is enabled): - dhcp6 - pxe get -ipv6 - pxe boot -ipv6 Signed-off-by: Sean Edmond <[email protected]> Reviewed-by: Ramon Fried <[email protected]>
2023-05-05net: ipv6: IPv6 environment variable cleanupSean Edmond
Fix "setenv gatewayip6". Synchronize IPv6 local variables with environment variables in netboot_update_env() Signed-off-by: Sean Edmond <[email protected]>
2023-05-05Merge tag 'video-for-v2023.07-rc2' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-video - enable video support in SPL - support splash screen for TI am62x - replace #ifdef and #if with if's in bmp/splash - add lm3533 backlight driver - add Solomon SSD2825 DSI/LVDS bridge driver - add Renesas R61307 and R69328 MIPI DSI panel drivers - add tegra DC based PWM backlight driver - add generic endeavoru (HTC One X) panel driver
2023-05-03cmd: bdinfo: Print ethaddr of current MACMarek Vasut
Instead of always printing ethaddr of MAC 0, print eth%daddr of the current MAC. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-05-03cmd: bdinfo: Wrap network information printing into print_eth()Marek Vasut
Move all the network information printing into print_eth(), no functional change. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-05-03cmd: bdinfo: Map fdt_blob and new_fdt to sysmemMarek Vasut
Map fdt_blob and new_fdt to sysmem, otherwise $fdtcontroladdr and bdinfo output do not match and the bdinfo output address is not a valid address accessible via sandbox memory accessors. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-05-02cmd: missing break in test_write_limit()Heinrich Schuchardt
In test_write_limit() an unintended fall-through occurs. Suggested-by: Simon Glass <[email protected]> Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Ilias Apalodimas <[email protected]>
2023-04-28bootflow: Rework do_bootflow_menu() slightlyTom Rini
When building this with clang, we get a warning such as: cmd/bootflow.c:412:27: warning: variable 'bflow' is uninitialized when used here [-Wuninitialized] printf("Selected: %s\n", bflow->os_name ? bflow->os_name : bflow->name); ^~~~~ And a suggestion to just initialize bflow to NULL. This would however would be ensuring a bad dereference. Instead, looking at the function we rework things so that when CONFIG_EXPO is not enabled (and so, no UI) we error early and would never reach this point in the code. Simplify the rest slightly as well while at this. Signed-off-by: Tom Rini <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-04-27ide: Move ide_init() into probingSimon Glass
At present the code does ide_init() as a separate operation, then calls device_probe() to copy over the information. We can call ide_init() from probe just as easily. The only difference is that using 'ide init' twice will do nothing. However it already fails to copy over the new data in that case, so the effect is the same. For now, unbind the block devices and remove the IDE device, which causes the bus to be probed again. Later patches will fix this up fully, so that all blk_desc data is copied across. Since ide_reset() is only called from ide_init(), there is no need to init the ide_dev_desc[] array. This is already done at the end of ide_init() so drop this code. The call to uclass_first_device() is now within the probe() function of the same device, so does nothing. Drop it. Signed-off-by: Simon Glass <[email protected]>
2023-04-26bootstd: Show a message sometimes if no bootflows are foundSimon Glass
Enable some messages that might provide hints, but only for CMD_BOOTFLOW_FULL since otherwise the -l flag is not available. Signed-off-by: Simon Glass <[email protected]> Suggested-by: Tom Rini <[email protected]>
2023-04-24cmd: bmp: Split bmp commands and functionsNikhil M Jain
To enable splash screen at SPL, need to compile cmd/bmp.c which also includes bmp commands, since SPL doesn't use commands split bmp.c into common/bmp.c which includes all bmp functions and cmd/bmp.c which only contains bmp commands. Add function delclaration for bmp_info in video.h. Signed-off-by: Nikhil M Jain <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-04-13cmd: mvebu/bubt: a38x: Do not hardcode SATA block size to 512Pali Rohár
Find SATA block device by blk_get_devnum_by_uclass_id() function and read from it the real block size of the SATA disk. In case of error, fallback back to 512 bytes. Signed-off-by: Pali Rohár <[email protected]>
2023-04-10cmd: mmc: Return CMD_RET_* from commandsPali Rohár
Numeric return values may cause strange errors line: exit not allowed from main input shell. Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-04-10mmc: Use EXT_CSD_EXTRACT_BOOT_PART() macro for extracting boot partPali Rohár
Mask macro PART_ACCESS_MASK filter out access bits of emmc register and macro EXT_CSD_EXTRACT_BOOT_PART() extracts boot part bits of emmc register. So use EXT_CSD_EXTRACT_BOOT_PART() when extracting boot partition. Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-04-08cmd: consider multiplexing in coninfoHeinrich Schuchardt
If console multiplexing in enabled (CONFIG_CONSOLE_MUX=y), the output of the coninfo command should show the file association (stdin, stderr, stdout) for all devices not only the default ones. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-04-06cmd: Add 2048 gameSimon Glass
Add the 2048 game, a good demo of ANSI sequences and a way to waste a little time. Bring it it from Barebox, modified for code style. Signed-off-by: Simon Glass <[email protected]>
2023-04-06cmd: CONFIG_CMD_SCSI depends on CONFIG_SCSIHeinrich Schuchardt
Compiling with CONFIG_CMD_SCSI=y, CONFIG_SCSI results in cmd/scsi.c:46: undefined reference to `scsi_scan' Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-04-06cmd/regulator: missing fallthrough in do_dev()Heinrich Schuchardt
Add missing fallthrough macro. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-04-06cmd: missing fallthrough macro in do_pci()Heinrich Schuchardt
Add a missing fallthrough macro to avoid a -Wimplicit-fallthrough warning. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-04-06cmd: convert fallthrough comment.Heinrich Schuchardt
gcc does not understand /* FALL TROUGH */ and emits a warning: cmd/date.c: In function ‘do_date’: cmd/date.c:62:20: warning: this statement may fall through [-Wimplicit-fallthrough=] 62 | if (strcmp(argv[1],"reset") == 0) { | ^ cmd/date.c:102:9: note: here 102 | case 1: /* get date & time */ | ^~~~ Use the fallthrough macro instead. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-04-05cmd: blkmap: Add blkmap commandTobias Waldekranz
Add a frontend for the blkmap subsystem. In addition to the common block device operations, this allows users to create and destroy devices, and map in memory and slices of other block devices. With that we support two primary use-cases: - Being able to "distro boot" from a RAM disk. I.e., from an image where the kernel is stored in /boot of some filesystem supported by U-Boot. - Accessing filesystems not located on exact partition boundaries, e.g. when a filesystem image is wrapped in an FIT image and stored in a disk partition. Signed-off-by: Tobias Waldekranz <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-04-05cmd: blk: Allow generic read/write operations to work in sandboxTobias Waldekranz
Ensure that the memory destination/source addresses of block read/write operations are mapped in before access. Currently, this is only needed on sandbox builds. Signed-off-by: Tobias Waldekranz <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-04-04android: boot: support boot image header version 3 and 4Safae Ouajih
Enable the support for boot image header version 3 and 4 using abootimg command. In order to use version 3 or 4: 1- Vendor boot image address should be given to abootimg cmd. abootimg addr $1 $vendor_boot_load_addr 2- "ramdisk_addr_r" env variable (ramdisk address) should be set to host the ramdisk : generic ramdisk + vendor ramdisk Replace "struct andr_boot_img_hdr_v0*" by "void *" in some functions since v3 and v4 are now supported as well. Signed-off-by: Safae Ouajih <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Tested-by: Mattijs Korpershoek <[email protected]>
2023-04-04android: boot: add vendor boot image to prepare for v3, v4 supportSafae Ouajih
Introduce vendor boot image for version 3 and 4 of boot image header. The vendor boot image will hold extra information about kernel, dtb and ramdisk. This is done to prepare for boot image version 3 and 4 support. Signed-off-by: Safae Ouajih <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Tested-by: Mattijs Korpershoek <[email protected]>
2023-04-04android: boot: move to andr_image_data structureSafae Ouajih
Move from andr_boot_img_hdr_v0 to andr_image_data structure to prepare for boot image header version 3 and 4. Signed-off-by: Safae Ouajih <[email protected]> Tested-by: Mattijs Korpershoek <[email protected]>
2023-04-04android: boot: replace android_image_check_headerSafae Ouajih
With the new vendor boot image introduced in versions 3 and 4 of boot image header, the header check must be done for both boot image and vendor boot image. Thus, replace android_image_check_header() by is_android_boot_image_header() to only refer to boot image header check. Signed-off-by: Safae Ouajih <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Tested-by: Mattijs Korpershoek <[email protected]>
2023-04-04android: boot: support vendor boot image in abootimgSafae Ouajih
Vendor boot image is introduced in boot image header version 3 and 4. Please check [1] for more details. To prepare for boot image v3/v4 support, allow the abootimg command to store the vendor_boot image address. Full support for this new format will be done in a future patch. Link:[1] https://source.android.com/docs/core/architecture/bootloader/partitions/vendor-boot-partitions Signed-off-by: Safae Ouajih <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Tested-by: Mattijs Korpershoek <[email protected]>