diff mbox

[U-Boot,2/4] x86: fsp: Print GUID whenever applicable in the hob command output

Message ID 1444466879-24281-2-git-send-email-bmeng.cn@gmail.com
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Bin Meng Oct. 10, 2015, 8:47 a.m. UTC
When examining a HOB, it's useful to see which GUID this HOB
belongs to. Add GUID output in the hob command to aid this.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 arch/x86/lib/cmd_hob.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

Comments

Simon Glass Oct. 18, 2015, 8:26 p.m. UTC | #1
On 10 October 2015 at 02:47, Bin Meng <bmeng.cn@gmail.com> wrote:
> When examining a HOB, it's useful to see which GUID this HOB
> belongs to. Add GUID output in the hob command to aid this.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  arch/x86/lib/cmd_hob.c | 22 +++++++++++++++++++---
>  1 file changed, 19 insertions(+), 3 deletions(-)

Acked-by: Simon Glass <sjg@chromium.org>
Simon Glass Oct. 18, 2015, 9:38 p.m. UTC | #2
On 18 October 2015 at 14:26, Simon Glass <sjg@chromium.org> wrote:
> On 10 October 2015 at 02:47, Bin Meng <bmeng.cn@gmail.com> wrote:
>> When examining a HOB, it's useful to see which GUID this HOB
>> belongs to. Add GUID output in the hob command to aid this.
>>
>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>> ---
>>
>>  arch/x86/lib/cmd_hob.c | 22 +++++++++++++++++++---
>>  1 file changed, 19 insertions(+), 3 deletions(-)
>
> Acked-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-x86, thanks!
diff mbox

Patch

diff --git a/arch/x86/lib/cmd_hob.c b/arch/x86/lib/cmd_hob.c
index 6ff321a..4a29aee 100644
--- a/arch/x86/lib/cmd_hob.c
+++ b/arch/x86/lib/cmd_hob.c
@@ -37,8 +37,10 @@  int do_hob(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 	printf("HOB list address: 0x%08x\n\n", (unsigned int)hdr);
 
-	printf("#  | Address  | Type      | Len\n");
-	printf("---|----------|-----------|-----\n");
+	printf("#  | Address  | Type      | Len  | ");
+	printf("%42s\n", "GUID");
+	printf("---|----------|-----------|------|-");
+	printf("------------------------------------------\n");
 	while (!end_of_hob(hdr)) {
 		printf("%-2d | %08x | ", i, (unsigned int)hdr);
 		type = hdr->type;
@@ -50,7 +52,21 @@  int do_hob(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 			desc = hob_type[type];
 		else
 			desc = "*Invalid*";
-		printf("%-9s | %-4d\n", desc, hdr->len);
+		printf("%-9s | %-4d | ", desc, hdr->len);
+
+		if (type == HOB_TYPE_MEM_ALLOC || type == HOB_TYPE_RES_DESC ||
+		    type == HOB_TYPE_GUID_EXT) {
+			struct efi_guid *guid = (struct efi_guid *)(hdr + 1);
+			int j;
+
+			printf("%08x-%04x-%04x", guid->data1,
+			       guid->data2, guid->data3);
+			for (j = 0; j < ARRAY_SIZE(guid->data4); j++)
+				printf("-%02x", guid->data4[j]);
+		} else {
+			printf("%42s", "Not Available");
+		}
+		printf("\n");
 		hdr = get_next_hob(hdr);
 		i++;
 	}