[U-Boot] [PATCH 01/12] x86: Allow compiling out realmode/bios code

Simon Glass sjg at chromium.org
Sun Oct 21 00:33:05 CEST 2012


From: Gabe Black <gabeblack at chromium.org>

We don't want this for coreboot, so provide a way of compiling it out.

Signed-off-by: Gabe Black <gabeblack at chromium.org>
Signed-off-by: Stefan Reinauer <reinauer at chromium.org>
Signed-off-by: Simon Glass <sjg at chromium.org>
---
 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
-- 
1.7.7.3



More information about the U-Boot mailing list