<p>Matt DeVillier has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/27169">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">drivers/fsp1_1: fix VBT Loading by using GMA common function<br><br>Commit 77034fa [intel/common: compress VBT] compressed vbt.bin in<br>CBFS, but only changed the loader in soc/intel/common, forgetting<br>the separate one used by FSP 1.0.  As the soc/intel/common loader<br>has now been rolled into the one in drivers/intel/gma, replace the<br>VBT loader used by FSP 1.1 with the GMA one.<br><br>Test: build/boot google/chell, observe display initialized prior<br>to OS load, no FSP warning in cbmem console due to invalid VBT signature.<br><br>Change-Id: Iba882ee4d9e83dcd88bdf7dd2f5591f66005a3fe<br>Signed-off-by: Matt DeVillier <matt.devillier@gmail.com><br>---<br>D src/drivers/intel/fsp1_1/include/fsp/gop.h<br>M src/drivers/intel/fsp1_1/vbt.c<br>2 files changed, 8 insertions(+), 63 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/69/27169/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/drivers/intel/fsp1_1/include/fsp/gop.h b/src/drivers/intel/fsp1_1/include/fsp/gop.h</span><br><span>deleted file mode 100644</span><br><span>index 66c8a3c..0000000</span><br><span>--- a/src/drivers/intel/fsp1_1/include/fsp/gop.h</span><br><span>+++ /dev/null</span><br><span>@@ -1,23 +0,0 @@</span><br><span style="color: hsl(0, 100%, 40%);">-/*</span><br><span style="color: hsl(0, 100%, 40%);">- * This file is part of the coreboot project.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * Copyright (C) 2015 Intel Corp.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * This program is free software; you can redistribute it and/or modify</span><br><span style="color: hsl(0, 100%, 40%);">- * it under the terms of the GNU General Public License as published by</span><br><span style="color: hsl(0, 100%, 40%);">- * the Free Software Foundation; version 2 of the License.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * This program is distributed in the hope that it will be useful,</span><br><span style="color: hsl(0, 100%, 40%);">- * but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(0, 100%, 40%);">- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span style="color: hsl(0, 100%, 40%);">- * GNU General Public License for more details.</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-#ifndef _FSP1_1_GOP_H_</span><br><span style="color: hsl(0, 100%, 40%);">-#define _FSP1_1_GOP_H_</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-#include <fsp/gma.h></span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-const optionrom_vbt_t *fsp_get_vbt(uint32_t *vbt_len);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-#endif /* _FSP1_1_GOP_H_ */</span><br><span>diff --git a/src/drivers/intel/fsp1_1/vbt.c b/src/drivers/intel/fsp1_1/vbt.c</span><br><span>index 92a4c91..4091340 100644</span><br><span>--- a/src/drivers/intel/fsp1_1/vbt.c</span><br><span>+++ b/src/drivers/intel/fsp1_1/vbt.c</span><br><span>@@ -17,47 +17,9 @@</span><br><span> #include <bootmode.h></span><br><span> #include <cbfs.h></span><br><span> #include <console/console.h></span><br><span style="color: hsl(0, 100%, 40%);">-#include <fsp/gop.h></span><br><span> #include <fsp/ramstage.h></span><br><span> #include <fsp/util.h></span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/* Reading VBT table from flash */</span><br><span style="color: hsl(0, 100%, 40%);">-const optionrom_vbt_t *fsp_get_vbt(uint32_t *vbt_len)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-        size_t vbt_size;</span><br><span style="color: hsl(0, 100%, 40%);">-        union {</span><br><span style="color: hsl(0, 100%, 40%);">-         const optionrom_vbt_t *data;</span><br><span style="color: hsl(0, 100%, 40%);">-            uint32_t *signature;</span><br><span style="color: hsl(0, 100%, 40%);">-    } vbt;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-  /* Locate the vbt file in cbfs */</span><br><span style="color: hsl(0, 100%, 40%);">-       vbt.data = cbfs_boot_map_with_leak("vbt.bin", CBFS_TYPE_RAW, &vbt_size);</span><br><span style="color: hsl(0, 100%, 40%);">-  if (!vbt.data) {</span><br><span style="color: hsl(0, 100%, 40%);">-                printk(BIOS_INFO,</span><br><span style="color: hsl(0, 100%, 40%);">-                       "FSP_INFO: VBT data file (vbt.bin) not found in CBFS");</span><br><span style="color: hsl(0, 100%, 40%);">-               return NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-    }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* Validate the vbt file */</span><br><span style="color: hsl(0, 100%, 40%);">-     if (*vbt.signature != VBT_SIGNATURE) {</span><br><span style="color: hsl(0, 100%, 40%);">-          printk(BIOS_WARNING,</span><br><span style="color: hsl(0, 100%, 40%);">-                    "FSP_WARNING: Invalid signature in VBT data file (vbt.bin)!\n");</span><br><span style="color: hsl(0, 100%, 40%);">-              return NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-    }</span><br><span style="color: hsl(0, 100%, 40%);">-       *vbt_len = vbt_size;</span><br><span style="color: hsl(0, 100%, 40%);">-    printk(BIOS_DEBUG, "FSP_INFO: VBT found at %p, 0x%08x bytes\n",</span><br><span style="color: hsl(0, 100%, 40%);">-               vbt.data, *vbt_len);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-#if IS_ENABLED(CONFIG_DISPLAY_VBT)</span><br><span style="color: hsl(0, 100%, 40%);">-  /* Display the vbt file contents */</span><br><span style="color: hsl(0, 100%, 40%);">-     printk(BIOS_DEBUG, "VBT Data:\n");</span><br><span style="color: hsl(0, 100%, 40%);">-    hexdump(vbt.data, *vbt_len);</span><br><span style="color: hsl(0, 100%, 40%);">-    printk(BIOS_DEBUG, "\n");</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* Return the pointer to the vbt file data */</span><br><span style="color: hsl(0, 100%, 40%);">-   return vbt.data;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(120, 100%, 40%);">+#include <drivers/intel/gma/opregion.h></span><br><span> </span><br><span> /* Locate VBT and pass it to FSP GOP */</span><br><span> void load_vbt(uint8_t s3_resume, SILICON_INIT_UPD *params)</span><br><span>@@ -70,9 +32,15 @@</span><br><span>           printk(BIOS_DEBUG, "S3 resume do not pass VBT to GOP\n");</span><br><span>  } else if (display_init_required()) {</span><br><span>                /* Get VBT data */</span><br><span style="color: hsl(0, 100%, 40%);">-              vbt_data = fsp_get_vbt(&vbt_len);</span><br><span style="color: hsl(120, 100%, 40%);">+         vbt_data = locate_vbt(&vbt_len);</span><br><span>                 if (vbt_data != NULL)</span><br><span>                        printk(BIOS_DEBUG, "Passing VBT to GOP\n");</span><br><span style="color: hsl(120, 100%, 40%);">+#if IS_ENABLED(CONFIG_DISPLAY_VBT)</span><br><span style="color: hsl(120, 100%, 40%);">+                     /* Display the vbt file contents */</span><br><span style="color: hsl(120, 100%, 40%);">+                   printk(BIOS_DEBUG, "VBT Data:\n");</span><br><span style="color: hsl(120, 100%, 40%);">+                  hexdump(vbt.data, *vbt_len);</span><br><span style="color: hsl(120, 100%, 40%);">+                  printk(BIOS_DEBUG, "\n");</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span>          else</span><br><span>                         printk(BIOS_DEBUG, "VBT not found!\n");</span><br><span>    } else {</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/27169">change 27169</a>. To unsubscribe, or for help writing mail filters, 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/27169"/><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: Iba882ee4d9e83dcd88bdf7dd2f5591f66005a3fe </div>
<div style="display:none"> Gerrit-Change-Number: 27169 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Matt DeVillier <matt.devillier@gmail.com> </div>