2014-12-12 13:05:32 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <command.h>
|
|
|
|
#include <linux/compiler.h>
|
2015-01-28 05:13:36 +00:00
|
|
|
#include <asm/fsp/fsp_support.h>
|
2014-12-12 13:05:32 +00:00
|
|
|
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
|
|
|
static char *hob_type[] = {
|
|
|
|
"reserved",
|
|
|
|
"Hand-off",
|
|
|
|
"Memory Allocation",
|
|
|
|
"Resource Descriptor",
|
|
|
|
"GUID Extension",
|
2014-12-17 07:50:49 +00:00
|
|
|
"Firmware Volume",
|
2014-12-12 13:05:32 +00:00
|
|
|
"CPU",
|
|
|
|
"Memory Pool",
|
|
|
|
"reserved",
|
2014-12-17 07:50:49 +00:00
|
|
|
"Firmware Volume 2",
|
2014-12-12 13:05:32 +00:00
|
|
|
"Load PEIM Unused",
|
|
|
|
"UEFI Capsule",
|
|
|
|
};
|
|
|
|
|
|
|
|
int do_hob(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|
|
|
{
|
2014-12-30 08:02:05 +00:00
|
|
|
const struct hob_header *hdr;
|
2015-01-06 06:04:36 +00:00
|
|
|
uint type;
|
2014-12-12 13:05:32 +00:00
|
|
|
char *desc;
|
|
|
|
int i = 0;
|
|
|
|
|
2014-12-30 08:02:05 +00:00
|
|
|
hdr = gd->arch.hob_list;
|
2014-12-12 13:05:32 +00:00
|
|
|
|
2014-12-30 08:02:05 +00:00
|
|
|
printf("HOB list address: 0x%08x\n\n", (unsigned int)hdr);
|
2014-12-12 13:05:32 +00:00
|
|
|
|
|
|
|
printf("No. | Address | Type | Length in Bytes\n");
|
|
|
|
printf("----|----------|---------------------|----------------\n");
|
2014-12-30 08:02:05 +00:00
|
|
|
while (!end_of_hob(hdr)) {
|
|
|
|
printf("%-3d | %08x | ", i, (unsigned int)hdr);
|
2015-01-06 06:04:36 +00:00
|
|
|
type = hdr->type;
|
2014-12-12 13:05:32 +00:00
|
|
|
if (type == HOB_TYPE_UNUSED)
|
|
|
|
desc = "*Unused*";
|
|
|
|
else if (type == HOB_TYPE_EOH)
|
2014-12-17 07:50:49 +00:00
|
|
|
desc = "*END OF HOB*";
|
2014-12-12 13:05:32 +00:00
|
|
|
else if (type >= 0 && type <= ARRAY_SIZE(hob_type))
|
|
|
|
desc = hob_type[type];
|
|
|
|
else
|
2014-12-17 07:50:49 +00:00
|
|
|
desc = "*Invalid Type*";
|
2015-01-06 06:04:36 +00:00
|
|
|
printf("%-19s | %-15d\n", desc, hdr->len);
|
2014-12-30 08:02:05 +00:00
|
|
|
hdr = get_next_hob(hdr);
|
2014-12-12 13:05:32 +00:00
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
U_BOOT_CMD(
|
|
|
|
hob, 1, 1, do_hob,
|
2014-12-17 07:50:49 +00:00
|
|
|
"print Firmware Support Package (FSP) Hand-Off Block information",
|
2014-12-12 13:05:32 +00:00
|
|
|
""
|
|
|
|
);
|