From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759646AbXKBCFe (ORCPT ); Thu, 1 Nov 2007 22:05:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753802AbXKBCF0 (ORCPT ); Thu, 1 Nov 2007 22:05:26 -0400 Received: from mga02.intel.com ([134.134.136.20]:41585 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752771AbXKBCFZ (ORCPT ); Thu, 1 Nov 2007 22:05:25 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.21,360,1188802800"; d="scan'208";a="260822692" Subject: [PATCH 1/2 -v3] x86_64 EFI boot support: EFI frame buffer driver From: "Huang, Ying" To: "H. Peter Anvin" Cc: akpm@linux-foundation.org, Andi Kleen , "Antonino A. Daplas" , linux-kernel@vger.kernel.org Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Fri, 02 Nov 2007 10:08:16 +0800 Message-Id: <1193969296.11724.17.camel@caritas-dev.intel.com> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 X-OriginalArrivalTime: 02 Nov 2007 02:05:09.0236 (UTC) FILETIME=[CB883B40:01C81CF4] 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 | 2 4 files changed, 246 insertions(+) Index: linux-2.6.24-rc1/include/linux/screen_info.h =================================================================== --- linux-2.6.24-rc1.orig/include/linux/screen_info.h +++ linux-2.6.24-rc1/include/linux/screen_info.h @@ -63,6 +63,8 @@ struct screen_info { #define VIDEO_TYPE_PMAC 0x60 /* PowerMacintosh frame buffer. */ +#define VIDEO_TYPE_EFI 0x70 /* EFI graphic mode */ + #ifdef __KERNEL__ extern struct screen_info screen_info; Index: linux-2.6.24-rc1/drivers/video/Kconfig =================================================================== --- linux-2.6.24-rc1.orig/drivers/video/Kconfig +++ linux-2.6.24-rc1/drivers/video/Kconfig @@ -641,6 +641,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 Index: linux-2.6.24-rc1/drivers/video/Makefile =================================================================== --- linux-2.6.24-rc1.orig/drivers/video/Makefile +++ linux-2.6.24-rc1/drivers/video/Makefile @@ -118,6 +118,7 @@ obj-$(CONFIG_FB_OMAP) += oma 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 +++ linux-2.6.24-rc1/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