From: "Huang, Ying" Following sets of patches add EFI/UEFI (Unified Extensible Firmware Interface) boot support to x86_64 architecture. The EFI runtime service support is not added by the patches. The patches have been tested against 2.6.23-rc2 kernel on Intel platforms with EFI1.10 and UEFI2.0 firmware. With this set of patches applied, the 64bit and 32bit x86 kernel can be booted on x86_64 machine with UEFI64 firmware. Because the EFI memory map is converted to E820 map in bootloader, now the only needed code for booting Linux kernel on x86_64 UEFI platform is the framebuffer driver. UEFI specification can be found here: http://www.uefi.org For booting the UEFI x86_64 enabled kernel, the machine with EFI/UEFI firmware and the support of bootloader is required. Detailed usage guide can be found in Documentation/x86_64/uefi.txt, which is added in the patch: EFI boot document Known issues: - Boot protocol: because the real mode BIOS call can not be used in EFI platform, the standard boot protocol defined in Documentation/i386/boot.txt can not be used by EFI based bootloader. So, a internal boot protocol defined in Documentation/i386/zero-page.txt is used instead. Since this internal boot protocol is also used by many other bootloaders, such as kexec, LinuxBIOS and Gujin etc, maybe it is better to make this internal boot protocol become a public 32bit boot protocol for Linux kernel. - Firmware information, such as ACPI root pointer, smbios pointer, etc. In orignal EFI supporting code, various firmware information is gotten through EFI configuration tables. But, I think the corresponding firmware support code need not depend on the EFI support. So, I think maybe it is a better idea to add these firmware information to 32bit boot protocol proposed previously, and they can be filled by bootloader if available. This patch: Add Graphics Output Protocol support to the kernel. UEFI2.0 spec deprecates Universal Graphics Adapter (UGA) protocol and only Graphics Output Protocol (GOP) is produced. Therefore, the boot loader needs to query the UEFI firmware with appropriate Output Protocol and pass the video information to the kernel. As a result of GOP protocol, an EFI framebuffer driver is needed for displaying console messages. The patch adds a EFI framebuffer driver. The EFI frame buffer driver in this patch is based on the Intel Mac framebuffer driver. The ELILO bootloader takes care of passing the video information as appropriate for EFI firmware. The framebuffer driver has been tested in i386 kernel and x86_64 kernel on EFI platform. Signed-off-by: Chandramouli Narayanan Signed-off-by: Huang Ying Cc: Andi Kleen Cc: "Antonino A. Daplas" Signed-off-by: Andrew Morton --- drivers/video/Kconfig | 11 + drivers/video/Makefile | 1 drivers/video/efifb.c | 232 ++++++++++++++++++++++++++++++++++ include/linux/screen_info.h | 1 4 files changed, 245 insertions(+) diff -puN drivers/video/Kconfig~x86_64-efi-boot-support-efi-frame-buffer-driver drivers/video/Kconfig --- a/drivers/video/Kconfig~x86_64-efi-boot-support-efi-frame-buffer-driver +++ a/drivers/video/Kconfig @@ -604,6 +604,17 @@ config FB_VESA You will get a boot time penguin logo at no additional cost. Please read . If unsure, say Y. +config FB_EFI + bool "EFI-based Framebuffer Support" + depends on (FB = y) && X86 + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + help + This is the EFI frame buffer device driver. If the firmware on + your platform is UEFI2.0, select Y to add support for + Graphics Output Protocol for early console messages to appear. + config FB_IMAC bool "Intel-based Macintosh Framebuffer Support" depends on (FB = y) && X86 && EFI diff -puN drivers/video/Makefile~x86_64-efi-boot-support-efi-frame-buffer-driver drivers/video/Makefile --- a/drivers/video/Makefile~x86_64-efi-boot-support-efi-frame-buffer-driver +++ a/drivers/video/Makefile @@ -117,6 +117,7 @@ obj-$(CONFIG_FB_OMAP) += oma # Platform or fallback drivers go here obj-$(CONFIG_FB_VESA) += vesafb.o obj-$(CONFIG_FB_IMAC) += imacfb.o +obj-$(CONFIG_FB_EFI) += efifb.o obj-$(CONFIG_FB_VGA16) += vga16fb.o obj-$(CONFIG_FB_OF) += offb.o diff -puN /dev/null drivers/video/efifb.c --- /dev/null +++ a/drivers/video/efifb.c @@ -0,0 +1,232 @@ +/* + * framebuffer driver for EFI/UEFI based system + * + * (c) 2006 Edgar Hucek + * Original efi driver written by Gerd Knorr + * + */ + +#include +#include +#include +#include +#include +#include + +#include