This patch adds a configuration menu for the VGA ROM, it also allow the creation of a PCI header so the ROM can be extracted from a PCI device.
Signed-off-by: Julian Pidancet julian.pidancet@gmail.com --- src/Kconfig | 35 +++++++++++++++++++++++++++++++++++ vgasrc/vga.c | 4 ---- vgasrc/vgaentry.S | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 80 insertions(+), 6 deletions(-)
diff --git a/src/Kconfig b/src/Kconfig index f8d245a..a6e11da 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -324,6 +324,41 @@ menu "BIOS Tables" Support generation of ACPI 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_PCI + bool "PCI ROM Headers" + default y + help + Build PCI ROM headers so the vga rom can be extracted from + a PCI device. + + config VGA_VID + depends on VGA_PCI + hex "Custom PCI Vendor ID" + default 0x0000 + help + Custom Vendor ID for the PCI ROM + + config VGA_DID + depends on VGA_PCI + hex "Custom PCI Device ID" + default 0x0000 + help + Custom Device ID for the PCI ROM +endmenu + menu "Debugging" config DEBUG_LEVEL int "Debug level" diff --git a/vgasrc/vga.c b/vgasrc/vga.c index b515d1d..b0d2598 100644 --- a/vgasrc/vga.c +++ b/vgasrc/vga.c @@ -17,10 +17,6 @@ #include "vgatables.h" // find_vga_entry
// XXX -#define CONFIG_VGA_BOCHS 0 -#define CONFIG_VGA_CIRRUS 0 - -// XXX #define DEBUG_VGA_POST 1 #define DEBUG_VGA_10 3
diff --git a/vgasrc/vgaentry.S b/vgasrc/vgaentry.S index fbfa9f7..6471928 100644 --- a/vgasrc/vgaentry.S +++ b/vgasrc/vgaentry.S @@ -12,15 +12,21 @@ .code16gcc #include "vgaccode.16.s"
+#include "config.h" // CONFIG_* #include "entryfuncs.S" // ENTRY_*
+ /**************************************************************** * Rom Header ****************************************************************/
.section .rom.header .global _rom_header, _rom_header_size, _rom_header_checksum +#ifdef CONFIG_VGA_PCI + .global _rom_pci_data +#endif + _rom_header: .word 0xaa55 _rom_header_size: @@ -29,9 +35,46 @@ _rom_header_entry: jmp _optionrom_entry _rom_header_checksum: .byte 0 -_rom_header_other: - .space 21 +_rom_header_rsrvd: + .space 17 +_rom_header_pcidata: +#ifdef CONFIG_VGA_PCI + .word _rom_pci_data +#else + .word 0 +#endif +_rom_header_pnpdata: + .word 0
+/**************************************************************** + * PCI Data + ****************************************************************/ +#ifdef CONFIG_PCIBIOS +_rom_pci_data: + .ascii "PCIR" +#if defined(CONFIG_VGA_VID) && defined(CONFIG_VGA_DID) + .word CONFIG_VGA_VID /* VendorID */ + .word CONFIG_VGA_DID /* DeviceID */ +#elif defined(CONFIG_VGA_CIRRUS) + .word 0x1013 + .word 0x00b8 +#elif defined(CONFIG_VGA_BOCHS) + .word 0x1234 + .word 0x1111 +#else +#error "Uknown PCI vendor or device ID" +#endif + .word 0x0 /* Reserved */ + .word 0x18 /* dlen */ + .byte 0x0 /* Revision */ + .byte 0x0 /* Class lo */ + .word 0x300 /* Class hi */ + .word 0x0 /* ilen */ + .word 0x1 /* Revision */ + .byte 0 /* Type */ + .byte 0x80 /* Indicator */ + .word 0x0 /* Reserved */ +#endif
/**************************************************************** * Entry points