From: Vadim Chichikalyuk <chichikalyuk@gmail.com>
To: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, Vadim Chichikalyuk <chichikalyuk@gmail.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Igor Mammedov <imammedo@redhat.com>,
Ani Sinha <anisinha@redhat.com>,
Shannon Zhao <shannon.zhaosl@gmail.com>,
Peter Maydell <peter.maydell@linaro.org>
Subject: [PATCH v2 2/3] hw: arm: acpi: upgrade SPCR table to revision 4
Date: Sun, 10 Aug 2025 00:10:50 +0300 [thread overview]
Message-ID: <20250809211051.68824-3-chichikalyuk@gmail.com> (raw)
In-Reply-To: <20250809211051.68824-1-chichikalyuk@gmail.com>
On the ARM virt machine, there is currently no way to programmatically
discover the frequency of the UART reference clock solely through the use of
UEFI/ACPI (without the DTB). The SPCR table can include this information
as of revision 4, but is currently at revision 2.
Bump the revision to 4, add the clock frequency of 24 MHz and
complete the other new fields.
Signed-off-by: Vadim Chichikalyuk <chichikalyuk@gmail.com>
---
hw/arm/virt-acpi-build.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index b01fc4f8ef..f685668c5e 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -536,6 +536,7 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
static void
spcr_setup(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
{
+ const char name[] = ".";
AcpiSpcrData serial = {
.interface_type = 3, /* ARM PL011 UART */
.base_addr.id = AML_AS_SYSTEM_MEMORY,
@@ -559,13 +560,14 @@ spcr_setup(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
.pci_function = 0,
.pci_flags = 0,
.pci_segment = 0,
+ .uart_clk_freq = 24000000,
+ .precise_baudrate = 0,
+ .namespace_string_length = sizeof(name),
+ .namespace_string_offset = 88,
};
- /*
- * Passing NULL as the SPCR Table for Revision 2 doesn't support
- * NameSpaceString.
- */
- build_spcr(table_data, linker, &serial, 2, vms->oem_id, vms->oem_table_id,
- NULL);
+
+ build_spcr(table_data, linker, &serial, 4, vms->oem_id, vms->oem_table_id,
+ name);
}
/*
--
2.39.5 (Apple Git-154)
next prev parent reply other threads:[~2025-08-09 21:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-09 21:10 [PATCH v2 0/3] hw: acpi: add UART clock freq to AArch64 SPCR Vadim Chichikalyuk
2025-08-09 21:10 ` [PATCH v2 1/3] tests: acpi: whitelist expected blobs Vadim Chichikalyuk
2025-08-09 21:10 ` Vadim Chichikalyuk [this message]
2025-08-18 15:41 ` [PATCH v2 2/3] hw: arm: acpi: upgrade SPCR table to revision 4 Peter Maydell
2025-08-09 21:10 ` [PATCH v2 3/3] tests: acpi: update expected blobs Vadim Chichikalyuk
2025-08-18 15:26 ` [PATCH v2 0/3] hw: acpi: add UART clock freq to AArch64 SPCR Peter Maydell
2025-08-24 23:00 ` Vadim Chichikalyuk
2025-08-25 12:50 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250809211051.68824-3-chichikalyuk@gmail.com \
--to=chichikalyuk@gmail.com \
--cc=anisinha@redhat.com \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=shannon.zhaosl@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).