Skip to contentSkip to conversation

cmd: acpi: Print revisions in hex format

PATCH New Andy Shevchenko 2 participants 2 messages Sep 21, 2020

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 cmd: acpi: Print revisions in hex format

The revisions are usually dates in hex-decimal format representing YYYYmmdd. Print them in hex to see this clearly.

Before:
...
FACP 000e5420 0000f4 (v06 U-BOOT U-BOOTBL 538970376 INTL 0) DSDT 000e4780 000ba0 (v02 U-BOOT U-BOOTBL 65536 INTL 538968870)
...
After:
...
FACP 000e5420 0000f4 (v06 U-BOOT U-BOOTBL 20200908 INTL 0) DSDT 000e4780 000ba0 (v02 U-BOOT U-BOOTBL 10000 INTL 20200326)
...

Fixes 0b885bcfd9b0 ("acpi: Add an acpi command")
Cc Wolfgang Wallner <[email protected]>

---
v2: fixed test cases as well (Bin)

 cmd/acpi.c     |  2 +-
 test/dm/acpi.c | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)
cmd/acpi.c +1 -1
index 085a3a650d1a..a3419b42b556 100644
@@ -26,7 +26,7 @@ static void dump_hdr(struct acpi_table_header *hdr)
 	printf("%.*s %08lx %06x", ACPI_NAME_LEN, hdr->signature,
 	       (ulong)map_to_sysmem(hdr), hdr->length);
 	if (has_hdr) {
-		printf(" (v%02d %.6s %.8s %u %.4s %d)\n", hdr->revision,
+		printf(" (v%02d %.6s %.8s %x %.4s %x)\n", hdr->revision,
 		       hdr->oem_id, hdr->oem_table_id, hdr->oem_revision,
 		       hdr->aslc_id, hdr->aslc_revision);
 	} else {
test/dm/acpi.c +5 -5
index 16aa1616c948..1f252a8d4540 100644
@@ -366,21 +366,21 @@ static int dm_test_acpi_cmd_list(struct unit_test_state *uts)
 	ut_assert_nextline("RSDP %08lx %06lx (v02 U-BOOT)", addr,
 			   sizeof(struct acpi_rsdp));
 	addr = ALIGN(addr + sizeof(struct acpi_rsdp), 16);
-	ut_assert_nextline("RSDT %08lx %06lx (v01 U-BOOT U-BOOTBL %u INTL 0)",
+	ut_assert_nextline("RSDT %08lx %06lx (v01 U-BOOT U-BOOTBL %x INTL 0)",
 			   addr, sizeof(struct acpi_table_header) +
 			   3 * sizeof(u32), U_BOOT_BUILD_DATE);
 	addr = ALIGN(addr + sizeof(struct acpi_rsdt), 16);
-	ut_assert_nextline("XSDT %08lx %06lx (v01 U-BOOT U-BOOTBL %u INTL 0)",
+	ut_assert_nextline("XSDT %08lx %06lx (v01 U-BOOT U-BOOTBL %x INTL 0)",
 			   addr, sizeof(struct acpi_table_header) +
 			   3 * sizeof(u64), U_BOOT_BUILD_DATE);
 	addr = ALIGN(addr + sizeof(struct acpi_xsdt), 64);
-	ut_assert_nextline("DMAR %08lx %06lx (v01 U-BOOT U-BOOTBL %u INTL 0)",
+	ut_assert_nextline("DMAR %08lx %06lx (v01 U-BOOT U-BOOTBL %x INTL 0)",
 			   addr, sizeof(struct acpi_dmar), U_BOOT_BUILD_DATE);
 	addr = ALIGN(addr + sizeof(struct acpi_dmar), 16);
-	ut_assert_nextline("DMAR %08lx %06lx (v01 U-BOOT U-BOOTBL %u INTL 0)",
+	ut_assert_nextline("DMAR %08lx %06lx (v01 U-BOOT U-BOOTBL %x INTL 0)",
 			   addr, sizeof(struct acpi_dmar), U_BOOT_BUILD_DATE);
 	addr = ALIGN(addr + sizeof(struct acpi_dmar), 16);
-	ut_assert_nextline("DMAR %08lx %06lx (v01 U-BOOT U-BOOTBL %u INTL 0)",
+	ut_assert_nextline("DMAR %08lx %06lx (v01 U-BOOT U-BOOTBL %x INTL 0)",
 			   addr, sizeof(struct acpi_dmar), U_BOOT_BUILD_DATE);
 	ut_assert_console_end();
 
Signature · 1 line
2.28.0
#1 lore raw

PATCH v2 1/1 cmd: acpi: Print revisions in hex format

Quoted 15 lines · Andy Shevchenko

The revisions are usually dates in hex-decimal format representing YYYYmmdd. Print them in hex to see this clearly.

Before:
...
FACP 000e5420 0000f4 (v06 U-BOOT U-BOOTBL 538970376 INTL 0) DSDT 000e4780 000ba0 (v02 U-BOOT U-BOOTBL 65536 INTL 538968870)
...
After:
...
FACP 000e5420 0000f4 (v06 U-BOOT U-BOOTBL 20200908 INTL 0) DSDT 000e4780 000ba0 (v02 U-BOOT U-BOOTBL 10000 INTL 20200326)
...

Quoted 9 lines
Fixes 0b885bcfd9b0 ("acpi: Add an acpi command")
Cc Wolfgang Wallner <[email protected]>

---
v2: fixed test cases as well (Bin)

 cmd/acpi.c     |  2 +-
 test/dm/acpi.c | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)