summaryrefslogtreecommitdiff
path: root/arch/x86
AgeCommit message (Collapse)Author
13 daysx86: Update linker scripts to ensure appended device tree is alignedTom Rini
With commit 0535e46d55d7 ("scripts/dtc: Update to upstream version v1.7.2-35-g52f07dcca47c") it is now a fatal error to U-Boot if our device tree is not 8-byte aligned. In commit 85f586035d75 ("ARM: OMAP2+: Pad SPL binary to 8-byte alignment before DTB") Beleswar Padhi explains that we must have ALIGN(x) statements inside of a section to ensure that padding is included and not simply that the linker address counter is incremented. To that end, this patch: - Rewrite the '.rel.dyn' (u-boot.lds) to follow modern practices, and include the 8-byte alignment at the end of the section. - Expands the '.dynamic' section (u-boot-64.lds) to be more readable when adding a second statement to the section. - Aligns the final section before _end (for U-Boot) or _image_binary_end or __bss_end (for xPL phases) by 8-bytes by adding '. = ALIGN(8);' to the final section before the symbol or changing an existing ALIGN(4) statement. - Ensure that we do have alignment by adding an ASSERT so that when not aligned we fail to link (and explain why). Signed-off-by: Tom Rini <trini@konsulko.com>
2026-01-09x86: Increase SYS_MALLOC_F_LEN to 0x1000Tom Rini
A few x86 platforms use a SYS_MALLOC_F_LEN value of 0x1000 or higher. With the impending move to having DEVRES enabled by default, we will need a little more room here. Raise the default value. Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2025-12-10Makefile: use --output-target instead of --targetHeinrich Schuchardt
The objcopy man-page teaches: --target=bfdname Use bfdname as the object format for both the input and the output file This implies for --target=efi-app-x86_64 that the input file would have to be an EFI app. Objcopy in binutils 2.45 checks this more strictly than previous versions and refuses to accept an ELF file as input with --target=efi-app-x86_64. Replace --target by --output-target for building sandbox and x86 EFI binaries. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2025-11-06acpi: use U-Boot ACPI vendor IDHeinrich Schuchardt
The U-Boot project has been assigned the vendor ID 'UBOO' [1]. Use this vendor ID and our release version in the ACPI table headers. [1] ACPI ID Registry https://uefi.org/ACPI_ID_List Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2025-10-28x86: Rename arch/x86/include/asm/pnp_def.h to include/pnp_def.hTom Rini
There is nothing x86-centric in this include file, and moving it will allow for some drivers to be compile-tested on sandbox. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-07-26efi: Rename CONFIG_EFI to CONFIG_EFI_CLIENTSimon Glass
The generic name 'EFI' would be more useful for common EFI features. At present it just refers to the EFI app and stub, which is confusing. Rename it to EFI_CLIENT Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-19dtc: Add Kconfig option to pad device tree blobEric Schikschneit
This will allow arch(s) that use device tree blobs to pad the end of the device tree so they can be modified by board files at run time. This will help prevent errors such as FDT_ERR_NOSPACE from occurring. Signed-off-by: Eric Schikschneit <eric.schikschneit@novatechautomation.com> [trini: Change default order so that X86 && EFI_APP works correctly]
2025-06-13spl: Rename jump_to_image_no_args()Simon Glass
This function is currently a misnomer at times as we have cases where it passes arguments to the image. In preparation for making that be a more common case rename this function to jump_to_image(...). In order to do this, rename jump_to_image in board_init_r(...) to jumper so that we do not have a conflict. Signed-off-by: Simon Glass <sjg@chromium.org> [trini: Reword the commit message, adding missing cases of jump_to_image_no_args()] Signed-off-by: Tom Rini <trini@konsulko.com>
2025-06-13x86: Move Intel GNVS file into the common include directorySimon Glass
Move this so we can include it from sandbox, needed since it is in a bloblist and must have a check. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-02Merge patch series "Audit include list for include/[a-m]*.h"Tom Rini
Tom Rini <trini@konsulko.com> says: Hey all, Related to my other series I've posted recently on cleaning up some headers, this series here is the result of at least lightly auditing the #includes used in include/[a-m]*.h. This ignores subdirectories, as at least in part I think the top-level includes we've constructed are the most likely places to have some extra transitive include paths. I'm sure there's exceptions and I'll likely audit deeper once this first pass is done. This only gets as far as "include/m*.h" because I didn't want this to get too big. This also sets aside <miiphy.h> and <phy.h>. While miiphy.h does not directly need <phy.h> there are *so* many users and I think I had half of the tree just about not building when I first tried. It might be worth further investigation, but it might just be OK as-is. Link: https://lore.kernel.org/r/20250521230119.2084088-1-trini@konsulko.com
2025-06-02include/bios_emul.h: Audit include listTom Rini
This file does not need <pc.h> but does directly need <linux/types.h>. Furthermore, arch/x86/lib/bios.c was getting <pci.h> via <bios_emul.h> so add it there. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-27binman: x86: Write skip-at-start when end-at-4gb is usedSimon Glass
The end-at-4gb property implies a value for skip-at-start so add it into the output FDT so that U-Boot can read it. Now that skip-at-start is implemented, we can drop the workarounds used in the x86 code to obtain the correct image-pos value. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-25x86: efi_loader: Ensure the SMBIOS tables are sent via EFISimon Glass
The EFI-loader code has not been fully converted to use bloblist, so relies on the SMBIOS-table address being set in global_data. Set this up in write_tables() so that the SMBIOS tables are actually available. Enable the command for x86 QEMU so that the SMBIOS tests actually run. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 83ce35d6ebb ("emulation: Use bloblist to hold tables") Reported-by: Niklas Sombert <niklas.sombert@uni-duesseldorf.de> Tested-by: Niklas Sombert <niklas.sombert@uni-duesseldorf.de> Tested-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-05-09x86: Correct usage of FSP_VERSION2Tom Rini
As the code is today, we get a warning about "select" statements on "choice" options not doing anything. In this case, we move to having a "default FSP_VERSION2 if INTEL_APOLLOLAKE" in order to get the desired outcome. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-09x86: spl: Add support for NVMe boot deviceNaresh Solanki
This change adds `BOOT_DEVICE_NVME` to the `enum` list in `arch/x86/include/asm/spl.h`, enabling NVMe as a recognized boot device for SPL (Secondary Program Loader). Tested x86 hardware with coreboot + U-Boot payload. Verified successful boot to NVMe drive. Signed-off-by: Naresh Solanki <naresh.solanki@9elements.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2025-05-09gpio: x86: Correct usage of IS_ENABLED() macro in intel_pinctrl_defs.hTom Rini
This file was using IS_ENABLED() to test for CONFIG flags but omitted the CONFIG_ prefix and so did not work as expected. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-09x86: Correct usage of IS_ENABLED() macro in arch/x86/lib/spl.cTom Rini
This file was using IS_ENABLED() to test for CONFIG flags but omitted the CONFIG_ prefix and so did not work as expected. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-09x86: cpu: Describe board final hooks in the headerAndy Shevchenko
The new two declarations board_final_init() and board_final_cleanup() need a description. Add it here. Suggested-by: Simon Glass <sjg@chromium.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2025-04-11Merge patch series "Switch to using $(PHASE_) in Makefiles"Tom Rini
Tom Rini <trini@konsulko.com> says: This series switches to always using $(PHASE_) in Makefiles when building rather than $(PHASE_) or $(XPL_). It also starts on documenting this part of the build, but as a follow-up we need to rename doc/develop/spl.rst and expand on explaining things a bit. Link: https://lore.kernel.org/r/20250401225851.1125678-1-trini@konsulko.com
2025-04-11Kbuild: Always use $(PHASE_)Tom Rini
It is confusing to have both "$(PHASE_)" and "$(XPL_)" be used in our Makefiles as part of the macros to determine when to do something in our Makefiles based on what phase of the build we are in. For consistency, bring this down to a single macro and use "$(PHASE_)" only. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-04-08Merge patch series "acpi: simplify updating ACPI table header checksum"Tom Rini
Heinrich Schuchardt <heinrich.schuchardt@canonical.com> says: Introduce a new function to update ACPI table headers. This allows to simplify the existing code. Link: https://lore.kernel.org/r/20250321232121.251800-1-heinrich.schuchardt@canonical.com
2025-04-08x86/acpi: simplify updating header checksumHeinrich Schuchardt
Use acpi_update_checksum() for updating ACPI table header checksum. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Matthias Brugger <mbrugger@suse.com>
2025-04-07Revert "Merge patch series "pxe: Precursor series for supporting read_all() ↵Tom Rini
in extlinux / PXE"" This reverts commit 8bc3542384e3a1219e5ffb62b79d16dddc1b1fb9, reversing changes made to 698edd63eca090a2e299cd3facf90a0b97bed677. There are still problems with this series to work out. Link: https://lore.kernel.org/u-boot/CAFLszTjw_MJbK9tpzVYi3XKGazcv55auBAdgVzcAVUta7dRqcg@mail.gmail.com/ Signed-off-by: Tom Rini <trini@konsulko.com>
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-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-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: 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>
2025-04-03x86: Use a simple jump into long modeSimon Glass
With the 64-bit descriptor we can use a jump instruction, rather than pushing things on the stack. Since the processor is in 64-bit mode by this point, pop a 64-bit value from the stack, containing the target address. This simplifies the code slightly, in particular its use of the stack. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: Use the same GDT when jumping to long modeSimon Glass
Make use the existing GDT which now includes entries for 64-bit code. Leave the interrupt descriptors alone. They can be tidied up once U-Boot starts up. With this, kvm mode works with QEMU. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/31
2025-04-03x86: Disable paging before changing to long modeSimon Glass
This is required as part of the procedure. The existing code works because it changes the GDT at the same time, but this makes kvm unhappy. Update the algorithm to disable and then re-enable paging. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: Tidy up the GDT size in start/16.SSimon Glass
Use a symbol to select the size of the GDT, rather than hard-coding a value. This matches how it is done in start64 Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: Include stdbool.h in interrupt headerSimon Glass
This makes use of a 'bool' type, so include the required header. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: Drop the message about features missing in 64-bitSimon Glass
This functions normally and has done for a while, so drop this scary message. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: spl: Drop duplicate CPU initSimon Glass
x86_cpu_init_f() is called by arch_cpu_init() a few lines below this code. Drop the duplicate call. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: Use defines for the cache flagsSimon Glass
Use some named flags when setting up the cache, so it is easier to see what is going on. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: Add 64-bit entries to the GDTSimon Glass
At present it is not possible to execution 64-bit code without installing an entire new Global Descriptor Table. This is inconvenient since kvm does not seem to like switching into long mode with a new table. It isn't actually necessary, since we can just extend the existing table. Add some new entries to this effect. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: Avoid clearing the VESA displaySimon Glass
U-Boot clears the display when it starts up, so there is no need to ask the VESA driver to do this. Fix this and add a comment explaining the flags. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-03x86: Drop use of CONFIG_REALMODE_DEBUGSimon Glass
This option is not actually defined in Kconfig anymore. Use a normal debug print instead, which has a similar effect. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2025-04-03x86: Add some log categoriesSimon Glass
Add categories for i8259 and bios files, so that log statements have the right category. Signed-off-by: Simon Glass <sjg@chromium.org>