All,

This is my first time submitting a patch to SeaBIOS for review/inclusion; I assume this list is the correct initial contact?

I have run into several situations where it is neccessary to execute only the relevant option ROMs contained in CBFS while ignoring any option ROM binary code present on PCI/PCIe devices; e.g. when the option ROM provided by the manufacturer is buggy but a FOSS replacement is available that works properly.

This patch adds an option to only execute option ROMs contained in CBFS. Tested on ASUS KFSN4-DRE with iPXE ROMs built in to CBFS; with this option set the on-board network ROMs were ignored while the iPXE ROMs executed normally.

--
Timothy Pearson
Raptor Engineering
+1 (415) 727-8645
http://www.raptorengineeringinc.com
diff --git a/src/Kconfig b/src/Kconfig
index 45ca59c..988bbb9 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -355,6 +355,17 @@ menu "BIOS interfaces"
         default y
         help
             Support finding and running option roms during POST.
+    config CBFS_OPTIONROMS_ONLY
+        depends on OPTIONROMS
+        bool "Only execute option ROMs stored in CBFS"
+        default "n"
+        help
+            Only execute option ROMs that are stored in CBFS.
+            Do not scan PCI bus for option ROMs.  This is useful
+            if one or more of your PCI devices crash/hang SeaBIOS
+            when executing their option ROMs, but you need to use
+            one or more option ROMs (such as SeaVGABIOS) that were
+            loaded into CBFS.
     config OPTIONROMS_DEPLOYED
         depends on OPTIONROMS && QEMU
         bool "Option roms are already at 0xc0000-0xf0000"
diff --git a/src/optionroms.c b/src/optionroms.c
index 93d9d2f..fbcb6ca 100644
--- a/src/optionroms.c
+++ b/src/optionroms.c
@@ -253,6 +253,9 @@ copy_rom(struct rom_header *rom)
 static struct rom_header *
 map_pcirom(struct pci_device *pci)
 {
+    if (CONFIG_CBFS_OPTIONROMS_ONLY)
+        return NULL;
+
     u16 bdf = pci->bdf;
     dprintf(6, "Attempting to map option rom on dev %02x:%02x.%x\n"
             , pci_bdf_to_bus(bdf), pci_bdf_to_dev(bdf), pci_bdf_to_fn(bdf));
_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
http://www.seabios.org/mailman/listinfo/seabios

Reply via email to