aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorBernhard Messerklinger <bernhard.messerklinger@br-automation.com>2020-05-18 12:33:33 +0200
committerBin Meng <bmeng.cn@gmail.com>2020-05-27 14:40:09 +0800
commit832fee864c6417efa9f39c41d23eb6c73da9e7b2 (patch)
tree3d344ae329ae13391dafe3bf6f2286b4b84de9b0 /arch
parentb032db2725dcd440811465f674e93f6c3a0a2573 (diff)
downloadu-boot-832fee864c6417efa9f39c41d23eb6c73da9e7b2.zip
u-boot-832fee864c6417efa9f39c41d23eb6c73da9e7b2.tar.gz
u-boot-832fee864c6417efa9f39c41d23eb6c73da9e7b2.tar.bz2
x86: apl: Only load VBT if CONFIG_HAVE_VBT is enabled
Only load VBT if it's present in the u-boot.rom. Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> (Tested on coral) Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/cpu/apollolake/fsp_s.c46
1 files changed, 25 insertions, 21 deletions
diff --git a/arch/x86/cpu/apollolake/fsp_s.c b/arch/x86/cpu/apollolake/fsp_s.c
index 3e303f8..53ed504 100644
--- a/arch/x86/cpu/apollolake/fsp_s.c
+++ b/arch/x86/cpu/apollolake/fsp_s.c
@@ -331,28 +331,32 @@ int fsps_update_config(struct udevice *dev, ulong rom_offset,
{
struct fsp_s_config *cfg = &upd->config;
struct apl_config *apl;
- struct binman_entry vbt;
- void *buf;
- int ret;
-
- ret = binman_entry_find("intel-vbt", &vbt);
- if (ret)
- return log_msg_ret("Cannot find VBT", ret);
- vbt.image_pos += rom_offset;
- buf = malloc(vbt.size);
- if (!buf)
- return log_msg_ret("Alloc VBT", -ENOMEM);
- /*
- * Load VBT before devicetree-specific config. This only supports
- * memory-mapped SPI at present.
- */
- bootstage_start(BOOTSTAGE_ID_ACCUM_MMAP_SPI, "mmap_spi");
- memcpy(buf, (void *)vbt.image_pos, vbt.size);
- bootstage_accum(BOOTSTAGE_ID_ACCUM_MMAP_SPI);
- if (*(u32 *)buf != VBT_SIGNATURE)
- return log_msg_ret("VBT signature", -EINVAL);
- cfg->graphics_config_ptr = (ulong)buf;
+ if (IS_ENABLED(CONFIG_HAVE_VBT)) {
+ struct binman_entry vbt;
+ void *vbt_buf;
+ int ret;
+
+ ret = binman_entry_find("intel-vbt", &vbt);
+ if (ret)
+ return log_msg_ret("Cannot find VBT", ret);
+ vbt.image_pos += rom_offset;
+ vbt_buf = malloc(vbt.size);
+ if (!vbt_buf)
+ return log_msg_ret("Alloc VBT", -ENOMEM);
+
+ /*
+ * Load VBT before devicetree-specific config. This only
+ * supports memory-mapped SPI at present.
+ */
+ bootstage_start(BOOTSTAGE_ID_ACCUM_MMAP_SPI, "mmap_spi");
+ memcpy(vbt_buf, (void *)vbt.image_pos, vbt.size);
+ bootstage_accum(BOOTSTAGE_ID_ACCUM_MMAP_SPI);
+ if (*(u32 *)vbt_buf != VBT_SIGNATURE)
+ return log_msg_ret("VBT signature", -EINVAL);
+
+ cfg->graphics_config_ptr = (ulong)vbt_buf;
+ }
apl = malloc(sizeof(*apl));
if (!apl)