Patrick Georgi has uploaded this change for review. ( https://review.coreboot.org/21724
Change subject: soc/intel/common: Allow overriding CBFS filename of VBT
......................................................................
soc/intel/common: Allow overriding CBFS filename of VBT
When reusing the same image across multiple devices, they sometimes need
different VBTs, so provide a hook for mainboard code to specify which
file is required.
Change-Id: Ic7865dc0e0c9ea3077b749d9d0482079877e9c4f
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
---
M src/soc/intel/common/vbt.c
M src/soc/intel/common/vbt.h
2 files changed, 20 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/21724/1
diff --git a/src/soc/intel/common/vbt.c b/src/soc/intel/common/vbt.c
index 315459b..287b182 100644
--- a/src/soc/intel/common/vbt.c
+++ b/src/soc/intel/common/vbt.c
@@ -17,17 +17,27 @@
#include <console/console.h>
#include <arch/acpi.h>
#include <bootmode.h>
+#include <string.h>
#include "vbt.h"
#define VBT_SIGNATURE 0x54425624
+
+__attribute__((weak))
+void mainboard_vbt_filename(char *filename)
+{
+ snprintf(filename, 32, "vbt.bin");
+}
enum cb_err locate_vbt(struct region_device *rdev)
{
uint32_t vbtsig = 0;
struct cbfsf file_desc;
- if (cbfs_boot_locate(&file_desc, "vbt.bin", NULL) < 0) {
+ char filename[32];
+ mainboard_vbt_filename(filename);
+
+ 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;
}
diff --git a/src/soc/intel/common/vbt.h b/src/soc/intel/common/vbt.h
index 9a02e6a..7a7a461 100644
--- a/src/soc/intel/common/vbt.h
+++ b/src/soc/intel/common/vbt.h
@@ -19,6 +19,15 @@
#include <commonlib/region.h>
#include <types.h>
+/*
+ * Returns the CBFS filename of the VBT blob in "filename", which is defined
+ * to have space for at least 32 bytes (incl. NUL termination).
+ *
+ * The default implementation returns "vbt.bin", but other implementations can
+ * override this.
+ */
+void mainboard_vbt_filename(char *filename);
+
/* locate .vbt file */
enum cb_err locate_vbt(struct region_device *rdev);
/*
--
To view, visit https://review.coreboot.org/21724
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic7865dc0e0c9ea3077b749d9d0482079877e9c4f
Gerrit-Change-Number: 21724
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Georgi <pgeorgi(a)google.com>