soc/intel/common: Allow exporting the size of the VBT
Change-Id: Ib340aad846ea7cb61d650928b495efaa1fc2d641 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/26038 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
@@ -33,7 +33,7 @@ const char *mainboard_vbt_filename(void)
|
|||||||
static char vbt_data[8 * KiB];
|
static char vbt_data[8 * KiB];
|
||||||
static int vbt_data_used;
|
static int vbt_data_used;
|
||||||
|
|
||||||
void *locate_vbt(void)
|
void *locate_vbt(size_t *vbt_size)
|
||||||
{
|
{
|
||||||
uint32_t vbtsig = 0;
|
uint32_t vbtsig = 0;
|
||||||
|
|
||||||
@@ -48,6 +48,9 @@ void *locate_vbt(void)
|
|||||||
if (file_size == 0)
|
if (file_size == 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
if (vbt_size)
|
||||||
|
*vbt_size = file_size;
|
||||||
|
|
||||||
memcpy(&vbtsig, vbt_data, sizeof(vbtsig));
|
memcpy(&vbtsig, vbt_data, sizeof(vbtsig));
|
||||||
if (vbtsig != VBT_SIGNATURE) {
|
if (vbtsig != VBT_SIGNATURE) {
|
||||||
printk(BIOS_ERR, "Missing/invalid signature in VBT data file!\n");
|
printk(BIOS_ERR, "Missing/invalid signature in VBT data file!\n");
|
||||||
@@ -72,5 +75,5 @@ void *vbt_get(void)
|
|||||||
return NULL;
|
return NULL;
|
||||||
if (!display_init_required())
|
if (!display_init_required())
|
||||||
return NULL;
|
return NULL;
|
||||||
return locate_vbt();
|
return locate_vbt(NULL);
|
||||||
}
|
}
|
||||||
|
@@ -27,8 +27,11 @@
|
|||||||
*/
|
*/
|
||||||
const char *mainboard_vbt_filename(void);
|
const char *mainboard_vbt_filename(void);
|
||||||
|
|
||||||
/* locate vbt.bin file. Returns a pointer to its content. */
|
/*
|
||||||
void *locate_vbt(void);
|
* locate vbt.bin file. Returns a pointer to its content.
|
||||||
|
* If vbt_size is non-NULL, also return the vbt's size.
|
||||||
|
*/
|
||||||
|
void *locate_vbt(size_t *vbt_size);
|
||||||
/*
|
/*
|
||||||
* Returns VBT pointer and mapping after checking prerequisites for Pre OS
|
* Returns VBT pointer and mapping after checking prerequisites for Pre OS
|
||||||
* Graphics initialization
|
* Graphics initialization
|
||||||
|
Reference in New Issue
Block a user