* [PATCH V4 1/4] bios-tables-test-allowed-diff.h: Allow LoongArch DSDT.*
2026-03-27 2:31 [PATCH V4 0/4] add rtc acpi table Xianglai Li
@ 2026-03-27 2:31 ` Xianglai Li
0 siblings, 0 replies; 11+ messages in thread
From: Xianglai Li @ 2026-03-27 2:31 UTC (permalink / raw)
To: qemu-devel, lixianglai
Cc: Song Gao, Bibo Mao, Jiaxun Yang, Huacai Chen, Jonathan Cameron
Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
---
Cc: Song Gao <gaosong@loongson.cn>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: "Huacai Chen"<zltjiangshi@gmail.com>
Cc: Jonathan Cameron <jonathan.cameron@huawei.com>
tests/qtest/bios-tables-test-allowed-diff.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
index dfb8523c8b..2ed837faee 100644
--- a/tests/qtest/bios-tables-test-allowed-diff.h
+++ b/tests/qtest/bios-tables-test-allowed-diff.h
@@ -1 +1,5 @@
/* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/loongarch64/virt/DSDT",
+"tests/data/acpi/loongarch64/virt/DSDT.memhp",
+"tests/data/acpi/loongarch64/virt/DSDT.numamem",
+"tests/data/acpi/loongarch64/virt/DSDT.topology",
--
2.39.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v4 0/4] hw/loongarch/virt: Fix UART ACPI and FDT
@ 2026-10-22 7:22 pillow
2026-10-22 7:22 ` [PATCH v4 1/4] bios-tables-test-allowed-diff.h: Allow LoongArch DSDT.* pillow
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: pillow @ 2026-10-22 7:22 UTC (permalink / raw)
To: qemu-devel
Cc: 17746591750, maobibo, lixianglai, jiaxun.yang, mst, imammedo,
anisinha, pillow
This series removes the UART _DSD clock property and _CCA, adds
_STA = 0x0f, and updates the expected DSDT blobs.
It also changes the FDT clock-frequency from 100000000 to 1843200 Hz
to match the emulated UART model. The FDT clock property is retained.
Changes since v3:
- Add a separate patch to correct the FDT UART clock frequency.
- Carry Bibo Mao's Reviewed-by for the ACPI change.
- Clarify the ACPI commit message.
Testing:
- All five LoongArch ACPI bios-tables-test subtests pass.
- The generated DTB reports clock-frequency = 1843200 for all four
UART nodes.
pillow (4):
bios-tables-test-allowed-diff.h: Allow LoongArch DSDT.*
hw/loongarch/virt-acpi-build: Drop UART _DSD clock and add _STA
tests/data/acpi/loongarch64: Update expected DSDT.*
hw/loongarch/virt: Fix UART clock frequency in FDT
hw/loongarch/virt-acpi-build.c | 12 +-----------
hw/loongarch/virt-fdt-build.c | 2 +-
tests/data/acpi/loongarch64/virt/DSDT | Bin 4603 -> 4379 bytes
tests/data/acpi/loongarch64/virt/DSDT.memhp | Bin 5824 -> 5600 bytes
tests/data/acpi/loongarch64/virt/DSDT.numamem | Bin 4609 -> 4385 bytes
.../data/acpi/loongarch64/virt/DSDT.topology | Bin 4905 -> 4681 bytes
6 files changed, 2 insertions(+), 12 deletions(-)
base-commit: 8967b2fe1b2aaae3c29e207d85fab901d580a2dc
--
2.56.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v4 1/4] bios-tables-test-allowed-diff.h: Allow LoongArch DSDT.*
2026-10-22 7:22 [PATCH v4 0/4] hw/loongarch/virt: Fix UART ACPI and FDT pillow
@ 2026-10-22 7:22 ` pillow
2026-10-22 7:22 ` [PATCH v4 2/4] hw/loongarch/virt-acpi-build: Drop UART _DSD clock and add _STA pillow
` (2 subsequent siblings)
3 siblings, 0 replies; 11+ messages in thread
From: pillow @ 2026-10-22 7:22 UTC (permalink / raw)
To: qemu-devel
Cc: 17746591750, maobibo, lixianglai, jiaxun.yang, mst, imammedo,
anisinha, pillow
Signed-off-by: pillow <waysorrypub@gmail.com>
---
tests/qtest/bios-tables-test-allowed-diff.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
index dfb8523..2ed837f 100644
--- a/tests/qtest/bios-tables-test-allowed-diff.h
+++ b/tests/qtest/bios-tables-test-allowed-diff.h
@@ -1 +1,5 @@
/* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/loongarch64/virt/DSDT",
+"tests/data/acpi/loongarch64/virt/DSDT.memhp",
+"tests/data/acpi/loongarch64/virt/DSDT.numamem",
+"tests/data/acpi/loongarch64/virt/DSDT.topology",
--
2.56.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v4 2/4] hw/loongarch/virt-acpi-build: Drop UART _DSD clock and add _STA
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
2026-10-22 8:15 ` Igor Mammedov
2026-10-22 8:18 ` 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
3 siblings, 2 replies; 11+ messages in thread
From: pillow @ 2026-10-22 7:22 UTC (permalink / raw)
To: qemu-devel
Cc: 17746591750, maobibo, lixianglai, jiaxun.yang, mst, imammedo,
anisinha, pillow
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
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v4 3/4] tests/data/acpi/loongarch64: Update expected DSDT.*
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 ` [PATCH v4 2/4] hw/loongarch/virt-acpi-build: Drop UART _DSD clock and add _STA pillow
@ 2026-10-22 7:22 ` pillow
2026-10-22 7:22 ` [PATCH v4 4/4] hw/loongarch/virt: Fix UART clock frequency in FDT pillow
3 siblings, 0 replies; 11+ messages in thread
From: pillow @ 2026-10-22 7:22 UTC (permalink / raw)
To: qemu-devel
Cc: 17746591750, maobibo, lixianglai, jiaxun.yang, mst, imammedo,
anisinha, pillow
--- tests/data/acpi/loongarch64/virt/DSDT (before)
+++ tests/data/acpi/loongarch64/virt/DSDT (after)
@@ -6,7 +6,7 @@
{
Name (_HID, "PNP0501" /* 16550A-compatible COM Serial Port */) // _HID: Hardware ID
Name (_UID, Zero) // _UID: Unique ID
- Name (_CCA, One) // _CCA: Cache Coherency Attribute
+ Name (_STA, 0x0F) // _STA: Status
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
{
QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
@@ -21,18 +21,6 @@
0x00000042,
}
})
- Name (_DSD, Package (0x02) // _DSD: Device-Specific Data
- {
- ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301") /* Device Properties for _DSD */,
- Package (0x01)
- {
- Package (0x02)
- {
- 0x05F5E100,
- "clock-frenquency"
- }
- }
- })
}
}
@@ -42,7 +30,7 @@
{
Name (_HID, "PNP0501" /* 16550A-compatible COM Serial Port */) // _HID: Hardware ID
Name (_UID, One) // _UID: Unique ID
- Name (_CCA, One) // _CCA: Cache Coherency Attribute
+ Name (_STA, 0x0F) // _STA: Status
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
{
QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
@@ -57,18 +45,6 @@
0x00000043,
}
})
- Name (_DSD, Package (0x02) // _DSD: Device-Specific Data
- {
- ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301") /* Device Properties for _DSD */,
- Package (0x01)
- {
- Package (0x02)
- {
- 0x05F5E100,
- "clock-frenquency"
- }
- }
- })
}
}
@@ -78,7 +54,7 @@
{
Name (_HID, "PNP0501" /* 16550A-compatible COM Serial Port */) // _HID: Hardware ID
Name (_UID, 0x02) // _UID: Unique ID
- Name (_CCA, One) // _CCA: Cache Coherency Attribute
+ Name (_STA, 0x0F) // _STA: Status
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
{
QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
@@ -93,18 +69,6 @@
0x00000044,
}
})
- Name (_DSD, Package (0x02) // _DSD: Device-Specific Data
- {
- ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301") /* Device Properties for _DSD */,
- Package (0x01)
- {
- Package (0x02)
- {
- 0x05F5E100,
- "clock-frenquency"
- }
- }
- })
}
}
@@ -114,7 +78,7 @@
{
Name (_HID, "PNP0501" /* 16550A-compatible COM Serial Port */) // _HID: Hardware ID
Name (_UID, 0x03) // _UID: Unique ID
- Name (_CCA, One) // _CCA: Cache Coherency Attribute
+ Name (_STA, 0x0F) // _STA: Status
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
{
QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
@@ -127,18 +91,6 @@
Interrupt (ResourceConsumer, Level, ActiveHigh, Shared, ,, )
{
0x00000045,
- }
- })
- Name (_DSD, Package (0x02) // _DSD: Device-Specific Data
- {
- ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301") /* Device Properties for _DSD */,
- Package (0x01)
- {
- Package (0x02)
- {
- 0x05F5E100,
- "clock-frenquency"
- }
}
})
}
Signed-off-by: pillow <waysorrypub@gmail.com>
---
tests/data/acpi/loongarch64/virt/DSDT | Bin 4603 -> 4379 bytes
tests/data/acpi/loongarch64/virt/DSDT.memhp | Bin 5824 -> 5600 bytes
tests/data/acpi/loongarch64/virt/DSDT.numamem | Bin 4609 -> 4385 bytes
.../data/acpi/loongarch64/virt/DSDT.topology | Bin 4905 -> 4681 bytes
tests/qtest/bios-tables-test-allowed-diff.h | 4 ----
5 files changed, 4 deletions(-)
diff --git a/tests/data/acpi/loongarch64/virt/DSDT b/tests/data/acpi/loongarch64/virt/DSDT
index 09aa903c4e875f541223e36f59b28e101599df20..686d9078e4d61558d65bdcfec76a2428b83ef56d 100644
GIT binary patch
delta 160
zcmeyZJX?v&CD<iIT9AQ((PJW)G?zD9e6Uk|bdxjNM13jN;1EYH{)rzYCZ=j>2_U4L
z{e2BN;ypZFcmw<b3``9S893rYJzW?%;-MOx_yv5R2Dz{~`}-PAR$vn0V1mm_OkT&R
Y#f_w9vJ8_n+_uTVOj?__F}d;s0NpGpmH+?%
delta 398
zcmbQO^jn$BCD<k8w;%%pW6VS@X)b53_+Y2_=q7K@iTYA3&d!dE6aAcAIO1J`U4)F8
z1ckW-L~i`QwJWd3w`<~_+55c~GYZKt3Q02YFg*Oq%A1^%pPa3mR+O4oSelxbT*)AS
zWZrC;c@h&ZX(f|yqzlxEKAg_}zD6AJ9-c0|0e%4nrUr%#9Py!^E?i6;@er3wOtxpF
ZnpMWwtYSu3wT4m4oJ?PBzQX9v4*-y-dI$gj
diff --git a/tests/data/acpi/loongarch64/virt/DSDT.memhp b/tests/data/acpi/loongarch64/virt/DSDT.memhp
index a069d6878fb45fa6b0e6342eedb0eb3d25eb20da..fb2104170a134bdd414f9f5456f2e37e3489b749 100644
GIT binary patch
delta 160
zcmX@0`#_t^CD<k8fhYq5qu)d>X)bTJ_+Y2_=q6{jiTYBk!6A-Z{1ZP)Oib0%5<o~f
z`}-Pl#Cv$U@CNt=7?>IuGH}F)db%)j#6vYW@eBAs4RT>~_V+cKtiU9~!339=n7ocr
YiyKMJWEm!DxNVbznY1=<W8xA40BABQOaK4?
delta 398
zcmaE$eL$DXCD<k8fEWV<W8y?EX)b53_+Y2_=q7K@iTYA3&d!dE6aAcAIO1J`U4)F8
z1ckW-L~i`QwJWd3w`<~_+55c~GYZKt3Q02YFg*Oq%A1^%pPa3mR+O4oSelxbT*)AS
zWZrC;c@h&ZX(f|yqzlxEKAg_}zD6AJ9-c0|0e%4nrUr%#9Py!^E?i6;@er3wOtxpF
ZnpMWwtYSu3wT4m4oJ?PBzQV{O0swOedA<Mu
diff --git a/tests/data/acpi/loongarch64/virt/DSDT.numamem b/tests/data/acpi/loongarch64/virt/DSDT.numamem
index 78ece52f57a383db128c7d1a08526e15ab911bb7..62374112f9e83ead0be549c8e17bdfe7941017e3 100644
GIT binary patch
delta 160
zcmZovS*XP266_M9D9FITcx57&G?zD9e6Uk|bdxjNM13jN;1EYH{)rzYCZ=j>2_U4L
z{e2BN;ypZFcmw<b3``9S893rYJzW?%;-MOx_yv5R2Dz{~`}-PAR$vn0V1mm_OkT&R
Y#f_w9vJ8_n+_uTVOj?__F?sU?0O+kLy8r+H
delta 398
zcmZ3e)TqMc66_MfD8#_P_<SOlG?z11e6Uk|bdxvdM13h1XJ<#oiGEHl9Puu}E<(mk
zg2G$^A~*iu+LhPi+cj~|?EPMg8HHpRg(R7H7#@CQ<xS4XPtMj&D@x5PEKSWzu4E8E
zGH*7_Jc)^yw35j;(go^7A5Ld~Un7oq4^J1~0KWhOQv*W=j`&bd7cM4_c!<j-CfhSo
Z%_?JTRxu;2TEnPiPNuImUt#p+2LLqfc`X0{
diff --git a/tests/data/acpi/loongarch64/virt/DSDT.topology b/tests/data/acpi/loongarch64/virt/DSDT.topology
index 7ab23f47cc82dd7bc1975e17893a8cd61039e66d..9c37939f91334659662ec9f6dc1f941572029e7f 100644
GIT binary patch
delta 160
zcmZ3fc2b4QCD<jzQ;30qanD39X)bTJ_+Y2_=q6{jiTYBk!6A-Z{1ZP)Oib0%5<o~f
z`}-Pl#Cv$U@CNt=7?>IuGH}F)db%)j#6vYW@eBAs4RT>~_V+cKtiU9~!339=n7ocr
YiyKMJWEm!DxNVbznY1=<V=5K^04K95NdN!<
delta 398
zcmX@9vQmx9CD<iIQ<#B)@%%(CX)b53_+Y2_=q7K@iTYA3&d!dE6aAcAIO1J`U4)F8
z1ckW-L~i`QwJWd3w`<~_+55c~GYZKt3Q02YFg*Oq%A1^%pPa3mR+O4oSelxbT*)AS
zWZrC;c@h&ZX(f|yqzlxEKAg_}zD6AJ9-c0|0e%4nrUr%#9Py!^E?i6;@er3wOtxpF
ZnpMWwtYSu3wT4m4oJ?PBzQR~4007a-dAk4r
diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
index 2ed837f..dfb8523 100644
--- a/tests/qtest/bios-tables-test-allowed-diff.h
+++ b/tests/qtest/bios-tables-test-allowed-diff.h
@@ -1,5 +1 @@
/* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/loongarch64/virt/DSDT",
-"tests/data/acpi/loongarch64/virt/DSDT.memhp",
-"tests/data/acpi/loongarch64/virt/DSDT.numamem",
-"tests/data/acpi/loongarch64/virt/DSDT.topology",
--
2.56.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v4 4/4] hw/loongarch/virt: Fix UART clock frequency in FDT
2026-10-22 7:22 [PATCH v4 0/4] hw/loongarch/virt: Fix UART ACPI and FDT pillow
` (2 preceding siblings ...)
2026-10-22 7:22 ` [PATCH v4 3/4] tests/data/acpi/loongarch64: Update expected DSDT.* pillow
@ 2026-10-22 7:22 ` pillow
3 siblings, 0 replies; 11+ messages in thread
From: pillow @ 2026-10-22 7:22 UTC (permalink / raw)
To: qemu-devel
Cc: 17746591750, maobibo, lixianglai, jiaxun.yang, mst, imammedo,
anisinha, pillow
The UART uses baudbase = 115200, corresponding to an input clock of
1843200 Hz. Update the FDT clock-frequency property to match the model.
Signed-off-by: pillow <waysorrypub@gmail.com>
---
hw/loongarch/virt-fdt-build.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/loongarch/virt-fdt-build.c b/hw/loongarch/virt-fdt-build.c
index c6f5d02..7be71e2 100644
--- a/hw/loongarch/virt-fdt-build.c
+++ b/hw/loongarch/virt-fdt-build.c
@@ -474,7 +474,7 @@ static void fdt_add_uart_node(LoongArchVirtMachineState *lvms,
qemu_fdt_add_subnode(ms->fdt, nodename);
qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "ns16550a");
qemu_fdt_setprop_cells(ms->fdt, nodename, "reg", 0x0, base, 0x0, size);
- qemu_fdt_setprop_cell(ms->fdt, nodename, "clock-frequency", 100000000);
+ qemu_fdt_setprop_cell(ms->fdt, nodename, "clock-frequency", 1843200);
if (chosen) {
qemu_fdt_setprop_string(ms->fdt, "/chosen", "stdout-path", nodename);
}
--
2.56.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v4 2/4] hw/loongarch/virt-acpi-build: Drop UART _DSD clock and add _STA
2026-10-22 7:22 ` [PATCH v4 2/4] hw/loongarch/virt-acpi-build: Drop UART _DSD clock and add _STA pillow
@ 2026-10-22 8:15 ` Igor Mammedov
2026-10-22 8:18 ` Igor Mammedov
1 sibling, 0 replies; 11+ messages in thread
From: Igor Mammedov @ 2026-10-22 8:15 UTC (permalink / raw)
To: pillow
Cc: qemu-devel, 17746591750, maobibo, lixianglai, jiaxun.yang, mst,
anisinha
On Thu, 22 Oct 2026 15:22:36 +0800
pillow <waysorrypub@gmail.com> wrote:
> 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>
do not put several different changes together
split it up on several patches
> ---
> 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);
> }
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 2/4] hw/loongarch/virt-acpi-build: Drop UART _DSD clock and add _STA
2026-10-22 7:22 ` [PATCH v4 2/4] hw/loongarch/virt-acpi-build: Drop UART _DSD clock and add _STA pillow
2026-10-22 8:15 ` Igor Mammedov
@ 2026-10-22 8:18 ` Igor Mammedov
2026-10-22 9:01 ` way sorry
1 sibling, 1 reply; 11+ messages in thread
From: Igor Mammedov @ 2026-10-22 8:18 UTC (permalink / raw)
To: pillow
Cc: qemu-devel, 17746591750, maobibo, lixianglai, jiaxun.yang, mst,
anisinha
On Thu, 22 Oct 2026 15:22:36 +0800
pillow <waysorrypub@gmail.com> wrote:
...
> @@ -325,7 +324,7 @@ static void build_uart_device_aml(Aml *table, int index)
...
> + aml_append(dev, aml_name_decl("_STA", aml_int(0x0f)));
also is it really necessary? Doesn't missing _STA imply 0xF already?
> crs = aml_resource_template();
> aml_append(crs,
> aml_qword_memory(AML_POS_DECODE, AML_MIN_FIXED, AML_MAX_FIXED,
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 2/4] hw/loongarch/virt-acpi-build: Drop UART _DSD clock and add _STA
2026-10-22 8:18 ` Igor Mammedov
@ 2026-10-22 9:01 ` way sorry
2026-10-22 9:25 ` way sorry
0 siblings, 1 reply; 11+ messages in thread
From: way sorry @ 2026-10-22 9:01 UTC (permalink / raw)
To: Igor Mammedov
Cc: qemu-devel, 17746591750, maobibo, lixianglai, jiaxun.yang, mst,
anisinha
[-- Attachment #1: Type: text/plain, Size: 1087 bytes --]
Hi Igor,
The _STA method was added in response to Bibo's review comment on the
original patch, where
he explicitly suggested adding _STA.
I understand your concern that omitting _STA already implies 0x0f. However,
the two review
comments seem to suggest different approaches.
I'm happy to split the changes into separate patches as required. For _STA,
though, I'd
appreciate it if we could first agree on whether it should be added or
omitted, so I have a clear
direction for the next version.
Thanks,
pillow
On Thu, Oct 22, 2026 at 4:18 PM Igor Mammedov <imammedo@redhat.com> wrote:
> On Thu, 22 Oct 2026 15:22:36 +0800
> pillow <waysorrypub@gmail.com> wrote:
>
> ...
> > @@ -325,7 +324,7 @@ static void build_uart_device_aml(Aml *table, int
> index)
> ...
> > + aml_append(dev, aml_name_decl("_STA", aml_int(0x0f)));
>
> also is it really necessary? Doesn't missing _STA imply 0xF already?
>
> > crs = aml_resource_template();
> > aml_append(crs,
> > aml_qword_memory(AML_POS_DECODE, AML_MIN_FIXED, AML_MAX_FIXED,
>
>
[-- Attachment #2: Type: text/html, Size: 1658 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 2/4] hw/loongarch/virt-acpi-build: Drop UART _DSD clock and add _STA
2026-10-22 9:01 ` way sorry
@ 2026-10-22 9:25 ` way sorry
2026-10-22 11:27 ` Igor Mammedov
0 siblings, 1 reply; 11+ messages in thread
From: way sorry @ 2026-10-22 9:25 UTC (permalink / raw)
To: Igor Mammedov
Cc: qemu-devel, 17746591750, maobibo, lixianglai, jiaxun.yang, mst,
anisinha
[-- Attachment #1: Type: text/plain, Size: 1617 bytes --]
Hi Igor,
One additional observation: QEMU's x86 ISA serial implementation explicitly
defines _STA =
0x0f in serial_isa_build_aml(), rather than relying on the ACPI default:
https://github.com/qemu/qemu/blob/8967b2fe1b2aaae3c29e207d85fab901d580a2dc/hw/char/serial-isa.c#L101
I think following the same approach for LoongArch UART would be reasonable
for consistency.
Thanks,
pillow
On Thu, Oct 22, 2026 at 5:01 PM way sorry <waysorrypub@gmail.com> wrote:
> Hi Igor,
>
> The _STA method was added in response to Bibo's review comment on the
> original patch, where
> he explicitly suggested adding _STA.
>
> I understand your concern that omitting _STA already implies 0x0f.
> However, the two review
> comments seem to suggest different approaches.
>
> I'm happy to split the changes into separate patches as required. For
> _STA, though, I'd
> appreciate it if we could first agree on whether it should be added or
> omitted, so I have a clear
> direction for the next version.
>
> Thanks,
> pillow
>
> On Thu, Oct 22, 2026 at 4:18 PM Igor Mammedov <imammedo@redhat.com> wrote:
>
>> On Thu, 22 Oct 2026 15:22:36 +0800
>> pillow <waysorrypub@gmail.com> wrote:
>>
>> ...
>> > @@ -325,7 +324,7 @@ static void build_uart_device_aml(Aml *table, int
>> index)
>> ...
>> > + aml_append(dev, aml_name_decl("_STA", aml_int(0x0f)));
>>
>> also is it really necessary? Doesn't missing _STA imply 0xF already?
>>
>> > crs = aml_resource_template();
>> > aml_append(crs,
>> > aml_qword_memory(AML_POS_DECODE, AML_MIN_FIXED, AML_MAX_FIXED,
>>
>>
[-- Attachment #2: Type: text/html, Size: 2634 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v4 2/4] hw/loongarch/virt-acpi-build: Drop UART _DSD clock and add _STA
2026-10-22 9:25 ` way sorry
@ 2026-10-22 11:27 ` Igor Mammedov
0 siblings, 0 replies; 11+ messages in thread
From: Igor Mammedov @ 2026-10-22 11:27 UTC (permalink / raw)
To: way sorry
Cc: qemu-devel, 17746591750, maobibo, lixianglai, jiaxun.yang, mst,
anisinha
On Thu, 22 Oct 2026 17:25:00 +0800
way sorry <waysorrypub@gmail.com> wrote:
> Hi Igor,
>
> One additional observation: QEMU's x86 ISA serial implementation explicitly
> defines _STA =
> 0x0f in serial_isa_build_aml(), rather than relying on the ACPI default:
>
> https://github.com/qemu/qemu/blob/8967b2fe1b2aaae3c29e207d85fab901d580a2dc/hw/char/serial-isa.c#L101
>
> I think following the same approach for LoongArch UART would be reasonable
> for consistency.
preexisting code in this case is not a good example to follow.
if it works without adding unnecessary stuff, do not add it.
DSD and CCA changes are also unrelated => separate patches
>
> Thanks,
> pillow
>
> On Thu, Oct 22, 2026 at 5:01 PM way sorry <waysorrypub@gmail.com> wrote:
>
> > Hi Igor,
> >
> > The _STA method was added in response to Bibo's review comment on the
> > original patch, where
> > he explicitly suggested adding _STA.
> >
> > I understand your concern that omitting _STA already implies 0x0f.
> > However, the two review
> > comments seem to suggest different approaches.
> >
> > I'm happy to split the changes into separate patches as required. For
> > _STA, though, I'd
> > appreciate it if we could first agree on whether it should be added or
> > omitted, so I have a clear
> > direction for the next version.
> >
> > Thanks,
> > pillow
> >
> > On Thu, Oct 22, 2026 at 4:18 PM Igor Mammedov <imammedo@redhat.com> wrote:
> >
> >> On Thu, 22 Oct 2026 15:22:36 +0800
> >> pillow <waysorrypub@gmail.com> wrote:
> >>
> >> ...
> >> > @@ -325,7 +324,7 @@ static void build_uart_device_aml(Aml *table, int
> >> index)
> >> ...
> >> > + aml_append(dev, aml_name_decl("_STA", aml_int(0x0f)));
> >>
> >> also is it really necessary? Doesn't missing _STA imply 0xF already?
> >>
> >> > crs = aml_resource_template();
> >> > aml_append(crs,
> >> > aml_qword_memory(AML_POS_DECODE, AML_MIN_FIXED, AML_MAX_FIXED,
> >>
> >>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-10-22 11:28 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH v4 2/4] hw/loongarch/virt-acpi-build: Drop UART _DSD clock and add _STA pillow
2026-10-22 8:15 ` 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
-- strict thread matches above, loose matches on Subject: below --
2026-03-27 2:31 [PATCH V4 0/4] add rtc acpi table Xianglai Li
2026-03-27 2:31 ` [PATCH V4 1/4] bios-tables-test-allowed-diff.h: Allow LoongArch DSDT.* Xianglai Li
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.