aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-07-17env: Fix default environment saving issueAshok Reddy Soma
When CONFIG_SYS_REDUNDAND_ENVIRONMENT is enabled, by default env is getting saved to redundant environment irrespective of primary env is present or not. It means even if primary and redundant environment are not present, by default, env is getting stored to redundant environment. Even if primary env is present, it is choosing to store in redudndant env. Ideally it should look for primary env and choose to store in primary env if it is present. If both primary and redundant env are not present then it should save in to primary env area. Fix the issue by making env_valid = ENV_INVALID when both the environments are not present. Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-17android_ab: Try backup booloader_messageJoshua Watt
Some devices keep 2 copies of the bootloader_message in the misc partition and write each in sequence when updating. This ensures that there is always one valid copy of the bootloader_message. Teach u-boot to optionally try a backup bootloader_message from a specified offset if the primary one fails its CRC check. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
2023-07-17cmd: mbr: Force DOS driver to be used for verifyJoshua Watt
Forces the DOS partition type driver to be used when verifying the MBR. This is particularly useful when using a hybrid MBR & GPT layout as otherwise MBR verification would mostly likely fail since the GPT partitions will be returned, even if the MBR is actually valid. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-17dm: test: Add test for part_get_info_by_typeJoshua Watt
Adds a test suite to ensure that part_get_info_by_type works correctly by creating a hybrid GPT/MBR partition table and reading both. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> [trini: Add this on the other sandbox configs] Signedd-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-17disk: part: Add API to get partitions with specific driverJoshua Watt
Adds part_driver_get_type() API which can be used to force a specific driver to be used when getting partition information instead of relying on auto detection. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-17dm: test: Improve partition test error outputJoshua Watt
Improve the logging when the partition test fails so that it is clear what went wrong, shown with actual values. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-17dm: test: Fix partition test to use mmc2Joshua Watt
d94d9844bc ("dm: part: Update test to use mmc2") attempted to make the test use mmc2, but the change was incomplete in that it didn't also change the strings that reference a specific partition. Fix these so that the test passes again Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2023-07-17tests: Fix exception when cleaning up skipped testJoshua Watt
If test_cat and test_xxd cannot create the required file, the test will be skipped, but this would result in an exception being raised in the finally block because the file didn't exist to be cleaned up. This caused the test to be marked as failed instead of skipped. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-17android_ab: Add option to skip decrementing triesJoshua Watt
It is is sometimes desired to be able to skip decrementing the number of tries remaining in an Android A/B boot, and instead just check which slot will be tried later. This can commonly be be the case for platforms that want to A/B u-boot itself, but are required to boot from a FAT MBR partition. In these cases, u-boot must do an early check that the MBR points to the correct A/B boot partition, and if not rewrite the MBR to point to the correct one and reboot. Decrementing the try count in this case is not desired because it means that each u-boot might constantly ping-pong overwriting the MBR and rebooting until all the retries are used up. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
2023-07-17disk: Use BOOT_DEFAULTS instead of DISTRO_DEFAULTSJonas Karlman
Set default y based on common BOOT_DEFAULTS instead of DISTRO_DEFAULTS. No change is intended, affected options is already implied for DISTRO and BOOTSTD due to BOOT_DEFAULTS imply DOS_PARTITION (USB_STORAGE), EFI_PARTITION and ISO_PARTITION. Fixes: a0c739c184ca ("boot: Create a common BOOT_DEFAULTS for distro and bootstd") Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-17dfu: Add proper dependency for CONFIG_DFU_MMCAshok Reddy Soma
When CONFIG_CMD_MMC and CONFIG_MMC are disabled, still some compilation errors are seen as below due to unresolved symbols. drivers/dfu/dfu_mmc.o: in function `mmc_block_op': drivers/dfu/dfu_mmc.c:32: undefined reference to `find_mmc_device' drivers/dfu/dfu_mmc.c:54: undefined reference to `mmc_get_blk_desc' drivers/dfu/dfu_mmc.c:67: undefined reference to `mmc_get_blk_desc' drivers/dfu/dfu_mmc.c:70: undefined reference to `mmc_get_blk_desc' drivers/dfu/dfu_mmc.o: in function `dfu_fill_entity_mmc': drivers/dfu/dfu_mmc.c:369: undefined reference to `find_mmc_device' drivers/dfu/dfu_mmc.c:376: undefined reference to `mmc_init' drivers/dfu/dfu_mmc.c:403: undefined reference to `mmc_get_blk_desc' gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-ld.bfd: line 4: 31661 Segmentation fault (core dumped) $CC --sysroot=$LIBC --no-warn-rwx-segment "$@" Makefile:1760: recipe for target 'u-boot' failed make: *** [u-boot] Error 139 make: *** Deleting file 'u-boot' Add dependency of CONFIG_MMC for CONFIG_DFU_MMC config to fix the errors. Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
2023-07-17fs/erofs: Introduce new features including ztailpacking, fragments and dedupeYifan Zhao
This patch updates erofs driver code to catch up with the latest code of erofs_utils (commit e4939f9eaa177e05d697ace85d8dc283e25dc2ed). LZMA will be supported in the separate patch later. Signed-off-by: Yifan Zhao <zhaoyifan@sjtu.edu.cn> Reviewed-by: Huang Jianan <jnhuang95@gmail.com>
2023-07-17Makefile: Add missing quotes around sort --field-separatorMarek Vasut
Busybox sort does not handle --field-separator== , replace this with --field-separator='=' for maximum compatibility. Fixes: cc5a490cf465 ("Makefile: Sort u-boot-initial-env output") Reported-by: Milan P. Stanić <mps@arvanta.net> Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-17bootstd: Correct 'bpot' typoJulien Delbergue
Fix it to 'boot' in the header, as it is in the source file. Signed-off-by: Julien Delbergue <j.delbergue.foss@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17Merge https://source.denx.de/u-boot/custodians/u-boot-x86Tom Rini
- bootstd: Add a bootmeth for ChromiumOS on x86 - x86: Use qemu-x86_64 to boot EFI installers
2023-07-17x86: Switch QEMU over to use the bochs driverSimon Glass
This is more convenient since it does not require a video BIOS. Enable it for QEMU. Also drop use of video in SPL for the 64-bit QEMU, since it not needed now. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: video: Add a driver for QEMU bochs emulationSimon Glass
Bochs is convenient with QEMU on x86 since it does not require a video BIOS. Add a driver for it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17efi: Use the installed ACPI tablesSimon Glass
U-Boot sets up the ACPI tables during startup. Rather than creating a new set, install the existing ones. Create a memory-map record to cover the tables. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17sandbox: Install ACPI tables on startupSimon Glass
With x86 we set up the ACPI tables on startup so they can be examined. Do the same with sandbox, so it is consistent. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17sandbox: Correct header order in board fileSimon Glass
Fix the header order in this file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17log: Support outputing function names in SPLSimon Glass
The output is garbled when tiny printf() is used. Correct this by adding a special case. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: Make sure that the LPC is active before SDRAM initSimon Glass
Some boards need to access GPIOs to determine which SDRAM is fitted to the board, for example chromebook_link. Probe this device (if it exists) to make sure that this works as expected. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: link: Support Micron memorySimon Glass
Add the required tag so that micron memory can be set up correctly. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: Convert some debug statements to use loggingSimon Glass
Move from using debug() to log_debug() so that we don't have to use the __func__ parameter and can access other logging features. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: Record the start and end of the tablesSimon Glass
The ACPI tables are special in that they are passed to EFI as a separate piece, independent of other tables. Also they can be spread over two areas of memory, e.g. with QEMU we end up with tables kept in high memory as well. Add new global_data fields to hold this information and update the bdinfo command to show the table areas. Move the rom_table_end variable into the loop that uses it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: Refactor table-writing code a littleSimon Glass
The implementation of write_tables() is confusing because it uses the rom_table_start variable as the address pointer as it progresses. Rename it to rom_addr to make the code clearer. Move the rom_table_end variable into the block where it is used. Also update logging to use the ACPI category, now that it is available. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: Enable useful options for qemu-86_64Simon Glass
This build can be used to boot standard distro builds, since these are mostly 64-bit these days. Enable some more options, so that all possible EFI UUIDs are decoded, we get a proper printf() in SPL, can search memory for tables, support the full set of standard-boot features, have full logging and can boot from CDROM media. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17fs: fat: Shrink the size of a few stringsSimon Glass
To save a few bytes, replace Error with ** and try to use the same string for multiple messages where possible. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: Allow logging to be used in SPL reliablySimon Glass
When global_data is relocated, log_head moves in memory, meaning that the items in that list point to the wrong place. Disable logging when making the change, then reenable it afterwards, so that logging works normally. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: Enable display for QEMU 64-bitSimon Glass
Enable the various options needed for display to work on the qemu-x86_64 board. This includes expanding the available malloc() memory in SPL, since the PCI bus must be enumerated in order to find the video device. It also includes enabling a bloblist, so that the video parameters can be passed. This is placed at address 10000 but is not needed after U-Boot proper reads the information there. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17pci: Mask the ROM address in case it is already enabledSimon Glass
In some cases the video ROM may have been enabled previously, such as by a previous firmware stage. Use the correct address in that case. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17pci: Adjust video BIOS debugging to be SPL-friendlySimon Glass
A hex value is expected for the VGA mode. Add a 0x prefix, since the # construct is not supported in SPL. We don't want to add it, due to code-size constraints. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: Init video in SPL if enabledSimon Glass
When video is required in SPL, set this up ready for use. Ignore any problems since it may be that video is not actually available and we still want to continue on to U-Boot proper in that case. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: Ensure SPL banner is only shown onceSimon Glass
Print the banner in SPL init only if the spl_board_init() function isn't enabled. The spl_board_init() function is in the same file, but is called later, by board_init_r(). This avoids printing two banners, which causes tests to fail. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: Pass video settings from SPL to U-Boot properSimon Glass
When video is set up in SPL, U-Boot proper needs to use the correct parameters so it can write to the display. Put these in a bloblist so they are available to U-Boot proper. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Nikhil M Jain <n-jain1@ti.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: Allow video-BIOS code to be built for SPLSimon Glass
With qemu-x86_64 we need to run the video BIOS while in 32-bit mode, i.e. SPL. Add a Kconfig option for this, adjust the Makefile rules and use CONFIG_IS_ENABLED() where needed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17pci: Tidy up logging and reporting for video BIOSSimon Glass
When running the ROM the code is not very helpful when something goes wrong. Add a little more debugging and some logging of return values to improve this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17pci: Support autoconfig in SPLSimon Glass
Allow PCI autoconfig to be handled in SPL, so that we can set it up correctly for boards which need to do this before U-Boot proper. This includes qemu-x64_64 which needs to set up the video device while in 32-bit mode. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17nvme: Provide more useful debugging messagesSimon Glass
When scanning fails it is useful to be able to decode what went wrong. Add some debugging for this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17bdinfo: Show the malloc base with the bdinfo commandSimon Glass
It is useful to see the base of the malloc region. This is visible when debugging but not in normal usage. Add it to the global data so that it can be shown. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Nikhil M Jain <n-jain1@ti.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Nikhil M Jain <n-jain1@ti.com>
2023-07-17x86: Improve the trampoline in 64-bit modeSimon Glass
At present this leaves the stack at the pre-relocation value. This is not ideal since we want to have U-Boot running entirely from the top of memory. In addition, the new global_data pointer is not actually used, since the global_data pointer itself is relocated, then the pre-relocation value is changed, so the effective value (after relocation) does not update. Adjust the implementation to follow the 32-bit code more closely, with a trampoline function which is passed the new stack and global_data pointer. This ensures that the correct values come through even when relocating. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17efi: Show all known UUIDs with CONFIG_CMD_EFIDEBUGSimon Glass
The CMD_EFIDEBUG option enables debugging so it is reasonable to assume that all effects should be made to decode the dreaded UUIDs favoured by UEFI. Update the table to show them all when CONFIG_CMD_EFIDEBUG is enabled. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17qfw: Set the address of the ACPI tablesSimon Glass
Once the ACPI tables have been set up, record their address so that it is possible to list them with 'acpi list'. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17log: Tidy up an ambiguous commentSimon Glass
Add a bit more detail so it is clear that multiple devices are supported, but only one per driver. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17qfw: Show the file address if availableSimon Glass
Some files have an associated address. Show this with the 'qfw list' command so that it is possible to dump the data. Note that the reference to 'md' is for the md.rst file, not a markdown file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17part: Allow setting the partition-table typeSimon Glass
Some devices have multiple partition types available on the same media. It is sometimes useful to see these to check that everything is working correctly. Provide a way to manually set the partition-table type, avoiding the auto-detection process. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17bdinfo: Show the RAM top and approximate stack pointerSimon Glass
These are useful pieces of information when debugging. The RAM top shows where U-Boot started allocating memory from, before it relocated. The stack pointer can be checked to ensure it is in the correct region. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Nikhil M Jain <n-jain1@ti.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Nikhil M Jain <n-jain1@ti.com>
2023-07-17acpi: Add a comment to set the acpi tablesSimon Glass
Sometimes a previous bootloader has written ACPI tables. It is useful to be able to find and list these. Add an 'acpi set' command to set the address for these tables. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: Show an error when a BIOS exception occursSimon Glass
Rather than silently hanging, show an error first. This can happen when there is something wrong with the video BIOS. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: Correct get_sp() implementation for 64-bitSimon Glass
Use an assembler implementation as is done for i386, so that the results are equivalent for i386 and x86_64. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>