EFI payload in 64 bit mode?

Heinrich Schuchardt xypron.glpk at gmx.de
Wed Apr 24 10:23:13 CEST 2024


On 24.04.24 09:55, Philip Oberfichtner wrote:
> Hi,
>
> I'm wondering if it is currently possible to have U-Boot run in 64-bit
> mode as EFI payload.
>
> TARGET_EFI_APP64 selects X86_64 to achieve this. TARGET_EFI_PAYLOAD does
> currently always switch 32-bit mode. Any hints what would have to be
> done to get it to run in 64-bit mode?
>
> Thanks in advance,
> Philip
>
>

There are two defconfigs:

efi-x86_payload64_defconfig
efi-x86_payload32_defconfig

efi-x86_payload64_defconfig builds a 64bit EFI binary.
efi-x86_payload32_defconfig builds a 32bit EFI binary.

The essential difference is that one selects CONFIG_EFI_STUB_32BIT and
the other CONFIG_EFI_STUB_64BIT.

U-Boot itself always runs at 32bit because CONFIG_X86_RUN_32BIT=y.

To allow running at 64bit you would need at least need to change:

* jump_to_uboot() needs to execute a 64bit call to main U-Boot
* CONFIG_X86_RUN_64BIT should not select SPL if TARGET_EFI_PAYLOAD
* the definition of the global data pointer needs to be adjusted

Best regards

Heinrich


More information about the U-Boot mailing list