Add the GX2 functionality.
Improve Kconfig VGA options.
Conditionally build VGA bios rom if selected in Kconfig.
--- Makefile
+++ Makefile
@@ -10,6 +10,12 @@
# Output directory
OUT=out/
+CONFIG_SHELL := sh
+DOTCONFIG ?= .config
+KCONFIG_CONFIG = $(DOTCONFIG)
+export KCONFIG_CONFIG
+HAVE_DOTCONFIG := $(wildcard $(DOTCONFIG))
+
# Source files
SRCBOTH=misc.c stacks.c pmm.c output.c util.c block.c floppy.c ata.c mouse.c \
kbd.c pci.c serial.c clock.c pic.c cdrom.c ps2port.c smp.c resume.c \
@@ -47,7 +53,13 @@
$(call cc-option,$(CC),--param large-stack-frame=4,-fno-inline)
CFLAGS16 = $(CFLAGS16INC) -g -fomit-frame-pointer
+include $(HAVE_DOTCONFIG)
+
+ifneq ($(CONFIG_NO_VGABIOS),y)
+all: $(OUT) $(OUT)bios.bin $(OUT)vgabios.bin
+else
all: $(OUT) $(OUT)bios.bin
+endif
# Run with "make V=1" to see the actual compile commands
ifdef V
@@ -171,7 +183,14 @@
# VGA src files
SRCVGA=src/output.c src/util.c vgasrc/vgabios.c vgasrc/vgafb.c \
vgasrc/vgatables.c vgasrc/vgafonts.c vgasrc/vbe.c \
- vgasrc/stdvga.c vgasrc/clext.c vgasrc/bochsvga.c vgasrc/geodevga.c
+ vgasrc/stdvga.c vgasrc/clext.c vgasrc/bochsvga.c
+
+ifeq ($(CONFIG_VGA_GEODEGX2),y)
+SRCVGA += vgasrc/geodevga.c
+endif
+ifeq ($(CONFIG_VGA_GEODELX),y)
+SRCVGA += vgasrc/geodevga.c
+endif
CFLAGS16VGA = $(CFLAGS16INC) -g -Isrc
--- src/Kconfig
+++ src/Kconfig
@@ -324,25 +324,38 @@
Support generation of ACPI tables.
endmenu
-menu "VGA ROM"
+choice
+ prompt "Extra VGABIOS"
+ default NONE
+
+ config NO_VGABIOS
+ bool "NONE"
+
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
+ Build support for Bochs DISPI interface.
+
+ config VGA_GEODEGX2
+ depends on COREBOOT
+ bool "GeodeGX2 interface VGA BIOS"
+ help
+ Build support for Geode GX2 vga.
config VGA_GEODELX
+ depends on COREBOOT
bool "GeodeLX interface VGA BIOS"
- default n
help
- Build support for Geode vga
+ Build support for Geode LX vga.
+endchoice
+menu "VGA_PCI"
+ depends on !NO_VGABIOS
config VGA_PCI
bool "PCI ROM Headers"
default y
@@ -355,6 +368,7 @@
hex "PCI Vendor ID"
default 0x1013 if VGA_CIRRUS
default 0x1234 if VGA_BOCHS
+ default 0x100b if VGA_GEODEGX2
default 0x1022 if VGA_GEODELX
default 0x0000
help
@@ -365,6 +379,7 @@
hex "PCI Device ID"
default 0x00b8 if VGA_CIRRUS
default 0x1111 if VGA_BOCHS
+ default 0x0030 if VGA_GEODEGX2
default 0x2081 if VGA_GEODELX
default 0x0000
help
--- vgasrc/geodevga.c
+++ vgasrc/geodevga.c
@@ -87,7 +87,12 @@
int ret=0;
union u64_u32_u val;
+#if (CONFIG_VGA_GEODEGX2)
+ val=geode_msrRead(GLIU0_P2D_BM_4);
+#endif
+#if (CONFIG_VGA_GEODELX)
val=geode_msrRead(MSR_GLIU0_BASE4);
+#endif
if (val.lo != 0x0A0fffe0)
ret|=1;
--- vgasrc/geodevga.h
+++ vgasrc/geodevga.h
@@ -9,6 +9,8 @@
#ifndef GEODEVGA_H
#define GEODEVGA_H
+#include "config.h" // CONFIG_*
+
#define VRC_INDEX 0xAC1C // Index register
#define VRC_DATA 0xAC1E // Data register
#define VR_UNLOCK 0xFC53 // Virtual register unlock code
@@ -37,12 +39,17 @@
/* LX MSRs */
#define MSR_GLIU0 (1 << 28)
-#define MSR_GLIU0_BASE4 (MSR_GLIU0 + 0x23)
-#define GLIU0_P2D_BM_4 (MSR_GLIU0 + 0x24)
+#define MSR_GLIU0_BASE4 (MSR_GLIU0 + 0x23) /* LX */
+#define GLIU0_P2D_BM_4 (MSR_GLIU0 + 0x24) /* GX2 */
#define GLIU0_IOD_BM_0 (MSR_GLIU0 + 0xE0)
#define GLIU0_IOD_BM_1 (MSR_GLIU0 + 0xE1)
#define DC_SPARE 0x80000011
-#define VP_MSR_CONFIG 0x48002001
+#if (CONFIG_VGA_GEODEGX2)
+ #define VP_MSR_CONFIG 0xc0002001 /* GX2 */
+#endif
+#if (CONFIG_VGA_GEODELX)
+ #define VP_MSR_CONFIG 0x48002001 /* LX */
+#endif
/* DC REG OFFSET */
#define DC_UNLOCK 0x0
--- vgasrc/vgahw.h
+++ vgasrc/vgahw.h
@@ -22,6 +22,8 @@
return clext_init();
if (CONFIG_VGA_BOCHS)
return bochsvga_init();
+ if (CONFIG_VGA_GEODEGX2)
+ return geodevga_init();
if (CONFIG_VGA_GEODELX)
return geodevga_init();
return stdvga_init();
_______________________________________________
SeaBIOS mailing list
[email protected]
http://www.seabios.org/mailman/listinfo/seabios