mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-25 14:56:03 +00:00
x86: Add a little more info to cbsysinfo
Show the number of records in the table and the total table size in bytes. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
parent
d560f7cae0
commit
db971a7587
3 changed files with 11 additions and 2 deletions
|
@ -138,6 +138,8 @@
|
||||||
* @rsdp: Pointer to ACPI RSDP table
|
* @rsdp: Pointer to ACPI RSDP table
|
||||||
* @unimpl_count: Number of entries in unimpl_map[]
|
* @unimpl_count: Number of entries in unimpl_map[]
|
||||||
* @unimpl: List of unimplemented IDs (bottom 8 bits only)
|
* @unimpl: List of unimplemented IDs (bottom 8 bits only)
|
||||||
|
* @table_size: Number of bytes taken up by the sysinfo table
|
||||||
|
* @rec_count: Number of records in the sysinfo table
|
||||||
*/
|
*/
|
||||||
struct sysinfo_t {
|
struct sysinfo_t {
|
||||||
unsigned int cpu_khz;
|
unsigned int cpu_khz;
|
||||||
|
@ -219,6 +221,8 @@ struct sysinfo_t {
|
||||||
void *rsdp;
|
void *rsdp;
|
||||||
u32 unimpl_count;
|
u32 unimpl_count;
|
||||||
u8 unimpl[SYSINFO_MAX_UNIMPL];
|
u8 unimpl[SYSINFO_MAX_UNIMPL];
|
||||||
|
uint table_size;
|
||||||
|
uint rec_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct sysinfo_t lib_sysinfo;
|
extern struct sysinfo_t lib_sysinfo;
|
||||||
|
|
|
@ -447,6 +447,8 @@ static int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
|
||||||
|
|
||||||
ptr += rec->size;
|
ptr += rec->size;
|
||||||
}
|
}
|
||||||
|
info->table_size += (void *)ptr - (void *)header;
|
||||||
|
info->rec_count += header->table_entries;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -462,6 +464,8 @@ int get_coreboot_info(struct sysinfo_t *info)
|
||||||
addr = locate_coreboot_table();
|
addr = locate_coreboot_table();
|
||||||
if (addr < 0)
|
if (addr < 0)
|
||||||
return addr;
|
return addr;
|
||||||
|
info->table_size = 0;
|
||||||
|
info->rec_count = 0;
|
||||||
ret = cb_parse_header((void *)addr, 0x1000, info);
|
ret = cb_parse_header((void *)addr, 0x1000, info);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
|
|
|
@ -190,8 +190,9 @@ static void show_table(struct sysinfo_t *info, bool verbose)
|
||||||
struct cb_serial *ser = info->serial;
|
struct cb_serial *ser = info->serial;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
printf("Coreboot table at %lx, decoded to %p",
|
printf("Coreboot table at %lx, size %x, records %x (dec %d), decoded to %p",
|
||||||
gd->arch.coreboot_table, info);
|
gd->arch.coreboot_table, info->table_size, info->rec_count,
|
||||||
|
info->rec_count, info);
|
||||||
if (info->header)
|
if (info->header)
|
||||||
printf(", forwarded to %p\n", info->header);
|
printf(", forwarded to %p\n", info->header);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
Loading…
Add table
Reference in a new issue