From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755054AbXJXJ34 (ORCPT ); Wed, 24 Oct 2007 05:29:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751494AbXJXJ3t (ORCPT ); Wed, 24 Oct 2007 05:29:49 -0400 Received: from mga09.intel.com ([134.134.136.24]:30266 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751421AbXJXJ3r (ORCPT ); Wed, 24 Oct 2007 05:29:47 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.21,323,1188802800"; d="scan'208";a="184743188" Subject: [PATCH 1/2 -v2 resend] x86_64 EFI boot support: EFI frame buffer driver From: "Huang, Ying" To: akpm@linux-foundation.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , Andi Kleen , "Eric W. Biederman" , Chandramouli Narayanan , Linus Torvalds , "Antonino A. Daplas" Cc: linux-kernel@vger.kernel.org Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Wed, 24 Oct 2007 17:32:29 +0800 Message-Id: <1193218349.23935.148.camel@caritas-dev.intel.com> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 X-OriginalArrivalTime: 24 Oct 2007 09:29:44.0318 (UTC) FILETIME=[6966F9E0:01C81620] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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.24-rc1/include/linux/screen_info.h =================================================================== --- linux-2.6.24-rc1.orig/include/linux/screen_info.h 2007-10-24 16:49:22.000000000 +0800 +++ linux-2.6.24-rc1/include/linux/screen_info.h 2007-10-24 16:54:40.000000000 +0800 @@ -51,6 +51,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.24-rc1/drivers/video/Kconfig =================================================================== --- linux-2.6.24-rc1.orig/drivers/video/Kconfig 2007-10-24 16:49:22.000000000 +0800 +++ linux-2.6.24-rc1/drivers/video/Kconfig 2007-10-24 16:54:40.000000000 +0800 @@ -641,6 +641,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.24-rc1/drivers/video/Makefile =================================================================== --- linux-2.6.24-rc1.orig/drivers/video/Makefile 2007-10-24 16:49:22.000000000 +0800 +++ linux-2.6.24-rc1/drivers/video/Makefile 2007-10-24 16:54:40.000000000 +0800 @@ -118,6 +118,7 @@ obj-$(CONFIG_FB_UVESA) += uvesafb.o 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 obj-$(CONFIG_FB_BF54X_LQ043) += bf54x-lq043fb.o Index: linux-2.6.24-rc1/drivers/video/efifb.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6.24-rc1/drivers/video/efifb.c 2007-10-24 16:54:40.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