From: pillow <waysorrypub@gmail.com>
To: qemu-devel@nongnu.org
Cc: 17746591750@163.com, maobibo@loongson.cn, lixianglai@loongson.cn,
jiaxun.yang@flygoat.com, mst@redhat.com, imammedo@redhat.com,
anisinha@redhat.com, pillow <waysorrypub@gmail.com>
Subject: [PATCH v4 2/4] hw/loongarch/virt-acpi-build: Drop UART _DSD clock and add _STA
Date: Thu, 22 Oct 2026 15:22:36 +0800 [thread overview]
Message-ID: <20261022072238.319308-3-waysorrypub@gmail.com> (raw)
In-Reply-To: <20261022072238.319308-1-waysorrypub@gmail.com>
The UART _DSD clock property contains a typo ("clock-frenquency")
and has its key/value order reversed. It also specifies a 100 MHz
clock, which does not match the emulated UART.
QEMU's UART model uses baudbase = 115200, corresponding to a clock
frequency of 1,843,200 Hz. The Linux 8250 PnP driver uses the same
frequency by default when no clock is specified.
Since the default already matches the UART model, there is no need
to provide an explicit clock property. Drop it from _DSD, consistent
with the existing x86 ISA serial ACPI implementation.
Also remove _CCA because the emulated UART does not support DMA,
and add _STA = 0x0f to indicate that the device is present,
enabled, visible, and functioning.
Signed-off-by: pillow <waysorrypub@gmail.com>
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
---
hw/loongarch/virt-acpi-build.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/hw/loongarch/virt-acpi-build.c b/hw/loongarch/virt-acpi-build.c
index 54965f0..55c7641 100644
--- a/hw/loongarch/virt-acpi-build.c
+++ b/hw/loongarch/virt-acpi-build.c
@@ -314,7 +314,6 @@ static void build_uart_device_aml(Aml *table, int index)
{
Aml *dev;
Aml *crs;
- Aml *pkg0, *pkg1, *pkg2;
Aml *scope;
uint32_t uart_irq;
uint64_t base;
@@ -325,7 +324,7 @@ static void build_uart_device_aml(Aml *table, int index)
dev = aml_device("COM%d", index);
aml_append(dev, aml_name_decl("_HID", aml_string("PNP0501")));
aml_append(dev, aml_name_decl("_UID", aml_int(index)));
- aml_append(dev, aml_name_decl("_CCA", aml_int(1)));
+ aml_append(dev, aml_name_decl("_STA", aml_int(0x0f)));
crs = aml_resource_template();
aml_append(crs,
aml_qword_memory(AML_POS_DECODE, AML_MIN_FIXED, AML_MAX_FIXED,
@@ -335,15 +334,6 @@ static void build_uart_device_aml(Aml *table, int index)
aml_append(crs, aml_interrupt(AML_CONSUMER, AML_LEVEL, AML_ACTIVE_HIGH,
AML_SHARED, &uart_irq, 1));
aml_append(dev, aml_name_decl("_CRS", crs));
- pkg0 = aml_package(0x2);
- aml_append(pkg0, aml_int(0x05F5E100));
- aml_append(pkg0, aml_string("clock-frenquency"));
- pkg1 = aml_package(0x1);
- aml_append(pkg1, pkg0);
- pkg2 = aml_package(0x2);
- aml_append(pkg2, aml_touuid("DAFFD814-6EBA-4D8C-8A91-BC9BBF4AA301"));
- aml_append(pkg2, pkg1);
- aml_append(dev, aml_name_decl("_DSD", pkg2));
aml_append(scope, dev);
aml_append(table, scope);
}
--
2.56.0
next prev parent reply other threads:[~2026-10-22 7:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 7:22 [PATCH v4 0/4] hw/loongarch/virt: Fix UART ACPI and FDT pillow
2026-10-22 7:22 ` [PATCH v4 1/4] bios-tables-test-allowed-diff.h: Allow LoongArch DSDT.* pillow
2026-10-22 7:22 ` pillow [this message]
2026-10-22 8:15 ` [PATCH v4 2/4] hw/loongarch/virt-acpi-build: Drop UART _DSD clock and add _STA Igor Mammedov
2026-10-22 8:18 ` Igor Mammedov
2026-10-22 9:01 ` way sorry
2026-10-22 9:25 ` way sorry
2026-10-22 11:27 ` Igor Mammedov
2026-10-22 7:22 ` [PATCH v4 3/4] tests/data/acpi/loongarch64: Update expected DSDT.* pillow
2026-10-22 7:22 ` [PATCH v4 4/4] hw/loongarch/virt: Fix UART clock frequency in FDT pillow
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=20261022072238.319308-3-waysorrypub@gmail.com \
--to=waysorrypub@gmail.com \
--cc=17746591750@163.com \
--cc=anisinha@redhat.com \
--cc=imammedo@redhat.com \
--cc=jiaxun.yang@flygoat.com \
--cc=lixianglai@loongson.cn \
--cc=maobibo@loongson.cn \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.