From patchwork Sat Oct 20 22:33:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 192954 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id D85182C0082 for ; Sun, 21 Oct 2012 09:33:56 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 524A74A3F5; Sun, 21 Oct 2012 00:33:55 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KiUkuGAygvPc; Sun, 21 Oct 2012 00:33:54 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2AD434A407; Sun, 21 Oct 2012 00:33:47 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B82104A3FA for ; Sun, 21 Oct 2012 00:33:44 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dya-lTMgndQW for ; Sun, 21 Oct 2012 00:33:44 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-qc0-f202.google.com (mail-qc0-f202.google.com [209.85.216.202]) by theia.denx.de (Postfix) with ESMTPS id DC5374A3F5 for ; Sun, 21 Oct 2012 00:33:42 +0200 (CEST) Received: by mail-qc0-f202.google.com with SMTP id s25so191345qcq.3 for ; Sat, 20 Oct 2012 15:33:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=56Gj557GsIw/j5C+RnsiOXtGTd/FWOTOD24x89O2ziw=; b=Xk8H60y3vSvO1OEq0ZjlU/eYDZauHwOeqFQldA3jlrrUTcX0Kc0jGpjLnVw+BZsR97 XMhLH4LXHjEgsejLng1crt/AjuHcgioiTTMVdTbWnNJwHGYRJuli6fpOXPKKT80rzt/s EuTwxhT82VAAswOsDm/AhHCqbL/15nAex9eLQecaegJy1tHAJPtdbC38ZVbgRdvkSC8b kdL5BX+dbE26YlCqlFZm1Jwj7TnPctsQiDp0KS9peOy2wMzDsx/6v13KIQA3p/o7TVfy nerVbfdp26jt4DXdYw/lqKgPT6nhtuexFCpmI4kDXoFuEvEScAF1g6Vi0AWOMhCLyDSI NH2g== Received: by 10.236.138.232 with SMTP id a68mr3420154yhj.28.1350772422302; Sat, 20 Oct 2012 15:33:42 -0700 (PDT) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id l20si466277yhi.2.2012.10.20.15.33.42 (version=TLSv1/SSLv3 cipher=AES128-SHA); Sat, 20 Oct 2012 15:33:42 -0700 (PDT) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id 239E8100047; Sat, 20 Oct 2012 15:33:42 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id D9F4F160374; Sat, 20 Oct 2012 15:33:41 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 20 Oct 2012 15:33:05 -0700 Message-Id: <1350772396-28946-2-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1350772396-28946-1-git-send-email-sjg@chromium.org> References: <1350772396-28946-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQmkZBrtEmyNfPoLs8E2tR1ZCtbcAJrbOE9G96WeCtOJo+4oRRE7XPD9r2BmV/IRrM+SscMT/jnY+enkxY+djxYw/6Bp+jg70NzPez+WD2UzDlyYKTQqhTeuMq1fjLa4NcRv9ZkgzWrNJz78r6MfKEJgfjuIBpmgOkuF8sPKfKUK7P25rPc9tgElwF5kPr2dn9G4cdBp Cc: Tom Rini , Stefan Reinauer Subject: [U-Boot] [PATCH 01/12] x86: Allow compiling out realmode/bios code X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Gabe Black We don't want this for coreboot, so provide a way of compiling it out. Signed-off-by: Gabe Black Signed-off-by: Stefan Reinauer Signed-off-by: Simon Glass --- arch/x86/lib/Makefile | 9 ++++++--- arch/x86/lib/video.c | 2 ++ arch/x86/lib/zimage.c | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile index 51836da..1cb9155 100644 --- a/arch/x86/lib/Makefile +++ b/arch/x86/lib/Makefile @@ -25,11 +25,16 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(ARCH).o +ifeq ($(CONFIG_SYS_X86_REALMODE),y) SOBJS-$(CONFIG_SYS_PC_BIOS) += bios.o SOBJS-$(CONFIG_SYS_PCI_BIOS) += bios_pci.o -SOBJS-$(CONFIG_SYS_X86_REALMODE) += realmode_switch.o +COBJS-y += realmode.o +SOBJS-y += realmode_switch.o COBJS-$(CONFIG_SYS_PC_BIOS) += bios_setup.o +COBJS-$(CONFIG_VIDEO) += video_bios.o +endif + COBJS-y += board.o COBJS-y += bootm.o COBJS-y += cmd_boot.o @@ -41,11 +46,9 @@ COBJS-$(CONFIG_SYS_PCAT_INTERRUPTS) += pcat_interrupts.o COBJS-$(CONFIG_SYS_GENERIC_TIMER) += pcat_timer.o COBJS-$(CONFIG_PCI) += pci.o COBJS-$(CONFIG_PCI) += pci_type1.o -COBJS-$(CONFIG_SYS_X86_REALMODE) += realmode.o COBJS-y += relocate.o COBJS-y += string.o COBJS-$(CONFIG_SYS_X86_ISR_TIMER) += timer.o -COBJS-$(CONFIG_VIDEO) += video_bios.o COBJS-$(CONFIG_VIDEO) += video.o COBJS-$(CONFIG_CMD_ZBOOT) += zimage.o diff --git a/arch/x86/lib/video.c b/arch/x86/lib/video.c index 3d6b24d..7d58ab0 100644 --- a/arch/x86/lib/video.c +++ b/arch/x86/lib/video.c @@ -222,8 +222,10 @@ int video_init(void) int drv_video_init(void) { +#if defined CONFIG_SYS_X86_REALMODE if (video_bios_init()) return 1; +#endif return video_init(); } diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index 2214286..2bbf5a8 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -171,7 +171,7 @@ struct boot_params *load_zimage(char *image, unsigned long kernel_size, else *load_address = (void *)ZIMAGE_LOAD_ADDR; -#if defined CONFIG_ZBOOT_32 +#if !defined CONFIG_SYS_X86_REALMODE || defined CONFIG_ZBOOT_32 printf("Building boot_params at 0x%8.8lx\n", (ulong)setup_base); memset(setup_base, 0, sizeof(*setup_base)); setup_base->hdr = params->hdr; @@ -283,7 +283,7 @@ void boot_zimage(void *setup_base, void *load_address) { printf("\nStarting kernel ...\n\n"); -#if defined CONFIG_ZBOOT_32 +#if !defined CONFIG_SYS_X86_REALMODE || defined CONFIG_ZBOOT_32 /* * Set %ebx, %ebp, and %edi to 0, %esi to point to the boot_params * structure, and then jump to the kernel. We assume that %cs is