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

@@ -23,11 +23,10 @@
enum cb_err init_igd_opregion(igd_opregion_t *opregion)
{
struct region_device vbt_rdev;
optionrom_vbt_t *vbt;
optionrom_vbt_t *ext_vbt;
vbt = locate_vbt(&vbt_rdev);
vbt = locate_vbt();
if (!vbt) {
printk(BIOS_ERR, "VBT couldn't be read\n");
@@ -64,7 +63,5 @@ enum cb_err init_igd_opregion(igd_opregion_t *opregion)
/* FIXME We just assume we're mobile for now */
opregion->header.mailboxes = MAILBOXES_MOBILE;
rdev_munmap(&vbt_rdev, vbt);
return CB_SUCCESS;
}