All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] hw/loongarch/virt: Fix UART ACPI description and update DSDT blobs
@ 2026-10-21 13:53 pillow
  2026-10-21 13:53 ` [PATCH v3 1/3] bios-tables-test-allowed-diff.h: Allow LoongArch DSDT.* pillow
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: pillow @ 2026-10-21 13:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: 17746591750, maobibo, lixianglai, jiaxun.yang, mst, imammedo,
	anisinha, pillow

The LoongArch virt UART ACPI description currently carries a _DSD clock
property with a typo ("clock-frenquency"), a reversed key/value order,
and a declared 100 MHz that does not match the QEMU model. The _DSD
contains nothing but this clock property, so the whole object is
dropped.

The Linux PNP serial driver uses uartclk = 1843200 Hz by default and
the QEMU UART uses baudbase = 115200, i.e. uartclk / 16 = baudbase,
so the Linux default clock already matches the model. QEMU's x86 ISA
serial ACPI description also provides no clock property, which is
consistent with this change.

Two further cleanups are folded into the same patch: _CCA is dropped
because the emulated UART does not support DMA, and _STA = 0x0f is
added to indicate the device is present, enabled, should be shown and
functioning properly.

Patch 1 allows the LoongArch DSDT.* diffs in bios-tables-test, patch 2
makes the ACPI change, and patch 3 refreshes the expected DSDT blobs.

Testing: ran bios-tables-test with the updated blobs; no unexpected
diffs remain.

pillow (3):
  bios-tables-test-allowed-diff.h: Allow LoongArch DSDT.*
  hw/loongarch/virt: Drop UART _DSD/_CCA and add _STA
  tests/data/acpi/loongarch64: Update expected DSDT.*

 hw/loongarch/virt-acpi-build.c                |  12 +-----------
 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
 5 files changed, 1 insertion(+), 11 deletions(-)


base-commit: 8967b2fe1b2aaae3c29e207d85fab901d580a2dc
-- 
2.56.0



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3 1/3] bios-tables-test-allowed-diff.h: Allow LoongArch DSDT.*
  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 ` pillow
  2026-10-21 13:53 ` [PATCH v3 2/3] hw/loongarch/virt: Drop UART _DSD/_CCA and add _STA pillow
  2026-10-21 13:53 ` [PATCH v3 3/3] tests/data/acpi/loongarch64: Update expected DSDT.* pillow
  2 siblings, 0 replies; 6+ messages in thread
From: pillow @ 2026-10-21 13:53 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] 6+ messages in thread

* [PATCH v3 2/3] hw/loongarch/virt: Drop UART _DSD/_CCA and add _STA
  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
  2026-10-22  1:23   ` Bibo Mao
  2026-10-21 13:53 ` [PATCH v3 3/3] tests/data/acpi/loongarch64: Update expected DSDT.* pillow
  2 siblings, 1 reply; 6+ messages in thread
From: pillow @ 2026-10-21 13:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: 17746591750, maobibo, lixianglai, jiaxun.yang, mst, imammedo,
	anisinha, pillow

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



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v3 3/3] tests/data/acpi/loongarch64: Update expected DSDT.*
  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 ` [PATCH v3 2/3] hw/loongarch/virt: Drop UART _DSD/_CCA and add _STA pillow
@ 2026-10-21 13:53 ` pillow
  2 siblings, 0 replies; 6+ messages in thread
From: pillow @ 2026-10-21 13:53 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] 6+ messages in thread

* Re: [PATCH v3 2/3] hw/loongarch/virt: Drop UART _DSD/_CCA and add _STA
  2026-10-21 13:53 ` [PATCH v3 2/3] hw/loongarch/virt: Drop UART _DSD/_CCA and add _STA pillow
@ 2026-10-22  1:23   ` Bibo Mao
  2026-10-22  7:28     ` way sorry
  0 siblings, 1 reply; 6+ messages in thread
From: Bibo Mao @ 2026-10-22  1:23 UTC (permalink / raw)
  To: pillow, qemu-devel
  Cc: 17746591750, lixianglai, jiaxun.yang, mst, imammedo, anisinha



On 2026/10/21 下午9:53, pillow wrote:
> 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
baudrate = uartclk / 16 / divider, the default divider is 12, so the 
default baudrate is 9600. It can be referenced in function serial_reset():
     /* Default to 9600 baud, 1 start bit, 8 data bits */
     s->divider = 0x0C;

The clock freq in FDT table should be changed with 1843200 rather than 
100000000, however it may be another issue.

Reviewed-by: Bibo Mao <maobibo@loongson.cn>

> 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);
>   }
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3 2/3] hw/loongarch/virt: Drop UART _DSD/_CCA and add _STA
  2026-10-22  1:23   ` Bibo Mao
@ 2026-10-22  7:28     ` way sorry
  0 siblings, 0 replies; 6+ messages in thread
From: way sorry @ 2026-10-22  7:28 UTC (permalink / raw)
  To: Bibo Mao
  Cc: qemu-devel, 17746591750, lixianglai, jiaxun.yang, mst, imammedo,
	anisinha

[-- Attachment #1: Type: text/plain, Size: 3669 bytes --]

Hi, all

Agreed. The reset baud rate is 9600, while 115200 is the baudbase.

I've sent v4 with a separate patch correcting the FDT UART clock
to 1843200 Hz. I've alse carried your Reviewed-by on the ACPI patch.

Thanks,
pillow

On Thu, Oct 22, 2026 at 9:22 AM Bibo Mao <maobibo@loongson.cn> wrote:

>
>
> On 2026/10/21 下午9:53, pillow wrote:
> > 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
> baudrate = uartclk / 16 / divider, the default divider is 12, so the
> default baudrate is 9600. It can be referenced in function serial_reset():
>      /* Default to 9600 baud, 1 start bit, 8 data bits */
>      s->divider = 0x0C;
>
> The clock freq in FDT table should be changed with 1843200 rather than
> 100000000, however it may be another issue.
>
> Reviewed-by: Bibo Mao <maobibo@loongson.cn>
>
> > 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);
> >   }
> >
>
>

[-- Attachment #2: Type: text/html, Size: 4699 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-10-22  7:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH v3 2/3] hw/loongarch/virt: Drop UART _DSD/_CCA and add _STA pillow
2026-10-22  1:23   ` 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

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.