2 * Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
4 * SPDX-License-Identifier: GPL-2.0+
9 #include <linux/compiler.h>
10 #include <asm/fsp/fsp_support.h>
12 DECLARE_GLOBAL_DATA_PTR;
14 static char *hob_type[] = {
29 int do_hob(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
31 const struct hob_header *hdr;
36 hdr = gd->arch.hob_list;
38 printf("HOB list address: 0x%08x\n\n", (unsigned int)hdr);
40 printf("# | Address | Type | Len | ");
41 printf("%42s\n", "GUID");
42 printf("---|----------|-----------|------|-");
43 printf("------------------------------------------\n");
44 while (!end_of_hob(hdr)) {
45 printf("%-2d | %08x | ", i, (unsigned int)hdr);
47 if (type == HOB_TYPE_UNUSED)
49 else if (type == HOB_TYPE_EOH)
51 else if (type >= 0 && type <= ARRAY_SIZE(hob_type))
52 desc = hob_type[type];
55 printf("%-9s | %-4d | ", desc, hdr->len);
57 if (type == HOB_TYPE_MEM_ALLOC || type == HOB_TYPE_RES_DESC ||
58 type == HOB_TYPE_GUID_EXT) {
59 struct efi_guid *guid = (struct efi_guid *)(hdr + 1);
62 printf("%08x-%04x-%04x", guid->data1,
63 guid->data2, guid->data3);
64 for (j = 0; j < ARRAY_SIZE(guid->data4); j++)
65 printf("-%02x", guid->data4[j]);
67 printf("%42s", "Not Available");
70 hdr = get_next_hob(hdr);
79 "print Firmware Support Package (FSP) Hand-Off Block information",