From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Huang, Ying" Subject: [PATCH 1/2] x86_64 EFI boot support: EFI frame buffer driver Date: Thu, 09 Aug 2007 16:20:33 +0800 Message-ID: <1186647633.15539.15.camel@caritas-dev.intel.com> Reply-To: linux-fbdev-devel@lists.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.92] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1IJ3Fv-0006GR-Hg for linux-fbdev-devel@lists.sourceforge.net; Thu, 09 Aug 2007 01:20:31 -0700 Received: from mga02.intel.com ([134.134.136.20]) by mail.sourceforge.net with esmtp (Exim 4.44) id 1IJ3Fu-0006a3-Qt for linux-fbdev-devel@lists.sourceforge.net; Thu, 09 Aug 2007 01:20:31 -0700 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-fbdev-devel-bounces@lists.sourceforge.net Errors-To: linux-fbdev-devel-bounces@lists.sourceforge.net To: Andi Kleen , akpm@linux-foundation.org, "Eric W. Biederman" , "H. Peter Anvin" , Chandramouli Narayanan Cc: "Antonino A. Daplas" , linux-fbdev-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Changelog between this version and previous version (v3 of x86_64 EFI support patch). 1. The include files of efifb.c is cleaned up. 2. Make CONFIG_FB_EFI do not depend on CONFIG_EFI. --- This patch adds 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 drivers/video/Kconfig | 11 ++ drivers/video/Makefile | 1 drivers/video/efifb.c | 232 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/screen_info.h | 1 4 files changed, 245 insertions(+) Index: linux-2.6.23-rc2/include/linux/screen_info.h =================================================================== --- linux-2.6.23-rc2.orig/include/linux/screen_info.h 2007-08-04 10:49:55.000000000 +0800 +++ linux-2.6.23-rc2/include/linux/screen_info.h 2007-08-07 14:43:59.000000000 +0800 @@ -62,6 +62,7 @@ #define VIDEO_TYPE_EGAC 0x21 /* EGA in Color Mode */ #define VIDEO_TYPE_VGAC 0x22 /* VGA+ in Color Mode */ #define VIDEO_TYPE_VLFB 0x23 /* VESA VGA in graphic mode */ +#define VIDEO_TYPE_EFI 0x24 /* EFI graphic mode */ #define VIDEO_TYPE_PICA_S3 0x30 /* ACER PICA-61 local S3 video */ #define VIDEO_TYPE_MIPS_G364 0x31 /* MIPS Magnum 4000 G364 video */ Index: linux-2.6.23-rc2/drivers/video/Kconfig =================================================================== --- linux-2.6.23-rc2.orig/drivers/video/Kconfig 2007-08-04 10:49:55.000000000 +0800 +++ linux-2.6.23-rc2/drivers/video/Kconfig 2007-08-08 11:27:35.000000000 +0800 @@ -605,6 +605,17 @@ 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 Index: linux-2.6.23-rc2/drivers/video/Makefile =================================================================== --- linux-2.6.23-rc2.orig/drivers/video/Makefile 2007-08-04 10:49:55.000000000 +0800 +++ linux-2.6.23-rc2/drivers/video/Makefile 2007-08-07 14:43:59.000000000 +0800 @@ -117,6 +117,7 @@ # 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 Index: linux-2.6.23-rc2/drivers/video/efifb.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6.23-rc2/drivers/video/efifb.c 2007-08-07 14:43:59.000000000 +0800 @@ -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