summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-04-05arm: dts: k3: Remove leftover file after OF_UPSTREAMAndrew Davis
The file k3-am62a7.dtsi is part of upstream DT and should have been removed when migrating to OF_UPSTREAM but must have been missed. Do this here. Signed-off-by: Andrew Davis <afd@ti.com>
2025-04-04Merge patch series "64-bit U-Boot configuration without SPL"Tom Rini
Jeremy Compostella <jeremy.compostella@intel.com> says: Introduces a new configuration option X86_RUN_64BIT_NO_SPL to allow building U-Boot as a 64-bit binary without using the SPL (Secondary Program Loader). The motivation is to simplify the boot process for specific x86-based platforms that do not require SPL, such as those booting directly from a 64-bit coreboot firmware. Link: https://lore.kernel.org/r/87bjtyutkp.fsf@jcompost-mobl.amr.corp.intel.com
2025-04-04configs: Add coreboot64-no-spl_defconfig for 64-bit X86 without SPLJeremy Compostella
Create a new defconfig file called `coreboot64-no-spl_defconfig`, tailored specifically for 64-bit X86 architecture systems that operate without the Secondary Program Loader (SPL). This configuration takes its inspiration from `coreboot64_defconfig`.. Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2025-04-04Fix EFI boot file name definition for 64-bit x86Jeremy Compostella
This change aligns the preprocessor directive with the standard configuration flag used for detecting 64-bit x86 architecture. Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2025-04-04arch/x86/lib: Fix CONFIG_X86_64 usage in zimage.cJeremy Compostella
Correct the preprocessor directive used to check for 64-bit kernel support in the `zboot_go` function. The code previously checked for `CONFIG_X86_RUN_64BIT`, which is not the correct configuration option for determining if the kernel should run in 64-bit mode. The correct option is `CONFIG_X86_64`. Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2025-04-04arch/x86/cpu: Call x86_cpu_reinit_f for 64-bitsJeremy Compostella
As both CONFIG_X86_RUN_64BIT and X86_RUN_64BIT_NO_SPL cases run U-Boot in 64-bit mode with the CPU fully initialized already. Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2025-04-04arch/x86: Add 64-bit U-Boot configuration without SPLJeremy Compostella
This commit introduces a new configuration option X86_RUN_64BIT_NO_SPL to allow building U-Boot as a 64-bit binary without using the SPL (Secondary Program Loader). The motivation is to simplify the boot process for certain x86-based platforms that do not require SPL, such as those booting directly from a 64-bit coreboot firmware. This update revises the `X86_RUN_64BIT` configuration to more accurately describe its role as "32-bit SPL followed by 64-bit U-Boot." It clarifies the sequence of operations during the boot process, where the system transitions from a 32-bit SPL (Secondary Program Loader) to the main 64-bit U-Boot. Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2025-04-04Merge patch series "cmd: fuse: Introduce fuse writebuff sub-system and clean up"Tom Rini
Harsha Vardhan V M <h-vm@ti.com> says: This patch series introduces the fuse writebuff sub-system command and makes improvements to the existing fuse implementation by removing the custom string functions. The patches are required to be applied in sequence. The series consists of the following changes: Patch 1 removes custom string functions and replaces them with standard string functions. Patch 2 introduces fuse.rst documentation for fuse commands. Patch 3 introduces the fuse writebuff sub-system command, allowing to write a structured buffer in memory to fuses, and implementing the necessary function calls. Patch 4 enables the fuse sub-system in the K3 platform. Patch 5 updates the fuse.rst documentation to include details about the new fuse writebuff command. These changes aim to improve the fuse sub-system by the removal of custom string functions and the addition of the fuse writebuff command improves fuse programming workflows by allowing to write a structured buffer in memory to efuses. Link: https://lore.kernel.org/r/20250319084714.335777-1-h-vm@ti.com
2025-04-04doc: cmd: Add fuse writebuff cmd documentationHarsha Vardhan V M
Add fuse writebuff sub-system command documentation. Signed-off-by: Harsha Vardhan V M <h-vm@ti.com>
2025-04-04drivers: k3_fuse: Add fuse sub-system func callsHarsha Vardhan V M
Add K3_FUSE config option to add and enable fuse sub-system implementation function calls. Signed-off-by: Harsha Vardhan V M <h-vm@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2025-04-04cmd: fuse: Add fuse writebuff sub-system commandHarsha Vardhan V M
Add CMD_FUSE_WRITEBUFF config option to add and enable fuse writebuff sub-system command. Add fuse_writebuff function to be invoked on writebuff command. Signed-off-by: Harsha Vardhan V M <h-vm@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2025-04-04doc: cmd: Add documentation for fuse commandHarsha Vardhan V M
Add documentation for the 'fuse' sub-system commands in doc/usage/cmd/fuse.rst file. Remove doc/README.fuse file. Signed-off-by: Harsha Vardhan V M <h-vm@ti.com>
2025-04-04cmd: fuse: Remove custom string functionsHarsha Vardhan V M
Remove custom string functions and replace them with normal string functions. Remove the custom strtou32 and replace it with simple_strtoul. Signed-off-by: Harsha Vardhan V M <h-vm@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2025-04-04arm64: Fix page permissions for platforms running at EL2Ilias Apalodimas
We currently set both and print both PXN and UXN bits when removing execution for pages. This happens even in the existing per platform definitions of 'struct mm_region'. That's not entirely correct though. For stage-1 translations, if a platform runs on a translation regime with a single privilege level or the the translation regime supports two privilege levels and we are not in EL1&0 with HCR_EL2.{NV, NV1} = {1, 1} only BIT54 (XN) is needed and BIT53(PXN) is reserved 0. Currently we support Non-Secure EL2, Non-secure EL2&0 and Non-secure EL1&0. We already have get_effective_el() which returns 1 if we are - Running in EL1 so we assume an EL1 translation regime but without checking HCR_EL2.{NV, NV1} != {1,1} - Running in EL2 with HCR_EL2.E2H = 1 The only problem with the above is that if we are in EL1&0 and HCR_EL2.{NV1, NV} == {1, 1}, then - Bit[54] holds the PXN instead of the UXN - The Effective value of UXN is 0 - Bit[53] is RES0 So let's re-use that function and set PXN only when we are in and EL[2|1]&0 translation regime. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-04-03Merge patch series "membuff: Add tests and update to support a flag for ↵Tom Rini
empty/full" Simon Glass <sjg@chromium.org> says: The membuff implementation curently has no tests. It also assumes that head and tail can never correspond unless the buffer is empty. This series provides a compile-time flag to support a 'full' flag. It also adds some tests of the main routines. The data structure is also renamed to membuf which fits better with U-Boot. There may be some cases in the code which could be optimised a little, but the implementation is functional. Link: https://lore.kernel.org/r/20250318152059.1464369-1-sjg@chromium.org
2025-04-03membuf: Minor code-style improvementsSimon Glass
Show the start in end in the comment. Comment a missing variable in membuf_readline() and fix its line length. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03membuf: Add some testsSimon Glass
Add tests for the membuf implementation. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03membuf: Correct implementation of membuf_dispose()Simon Glass
This should free the pointer, not the address of the pointer. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03membuf: Include stdboolSimon Glass
This uses a bool type so include the required header. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03membuf: Rename structSimon Glass
Rename the struct to match the function prefix and filenames. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03membuff: Rename the files to membufSimon Glass
Rename the C and header files to use the membuf basename, to match the functions. Add a MAINTAINERS entry while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03membuff: Rename functions to have membuf_ prefixSimon Glass
The double 'f' is not necessary and is a bit annoying as elsewhere in U-Boot we use 'buf'. Rename all the functions before it is used more widely. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03Merge patch series "x86: Improve operation under QEMU"Tom Rini
Simon Glass <sjg@chromium.org> says: U-Boot can start and boot an OS in both qemu-x86 and qemu-x86_64 but it is not perfect. With both builds, executing the VESA ROM causes an intermittent hang, at least on some AMD CPUs. With qemu-x86_64 kvm cannot be used since the move to long mode (64-bit) is done in a way that works on real hardware but not with QEMU. This means that performance is 4-5x slower than it could be, at least on my CPU. We can work around the first problem by using Bochs, which is anyway a better choice than VESA for QEMU. The second can be addressed by using the same descriptor across the jump to long mode. With an MTRR fix this allows booting into Ubuntu on qemu-x86_64 In v3 some e820 patches are included to make booting reliable and avoid ACPI tables being dropped. Also, several MTTR problems are addressed, to support memory sizes above 4GB reliably. Link: https://lore.kernel.org/all/20250315142643.2600605-1-sjg@chromium.org/
2025-04-03test: Add a test for booting Ubuntu 24.04Simon Glass
Now that U-Boot can boot this quickly, using kvm, add a test that the installer starts up correctly. Use the qemu-x86_64 board in the SJG lab. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03acpi: Support checking checksumsSimon Glass
When the ACPI tables come from an earlier bootloader it is helpful to see whether the checksums are correct or not. Add a -c flag to the 'acpi list' command to support that. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03test: acpi: Correct memory leaksSimon Glass
Free the memory used in tests to avoid a leak. Also unmap the addresses for sandbox. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2025-04-03acpi: Add a checksum to the DMAR tableSimon Glass
This table lacks a correct checksum at present, so fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2025-04-03sandbox: acpi: Correct mapping in FADTSimon Glass
The values in the FADT are pointers so should not go through sandbox's normal addr<->pointer mapping. Fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03sandbox: acpi: Avoid a warning about FADTSimon Glass
Add a condition for sandbox, to match that of x86, to avoid the warning "FADT not ACPI-hardware-reduced-compliant". Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03boot: Support IO UARTs for earlycon and consoleSimon Glass
Update the string to take account of UARTs which are connected on I/O ports, as on x86. Fix a typo in an error message in the same command, while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03boot: Handle running out of labelsSimon Glass
If only a single label is provided in the list, bootdev_next_label() does not operate correctly and reads beyond the end of the pointer list. Fix this by adding a new check. Also add a note to convert this array to an alist Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03boot: Consider non-bootable partitionsSimon Glass
Any 'bootable' flag in a DOS partition causes boostd to only scan bootable partitions for that media. This can mean that extlinux.conf files on the root disk are missed. Put this logic behind a flag and update the documentation. For now, the flag is enabled, to preserve the existing behaviour of bootstd which is to ignore non-bootable partitions so long as there is at least one bootable partition on the disk. Future work may provide a command (or some other mechanism) to control this. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03acpi: Mark struct acpi_rsdp as packedSimon Glass
At present the size of this struct is too large on 64-bit machines. Annotate it with __packed to fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: Support a 64-bit ramdisk addressSimon Glass
Add some missing pieces to bootparams so that a 64-bit ramdisk address can be used. Tidy up the logging while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: emulation: Support BLOBLIST_TABLES properlySimon Glass
The existing QEMU implementation mostly ignored BLOBLIST_TABLES and allocates the bulk of the tables with malloc(). Update it to place all tables in the bloblist. Since QEMU declares a size of 128KB regardless of the size of its tables, this requires a larger bloblist. Fix up the e820 table to handle this, keeping the old code as an option for now, to assist with any future bug-fixing. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: qemu: Use the new e820 APISimon Glass
Move over to use this API before making the code even more complicated. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: Add a new API for e820Simon Glass
The existing mechanism is pretty painful as it requires manual calculations for anything but a trivial setup. Add a new API for adding e820 entries. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: e820: Add a function to dump the e820 tableSimon Glass
There is already code for this in zimage. Move it to the e820 file so it can be used elsewhere. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03test/py: Allow tests to be filtered by roleSimon Glass
Some test can only be run by a particular board in a lab, e.g. because they are loaded with an OS image used by the test. Add a way to specify this in tests. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03test/py: Add a helper to send charactersSimon Glass
The existing run_command() method is not great for sending things other than U-Boot commands. Add a helper for sending arbitrary strings as well as control characters. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2025-04-03test/py: Correct sizing of created disksSimon Glass
At present the disks end up being 1MB shorter than they should be, since dd truncates by default. Move the code into a function and update it to avoid truncation. This resolves various warnings when running sandbox tests, of the form: mmc_bread() MMC: block number 0x9801 exceeds max(0x9800) caused by the FAT partition being scanning. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: qemu: Support environment and cat commandSimon Glass
Add support for an environment stored in the first partition of the disk, which is assumed to hold a FAT filesystem. Support the 'cat' command as it is useful for looking at extlinux.conf files. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: emulation: Set an MTRR for the RAMSimon Glass
QEMU likes to have an MTRR set up, just like real machines. Add an MTRR which covers the total RAM size. This does nothing on machines without MTRRs. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: Allow adding non-aligned size for MTRRSimon Glass
At present mtrr_add_request() requires that the size is a power of two. This is too limiting for machines with 4GB (or more) of RAM, since they often must take account of a memory hole at 3GB. Update the function to automatically deal with an unaligned size, using more MTRRs as required. The algorithm is taken from coreboot commit 60bce10750 Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: Correct msr operation on amd64Simon Glass
The CONFIG option is no-longer correct since we can have SPL and PPL with different bitness. Fix this and sync up with Linux 6.13 in this area, since this is where the code came from many years ago. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: Update cpuid_eax et al to work on amd64Simon Glass
The existing functions work but the register clobbers are wrong, so strange bugs results. The original functions were taken from a very old version of Linux. Update them from Linux 6.13 Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: Update mtrr command to support 64-bit valuesSimon Glass
The MTRR registers have 64-bit values. Update the command to use 64-bit values so that memory larger than 4GB can be handled. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: Add functions to convert between mtrr size and maskSimon Glass
Rather than repeating the same code in several places, add some functions which can do the conversion. Use the cpu_phys_address_size() function to obtain the physical-address size, since it is more reliable with kvm, where the host CPU may have a different value from the emulation CPU. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: Support CPU functions in long modeSimon Glass
At present it is not possible to find out the physical-address size in long mode, so a predefined value is used. Update the macros to support this properly, since it is important when programming MTRRs. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: Rename the _D dirty flagSimon Glass
This value happens to be used by ctype.h so chose a different name. Signed-off-by: Simon Glass <sjg@chromium.org>