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 v3 2/3] hw/loongarch/virt: Drop UART _DSD/_CCA and add _STA
Date: Wed, 21 Oct 2026 21:53:21 +0800 [thread overview]
Message-ID: <20261021135322.473781-3-waysorrypub@gmail.com> (raw)
In-Reply-To: <20261021135322.473781-1-waysorrypub@gmail.com>
The UART _DSD contains only a clock property, which has a typo
("clock-frenquency") and the key/value order is reversed. The declared
100 MHz also does not match the current QEMU model.
The Linux PNP serial driver uses uartclk = 1843200 Hz by default, and
the QEMU UART uses baudbase = 115200. These correspond as
uartclk / 16 = baudbase (1843200 / 16 = 115200), so the Linux default
clock is consistent with the QEMU model. Since the clock property is
the only content of the _DSD, remove the entire _DSD rather than
keeping an empty one. The QEMU x86 ISA serial ACPI description also
does not provide a clock property, which is consistent with this
change.
Also drop _CCA because the emulated UART does not support DMA, and add
_STA = 0x0f to indicate the device is present, enable, should be
shown and functioning properly.
Signed-off-by: pillow <waysorrypub@gmail.com>
---
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-21 13:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 13:53 [PATCH v3 0/3] hw/loongarch/virt: Fix UART ACPI description and update DSDT blobs pillow
2026-10-21 13:53 ` [PATCH v3 1/3] bios-tables-test-allowed-diff.h: Allow LoongArch DSDT.* pillow
2026-10-21 13:53 ` pillow [this message]
2026-10-22 1:23 ` [PATCH v3 2/3] hw/loongarch/virt: Drop UART _DSD/_CCA and add _STA Bibo Mao
2026-10-22 7:28 ` way sorry
2026-10-21 13:53 ` [PATCH v3 3/3] tests/data/acpi/loongarch64: Update expected DSDT.* 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=20261021135322.473781-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.