summaryrefslogtreecommitdiff
path: root/drivers/pci/pci_rom.c
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2017-04-21 07:24:46 -0700
committerBin Meng <bmeng.cn@gmail.com>2017-05-17 17:11:46 +0800
commit68769ebcbc892c85e9a1ffff09bbc6e4877f2d1f (patch)
tree69f4f802e1557b7584309e6c5639449ed5d8fe37 /drivers/pci/pci_rom.c
parent82a5648f5604709ae405b7faf23e68dc700b58d9 (diff)
x86: pci: Allow conditionally run VGA rom in S3
Introduce a new CONFIG_S3_VGA_ROM_RUN option so that U-Boot can bypass executing VGA roms in S3. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'drivers/pci/pci_rom.c')
-rw-r--r--drivers/pci/pci_rom.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c
index 57204c4f3f..75fb093337 100644
--- a/drivers/pci/pci_rom.c
+++ b/drivers/pci/pci_rom.c
@@ -35,8 +35,22 @@
#include <video_fb.h>
#include <linux/screen_info.h>
+#ifdef CONFIG_X86
+#include <asm/acpi_s3.h>
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
__weak bool board_should_run_oprom(struct udevice *dev)
{
+#if defined(CONFIG_X86) && defined(CONFIG_HAVE_ACPI_RESUME)
+ if (gd->arch.prev_sleep_state == ACPI_S3) {
+ if (IS_ENABLED(CONFIG_S3_VGA_ROM_RUN))
+ return true;
+ else
+ return false;
+ }
+#endif
+
return true;
}