From: Julian Pidancet <julian.pidancet@gmail.com>
To: xen-devel@lists.xensource.com
Cc: Ian.Campbell@citrix.com, Julian Pidancet <julian.pidancet@gmail.com>
Subject: [PATCH v2 3/3] firmware: Introduce CONFIG_ROMBIOS and CONFIG_SEABIOS options
Date: Fri, 10 Feb 2012 01:53:44 +0000 [thread overview]
Message-ID: <49af4f8a096e6d47f5221fc8ec22d8882b5a3faa.1328837585.git.julian.pidancet@gmail.com> (raw)
In-Reply-To: <cover.1328837585.git.julian.pidancet@gmail.com>
This patch introduces configuration options allowing to built either
a rombios only or a seabios only hvmloader.
Building option ROMs like vgabios or etherboot is only enabled for
a rombios hvmloader, since SeaBIOS takes care or extracting option
ROMs itself from the PCI devices (these option ROMs are provided
by the device model and do not need to be built in hvmloader).
The Makefile in tools/firmware/ now only checks for bcc if rombios
is enabled.
These two configuration options are left on by default to remain
compatible.
Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
---
Config.mk | 3 +++
tools/firmware/Makefile | 21 +++++++++++++--------
tools/firmware/hvmloader/Makefile | 32 +++++++++++++++++++-------------
tools/firmware/hvmloader/hvmloader.c | 4 ++++
4 files changed, 39 insertions(+), 21 deletions(-)
diff --git a/Config.mk b/Config.mk
index 42508b8..a43596c 100644
--- a/Config.mk
+++ b/Config.mk
@@ -224,6 +224,9 @@ SEABIOS_UPSTREAM_TAG ?= rel-1.6.3.1
ETHERBOOT_NICS ?= rtl8139 8086100e
+CONFIG_ROMBIOS ?= y
+CONFIG_SEABIOS ?= y
+
# Specify which qemu-dm to use. This may be `ioemu' to use the old
# Mercurial in-tree version, or a local directory, or a git URL.
# CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
diff --git a/tools/firmware/Makefile b/tools/firmware/Makefile
index c3ec9a0..29d2041 100644
--- a/tools/firmware/Makefile
+++ b/tools/firmware/Makefile
@@ -5,19 +5,20 @@ include $(XEN_ROOT)/tools/Rules.mk
TARGET := hvmloader/hvmloader
INST_DIR := $(DESTDIR)$(XENFIRMWAREDIR)
-SUBDIRS :=
-SUBDIRS += seabios-dir
-SUBDIRS += rombios
-SUBDIRS += vgabios
-SUBDIRS += etherboot
-SUBDIRS += hvmloader
+SUBDIRS-y :=
+SUBDIRS-$(CONFIG_SEABIOS) += seabios-dir
+SUBDIRS-$(CONFIG_ROMBIOS) += rombios
+SUBDIRS-$(CONFIG_ROMBIOS) += vgabios
+SUBDIRS-$(CONFIG_ROMBIOS) += etherboot
+SUBDIRS-y += hvmloader
seabios-dir:
GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_TAG) seabios-dir
cp seabios-config seabios-dir/.config;
.PHONY: all
-all: seabios-dir
+all:
+ifeq ($(CONFIG_ROMBIOS),y)
@set -e; if [ $$((`( bcc -v 2>&1 | grep version || echo 0.0.0 ) | cut -d' ' -f 3 | awk -F. '{ printf "0x%02x%02x%02x", $$1, $$2, $$3}'`)) -lt $$((0x00100e)) ] ; then \
echo "==========================================================================="; \
echo "Require dev86 rpm or bin86 & bcc debs version >= 0.16.14 to build firmware!"; \
@@ -25,7 +26,11 @@ all: seabios-dir
echo "==========================================================================="; \
false ; \
fi
- $(MAKE) subdirs-$@; \
+endif
+ifeq ($(CONFIG_SEABIOS),y)
+ $(MAKE) seabios-dir
+endif
+ $(MAKE) subdirs-$@
.PHONY: install
diff --git a/tools/firmware/hvmloader/Makefile b/tools/firmware/hvmloader/Makefile
index 1ea32db..730bbba 100644
--- a/tools/firmware/hvmloader/Makefile
+++ b/tools/firmware/hvmloader/Makefile
@@ -38,27 +38,33 @@ endif
CIRRUSVGA_DEBUG ?= n
ROMBIOS_DIR := ../rombios
-ifneq ($(ROMBIOS_DIR),)
-OBJS += 32bitbios_support.o rombios.o
-CFLAGS += -DENABLE_ROMBIOS
-ROMBIOS_ROM := $(ROMBIOS_DIR)/BIOS-bochs-latest
-endif
-
SEABIOS_DIR := ../seabios-dir
-ifneq ($(SEABIOS_DIR),)
-OBJS += seabios.o
-CFLAGS += -DENABLE_SEABIOS
-SEABIOS_ROM := $(SEABIOS_DIR)/out/bios.bin
-endif
+ifeq ($(CONFIG_ROMBIOS),y)
STDVGA_ROM := ../vgabios/VGABIOS-lgpl-latest.bin
ifeq ($(CIRRUSVGA_DEBUG),y)
CIRRUSVGA_ROM := ../vgabios/VGABIOS-lgpl-latest.cirrus.debug.bin
else
CIRRUSVGA_ROM := ../vgabios/VGABIOS-lgpl-latest.cirrus.bin
endif
-
ETHERBOOT_ROMS := $(addprefix ../etherboot/ipxe/src/bin/, $(addsuffix .rom, $(ETHERBOOT_NICS)))
+endif
+
+ROMS :=
+
+ifeq ($(CONFIG_ROMBIOS),y)
+OBJS += 32bitbios_support.o rombios.o
+CFLAGS += -DENABLE_ROMBIOS
+ROMBIOS_ROM := $(ROMBIOS_DIR)/BIOS-bochs-latest
+ROMS += $(ROMBIOS_ROM) $(STDVGA_ROM) $(CIRRUSVGA_ROM) $(ETHERBOOT_ROMS)
+endif
+
+ifeq ($(CONFIG_SEABIOS),y)
+OBJS += seabios.o
+CFLAGS += -DENABLE_SEABIOS
+SEABIOS_ROM := $(SEABIOS_DIR)/out/bios.bin
+ROMS += $(SEABIOS_ROM)
+endif
.PHONY: all
all: subdirs-all
@@ -72,7 +78,7 @@ hvmloader: $(OBJS) acpi/acpi.a
$(OBJCOPY) hvmloader.tmp hvmloader
rm -f hvmloader.tmp
-roms.inc: $(ROMBIOS_ROM) $(SEABIOS_ROM) $(STDVGA_ROM) $(CIRRUSVGA_ROM) $(ETHERBOOT_ROMS)
+roms.inc: $(ROMS)
echo "/* Autogenerated file. DO NOT EDIT */" > $@.new
ifneq ($(ROMBIOS_ROM),)
diff --git a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c
index f120ffe..874ee30 100644
--- a/tools/firmware/hvmloader/hvmloader.c
+++ b/tools/firmware/hvmloader/hvmloader.c
@@ -147,6 +147,7 @@ static void init_hypercalls(void)
printf("Detected Xen v%u.%u%s\n", eax >> 16, eax & 0xffff, extraversion);
}
+#ifdef ENABLE_ROMBIOS
/*
* Scan the list of Option ROMs at @roms for one which supports
* PCI (@vendor_id, @device_id) found at slot @devfn. If one is found,
@@ -309,6 +310,7 @@ static int pci_load_option_roms(unsigned int option_rom_end,
return rom_phys_addr - rom_base_addr;
}
+#endif
/* Replace possibly erroneous memory-size CMOS fields with correct values. */
static void cmos_write_memory_size(void)
@@ -470,6 +472,7 @@ int main(void)
bios->create_pir_tables();
}
+#ifdef ENABLE_ROMBIOS
if ( bios->load_roms )
{
switch ( virtual_vga )
@@ -506,6 +509,7 @@ int main(void)
option_rom_sz = pci_load_option_roms(bios->optionrom_end,
option_rom_phys_addr);
}
+#endif
acpi_enabled = !strncmp(xenstore_read("platform/acpi", "1"), "1", 1);
--
Julian Pidancet
next prev parent reply other threads:[~2012-02-10 1:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-10 1:53 [PATCH v2 0/3] hvmloader: Make ROM dependencies optional Julian Pidancet
2012-02-10 1:53 ` [PATCH v2 1/3] hvmloader: Only compile 32bitbios_support.c when rombios is enabled Julian Pidancet
2012-02-10 9:03 ` Ian Campbell
2012-02-10 1:53 ` [PATCH v2 2/3] firmware: Use mkhex from hvmloader directory for etherboot ROMs Julian Pidancet
2012-02-10 9:07 ` Ian Campbell
2012-02-10 1:53 ` Julian Pidancet [this message]
2012-02-10 9:16 ` [PATCH v2 3/3] firmware: Introduce CONFIG_ROMBIOS and CONFIG_SEABIOS options Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49af4f8a096e6d47f5221fc8ec22d8882b5a3faa.1328837585.git.julian.pidancet@gmail.com \
--to=julian.pidancet@gmail.com \
--cc=Ian.Campbell@citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).