public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH edk2-platforms 0/2] Silicon/Qemu: SbsaQemu ACPI formatting improvements
@ 2023-02-21  1:09 Rebecca Cran
  2023-02-21  1:09 ` [PATCH edk2-platforms 1/2] Silicon/Qemu: Convert DSDT ASL from legacy to ASL 2.0 syntax Rebecca Cran
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rebecca Cran @ 2023-02-21  1:09 UTC (permalink / raw)
  To: devel, Ard Biesheuvel, Leif Lindholm, Radoslaw Biernacki; +Cc: Rebecca Cran

Improve the readability of the SbsaQemu SPCR and DSDT.

Rebecca Cran (2):
  Silicon/Qemu: Convert DSDT ASL from legacy to ASL 2.0 syntax
  Silicon/Qemu: Use the symbolic value for the SPCR table revision.

 Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl  | 18 +++++++++---------
 Silicon/Qemu/SbsaQemu/AcpiTables/Spcr.aslc |  3 ++-
 2 files changed, 11 insertions(+), 10 deletions(-)

-- 
2.30.2


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

* [PATCH edk2-platforms 1/2] Silicon/Qemu: Convert DSDT ASL from legacy to ASL 2.0 syntax
  2023-02-21  1:09 [PATCH edk2-platforms 0/2] Silicon/Qemu: SbsaQemu ACPI formatting improvements Rebecca Cran
@ 2023-02-21  1:09 ` Rebecca Cran
  2023-02-21  1:09 ` [PATCH edk2-platforms 2/2] Silicon/Qemu: Use the symbolic value for the SPCR table revision Rebecca Cran
  2023-02-21  8:50 ` [edk2-devel] [PATCH edk2-platforms 0/2] Silicon/Qemu: SbsaQemu ACPI formatting improvements Ard Biesheuvel
  2 siblings, 0 replies; 4+ messages in thread
From: Rebecca Cran @ 2023-02-21  1:09 UTC (permalink / raw)
  To: devel, Ard Biesheuvel, Leif Lindholm, Radoslaw Biernacki; +Cc: Rebecca Cran

From: Rebecca Cran <quic_rcran@quicinc.com>

ACPI 6.0 introduced support for ASL 2.0 includes standard operators.
Convert the DSDT from legacy to ASL 2.0 syntax.

Signed-off-by: Rebecca Cran <quic_rcran@quicinc.com>
---
 Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl b/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl
index 3357916571fe..e50772fcf76d 100644
--- a/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl
+++ b/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl
@@ -449,7 +449,7 @@ DefinitionBlock ("DsdtTable.aml", "DSDT",
        */
       Method (_OSC,4) {
         // Check for proper UUID
-        If (LEqual(Arg0,ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766"))) {
+        If (Arg0 == ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766")) {
           // Create DWord-adressable fields from the Capabilities Buffer
           CreateDWordField (Arg3,0,CDW1)
           CreateDWordField (Arg3,4,CDW2)
@@ -463,28 +463,28 @@ DefinitionBlock ("DsdtTable.aml", "DSDT",
           // * ASPM
           // * Clock PM
           // * MSI/MSI-X
-          If (LNotEqual(And(SUPP, 0x16), 0x16)) {
-            And (CTRL,0x1E,CTRL) // Mask bit 0 (and undefined bits)
+          If ((SUPP & 0x16) != 0x16) {
+            CTRL &= 0x1E // Mask bit 0 (and undefined bits)
           }
 
           // Always allow native PME, AER (no dependencies)
 
           // Never allow SHPC (no SHPC controller in this system)
-          And (CTRL,0x1D,CTRL)
+          CTRL &= 0x1D
 
-          If (LNotEqual(Arg1,One)) {        // Unknown revision
-            Or (CDW1,0x08,CDW1)
+          If (Arg1 != One) {         // Unknown revision
+            CDW1 |= 0x08
           }
 
-          If (LNotEqual(CDW3,CTRL)) {        // Capabilities bits were masked
-            Or (CDW1,0x10,CDW1)
+          If (CDW3 != CTRL) {        // Capabilities bits were masked
+            CDW1 |= 0x10
           }
 
           // Update DWORD3 in the buffer
           Store (CTRL,CDW3)
           Return (Arg3)
         } Else {
-          Or (CDW1,4,CDW1) // Unrecognized UUID
+          CDW1 |= 4 // Unrecognized UUID
           Return (Arg3)
         }
       } // End _OSC
-- 
2.30.2


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

* [PATCH edk2-platforms 2/2] Silicon/Qemu: Use the symbolic value for the SPCR table revision.
  2023-02-21  1:09 [PATCH edk2-platforms 0/2] Silicon/Qemu: SbsaQemu ACPI formatting improvements Rebecca Cran
  2023-02-21  1:09 ` [PATCH edk2-platforms 1/2] Silicon/Qemu: Convert DSDT ASL from legacy to ASL 2.0 syntax Rebecca Cran
@ 2023-02-21  1:09 ` Rebecca Cran
  2023-02-21  8:50 ` [edk2-devel] [PATCH edk2-platforms 0/2] Silicon/Qemu: SbsaQemu ACPI formatting improvements Ard Biesheuvel
  2 siblings, 0 replies; 4+ messages in thread
From: Rebecca Cran @ 2023-02-21  1:09 UTC (permalink / raw)
  To: devel, Ard Biesheuvel, Leif Lindholm, Radoslaw Biernacki; +Cc: Rebecca Cran

From: Rebecca Cran <quic_rcran@quicinc.com>

The current SPCR table revision is 2. Instead of using a hard-coded
value, use the symbolic constant
EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION.

Signed-off-by: Rebecca Cran <quic_rcran@quicinc.com>
---
 Silicon/Qemu/SbsaQemu/AcpiTables/Spcr.aslc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/Spcr.aslc b/Silicon/Qemu/SbsaQemu/AcpiTables/Spcr.aslc
index 432097307f8a..435b7fe66778 100644
--- a/Silicon/Qemu/SbsaQemu/AcpiTables/Spcr.aslc
+++ b/Silicon/Qemu/SbsaQemu/AcpiTables/Spcr.aslc
@@ -17,7 +17,8 @@ STATIC EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE Spcr = {
   SBSAQEMU_ACPI_HEADER (
     EFI_ACPI_6_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE,
     EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE,
-    2), /* New MS definition for PL011 support */
+    /* New MS definition for PL011 support */
+    EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION),
   EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_ARM_PL011_UART,
   { EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE },
   {
-- 
2.30.2


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

* Re: [edk2-devel] [PATCH edk2-platforms 0/2] Silicon/Qemu: SbsaQemu ACPI formatting improvements
  2023-02-21  1:09 [PATCH edk2-platforms 0/2] Silicon/Qemu: SbsaQemu ACPI formatting improvements Rebecca Cran
  2023-02-21  1:09 ` [PATCH edk2-platforms 1/2] Silicon/Qemu: Convert DSDT ASL from legacy to ASL 2.0 syntax Rebecca Cran
  2023-02-21  1:09 ` [PATCH edk2-platforms 2/2] Silicon/Qemu: Use the symbolic value for the SPCR table revision Rebecca Cran
@ 2023-02-21  8:50 ` Ard Biesheuvel
  2 siblings, 0 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2023-02-21  8:50 UTC (permalink / raw)
  To: devel, quic_rcran; +Cc: Leif Lindholm, Radoslaw Biernacki, Rebecca Cran

On Tue, 21 Feb 2023 at 02:09, Rebecca Cran <quic_rcran@quicinc.com> wrote:
>
> Improve the readability of the SbsaQemu SPCR and DSDT.
>
> Rebecca Cran (2):
>   Silicon/Qemu: Convert DSDT ASL from legacy to ASL 2.0 syntax
>   Silicon/Qemu: Use the symbolic value for the SPCR table revision.
>

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>

Pushed as e20ee6e3a65d..bb3d2f10a9d7

Thanks!


>  Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl  | 18 +++++++++---------
>  Silicon/Qemu/SbsaQemu/AcpiTables/Spcr.aslc |  3 ++-
>  2 files changed, 11 insertions(+), 10 deletions(-)
>
> --
> 2.30.2
>
>
>
> 
>
>

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

end of thread, other threads:[~2023-02-21  8:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-21  1:09 [PATCH edk2-platforms 0/2] Silicon/Qemu: SbsaQemu ACPI formatting improvements Rebecca Cran
2023-02-21  1:09 ` [PATCH edk2-platforms 1/2] Silicon/Qemu: Convert DSDT ASL from legacy to ASL 2.0 syntax Rebecca Cran
2023-02-21  1:09 ` [PATCH edk2-platforms 2/2] Silicon/Qemu: Use the symbolic value for the SPCR table revision Rebecca Cran
2023-02-21  8:50 ` [edk2-devel] [PATCH edk2-platforms 0/2] Silicon/Qemu: SbsaQemu ACPI formatting improvements Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox