Load option roms from the "vgaroms/" CBFS directory during VGA scan.
return cbfs_copyfile(dst, maxlen, fname);
}
+// Copy the next file with the given prefix - starting at pos 'last'.
struct cbfs_file *
-cbfs_copy_gen_optionrom(void *dst, u32 maxlen, struct cbfs_file *file)
+cbfs_copyfile_prefix(void *dst, u32 maxlen, char *prefix
+ , struct cbfs_file *last)
{
if (! CONFIG_COREBOOT_FLASH)
return NULL;
- if (! file)
+ dprintf(3, "Searching CBFS for data file prefix %s\n", prefix);
+ struct cbfs_file *file;
+ if (! last)
file = cbfs_getfirst();
else
- file = cbfs_getnext(file);
+ file = cbfs_getnext(last);
+ int prefixlen = strlen(prefix);
for (; file; file = cbfs_getnext(file)) {
- if (memcmp("genroms/", file->filename, 8) != 0)
+ if (memcmp(prefix, file->filename, prefixlen) != 0)
continue;
u32 size = ntohl(file->len);
void *src = (void*)file + ntohl(file->offset);
// Find and deploy CBFS roms not associated with a device.
struct cbfs_file *tmp = NULL;
for (;;) {
- tmp = cbfs_copy_gen_optionrom(
- (void*)next_rom, BUILD_BIOS_ADDR - next_rom, tmp);
+ tmp = cbfs_copyfile_prefix(
+ (void*)next_rom, BUILD_BIOS_ADDR - next_rom, "genroms/", tmp);
if (!tmp)
break;
verifysize_optionrom((void*)next_rom, 0);
if (rom && !get_pnp_rom(rom))
// Call rom even if it isn't a pnp rom.
callrom(rom, OPTION_ROM_INITVECTOR, bdf);
+
+ // Find and deploy CBFS vga-style roms not associated with a device.
+ struct cbfs_file *tmp = NULL;
+ for (;;) {
+ tmp = cbfs_copyfile_prefix(
+ (void*)next_rom, BUILD_BIOS_ADDR - next_rom, "vgaroms/", tmp);
+ if (!tmp)
+ break;
+ rom = verifysize_optionrom((void*)next_rom, 0);
+ if (rom && !get_pnp_rom(rom))
+ // Call rom even if it isn't a pnp rom.
+ callrom(rom, OPTION_ROM_INITVECTOR, bdf);
+ }
}
dprintf(1, "Turning on vga console\n");
int cbfs_copy_optionrom(void *dst, u32 maxlen, u32 vendev);
void cbfs_run_payload(const char *filename);
struct cbfs_file;
-struct cbfs_file *cbfs_copy_gen_optionrom(void *dst, u32 maxlen
- , struct cbfs_file *file);
+struct cbfs_file *cbfs_copyfile_prefix(void *dst, u32 maxlen, char *prefix
+ , struct cbfs_file *last);
void coreboot_setup();
// vgahooks.c