Improvements to the Kconfig system. Namely, this series allows the main makefile target to build the vgabios if selected. (Thanks Nils for pointing this out.) It also fixes an issue causing the PCI vendor id and device id to often not be populated.
-Kevin
Kevin O'Connor (4): vgabios: Improve vgabios Kconfig menu. vgabios: Build vgabios by default if enabled in Kconfig. vgabios: Move vgabios Kconfig definitions to vgasrc/Kconfig. vgabios: Make VBE code depend on a config setting.
Makefile | 42 ++++++++++++++----------- src/Kconfig | 55 +--------------------------------- vgasrc/Kconfig | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++ vgasrc/bochsvga.c | 1 - vgasrc/clext.c | 1 - vgasrc/vbe.c | 3 +- vgasrc/vgabios.h | 1 - 7 files changed, 112 insertions(+), 78 deletions(-) create mode 100644 vgasrc/Kconfig
Place driver types in a "choice" selection - only one driver type makes sense.
Only prompt the user for PCI Vendor/Device ids if they wish to override the default choices. Otherwise, Kconfig wont know to use the proper defaults when building autoconf.h.
Signed-off-by: Kevin O'Connor kevin@koconnor.net --- src/Kconfig | 64 +++++++++++++++++++++++++++++++++++----------------------- 1 files changed, 39 insertions(+), 25 deletions(-)
diff --git a/src/Kconfig b/src/Kconfig index 099cd15..e6ce117 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -325,29 +325,35 @@ menu "BIOS Tables" endmenu
menu "VGA ROM" - config VGA_CIRRUS - bool "QEMU Cirrus CLGD 54xx VGA BIOS" - default n - help - Build support for Cirrus VGA emulation. - - config VGA_BOCHS - bool "Bochs DISPI interface VGA BIOS" - default n - help - Build support for Bochs DISPI interface. - - config VGA_GEODEGX2 - bool "GeodeGX2 interface VGA BIOS" - default n - help - Build support for Geode GX2 vga. - - config VGA_GEODELX - bool "GeodeLX interface VGA BIOS" - default n - help - Build support for Geode LX vga. + choice + prompt "VGA Hardware Type" + default VGA_CIRRUS + + config VGA_STANDARD_VGA + bool "Standard VGA" + help + Build basic VGA BIOS support. + + config VGA_CIRRUS + bool "QEMU Cirrus CLGD 54xx VGA BIOS" + help + Build support for Cirrus VGA emulation. + + config VGA_BOCHS + bool "Bochs DISPI interface VGA BIOS" + help + Build support for Bochs DISPI interface. + + config VGA_GEODEGX2 + bool "GeodeGX2 interface VGA BIOS" + help + Build support for Geode GX2 vga. + + config VGA_GEODELX + bool "GeodeLX interface VGA BIOS" + help + Build support for Geode LX vga. + endchoice
config VGA_PCI bool "PCI ROM Headers" @@ -356,9 +362,16 @@ menu "VGA ROM" Build PCI ROM headers so the vga rom can be extracted from a PCI device.
+ config OVERRIDE_PCI_ID + depends on VGA_PCI + bool "Override PCI Vendor and Device IDs" + help + Specify specific values for the PCI Vendor and Device IDs. + config VGA_VID depends on VGA_PCI - hex "PCI Vendor ID" + hex + prompt "PCI Vendor ID" if OVERRIDE_PCI_ID default 0x1013 if VGA_CIRRUS default 0x1234 if VGA_BOCHS default 0x100b if VGA_GEODEGX2 @@ -369,7 +382,8 @@ menu "VGA ROM"
config VGA_DID depends on VGA_PCI - hex "PCI Device ID" + hex + prompt "PCI Vendor ID" if OVERRIDE_PCI_ID default 0x00b8 if VGA_CIRRUS default 0x1111 if VGA_BOCHS default 0x0030 if VGA_GEODEGX2
Signed-off-by: Kevin O'Connor kevin@koconnor.net --- Makefile | 42 +++++++++++++++++++++++------------------- src/Kconfig | 12 +++++++++++- 2 files changed, 34 insertions(+), 20 deletions(-)
diff --git a/Makefile b/Makefile index beb8fd0..0343ce5 100644 --- a/Makefile +++ b/Makefile @@ -47,8 +47,6 @@ CFLAGS16INC = $(CFLAGSSEG) -DMODE16=1 \ $(call cc-option,$(CC),--param large-stack-frame=4,-fno-inline) CFLAGS16 = $(CFLAGS16INC) -g -fomit-frame-pointer
-all: $(OUT) $(OUT)bios.bin - # Run with "make V=1" to see the actual compile commands ifdef V Q= @@ -57,10 +55,24 @@ Q=@ MAKEFLAGS += --no-print-directory endif
+# Common command definitions +export HOSTCC := $(CC) +export CONFIG_SHELL := sh +export KCONFIG_AUTOHEADER := autoconf.h +export KCONFIG_CONFIG := $(CURDIR)/.config OBJCOPY=objcopy OBJDUMP=objdump STRIP=strip
+# Default targets +-include $(KCONFIG_CONFIG) + +target-y = $(OUT) $(OUT)bios.bin +target-$(CONFIG_BUILD_VGABIOS) += $(OUT)vgabios.bin + +all: $(target-y) + +# Make definitions .PHONY : all clean distclean FORCE
vpath %.c src vgasrc @@ -206,24 +218,16 @@ src/%.hex: src/%.dsl ./tools/acpi_extract_preprocess.py ./tools/acpi_extract.py $(OUT)ccode32flat.o: src/acpi-dsdt.hex src/ssdt-proc.hex src/ssdt-pcihp.hex
####### Kconfig rules -export HOSTCC := $(CC) -export CONFIG_SHELL := sh -export KCONFIG_AUTOHEADER := autoconf.h -export KCONFIG_CONFIG := $(CURDIR)/.config - -$(OUT)autoconf.h : $(KCONFIG_CONFIG) - $(Q)$(MAKE) silentoldconfig - -$(KCONFIG_CONFIG): - $(Q)$(MAKE) defconfig - -%onfig: - $(Q)mkdir -p $(OUT)/tools/kconfig/lxdialog - $(Q)mkdir -p $(OUT)/include/config - $(Q)$(MAKE) -C $(OUT) -f $(CURDIR)/tools/kconfig/Makefile srctree=$(CURDIR) src=tools/kconfig obj=tools/kconfig Q=$(Q) Kconfig=$(CURDIR)/src/Kconfig $@ +define do-kconfig +$(Q)mkdir -p $(OUT)/tools/kconfig/lxdialog +$(Q)mkdir -p $(OUT)/include/config +$(Q)$(MAKE) -C $(OUT) -f $(CURDIR)/tools/kconfig/Makefile srctree=$(CURDIR) src=tools/kconfig obj=tools/kconfig Q=$(Q) Kconfig=$(CURDIR)/src/Kconfig $1 +endef
-help: - $(Q)$(MAKE) -f $(CURDIR)/tools/kconfig/Makefile help +$(OUT)autoconf.h : $(KCONFIG_CONFIG) ; $(call do-kconfig, silentoldconfig) +$(KCONFIG_CONFIG): ; $(call do-kconfig, defconfig) +%onfig: ; $(call do-kconfig, $@) +help: ; $(call do-kconfig, $@)
####### Generic rules clean: diff --git a/src/Kconfig b/src/Kconfig index e6ce117..4b72bd1 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -327,7 +327,12 @@ endmenu menu "VGA ROM" choice prompt "VGA Hardware Type" - default VGA_CIRRUS + default NO_VGABIOS + + config NO_VGABIOS + bool "None" + help + Do not build a VGA BIOS.
config VGA_STANDARD_VGA bool "Standard VGA" @@ -355,7 +360,12 @@ menu "VGA ROM" Build support for Geode LX vga. endchoice
+ config BUILD_VGABIOS + bool + default !NO_VGABIOS + config VGA_PCI + depends on BUILD_VGABIOS bool "PCI ROM Headers" default y help
Signed-off-by: Kevin O'Connor kevin@koconnor.net --- src/Kconfig | 79 +------------------------------------------------------ vgasrc/Kconfig | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 78 deletions(-) create mode 100644 vgasrc/Kconfig
diff --git a/src/Kconfig b/src/Kconfig index 4b72bd1..4270014 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -324,84 +324,7 @@ menu "BIOS Tables" Support generation of ACPI tables. endmenu
-menu "VGA ROM" - choice - prompt "VGA Hardware Type" - default NO_VGABIOS - - config NO_VGABIOS - bool "None" - help - Do not build a VGA BIOS. - - config VGA_STANDARD_VGA - bool "Standard VGA" - help - Build basic VGA BIOS support. - - config VGA_CIRRUS - bool "QEMU Cirrus CLGD 54xx VGA BIOS" - help - Build support for Cirrus VGA emulation. - - config VGA_BOCHS - bool "Bochs DISPI interface VGA BIOS" - help - Build support for Bochs DISPI interface. - - config VGA_GEODEGX2 - bool "GeodeGX2 interface VGA BIOS" - help - Build support for Geode GX2 vga. - - config VGA_GEODELX - bool "GeodeLX interface VGA BIOS" - help - Build support for Geode LX vga. - endchoice - - config BUILD_VGABIOS - bool - default !NO_VGABIOS - - config VGA_PCI - depends on BUILD_VGABIOS - bool "PCI ROM Headers" - default y - help - Build PCI ROM headers so the vga rom can be extracted from - a PCI device. - - config OVERRIDE_PCI_ID - depends on VGA_PCI - bool "Override PCI Vendor and Device IDs" - help - Specify specific values for the PCI Vendor and Device IDs. - - config VGA_VID - depends on VGA_PCI - hex - prompt "PCI Vendor ID" if OVERRIDE_PCI_ID - default 0x1013 if VGA_CIRRUS - default 0x1234 if VGA_BOCHS - default 0x100b if VGA_GEODEGX2 - default 0x1022 if VGA_GEODELX - default 0x0000 - help - Vendor ID for the PCI ROM - - config VGA_DID - depends on VGA_PCI - hex - prompt "PCI Vendor ID" if OVERRIDE_PCI_ID - default 0x00b8 if VGA_CIRRUS - default 0x1111 if VGA_BOCHS - default 0x0030 if VGA_GEODEGX2 - default 0x2081 if VGA_GEODELX - default 0x0000 - help - Device ID for the PCI ROM -endmenu +source ../vgasrc/Kconfig
menu "Debugging" config DEBUG_LEVEL diff --git a/vgasrc/Kconfig b/vgasrc/Kconfig new file mode 100644 index 0000000..f6dfa66 --- /dev/null +++ b/vgasrc/Kconfig @@ -0,0 +1,80 @@ +# Kconfig SeaBIOS VGA BIOS configuration + +menu "VGA ROM" + choice + prompt "VGA Hardware Type" + default NO_VGABIOS + + config NO_VGABIOS + bool "None" + help + Do not build a VGA BIOS. + + config VGA_STANDARD_VGA + bool "Standard VGA" + help + Build basic VGA BIOS support. + + config VGA_CIRRUS + bool "QEMU Cirrus CLGD 54xx VGA BIOS" + help + Build support for Cirrus VGA emulation. + + config VGA_BOCHS + bool "Bochs DISPI interface VGA BIOS" + help + Build support for Bochs DISPI interface. + + config VGA_GEODEGX2 + bool "GeodeGX2 interface VGA BIOS" + help + Build support for Geode GX2 vga. + + config VGA_GEODELX + bool "GeodeLX interface VGA BIOS" + help + Build support for Geode LX vga. + endchoice + + config BUILD_VGABIOS + bool + default !NO_VGABIOS + + config VGA_PCI + depends on BUILD_VGABIOS + bool "PCI ROM Headers" + default y + help + Build PCI ROM headers so the vga rom can be extracted from + a PCI device. + + config OVERRIDE_PCI_ID + depends on VGA_PCI + bool "Override PCI Vendor and Device IDs" + help + Specify specific values for the PCI Vendor and Device IDs. + + config VGA_VID + depends on VGA_PCI + hex + prompt "PCI Vendor ID" if OVERRIDE_PCI_ID + default 0x1013 if VGA_CIRRUS + default 0x1234 if VGA_BOCHS + default 0x100b if VGA_GEODEGX2 + default 0x1022 if VGA_GEODELX + default 0x0000 + help + Vendor ID for the PCI ROM + + config VGA_DID + depends on VGA_PCI + hex + prompt "PCI Vendor ID" if OVERRIDE_PCI_ID + default 0x00b8 if VGA_CIRRUS + default 0x1111 if VGA_BOCHS + default 0x0030 if VGA_GEODEGX2 + default 0x2081 if VGA_GEODELX + default 0x0000 + help + Device ID for the PCI ROM +endmenu
Signed-off-by: Kevin O'Connor kevin@koconnor.net --- vgasrc/Kconfig | 7 +++++++ vgasrc/bochsvga.c | 1 - vgasrc/clext.c | 1 - vgasrc/vbe.c | 3 +-- vgasrc/vgabios.h | 1 - 5 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/vgasrc/Kconfig b/vgasrc/Kconfig index f6dfa66..881e9ec 100644 --- a/vgasrc/Kconfig +++ b/vgasrc/Kconfig @@ -40,6 +40,13 @@ menu "VGA ROM" bool default !NO_VGABIOS
+ config VGA_VBE + depends on BUILD_VGABIOS + bool "Video BIOS Extensions (VBE)" + default y + help + Support VBE. + config VGA_PCI depends on BUILD_VGABIOS bool "PCI ROM Headers" diff --git a/vgasrc/bochsvga.c b/vgasrc/bochsvga.c index 07bf6cd..b8ce89b 100644 --- a/vgasrc/bochsvga.c +++ b/vgasrc/bochsvga.c @@ -121,7 +121,6 @@ bochsvga_init(void) return -1; }
- SET_VGA(VBE_enabled, 1); dispi_write(VBE_DISPI_INDEX_ID, VBE_DISPI_ID5);
u32 lfb_addr; diff --git a/vgasrc/clext.c b/vgasrc/clext.c index 1de94c1..815d639 100644 --- a/vgasrc/clext.c +++ b/vgasrc/clext.c @@ -736,7 +736,6 @@ clext_init(void) return -1; dprintf(1, "cirrus init 2\n");
- SET_VGA(VBE_enabled, 1); u32 lfb_addr = 0; if (CONFIG_VGA_PCI) lfb_addr = (pci_config_readl(GET_GLOBAL(VgaBDF), PCI_BASE_ADDRESS_0) diff --git a/vgasrc/vbe.c b/vgasrc/vbe.c index 14efece..d7dd8b4 100644 --- a/vgasrc/vbe.c +++ b/vgasrc/vbe.c @@ -13,7 +13,6 @@ #include "biosvar.h" // get_global_set #include "vgahw.h" // vgahw_set_mode
-int VBE_enabled VAR16; u32 VBE_total_memory VAR16 = 256 * 1024; u32 VBE_capabilities VAR16; u32 VBE_framebuffer VAR16; @@ -257,7 +256,7 @@ vbe_104fXX(struct bregs *regs) void handle_104f(struct bregs *regs) { - if (!GET_GLOBAL(VBE_enabled)) { + if (!CONFIG_VGA_VBE) { vbe_104fXX(regs); return; } diff --git a/vgasrc/vgabios.h b/vgasrc/vgabios.h index a10198d..403e7ce 100644 --- a/vgasrc/vgabios.h +++ b/vgasrc/vgabios.h @@ -93,7 +93,6 @@ void vgafb_write_pixel(u8 color, u16 x, u16 y); u8 vgafb_read_pixel(u16 x, u16 y);
// vbe.c -int VBE_enabled; u32 VBE_total_memory; u32 VBE_capabilities; u32 VBE_framebuffer;