<p>Patrick Georgi has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/21724">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">soc/intel/common: Allow overriding CBFS filename of VBT<br><br>When reusing the same image across multiple devices, they sometimes need<br>different VBTs, so provide a hook for mainboard code to specify which<br>file is required.<br><br>Change-Id: Ic7865dc0e0c9ea3077b749d9d0482079877e9c4f<br>Signed-off-by: Patrick Georgi <pgeorgi@google.com><br>---<br>M src/soc/intel/common/vbt.c<br>M src/soc/intel/common/vbt.h<br>2 files changed, 20 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/21724/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/soc/intel/common/vbt.c b/src/soc/intel/common/vbt.c<br>index 315459b..287b182 100644<br>--- a/src/soc/intel/common/vbt.c<br>+++ b/src/soc/intel/common/vbt.c<br>@@ -17,17 +17,27 @@<br> #include <console/console.h><br> #include <arch/acpi.h><br> #include <bootmode.h><br>+#include <string.h><br> <br> #include "vbt.h"<br> <br> #define VBT_SIGNATURE 0x54425624<br>+<br>+__attribute__((weak))<br>+void mainboard_vbt_filename(char *filename)<br>+{<br>+        snprintf(filename, 32, "vbt.bin");<br>+}<br> <br> enum cb_err locate_vbt(struct region_device *rdev)<br> {<br>  uint32_t vbtsig = 0;<br>  struct cbfsf file_desc;<br> <br>-   if (cbfs_boot_locate(&file_desc, "vbt.bin", NULL) < 0) {<br>+    char filename[32];<br>+   mainboard_vbt_filename(filename);<br>+<br>+ if (cbfs_boot_locate(&file_desc, filename, NULL) < 0) {<br>                printk(BIOS_ERR, "Could not locate a VBT file in in CBFS\n");<br>               return CB_ERR;<br>        }<br>diff --git a/src/soc/intel/common/vbt.h b/src/soc/intel/common/vbt.h<br>index 9a02e6a..7a7a461 100644<br>--- a/src/soc/intel/common/vbt.h<br>+++ b/src/soc/intel/common/vbt.h<br>@@ -19,6 +19,15 @@<br> #include <commonlib/region.h><br> #include <types.h><br> <br>+/*<br>+ * Returns the CBFS filename of the VBT blob in "filename", which is defined<br>+ * to have space for at least 32 bytes (incl. NUL termination).<br>+ *<br>+ * The default implementation returns "vbt.bin", but other implementations can<br>+ * override this.<br>+ */<br>+void mainboard_vbt_filename(char *filename);<br>+<br> /* locate .vbt file */<br> enum cb_err locate_vbt(struct region_device *rdev);<br> /*<br></pre><p>To view, visit <a href="https://review.coreboot.org/21724">change 21724</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/21724"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ic7865dc0e0c9ea3077b749d9d0482079877e9c4f </div>
<div style="display:none"> Gerrit-Change-Number: 21724 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Patrick Georgi <pgeorgi@google.com> </div>