Some changes for option roms:

- don't make users pick the name. Names for option roms are in the v3-defined
format of pci%04x,%04x.rom with the vendor and device id filling in the 
%04x. 
- users pass in vendor and device id. 
- users pass in a dest. If the dest is 0, the address of the ROM image in 
FLASH is returned. If the address is non-zero, then the decmpressor is called,
and it will make sure the ROM image is copied to the destination (even 
in the uncompressed case).

move qemu over to always using ROMFS

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Patrick Georgi <patrick.georgi@coresystems.de>


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4078 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Ronald G. Minnich 2009-04-06 20:38:34 +00:00
parent 662d52d244
commit 308312ce6c
3 changed files with 19 additions and 11 deletions

View File

@ -31,32 +31,40 @@
struct rom_header * pci_rom_probe(struct device *dev) struct rom_header * pci_rom_probe(struct device *dev)
{ {
unsigned long rom_address; unsigned long rom_address = 0;
struct rom_header *rom_header; struct rom_header *rom_header;
struct pci_data *rom_data; struct pci_data *rom_data;
if (CONFIG_ROMFS) { if (CONFIG_ROMFS) {
rom_address = (unsigned long) romfs_load_optionrom(dev->vendor, dev->device, NULL); void *v;
/* if it's in FLASH, then it's as if dev->on_mainboard was true */ /* if it's in FLASH, then it's as if dev->on_mainboard was true */
dev->on_mainboard = 1; v = romfs_load_optionrom(dev->vendor, dev->device, NULL);
/* and we might as well set the address correctly */ printk_debug("In cbfs, rom address for %s = %lx\n",
dev->rom_address = rom_address; dev_path(dev), rom_address);
} else if (dev->on_mainboard) { if (v) {
dev->rom_address = v;
dev->on_mainboard = 1;
}
}
if (dev->on_mainboard) {
/* this is here as a legacy path. We hope it goes away soon. Users should not have to /* 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! * compute the ROM address at build time!
*/ */
// in case some device PCI_ROM_ADDRESS can not be set or readonly // in case some device PCI_ROM_ADDRESS can not be set or readonly
rom_address = dev->rom_address; rom_address = dev->rom_address;
printk_debug("On mainboard, rom address for %s = %lx\n",
dev_path(dev), rom_address);
} else { } else {
rom_address = pci_read_config32(dev, PCI_ROM_ADDRESS); rom_address = pci_read_config32(dev, PCI_ROM_ADDRESS);
printk_debug("On card, rom address for %s = %lx\n",
dev_path(dev), rom_address);
} }
if (rom_address == 0x00000000 || rom_address == 0xffffffff) { if (rom_address == 0x00000000 || rom_address == 0xffffffff) {
return NULL; return NULL;
} }
printk_debug("rom address for %s = %lx\n", dev_path(dev), rom_address);
if(!dev->on_mainboard) { if(!dev->on_mainboard) {
/* enable expansion ROM address decoding */ /* enable expansion ROM address decoding */
pci_write_config32(dev, PCI_ROM_ADDRESS, pci_write_config32(dev, PCI_ROM_ADDRESS,

View File

@ -49,7 +49,7 @@ uses CONFIG_ROMFS
default CONFIG_CONSOLE_SERIAL8250=1 default CONFIG_CONSOLE_SERIAL8250=1
default DEFAULT_CONSOLE_LOGLEVEL=8 default DEFAULT_CONSOLE_LOGLEVEL=8
default MAXIMUM_CONSOLE_LOGLEVEL=8 default MAXIMUM_CONSOLE_LOGLEVEL=8
default CONFIG_ROMFS=0 default CONFIG_ROMFS=1
## ROM_SIZE is the size of boot ROM that this board will use. ## ROM_SIZE is the size of boot ROM that this board will use.
default ROM_SIZE = 256*1024 default ROM_SIZE = 256*1024

View File

@ -10,12 +10,12 @@ option CC="gcc -m32"
option HAVE_PIRQ_TABLE=1 option HAVE_PIRQ_TABLE=1
option IRQ_SLOT_COUNT=6 option IRQ_SLOT_COUNT=6
romimage "image" romimage "normal"
option ROM_IMAGE_SIZE=0x10000 option ROM_IMAGE_SIZE=0x10000
option COREBOOT_EXTRA_VERSION="-GRUB2" option COREBOOT_EXTRA_VERSION="-GRUB2"
# payload /home/stepan/core.img # payload /home/stepan/core.img
payload ../payload.elf payload ../payload.elf
end end
buildrom ./coreboot.rom ROM_SIZE "image" buildrom ./coreboot.rom ROM_SIZE "normal"