162306a36Sopenharmony_ci.. SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci
362306a36Sopenharmony_ci=====================================
462306a36Sopenharmony_ciGeneral note on [U]EFI x86_64 support
562306a36Sopenharmony_ci=====================================
662306a36Sopenharmony_ci
762306a36Sopenharmony_ciThe nomenclature EFI and UEFI are used interchangeably in this document.
862306a36Sopenharmony_ci
962306a36Sopenharmony_ciAlthough the tools below are _not_ needed for building the kernel,
1062306a36Sopenharmony_cithe needed bootloader support and associated tools for x86_64 platforms
1162306a36Sopenharmony_ciwith EFI firmware and specifications are listed below.
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci1. UEFI specification:  http://www.uefi.org
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci2. Booting Linux kernel on UEFI x86_64 platform requires bootloader
1662306a36Sopenharmony_ci   support. Elilo with x86_64 support can be used.
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci3. x86_64 platform with EFI/UEFI firmware.
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ciMechanics
2162306a36Sopenharmony_ci---------
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci- Build the kernel with the following configuration::
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ci	CONFIG_FB_EFI=y
2662306a36Sopenharmony_ci	CONFIG_FRAMEBUFFER_CONSOLE=y
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci  If EFI runtime services are expected, the following configuration should
2962306a36Sopenharmony_ci  be selected::
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci	CONFIG_EFI=y
3262306a36Sopenharmony_ci	CONFIG_EFIVAR_FS=y or m		# optional
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci- Create a VFAT partition on the disk
3562306a36Sopenharmony_ci- Copy the following to the VFAT partition:
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci	elilo bootloader with x86_64 support, elilo configuration file,
3862306a36Sopenharmony_ci	kernel image built in first step and corresponding
3962306a36Sopenharmony_ci	initrd. Instructions on building elilo and its dependencies
4062306a36Sopenharmony_ci	can be found in the elilo sourceforge project.
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ci- Boot to EFI shell and invoke elilo choosing the kernel image built
4362306a36Sopenharmony_ci  in first step.
4462306a36Sopenharmony_ci- If some or all EFI runtime services don't work, you can try following
4562306a36Sopenharmony_ci  kernel command line parameters to turn off some or all EFI runtime
4662306a36Sopenharmony_ci  services.
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ci	noefi
4962306a36Sopenharmony_ci		turn off all EFI runtime services
5062306a36Sopenharmony_ci	reboot_type=k
5162306a36Sopenharmony_ci		turn off EFI reboot runtime service
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci- If the EFI memory map has additional entries not in the E820 map,
5462306a36Sopenharmony_ci  you can include those entries in the kernels memory map of available
5562306a36Sopenharmony_ci  physical RAM by using the following kernel command line parameter.
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ci	add_efi_memmap
5862306a36Sopenharmony_ci		include EFI memory map of available physical RAM
59