hw/loongarch/virt: Fix clock property name typo and order
cover hw/loongarch/virt: Fix clock property name typo and order
The property was incorrectly named "clock-frenquency" and is now corrected to "clock-frequency". The order between the property name and its frequency value has also been adjusted for consistency.
pillow (3):
bios-tables-test-allowed-diff.h: Allow LoongArch DSDT.* hw/loongarch/virt: Fix clock property name typo and order tests/data/acpi/loongarch64: Update expected DSDT.*
hw/loongarch/virt-acpi-build.c | 2 +- tests/data/acpi/loongarch64/virt/DSDT | Bin 4603 -> 4599 bytes tests/data/acpi/loongarch64/virt/DSDT.memhp | Bin 5824 -> 5820 bytes tests/data/acpi/loongarch64/virt/DSDT.numamem | Bin 4609 -> 4605 bytes .../data/acpi/loongarch64/virt/DSDT.topology | Bin 4905 -> 4901 bytes 5 files changed, 1 insertion(+), 1 deletion(-)
base-commit: 615ece3c406b262996e569f29ea6eed0d81c4d8d
Signature · 1 line
2.56.0
PATCH 1/3 bios-tables-test-allowed-diff.h: Allow LoongArch DSDT.*
--- tests/qtest/bios-tables-test-allowed-diff.h | 4 ++++ 1 file changed, 4 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +4 -0
@@ -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",
Signature · 1 line
2.56.0
PATCH 2/3 hw/loongarch/virt: Fix clock property name typo and order
In reply to pillowThe original code had a typo in the clock preperty name, and the property name and frequency value were in reversed order. According to the _DSD format rules, the property name string comes first, followed by the property value:
https://github.com/UEFI/DSD-Guide/blob/main/src/dsd-guide.adoc#data-format-definition
--- hw/loongarch/virt-acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/loongarch/virt-acpi-build.c +1 -1
@@ -336,8 +336,8 @@ static void build_uart_device_aml(Aml *table, int index) AML_SHARED, &uart_irq, 1));aml_append (dev,aml_name_decl ("_CRS" , crs)); pkg0 =aml_package (0x2 ); +aml_append (pkg0,aml_string ("clock-frequency" ));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 );
Signature · 1 line
2.56.0
PATCH 3/3 tests/data/acpi/loongarch64: Update expected DSDT.*
In reply to pillow --- DSDT (before)
+++ DSDT (after)
@@ -23,18 +23,18 @@
})
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"
+ "clock-frequency",
+ 0x05F5E100
}
}
})
}
}
Scope (_SB)
{
@@ -59,18 +59,18 @@
})
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"
+ "clock-frequency",
+ 0x05F5E100
}
}
})
}
}
Scope (_SB)
{
@@ -95,18 +95,18 @@
})
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"
+ "clock-frequency",
+ 0x05F5E100
}
}
})
}
}
Scope (_SB)
{
@@ -131,18 +131,18 @@
})
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"
+ "clock-frequency",
+ 0x05F5E100
}
}
})
}
}
Device (L000)
{
--- DSDT.memhp (before)
+++ DSDT.memhp (after)
@@ -23,18 +23,18 @@
})
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"
+ "clock-frequency",
+ 0x05F5E100
}
}
})
}
}
Scope (_SB)
{
@@ -59,18 +59,18 @@
})
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"
+ "clock-frequency",
+ 0x05F5E100
}
}
})
}
}
Scope (_SB)
{
@@ -95,18 +95,18 @@
})
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"
+ "clock-frequency",
+ 0x05F5E100
}
}
})
}
}
Scope (_SB)
{
@@ -131,18 +131,18 @@
})
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"
+ "clock-frequency",
+ 0x05F5E100
}
}
})
}
}
Device (L000)
{
--- DSDT.numamem (before)
+++ DSDT.numamem (after)
@@ -23,18 +23,18 @@
})
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"
+ "clock-frequency",
+ 0x05F5E100
}
}
})
}
}
Scope (_SB)
{
@@ -59,18 +59,18 @@
})
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"
+ "clock-frequency",
+ 0x05F5E100
}
}
})
}
}
Scope (_SB)
{
@@ -95,18 +95,18 @@
})
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"
+ "clock-frequency",
+ 0x05F5E100
}
}
})
}
}
Scope (_SB)
{
@@ -131,18 +131,18 @@
})
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"
+ "clock-frequency",
+ 0x05F5E100
}
}
})
}
}
Device (L000)
{
--- DSDT.topology (before)
+++ DSDT.topology (after)
@@ -23,18 +23,18 @@
})
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"
+ "clock-frequency",
+ 0x05F5E100
}
}
})
}
}
Scope (_SB)
{
@@ -59,18 +59,18 @@
})
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"
+ "clock-frequency",
+ 0x05F5E100
}
}
})
}
}
Scope (_SB)
{
@@ -95,18 +95,18 @@
})
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"
+ "clock-frequency",
+ 0x05F5E100
}
}
})
}
}
Scope (_SB)
{
@@ -131,18 +131,18 @@
})
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"
+ "clock-frequency",
+ 0x05F5E100
}
}
})
}
}
Device (L000)
{--- tests/data/acpi/loongarch64/virt/DSDT | Bin 4603 -> 4599 bytes tests/data/acpi/loongarch64/virt/DSDT.memhp | Bin 5824 -> 5820 bytes tests/data/acpi/loongarch64/virt/DSDT.numamem | Bin 4609 -> 4605 bytes .../data/acpi/loongarch64/virt/DSDT.topology | Bin 4905 -> 4901 bytes tests/qtest/bios-tables-test-allowed-diff.h | 4 ---- 5 files changed, 4 deletions(-)
tests/data/acpi/loongarch64/virt/DSDT binary +0 -0
tests/data/acpi/loongarch64/virt/DSDT.memhp binary +0 -0
tests/data/acpi/loongarch64/virt/DSDT.numamem binary +0 -0
tests/data/acpi/loongarch64/virt/DSDT.topology binary +0 -0
tests/qtest/bios-tables-test-allowed-diff.h +0 -4
@@ -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",
Signature · 1 line
2.56.0
Quoted 17 lines · pillow
The original code had a typo in the clock preperty name, and the property name and frequency value were in reversed order. According to the
_DSDformat rules, the property name string comes first, followed by the property value:
https://github.com/UEFI/DSD-Guide/blob/main/src/dsd-guide.adoc#data-format-definitionSigned-off-by pillow <[email protected]>--- hw/loongarch/virt-acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/loongarch/virt-acpi-build.c +0
-0
hw/loongarch/virt-acpi-build.c static void build_uart_device_aml(Aml *table, int index) · line 343
Quoted 9 lines
hw/loongarch/virt-acpi-build.c +1
-1@@ -336,8 +336,8 @@ static void build_uart_device_aml(Aml *table, int index) AML_SHARED, &uart_irq, 1));aml_append (dev,aml_name_decl ("_CRS" , crs)); pkg0 =aml_package (0x2 ); +aml_append (pkg0,aml_string ("clock-frequency" ));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 );
Hi,
yes, there is spelling issue with LoongArch virt machine UART acpi table. It seems that clock-frequency is not used by serial port. is it possible to remove pkg0/pkg1/pkg2 property like ISA serial acpi table defined in function serial_isa_build_aml()?
Also "_CCA" property should be removed since the emulated serial port does not support DMA, and add "_STA" property.
Regards
Bibo Mao
Quoted 33 lines · Bibo Mao
Quoted 26 lines · pillow
The original code had a typo in the clock preperty name, and the property name and frequency value were in reversed order. According to the
_DSDformat rules, the property name string comes first, followed by the property value:
https://github.com/UEFI/DSD-Guide/blob/main/src/dsd-guide.adoc#data-format-definitionSigned-off-by pillow <[email protected]>---
hw/loongarch/virt-acpi-build.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)hw/loongarch/virt-acpi-build.c +1
-1@@ -336,8 +336,8 @@ static void build_uart_device_aml(Aml *table, int index) AML_SHARED, &uart_irq, 1)); aml_append(dev, aml_name_decl("_CRS", crs)); pkg0 = aml_package(0x2); + aml_append(pkg0, aml_string("clock-frequency")); aml_append(pkg0, aml_int(0x05F5E100)); - aml_append(pkg0, aml_string("clock-frenquency")); pkg1 = aml_package(0x1); aml_append(pkg1, pkg0);Quoted 2 lines
pkg2 =
aml_package(0x2);Hi,
Quoted 3 lines
yes, there is spelling issue with LoongArch virt machine UART acpi table. It seems that clock-frequency is not used by serial port. is it possible to remove pkg0/pkg1/pkg2 property like ISA serial acpi table defined in function
serial_isa_build_aml()?Also "
_CCA" property should be removed since the emulated serial port does not support DMA, and add "_STA" property.
Also maybe property clock-frequency of uart fdt table in fdt_add_uart_node() can be removed.
Regards
Bibo Mao
Quoted 3 lines
Regards
Bibo Mao
Hi all,
Thanks for the comments. v2 drops _CCA from the UART and adds _STA = 0x0f. The expected DSDT blobs have been updated, and the 5 ACPI subtests pass.
On the DT side: with Linux 7.0, removing clock-frequency makes all 4 UARTs report failed to get clock, and the real driver fails to probe, so we are keeping the property for now. Logs:
[ 0.702431] of_serial 1fe001e0.serial: error -ENOENT: failed to get clock [ 0.702884] of_serial 1fe001e0.serial: probe with driver of_serial failed with error -2 [ 0.703468] of_serial 1fe002e0.serial: error -ENOENT: failed to get clock [ 0.703718] of_serial 1fe002e0.serial: probe with driver of_serial failed with error -2 [ 0.704127] of_serial 1fe003e0.serial: error -ENOENT: failed to get clock [ 0.704371] of_serial 1fe003e0.serial: probe with driver of_serial failed with error -2 [ 0.704762] of_serial 1fe004e0.serial: error -ENOENT: failed to get clock [ 0.705013] of_serial 1fe004e0.serial: probe with driver of_serial
failed with error -2
On the ACPI side: after removing it, all 4 UARTs still register, but base_baud changes from 6250000 to 115200. Logs:
With clock-frequency:
[ 0.813488] 00:00: ttyS0 at MMIO 0x1fe001e0 (irq = 20, base_baud = 6250000) is a 16550A Without clock-frequency: [ 0.843528] 00:00: ttyS0 at MMIO 0x1fe001e0 (irq = 20, base_baud = 115200) is a 16550A [ 0.844663] printk: legacy console [ttyS0] enabled [ 0.845209] printk: legacy bootconsole [uart0] disabled [ 0.869343] 00:01: ttyS1 at MMIO 0x1fe002e0 (irq = 21, base_baud = 115200) is a 16550A [ 0.892556] 00:02: ttyS2 at MMIO 0x1fe003e0 (irq = 22, base_baud = 115200) is a 16550A [ 0.914867] 00:03: ttyS3 at MMIO 0x1fe004e0 (irq = 23, base_baud =
115200) is a 16550A
The reason is that Linux provides a default clock of 1,843,200 Hz in 8250_pnp.c, which matches the current QEMU UART model:
So the property is optional under Linux ACPI, but that does not mean Linux does not use it.
So far I have only verified boot, UART registration, and console output. I have not tested other kernels or full TX/RX behavior. We would prefer to keep an explicit and accurate frequency description rather than rely on a kernel-specific default. But keeping the property does not mean keeping the current 100 MHz; the correct value still needs discussion.
Questions: what is the advantage of omitting the ACPI clock property here? Is there any compatibility rationale from other guest OSes that supports omitting it?
Thanks,
pillow
Quoted 55 lines · Bibo Mao
Quoted 8 lines · Bibo Mao
Quoted 5 lines · pillow
The original code had a typo in the clock preperty name, and the property name and frequency value were in reversed order. According to the
_DSDformat rules, the property name string comes first, followed by the property value:https://github.com/UEFI/DSD-Guide/blob/main/src/dsd-guide.adoc#data-format-definition
Quoted 26 lines
Quoted 22 lines
Signed-off-by pillow <[email protected]>--- hw/loongarch/virt-acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/loongarch/virt-acpi-build.c +1
-1@@ -336,8 +336,8 @@ static void build_uart_device_aml(Aml *table, int index) AML_SHARED, &uart_irq, 1));aml_append (dev,aml_name_decl ("_CRS" , crs)); pkg0 =aml_package (0x2 ); +aml_append (pkg0,aml_string ("clock-frequency" ));aml_append (pkg0,aml_int (0x05F5E100 )); -aml_append (pkg0,aml_string ("clock-frenquency" )); pkg1 =aml_package (0x1 );aml_append (pkg1, pkg0);Quoted 2 lines
pkg2 = aml_package(0x2);Hi,
Quoted 7 lines
yes, there is spelling issue with LoongArch virt machine UART acpi table. It seems that clock-frequency is not used by serial port. is it possible to remove pkg0/pkg1/pkg2 property like ISA serial acpi table defined in function
serial_isa_build_aml()?Also "
_CCA" property should be removed since the emulated serial port does not support DMA, and add "_STA" property.Also maybe property clock-frequency of uart fdt table in
fdt_add_uart_node()can be removed.Regards
Bibo MaoQuoted 3 lines
Regards
Bibo Mao
Quoted 40 lines · way sorry
Hi all,
Thanks for the comments. v2 drops
_CCAfrom the UART and adds_STA = 0x0f. The expected DSDT blobs have been updated, and the 5 ACPI subtests pass.On the DT side: with Linux 7.0, removing
clock-frequencymakes all 4 UARTs reportfailed to get clock, and the real driver fails to probe, so we are keeping the property for now. Logs:[ 0.702431]
of_serial1fe001e0.serial: error-ENOENT: failed to get clock [ 0.702884]of_serial1fe001e0.serial: probe with driverof_serialfailed with error -2 [ 0.703468]of_serial1fe002e0.serial: error-ENOENT: failed to get clock [ 0.703718]of_serial1fe002e0.serial: probe with driverof_serialfailed with error -2 [ 0.704127]of_serial1fe003e0.serial: error-ENOENT: failed to get clock [ 0.704371]of_serial1fe003e0.serial: probe with driverof_serialfailed with error -2 [ 0.704762]of_serial1fe004e0.serial: error-ENOENT: failed to get clock [ 0.705013]of_serial1fe004e0.serial: probe with driverof_serialfailed with error -2On the ACPI side: after removing it, all 4 UARTs still register, but
base_baudchanges from 6250000 to 115200. Logs:With clock-frequency:
[ 0.813488] 00:00: ttyS0 at MMIO0x1fe001e0(irq = 20,base_baud= 6250000) is a 16550A Without clock-frequency:
[ 0.843528] 00:00: ttyS0 at MMIO0x1fe001e0(irq = 20,base_baud= 115200) is a 16550A [ 0.844663] printk: legacy console [ttyS0] enabled
[ 0.845209] printk: legacy bootconsole [uart0] disabled
[ 0.869343] 00:01: ttyS1 at MMIO0x1fe002e0(irq = 21,base_baud= 115200) is a 16550A [ 0.892556] 00:02: ttyS2 at MMIO0x1fe003e0(irq = 22,base_baud= 115200) is a 16550A [ 0.914867] 00:03: ttyS3 at MMIO0x1fe004e0(irq = 23,base_baud= 115200) is a 16550AThe reason is that Linux provides a default clock of 1,843,200 Hz in
8250_pnp.c, which matches the current QEMU UART model:So the property is optional under Linux ACPI, but that does not mean Linux does not use it.
Quoted 6 lines
So far I have only verified boot, UART registration, and console output. I have not tested other kernels or full TX/RX behavior. We would prefer to keep an explicit and accurate frequency description rather than rely on a kernel-specific default. But keeping the property does not mean keeping the current 100 MHz; the correct value still needs discussion.
so what is the suggested frequency from your side?
Quoted 4 lines
Questions: what is the advantage of omitting the ACPI clock property here? Is there any compatibility rationale from other guest OSes that supports omitting it?
Can you describe the detailed guest OS? which cannot run in qemu-x86 platform without ACPI clock property.
Regards
Bibo Mao
Quoted 66 lines
Thanks,
pillowOn Thu, Oct 15, 2026 at 6:03 PM Bibo Mao <[email protected] <mailto:[email protected]>> wrote:
On 2026/10/15 下午2:57, Bibo Mao wrote: > > > On 2026/10/12 下午7:39, pillow wrote: >> The original code had a typo in the clock preperty name, and the >> property name and frequency value were in reversed order. >> According to the _DSD format rules, the property name string comes >> first, followed by the property value: >> https://github.com/UEFI/DSD-Guide/blob/main/src/dsd-guide.adoc#data-format-definition >> >> >> Signed-off-by: pillow <[email protected] <mailto:[email protected]>> >> --- >> hw/loongarch/virt-acpi-build.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/hw/loongarch/virt-acpi-build.c >> b/hw/loongarch/virt-acpi-build.c >> index 54965f0..4081730 100644 >> --- a/hw/loongarch/virt-acpi-build.c >> +++ b/hw/loongarch/virt-acpi-build.c >> @@ -336,8 +336,8 @@ static void build_uart_device_aml(Aml *table, int >> index) >> AML_SHARED, &uart_irq, 1)); >> aml_append(dev, aml_name_decl("_CRS", crs)); >> pkg0 = aml_package(0x2); >> + aml_append(pkg0, aml_string("clock-frequency")); >> 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); >> > Hi, > > yes, there is spelling issue with LoongArch virt machine UART acpi > table. It seems that clock-frequency is not used by serial port. is it > possible to remove pkg0/pkg1/pkg2 property like ISA serial acpi table > defined in function serial_isa_build_aml()? > > Also "_CCA" property should be removed since the emulated serial port > does not support DMA, and add "_STA" property. Also maybe property clock-frequency of uart fdt table in fdt_add_uart_node() can be removed. Regards Bibo Mao > > Regards > Bibo Mao
Hi Bobo,
After checking the QEMU UART source codes and Linux PNP driver, I agree with dropping the ACPI clock property, The default 1843200 Hz clock matches QEMU's baudbase of 115200. This also follows the x86 ISA serial approach.
I have sent v3, which removes the UART _DSD and _CCA, adds _STA = 0x0f, and updates the expected DSDT blobs. All five ACPI subtests pass.
The FDT clock property is kept, since removing it causes UART probe failures with Linux
Thanks,
pillow
Quoted 144 lines · Bibo Mao
Quoted 11 lines · way sorry
Hi all,
Thanks for the comments. v2 drops
_CCAfrom the UART and adds_STA = 0x0f. The expected DSDT blobs have been updated, and the 5 ACPI subtests pass.On the DT side: with Linux 7.0, removing
clock-frequencymakes all 4 UARTs reportfailed to get clock, and the real driver fails to probe, so we are keeping the property for now. Logs:[ 0.702431] of_serial 1fe001e0.serial: error -ENOENT: failed to getclock
Quoted 3 lines
[ 0.702884] of_serial 1fe001e0.serial: probe with driver of_serial failed with error -2 [ 0.703468] of_serial 1fe002e0.serial: error -ENOENT: failed to getclock
Quoted 3 lines
[ 0.703718] of_serial 1fe002e0.serial: probe with driver of_serial failed with error -2 [ 0.704127] of_serial 1fe003e0.serial: error -ENOENT: failed to getclock
Quoted 3 lines
[ 0.704371] of_serial 1fe003e0.serial: probe with driver of_serial failed with error -2 [ 0.704762] of_serial 1fe004e0.serial: error -ENOENT: failed to getclock
Quoted 19 lines
[ 0.705013] of_serial 1fe004e0.serial: probe with driver of_serialfailed with error -2
On the ACPI side: after removing it, all 4 UARTs still register, but
base_baudchanges from 6250000 to 115200. Logs:With clock-frequency:
[ 0.813488] 00:00: ttyS0 at MMIO 0x1fe001e0 (irq = 20, base_baud = 6250000) is a 16550A Without clock-frequency: [ 0.843528] 00:00: ttyS0 at MMIO 0x1fe001e0 (irq = 20, base_baud = 115200) is a 16550A [ 0.844663] printk: legacy console [ttyS0] enabled [ 0.845209] printk: legacy bootconsole [uart0] disabled [ 0.869343] 00:01: ttyS1 at MMIO 0x1fe002e0 (irq = 21, base_baud = 115200) is a 16550A [ 0.892556] 00:02: ttyS2 at MMIO 0x1fe003e0 (irq = 22, base_baud = 115200) is a 16550A [ 0.914867] 00:03: ttyS3 at MMIO 0x1fe004e0 (irq = 23, base_baud =Quoted 6 lines
115200) is a 16550A
The reason is that Linux provides a default clock of 1,843,200 Hz in
8250_pnp.c, which matches the current QEMU UART model:Quoted 10 lines
So the property is optional under Linux ACPI, but that does not mean Linux does not use it.
So far I have only verified boot, UART registration, and console output. I have not tested other kernels or full TX/RX behavior. We would prefer to keep an explicit and accurate frequency description rather than rely on a kernel-specific default. But keeping the property does not mean keeping the current 100 MHz; the correct value still needs discussion.
so what is the suggested frequency from your side?
Quoted 4 lines
Questions: what is the advantage of omitting the ACPI clock property here? Is there any compatibility rationale from other guest OSes that supports omitting it?
Can you describe the detailed guest OS? which cannot run in qemu-x86 platform without ACPI clock property.
Regards
Bibo MaoQuoted 9 lines
Thanks,
pillowOn Thu, Oct 15, 2026 at 6:03 PM Bibo Mao <[email protected] <mailto:[email protected]>> wrote:
Quoted 7 lines
On 2026/10/15 下午2:57, Bibo Mao wrote: > > > On 2026/10/12 下午7:39, pillow wrote: >> The original code had a typo in the clock preperty name, and the >> property name and frequency value were in reversed order. >> According to the _DSD format rules, the property name stringcomes
Quoted 3 lines
>> first, followed by the property value:
>>https://github.com/UEFI/DSD-Guide/blob/main/src/dsd-guide.adoc#data-format-definition
Quoted 48 lines
>> >> >> Signed-off-by: pillow <[email protected] <mailto:[email protected]>> >> --- >> hw/loongarch/virt-acpi-build.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/hw/loongarch/virt-acpi-build.c >> b/hw/loongarch/virt-acpi-build.c >> index 54965f0..4081730 100644 >> --- a/hw/loongarch/virt-acpi-build.c >> +++ b/hw/loongarch/virt-acpi-build.c >> @@ -336,8 +336,8 @@ static void build_uart_device_aml(Aml *table, int >> index) >> AML_SHARED, &uart_irq, 1)); >> aml_append(dev, aml_name_decl("_CRS", crs)); >> pkg0 = aml_package(0x2); >> + aml_append(pkg0, aml_string("clock-frequency")); >> 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); >> > Hi, > > yes, there is spelling issue with LoongArch virt machine UART acpi > table. It seems that clock-frequency is not used by serial port. is it > possible to remove pkg0/pkg1/pkg2 property like ISA serial acpi table > defined in function serial_isa_build_aml()? > > Also "_CCA" property should be removed since the emulated serial port > does not support DMA, and add "_STA" property. Also maybe property clock-frequency of uart fdt table in fdt_add_uart_node() can be removed. Regards Bibo Mao > > Regards > Bibo Mao