#include <device/pci_ids.h>
#include <device/pci_ops.h>
#include <string.h>
+#include <romfs.h>
struct rom_header * pci_rom_probe(struct device *dev)
{
struct rom_header *rom_header;
struct pci_data *rom_data;
- if (dev->on_mainboard) {
+ if (CONFIG_ROMFS) {
+ rom_address = (unsigned long) romfs_load_optionrom(dev->vendor, dev->device, NULL);
+ /* if it's in FLASH, then it's as if dev->on_mainboard was true */
+ dev->on_mainboard = 1;
+ /* and we might as well set the address correctly */
+ dev->rom_address = rom_address;
+ } else if (dev->on_mainboard) {
+ /* this is here as a legacy path. We hope it goes away soon. Users should not have to
+ * compute the ROM address at build time!
+ */
// in case some device PCI_ROM_ADDRESS can not be set or readonly
rom_address = dev->rom_address;
} else {