1 // SPDX-License-Identifier: GPL-2.0+
12 DECLARE_GLOBAL_DATA_PTR;
14 static char *hob_type[] = {
29 static int do_hob(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
31 const struct hob_header *hdr;
36 char uuid[UUID_STR_LEN + 1];
38 hdr = gd->arch.hob_list;
40 printf("HOB list address: 0x%08x\n\n", (unsigned int)hdr);
42 printf("# | Address | Type | Len | ");
43 printf("%36s\n", "GUID");
44 printf("---|----------|-----------|------|-");
45 printf("------------------------------------\n");
46 while (!end_of_hob(hdr)) {
47 printf("%02x | %08x | ", i, (unsigned int)hdr);
49 if (type == HOB_TYPE_UNUSED)
51 else if (type == HOB_TYPE_EOH)
53 else if (type >= 0 && type <= ARRAY_SIZE(hob_type))
54 desc = hob_type[type];
57 printf("%-9s | %04x | ", desc, hdr->len);
59 if (type == HOB_TYPE_MEM_ALLOC || type == HOB_TYPE_RES_DESC ||
60 type == HOB_TYPE_GUID_EXT) {
61 guid = (efi_guid_t *)(hdr + 1);
62 uuid_bin_to_str(guid->b, uuid, UUID_STR_FORMAT_GUID);
65 printf("%36s", "Not Available");
68 hdr = get_next_hob(hdr);
75 U_BOOT_CMD(hob, 1, 1, do_hob,
76 "Print Hand-Off Block (HOB) information",