soc/intel/common: refactor locate_vbt and vbt_get

Instead of having all callers provide a region_device just for the
purpose of reading vbt.bin, let locate_vbt handle its entire life cycle,
simplifying the VBT access API.

Change-Id: Ib85e55164e217050b67674d020d17b2edf5ad14d
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/21897
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Patrick Georgi
2017-10-05 18:10:09 +02:00
parent cba7316c26
commit 9d3de2649f
6 changed files with 28 additions and 30 deletions

View File

@@ -49,7 +49,6 @@
#include "chip.h"
static void *vbt;
static struct region_device vbt_rdev;
static const char *soc_acpi_name(const struct device *dev)
{
@@ -317,7 +316,7 @@ static void soc_init(void *data)
struct global_nvs_t *gnvs;
/* Save VBT info and mapping */
vbt = vbt_get(&vbt_rdev);
vbt = vbt_get();
/* Snapshot the current GPIO IRQ polarities. FSP is setting a
* default policy that doesn't honor boards' requirements. */
@@ -354,9 +353,6 @@ static void soc_init(void *data)
static void soc_final(void *data)
{
if (vbt)
rdev_munmap(&vbt_rdev, vbt);
/* Disable global reset, just in case */
pmc_global_reset_enable(0);
/* Make sure payload/OS can't trigger global reset */