From patchwork Wed Aug 20 14:05:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 78 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755698750; bh=SCWM7DLhQHtf2SDo7Dwtog5g9NCNWlcf5Ivllq1yAKg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Gp8qjpr+EWm0GcCKLx91Rpl2/MSCETB4lMS3F2cJuHLU821wbr7UBuSfcNKr+zkcr li3Rj73jl1gkJ6LjT7OkUA80JYZ49FPDos2gmjPfg0Ft7G8ZrsTLdI9OYGfhRQcMv4 SJyIqkfj8YclksSPrCOl+l0tMObTJgWQQhelt5R1s6HZZUjzWLmBjsMQHiGWISJhqK Hqz5gmtZZ/LGBG932vcVkrlquh2PyRwcPA4KJvSCAV/EBDy0XPb8ezUeON7cxtlCk3 jNdZxdDjP0q8Twnkk/TWTQA4d0aaEXOLR+InKrkRbrTFxUfK0UYmmIKvKmgWuy2G3G /hEPxzXCrvjkQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9B4BD6768D for ; Wed, 20 Aug 2025 08:05:50 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id jXaWQQkOuTfl for ; Wed, 20 Aug 2025 08:05:50 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755698750; bh=SCWM7DLhQHtf2SDo7Dwtog5g9NCNWlcf5Ivllq1yAKg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Gp8qjpr+EWm0GcCKLx91Rpl2/MSCETB4lMS3F2cJuHLU821wbr7UBuSfcNKr+zkcr li3Rj73jl1gkJ6LjT7OkUA80JYZ49FPDos2gmjPfg0Ft7G8ZrsTLdI9OYGfhRQcMv4 SJyIqkfj8YclksSPrCOl+l0tMObTJgWQQhelt5R1s6HZZUjzWLmBjsMQHiGWISJhqK Hqz5gmtZZ/LGBG932vcVkrlquh2PyRwcPA4KJvSCAV/EBDy0XPb8ezUeON7cxtlCk3 jNdZxdDjP0q8Twnkk/TWTQA4d0aaEXOLR+InKrkRbrTFxUfK0UYmmIKvKmgWuy2G3G /hEPxzXCrvjkQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8AC4767688 for ; Wed, 20 Aug 2025 08:05:50 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755698747; bh=6fOTw8P36UuhJYoyOXUomFK6Ajs8kKOcqglzz40cwl0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oSifY6i3trh+pNUYhC8Gk4nMy0z1Ts7C6h9QMQkEhvEz2qon5c2LPTDa8qrNoyC3h +FDYEYkzqDu5AoYBx0SHr+Zngei9Wl/mI+Fky4fhhY7VC2atT6gBh98bCDKk9UB4Qw PiGuROP+6+voFst4mYc9DEsLsVPX9oi7tuwwNTzbKA2WZ/rxisyK8Q98UEqL+R9zJ9 UTOVV/NET6e+a95rHbqMUqUay34fz2w/nZjLUDLpxztuXjdIq4gdHR576K3DccJbDO dMjD7ZHUoGJTCeD+JeyRzy3Pj1+U29mII6VnE6BBR4X8m+X8fTur/q1FoBOtrGjAA2 SkHenLKSf/ZNg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D8D87674FA; Wed, 20 Aug 2025 08:05:47 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id WURi9nqh2r-j; Wed, 20 Aug 2025 08:05:47 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755698746; bh=5DAK3yrlGPxLDwDWU7pCijcqHjttkKROtUDvhEjh5ok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J4p0kRyKSmTig6EbIpr5Z/EYPK7L2f6imzVXxusg/SrQ015yDCXa8AymU4o+5myzB Jtk0OxPWD9/fEpFD2OOGjArjSB+gTUlmrbfDTuXnRBWzqYQEtSCGXYQmxmol76jR8c VaSw8jdKdApqYZfKDFV4mnCmJWwry5LV9QyRYZJ5epx0CZL6vW+Yz/hXyjsgGrCXEn eq3dwRLqGdjYSAA2SKqcMQu3MNd8dJlRp5+FcQX9eJ/MmlJt6VbhLZ59UJcvJqp3Br AU3QMWVc7R9IpFTX/UQ3AzRrXpBf0yWJhaQyIVfUf7CL5QLGoSKLaOIQks6cO6lHKB oqYvRMuMk3N+A== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 219C66765F; Wed, 20 Aug 2025 08:05:46 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 08:05:12 -0600 Message-ID: <20250820140516.344113-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820140516.344113-1-sjg@u-boot.org> References: <20250820140516.344113-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: OYEBG25TNNXPNJ3R2LKWPS2XSDHTAALB X-Message-ID-Hash: OYEBG25TNNXPNJ3R2LKWPS2XSDHTAALB X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 4/4] acpi: Use the U-Boot ACPI ID and version List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The ACPI spec is a little confusing as to what should go in the 'creator_id' field: Vendor ID of utility that created the table. For tables containing Definition Blocks, this is the ID for the ASL Compiler. Even though some of the tables are compiled by the Intel ASL compiler (generally DSDT), U-Boot generates many of the tables itself. So it should be listed as the creator. Rename the constant and use "UBOO", as per the UEFI forum. For the version, use (year << 16) | (patchlevel << 8) which seems to be a common approach. This mostly fixes https://concept.u-boot.org/u-boot/u-boot/-/issues/16 but the question of the logo remains. Signed-off-by: Simon Glass Link: https://uefi.org/ACPI_ID_List?acpi_search=u-boot --- arch/x86/lib/acpi_nhlt.c | 2 +- arch/x86/lib/acpi_table.c | 2 +- include/acpi/acpi_table.h | 5 +--- lib/acpi/acpi.c | 6 ++-- lib/acpi/acpi_table.c | 2 +- test/dm/acpi.c | 58 ++++++++++++++++++++++++--------------- 6 files changed, 44 insertions(+), 31 deletions(-) diff --git a/arch/x86/lib/acpi_nhlt.c b/arch/x86/lib/acpi_nhlt.c index 8aae5fa5af7..00b313b0703 100644 --- a/arch/x86/lib/acpi_nhlt.c +++ b/arch/x86/lib/acpi_nhlt.c @@ -408,7 +408,7 @@ int nhlt_serialise_oem_overrides(struct acpi_ctx *ctx, struct nhlt *nhlt, memcpy(header->oem_table_id, oem_table_id, oem_table_id_len); } header->oem_revision = oem_revision; - memcpy(header->creator_id, ASLC_ID, 4); + memcpy(header->creator_id, ACPI_CREATOR, 4); cur.buf = (void *)(header + 1); cur.start = (void *)header; diff --git a/arch/x86/lib/acpi_table.c b/arch/x86/lib/acpi_table.c index b13292c4150..8663f97457e 100644 --- a/arch/x86/lib/acpi_table.c +++ b/arch/x86/lib/acpi_table.c @@ -224,7 +224,7 @@ static int acpi_write_tpm2(struct acpi_ctx *ctx, /* Fill out header fields. */ acpi_fill_header(header, "TPM2"); - memcpy(header->creator_id, ASLC_ID, 4); + memcpy(header->creator_id, ACPI_CREATOR, 4); header->length = sizeof(struct acpi_tpm2); header->revision = acpi_get_table_revision(ACPITAB_TPM2); diff --git a/include/acpi/acpi_table.h b/include/acpi/acpi_table.h index 850cb8db816..f2bd758599f 100644 --- a/include/acpi/acpi_table.h +++ b/include/acpi/acpi_table.h @@ -18,10 +18,7 @@ #define RSDP_SIG "RSD PTR " /* RSDP pointer signature */ #define OEM_ID "U-BOOT" /* U-Boot */ #define OEM_TABLE_ID "U-BOOTBL" /* U-Boot Table */ -#define ASLC_ID "INTL" /* Intel ASL Compiler */ - -/* TODO(sjg@chromium.org): Figure out how to get compiler revision */ -#define ASL_REVISION 0 +#define ACPI_CREATOR "UBOO" /* U-Boot */ #define ACPI_RSDP_REV_ACPI_1_0 0 #define ACPI_RSDP_REV_ACPI_2_0 2 diff --git a/lib/acpi/acpi.c b/lib/acpi/acpi.c index 698d17a02e8..3e0360ab9fe 100644 --- a/lib/acpi/acpi.c +++ b/lib/acpi/acpi.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -174,8 +175,9 @@ void acpi_fill_header(struct acpi_table_header *header, char *signature) memcpy(header->oem_id, OEM_ID, 6); memcpy(header->oem_table_id, OEM_TABLE_ID, 8); header->oem_revision = OEM_REVISION; - memcpy(header->creator_id, ASLC_ID, 4); - header->creator_revision = ASL_REVISION; + memcpy(header->creator_id, ACPI_CREATOR, 4); + header->creator_revision = (U_BOOT_VERSION_NUM << 16) | + (U_BOOT_VERSION_NUM_PATCH << 8); } void acpi_align(struct acpi_ctx *ctx) diff --git a/lib/acpi/acpi_table.c b/lib/acpi/acpi_table.c index f2dadd792bd..2589efbb5f2 100644 --- a/lib/acpi/acpi_table.c +++ b/lib/acpi/acpi_table.c @@ -126,7 +126,7 @@ int acpi_write_fadt(struct acpi_ctx *ctx, const struct acpi_writer *entry) header->revision = acpi_get_table_revision(ACPITAB_FADT); memcpy(header->oem_id, OEM_ID, 6); memcpy(header->oem_table_id, OEM_TABLE_ID, 8); - memcpy(header->creator_id, ASLC_ID, 4); + memcpy(header->creator_id, ACPI_CREATOR, 4); header->creator_revision = 1; fadt->minor_revision = 2; diff --git a/test/dm/acpi.c b/test/dm/acpi.c index a274671de02..d1be6707693 100644 --- a/test/dm/acpi.c +++ b/test/dm/acpi.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -25,6 +26,9 @@ #define BUF_SIZE 4096 +#define CREATOR_REVISION ((U_BOOT_VERSION_NUM << 16) | \ + (U_BOOT_VERSION_NUM_PATCH << 8)) + #define OEM_REVISION ((((version_num / 1000) % 10) << 28) | \ (((version_num / 100) % 10) << 24) | \ (((version_num / 10) % 10) << 20) | \ @@ -263,8 +267,8 @@ static int dm_test_acpi_fill_header(struct unit_test_state *uts) ut_asserteq_mem(OEM_TABLE_ID, hdr.oem_table_id, sizeof(hdr.oem_table_id)); ut_asserteq(OEM_REVISION, hdr.oem_revision); - ut_asserteq_mem(ASLC_ID, hdr.creator_id, sizeof(hdr.creator_id)); - ut_asserteq(ASL_REVISION, hdr.creator_revision); + ut_asserteq_mem(ACPI_CREATOR, hdr.creator_id, sizeof(hdr.creator_id)); + ut_asserteq(CREATOR_REVISION, hdr.creator_revision); return 0; } @@ -417,22 +421,27 @@ static int dm_test_acpi_cmd_list(struct unit_test_state *uts) ut_assert_nextline("RSDP %16lx %5zx v02 U-BOOT", addr, sizeof(struct acpi_rsdp)); addr = ALIGN(addr + sizeof(struct acpi_rsdp), 16); - ut_assert_nextline("RSDT %16lx %5zx v01 U-BOOT U-BOOTBL %x INTL 0", + ut_assert_nextline("RSDT %16lx %5zx v01 U-BOOT U-BOOTBL %x UBOO %x", addr, sizeof(struct acpi_table_header) + - 3 * sizeof(u32), OEM_REVISION); + 3 * sizeof(u32), OEM_REVISION, + CREATOR_REVISION); addr = ALIGN(addr + sizeof(struct acpi_rsdt), 16); - ut_assert_nextline("XSDT %16lx %5zx v01 U-BOOT U-BOOTBL %x INTL 0", + ut_assert_nextline("XSDT %16lx %5zx v01 U-BOOT U-BOOTBL %x UBOO %x", addr, sizeof(struct acpi_table_header) + - 3 * sizeof(u64), OEM_REVISION); + 3 * sizeof(u64), OEM_REVISION, + CREATOR_REVISION); addr = ALIGN(addr + sizeof(struct acpi_xsdt), 64); - ut_assert_nextline("DMAR %16lx %5zx v01 U-BOOT U-BOOTBL %x INTL 0", - addr, sizeof(struct acpi_dmar), OEM_REVISION); + ut_assert_nextline("DMAR %16lx %5zx v01 U-BOOT U-BOOTBL %x UBOO %x", + addr, sizeof(struct acpi_dmar), OEM_REVISION, + CREATOR_REVISION); addr = ALIGN(addr + sizeof(struct acpi_dmar), 16); - ut_assert_nextline("DMAR %16lx %5zx v01 U-BOOT U-BOOTBL %x INTL 0", - addr, sizeof(struct acpi_dmar), OEM_REVISION); + ut_assert_nextline("DMAR %16lx %5zx v01 U-BOOT U-BOOTBL %x UBOO %x", + addr, sizeof(struct acpi_dmar), OEM_REVISION, + CREATOR_REVISION); addr = ALIGN(addr + sizeof(struct acpi_dmar), 16); - ut_assert_nextline("DMAR %16lx %5zx v01 U-BOOT U-BOOTBL %x INTL 0", - addr, sizeof(struct acpi_dmar), OEM_REVISION); + ut_assert_nextline("DMAR %16lx %5zx v01 U-BOOT U-BOOTBL %x UBOO %x", + addr, sizeof(struct acpi_dmar), OEM_REVISION, + CREATOR_REVISION); ut_assert_console_end(); unmap_sysmem(buf); free(buf); @@ -461,22 +470,27 @@ static int dm_test_acpi_cmd_list_chksum(struct unit_test_state *uts) ut_assert_nextline("RSDP %16lx %5zx v02 U-BOOT OK OK", addr, sizeof(struct acpi_rsdp)); addr = ALIGN(addr + sizeof(struct acpi_rsdp), 16); - ut_assert_nextline("RSDT %16lx %5zx v01 U-BOOT U-BOOTBL %x INTL 0 OK", + ut_assert_nextline("RSDT %16lx %5zx v01 U-BOOT U-BOOTBL %x UBOO %x OK", addr, sizeof(struct acpi_table_header) + - 3 * sizeof(u32), OEM_REVISION); + 3 * sizeof(u32), OEM_REVISION, + CREATOR_REVISION); addr = ALIGN(addr + sizeof(struct acpi_rsdt), 16); - ut_assert_nextline("XSDT %16lx %5zx v01 U-BOOT U-BOOTBL %x INTL 0 OK", + ut_assert_nextline("XSDT %16lx %5zx v01 U-BOOT U-BOOTBL %x UBOO %x OK", addr, sizeof(struct acpi_table_header) + - 3 * sizeof(u64), OEM_REVISION); + 3 * sizeof(u64), OEM_REVISION, + CREATOR_REVISION); addr = ALIGN(addr + sizeof(struct acpi_xsdt), 64); - ut_assert_nextline("DMAR %16lx %5zx v01 U-BOOT U-BOOTBL %x INTL 0 OK", - addr, sizeof(struct acpi_dmar), OEM_REVISION); + ut_assert_nextline("DMAR %16lx %5zx v01 U-BOOT U-BOOTBL %x UBOO %x OK", + addr, sizeof(struct acpi_dmar), OEM_REVISION, + CREATOR_REVISION); addr = ALIGN(addr + sizeof(struct acpi_dmar), 16); - ut_assert_nextline("DMAR %16lx %5zx v01 U-BOOT U-BOOTBL %x INTL 0 OK", - addr, sizeof(struct acpi_dmar), OEM_REVISION); + ut_assert_nextline("DMAR %16lx %5zx v01 U-BOOT U-BOOTBL %x UBOO %x OK", + addr, sizeof(struct acpi_dmar), OEM_REVISION, + CREATOR_REVISION); addr = ALIGN(addr + sizeof(struct acpi_dmar), 16); - ut_assert_nextline("DMAR %16lx %5zx v01 U-BOOT U-BOOTBL %x INTL 0 OK", - addr, sizeof(struct acpi_dmar), OEM_REVISION); + ut_assert_nextline("DMAR %16lx %5zx v01 U-BOOT U-BOOTBL %x UBOO %x OK", + addr, sizeof(struct acpi_dmar), OEM_REVISION, + CREATOR_REVISION); ut_assert_console_end(); ut_assert_console_end(); unmap_sysmem(buf);