blob: c01db665a1a9ea32b9617b0a911b03c7de6a3c36 [file] [log] [blame]
Angel Pons0612b272020-04-05 15:46:56 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Andrey Petrov060b2152016-05-13 15:27:42 -07002
Furquan Shaikh76cedd22020-05-02 10:24:23 -07003#include <acpi/acpi.h>
Abhay Kumarec2947f2016-07-14 18:43:54 -07004#include <bootmode.h>
Elyes Haouas8ed58352022-10-22 22:17:28 +02005#include <drivers/intel/gma/opregion.h>
6#include <stddef.h>
Andrey Petrov060b2152016-05-13 15:27:42 -07007
8#include "vbt.h"
Abhay Kumarec2947f2016-07-14 18:43:54 -07009
Patrick Georgi9d3de262017-10-05 18:10:09 +020010void *vbt_get(void)
Abhay Kumarec2947f2016-07-14 18:43:54 -070011{
Julius Wernercd49cce2019-03-05 16:53:33 -080012 if (!CONFIG(RUN_FSP_GOP))
Nico Huber2e7f6cc2017-05-22 15:58:03 +020013 return NULL;
14
Abhay Kumarec2947f2016-07-14 18:43:54 -070015 /* Normal mode and S3 resume path PEIM GFX init is not needed.
16 * Passing NULL as VBT will not make PEIM GFX to execute. */
17 if (acpi_is_wakeup_s3())
18 return NULL;
19 if (!display_init_required())
20 return NULL;
Patrick Georgi76512032018-05-03 19:15:00 +020021 return locate_vbt(NULL);
Abhay Kumarec2947f2016-07-14 18:43:54 -070022}