summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/drivers/intel/fsp2_0/graphics.c3
-rw-r--r--src/soc/intel/common/opregion.c7
-rw-r--r--src/soc/intel/common/vbt.c17
-rw-r--r--src/soc/intel/common/vbt.h4
4 files changed, 9 insertions, 22 deletions
diff --git a/src/drivers/intel/fsp2_0/graphics.c b/src/drivers/intel/fsp2_0/graphics.c
index 84f2d6dc21..e2ff7cf4f8 100644
--- a/src/drivers/intel/fsp2_0/graphics.c
+++ b/src/drivers/intel/fsp2_0/graphics.c
@@ -99,8 +99,7 @@ uintptr_t fsp_load_vbt(void)
struct region_device rdev;
void *vbt_data = NULL;
- if (locate_vbt(&rdev) != CB_ERR)
- vbt_data = rdev_mmap_full(&rdev);
+ vbt_data = locate_vbt(&rdev);
if (vbt_data == NULL)
printk(BIOS_NOTICE, "Could not locate a VBT file in CBFS\n");
diff --git a/src/soc/intel/common/opregion.c b/src/soc/intel/common/opregion.c
index 6cb388ce82..1eb8609ada 100644
--- a/src/soc/intel/common/opregion.c
+++ b/src/soc/intel/common/opregion.c
@@ -27,12 +27,7 @@ enum cb_err init_igd_opregion(igd_opregion_t *opregion)
optionrom_vbt_t *vbt;
optionrom_vbt_t *ext_vbt;
- if (locate_vbt(&vbt_rdev) == CB_ERR) {
- printk(BIOS_ERR, "VBT not found\n");
- return CB_ERR;
- };
-
- vbt = rdev_mmap_full(&vbt_rdev);
+ vbt = locate_vbt(&vbt_rdev);
if (!vbt) {
printk(BIOS_ERR, "VBT couldn't be read\n");
diff --git a/src/soc/intel/common/vbt.c b/src/soc/intel/common/vbt.c
index e3360dcf83..c36f797c9b 100644
--- a/src/soc/intel/common/vbt.c
+++ b/src/soc/intel/common/vbt.c
@@ -28,7 +28,7 @@ const char *mainboard_vbt_filename(void)
return "vbt.bin";
}
-enum cb_err locate_vbt(struct region_device *rdev)
+void *locate_vbt(struct region_device *rdev)
{
uint32_t vbtsig = 0;
struct cbfsf file_desc;
@@ -37,7 +37,7 @@ enum cb_err locate_vbt(struct region_device *rdev)
if (cbfs_boot_locate(&file_desc, filename, NULL) < 0) {
printk(BIOS_ERR, "Could not locate a VBT file in in CBFS\n");
- return CB_ERR;
+ return NULL;
}
cbfs_file_data(rdev, &file_desc);
@@ -45,16 +45,14 @@ enum cb_err locate_vbt(struct region_device *rdev)
if (vbtsig != VBT_SIGNATURE) {
printk(BIOS_ERR, "Missing/invalid signature in VBT data file!\n");
- return CB_ERR;
+ return NULL;
}
- return CB_SUCCESS;
+ return rdev_mmap_full(rdev);
}
void *vbt_get(struct region_device *rdev)
{
- void *vbt_data;
-
if (!IS_ENABLED(CONFIG_RUN_FSP_GOP))
return NULL;
@@ -64,10 +62,5 @@ void *vbt_get(struct region_device *rdev)
return NULL;
if (!display_init_required())
return NULL;
- if (locate_vbt(rdev) != CB_ERR) {
- vbt_data = rdev_mmap_full(rdev);
- return vbt_data;
- } else {
- return NULL;
- }
+ return locate_vbt(rdev);
}
diff --git a/src/soc/intel/common/vbt.h b/src/soc/intel/common/vbt.h
index 7b65d74a4d..2d52fea6ed 100644
--- a/src/soc/intel/common/vbt.h
+++ b/src/soc/intel/common/vbt.h
@@ -27,8 +27,8 @@
*/
const char *mainboard_vbt_filename(void);
-/* locate .vbt file */
-enum cb_err locate_vbt(struct region_device *rdev);
+/* locate vbt.bin file. Returns a pointer to its content. */
+void *locate_vbt(struct region_device *rdev);
/*
* Returns VBT pointer and mapping after checking prerequisites for Pre OS
* Graphics initialization