mirror of
https://xff.cz/git/u-boot/
synced 2025-09-26 21:11:18 +02:00
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>
This commit is contained in:
committed by
Bin Meng
parent
b032db2725
commit
832fee864c
@@ -331,28 +331,32 @@ int fsps_update_config(struct udevice *dev, ulong rom_offset,
|
|||||||
{
|
{
|
||||||
struct fsp_s_config *cfg = &upd->config;
|
struct fsp_s_config *cfg = &upd->config;
|
||||||
struct apl_config *apl;
|
struct apl_config *apl;
|
||||||
|
|
||||||
|
if (IS_ENABLED(CONFIG_HAVE_VBT)) {
|
||||||
struct binman_entry vbt;
|
struct binman_entry vbt;
|
||||||
void *buf;
|
void *vbt_buf;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = binman_entry_find("intel-vbt", &vbt);
|
ret = binman_entry_find("intel-vbt", &vbt);
|
||||||
if (ret)
|
if (ret)
|
||||||
return log_msg_ret("Cannot find VBT", ret);
|
return log_msg_ret("Cannot find VBT", ret);
|
||||||
vbt.image_pos += rom_offset;
|
vbt.image_pos += rom_offset;
|
||||||
buf = malloc(vbt.size);
|
vbt_buf = malloc(vbt.size);
|
||||||
if (!buf)
|
if (!vbt_buf)
|
||||||
return log_msg_ret("Alloc VBT", -ENOMEM);
|
return log_msg_ret("Alloc VBT", -ENOMEM);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Load VBT before devicetree-specific config. This only supports
|
* Load VBT before devicetree-specific config. This only
|
||||||
* memory-mapped SPI at present.
|
* supports memory-mapped SPI at present.
|
||||||
*/
|
*/
|
||||||
bootstage_start(BOOTSTAGE_ID_ACCUM_MMAP_SPI, "mmap_spi");
|
bootstage_start(BOOTSTAGE_ID_ACCUM_MMAP_SPI, "mmap_spi");
|
||||||
memcpy(buf, (void *)vbt.image_pos, vbt.size);
|
memcpy(vbt_buf, (void *)vbt.image_pos, vbt.size);
|
||||||
bootstage_accum(BOOTSTAGE_ID_ACCUM_MMAP_SPI);
|
bootstage_accum(BOOTSTAGE_ID_ACCUM_MMAP_SPI);
|
||||||
if (*(u32 *)buf != VBT_SIGNATURE)
|
if (*(u32 *)vbt_buf != VBT_SIGNATURE)
|
||||||
return log_msg_ret("VBT signature", -EINVAL);
|
return log_msg_ret("VBT signature", -EINVAL);
|
||||||
cfg->graphics_config_ptr = (ulong)buf;
|
|
||||||
|
cfg->graphics_config_ptr = (ulong)vbt_buf;
|
||||||
|
}
|
||||||
|
|
||||||
apl = malloc(sizeof(*apl));
|
apl = malloc(sizeof(*apl));
|
||||||
if (!apl)
|
if (!apl)
|
||||||
|
Reference in New Issue
Block a user