summaryrefslogtreecommitdiff
path: root/src/device
diff options
context:
space:
mode:
authorRaul E Rangel <rrangel@chromium.org>2021-11-01 13:40:14 -0600
committerRaul Rangel <rrangel@chromium.org>2021-11-15 16:16:02 +0000
commita3811fe5e74575cc6173f8e2fc153c6f9884f89c (patch)
tree20d4e580ec6e35202a54af1431b64cd75fed20fb /src/device
parentb5811c0b487ac6e5a12b69c5c2db7c6839f48fc0 (diff)
device/pci_rom: Add vga_oprom_preload
This method will allow preloading the VGA_BIOS_FILE. By preloading the file, into cbfs_cache we reduce boot time. In the future we can also add support for loading the second VGA_BIOS_FILE and the DGPU VGA_BIOS_FILE. BUG=b:179699789 TEST=Boot guybrush to OS and verify 12 ms reduction in boot time Signed-off-by: Raul E Rangel <rrangel@chromium.org> Change-Id: Icb54fe3a942e9507ff6f1173ba5620a8f4ce6549 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56581 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Rob Barnes <robbarnes@google.com>
Diffstat (limited to 'src/device')
-rw-r--r--src/device/pci_rom.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/device/pci_rom.c b/src/device/pci_rom.c
index 895c5b7737..70ffe48b26 100644
--- a/src/device/pci_rom.c
+++ b/src/device/pci_rom.c
@@ -16,6 +16,21 @@
void __weak map_oprom_vendev_rev(u32 *vendev, u8 *rev) { return; }
u32 __weak map_oprom_vendev(u32 vendev) { return vendev; }
+void vga_oprom_preload(void)
+{
+/* The CONFIG_VGA_BIOS_ID symbol is only defined when VGA_BIOS is selected */
+#if CONFIG(VGA_BIOS)
+ const char name[] = "pci" CONFIG_VGA_BIOS_ID ".rom";
+
+ if (!CONFIG(CBFS_PRELOAD))
+ return;
+
+ printk(BIOS_DEBUG, "Preloading VGA ROM %s\n", name);
+
+ cbfs_preload(name);
+#endif
+}
+
static void *cbfs_boot_map_optionrom(uint16_t vendor, uint16_t device)
{
char name[17] = "pciXXXX,XXXX.rom";