Angel Pons | 0612b27 | 2020-04-05 15:46:56 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Andrey Petrov | 060b215 | 2016-05-13 15:27:42 -0700 | [diff] [blame] | 2 | |
Furquan Shaikh | 76cedd2 | 2020-05-02 10:24:23 -0700 | [diff] [blame] | 3 | #include <acpi/acpi.h> |
Abhay Kumar | ec2947f | 2016-07-14 18:43:54 -0700 | [diff] [blame] | 4 | #include <bootmode.h> |
Elyes Haouas | 8ed5835 | 2022-10-22 22:17:28 +0200 | [diff] [blame] | 5 | #include <drivers/intel/gma/opregion.h> |
| 6 | #include <stddef.h> |
Andrey Petrov | 060b215 | 2016-05-13 15:27:42 -0700 | [diff] [blame] | 7 | |
| 8 | #include "vbt.h" |
Abhay Kumar | ec2947f | 2016-07-14 18:43:54 -0700 | [diff] [blame] | 9 | |
Patrick Georgi | 9d3de26 | 2017-10-05 18:10:09 +0200 | [diff] [blame] | 10 | void *vbt_get(void) |
Abhay Kumar | ec2947f | 2016-07-14 18:43:54 -0700 | [diff] [blame] | 11 | { |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 12 | if (!CONFIG(RUN_FSP_GOP)) |
Nico Huber | 2e7f6cc | 2017-05-22 15:58:03 +0200 | [diff] [blame] | 13 | return NULL; |
| 14 | |
Abhay Kumar | ec2947f | 2016-07-14 18:43:54 -0700 | [diff] [blame] | 15 | /* 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 Georgi | 7651203 | 2018-05-03 19:15:00 +0200 | [diff] [blame] | 21 | return locate_vbt(NULL); |
Abhay Kumar | ec2947f | 2016-07-14 18:43:54 -0700 | [diff] [blame] | 22 | } |