aboutsummaryrefslogtreecommitdiff
path: root/src/devices
diff options
context:
space:
mode:
authorRonald G. Minnich <rminnich@gmail.com>2009-04-06 16:03:53 +0000
committerStefan Reinauer <stepan@openbios.org>2009-04-06 16:03:53 +0000
commit662d52d24426b8fb8d11d455f8b30ae67a669ade (patch)
tree10b480968525b4c793b34b3c93547f6179073ce0 /src/devices
parentdf77f345e734e3a16548126ed0542615b6144ab6 (diff)
Add support for romfs to option rom loading.
Pretty simple: Find the rom in the romfs, if found, set dev properties so that the rest of the code works. At some point, we can remove some of the other code, i.e. the first else, and stop requiring people to do math. Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4077 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/pci_rom.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/devices/pci_rom.c b/src/devices/pci_rom.c
index 1d1024c9da..702f010eb5 100644
--- a/src/devices/pci_rom.c
+++ b/src/devices/pci_rom.c
@@ -27,6 +27,7 @@
#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)
{
@@ -34,7 +35,16 @@ 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 {