mirror of
https://xff.cz/git/u-boot/
synced 2025-09-30 06:51:28 +02:00
x86: apl: Use memory-mapped access for VBT
Use the new binman memory-mapping function to access the VBT, to simplify the code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
@@ -36,29 +36,20 @@ int fsps_update_config(struct udevice *dev, ulong rom_offset,
|
|||||||
ofnode node;
|
ofnode node;
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_HAVE_VBT)) {
|
if (IS_ENABLED(CONFIG_HAVE_VBT)) {
|
||||||
struct binman_entry vbt;
|
void *buf;
|
||||||
void *vbt_buf;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = binman_entry_find("intel-vbt", &vbt);
|
ret = binman_entry_map(ofnode_null(), "intel-vbt", &buf, NULL);
|
||||||
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;
|
if (*(u32 *)buf != VBT_SIGNATURE)
|
||||||
vbt_buf = malloc(vbt.size);
|
return log_msg_ret("VBT signature", -EINVAL);
|
||||||
if (!vbt_buf)
|
|
||||||
return log_msg_ret("Alloc VBT", -ENOMEM);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Load VBT before devicetree-specific config. This only
|
* Load VBT before devicetree-specific config. This only
|
||||||
* supports memory-mapped SPI at present.
|
* supports memory-mapped SPI at present.
|
||||||
*/
|
*/
|
||||||
bootstage_start(BOOTSTAGE_ID_ACCUM_MMAP_SPI, "mmap_spi");
|
cfg->graphics_config_ptr = (ulong)buf;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
node = dev_read_subnode(dev, "fsp-s");
|
node = dev_read_subnode(dev, "fsp-s");
|
||||||
|
@@ -32,6 +32,7 @@ int fsp_silicon_init(bool s3wake, bool use_spi_flash)
|
|||||||
&rom_offset);
|
&rom_offset);
|
||||||
if (ret)
|
if (ret)
|
||||||
return log_msg_ret("locate FSP", ret);
|
return log_msg_ret("locate FSP", ret);
|
||||||
|
binman_set_rom_offset(rom_offset);
|
||||||
gd->arch.fsp_s_hdr = hdr;
|
gd->arch.fsp_s_hdr = hdr;
|
||||||
|
|
||||||
/* Copy over the default config */
|
/* Copy over the default config */
|
||||||
|
Reference in New Issue
Block a user