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@google.com>
Reviewed-on: https://review.coreboot.org/21724
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Patrick Georgi 2017-09-27 18:33:33 +02:00
parent a06f55b8e4
commit f614277099
2 changed files with 17 additions and 1 deletions

View file

@ -22,12 +22,20 @@
#define VBT_SIGNATURE 0x54425624
__attribute__((weak))
const char *mainboard_vbt_filename(void)
{
return "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) {
const char *filename = mainboard_vbt_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;
}

View file

@ -19,6 +19,14 @@
#include <commonlib/region.h>
#include <types.h>
/*
* Returns the CBFS filename of the VBT blob.
*
* The default implementation returns "vbt.bin", but other implementations can
* override this.
*/
const char *mainboard_vbt_filename(void);
/* locate .vbt file */
enum cb_err locate_vbt(struct region_device *rdev);
/*