]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
x86: Allow compiling out realmode/bios code
authorGabe Black <gabeblack@chromium.org>
Thu, 29 Nov 2012 16:23:41 +0000 (16:23 +0000)
committerSimon Glass <sjg@chromium.org>
Fri, 30 Nov 2012 21:44:04 +0000 (13:44 -0800)
We don't want this for coreboot, so provide a way of compiling it out.

Signed-off-by: Gabe Black <gabeblack@chromium.org>
Signed-off-by: Stefan Reinauer <reinauer@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
README
arch/x86/lib/Makefile
arch/x86/lib/video.c
arch/x86/lib/zimage.c

diff --git a/README b/README
index b9a36856d923d985cb159f91263f171eb56bf24f..ed7d270adb764ebacc115fc872f0e6228fc43abc 100644 (file)
--- a/README
+++ b/README
@@ -3668,6 +3668,12 @@ Low Level (hardware related) configuration options:
                If defined, the x86 reset vector code is excluded. You will need
                to do this when U-Boot is running from Coreboot.
 
+- CONFIG_X86_NO_REAL_MODE
+               If defined, x86 real mode code is omitted. This assumes a
+               32-bit environment where such code is not needed. You will
+               need to do this when U-Boot is running from Coreboot.
+
+
 Freescale QE/FMAN Firmware Support:
 -----------------------------------
 
index 51836dacca5823b4cc64fbdb04c54c9a8d3f8e4e..4325b2502ea5e9277fdd4a0b9978892b7de8e4c5 100644 (file)
@@ -25,11 +25,16 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(ARCH).o
 
+ifeq ($(CONFIG_X86_NO_REAL_MODE),)
 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
 
index 3d6b24d6204a67228f93850437013e6df2489c21..20e2416ae16f31f3ae8e441b8ec7b640e3dc00c4 100644 (file)
@@ -222,8 +222,10 @@ int video_init(void)
 
 int drv_video_init(void)
 {
+#ifndef CONFIG_X86_NO_REAL_MODE
        if (video_bios_init())
                return 1;
+#endif
 
        return video_init();
 }
index 22142864c22c052efd5626f26fc3ab04dfb1b630..b8c672babddc23fa06189efa31e09f300180a01f 100644 (file)
@@ -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_ZBOOT_32 || defined CONFIG_X86_NO_REAL_MODE)
        printf("Building boot_params at 0x%8.8lx\n", (ulong)setup_base);
        memset(setup_base, 0, sizeof(*setup_base));
        setup_base->hdr = params->hdr;
@@ -237,7 +237,7 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot,
        struct setup_header *hdr = &setup_base->hdr;
        int bootproto = get_boot_protocol(hdr);
 
-#if defined CONFIG_ZBOOT_32
+#if (defined CONFIG_ZBOOT_32 || defined CONFIG_X86_NO_REAL_MODE)
        setup_base->e820_entries = install_e820_map(
                ARRAY_SIZE(setup_base->e820_map), setup_base->e820_map);
 #endif