[edk2-devel] [PATCH edk2-platforms 1/1] Silicon/Socionext/SynQuacer: use Generic Event Device for power button

Andrei Warkentin awarkentin at vmware.com
Fri May 15 20:00:07 UTC 2020


I've not tested this, but it looks good. You wouldn't happen to have a capsule handy that I or others could try?

Is there any value behind explicitly testing for the right pin in _EVT? Just to be patently obvious that this is where the demux could happen to trigger other events (just building on top of yesterday's discussion)

Regardless - Reviewed-by: Andrey Warkentin <andrey.warkentin at gmail.com>

A
________________________________
From: devel at edk2.groups.io <devel at edk2.groups.io> on behalf of Ard Biesheuvel via groups.io <ard.biesheuvel=arm.com at groups.io>
Sent: Friday, May 15, 2020 3:32 AM
To: devel at edk2.groups.io <devel at edk2.groups.io>
Cc: leif at nuviainc.com <leif at nuviainc.com>; andrey.warkentin at gmail.com <andrey.warkentin at gmail.com>; Ard Biesheuvel <ard.biesheuvel at arm.com>
Subject: [edk2-devel] [PATCH edk2-platforms 1/1] Silicon/Socionext/SynQuacer: use Generic Event Device for power button

Drop the description of the interrupt handling part of the GPIO
controller, and use a ACPI0013 Generic Event device instead to
handle the power button event. This way, an OS can handle these
events without the need for a SoC specific driver.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel at arm.com>
---
 Silicon/Socionext/SynQuacer/AcpiTables/Dsdt.asl | 52 ++++++++++++--------
 1 file changed, 31 insertions(+), 21 deletions(-)

diff --git a/Silicon/Socionext/SynQuacer/AcpiTables/Dsdt.asl b/Silicon/Socionext/SynQuacer/AcpiTables/Dsdt.asl
index f6ff3988aa91..3cfd025fbc16 100644
--- a/Silicon/Socionext/SynQuacer/AcpiTables/Dsdt.asl
+++ b/Silicon/Socionext/SynQuacer/AcpiTables/Dsdt.asl
@@ -196,18 +196,40 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "SNI", "SYNQUACR",
       })
     }

-    Device (EXIU) {
-      Name (_HID, "SCX0008")
+    Device (GED0) {
+      Name (_HID, "ACPI0013")
       Name (_UID, Zero)
       Name (_CRS, ResourceTemplate () {
-        Memory32Fixed (ReadWrite, SYNQUACER_EXIU_BASE, SYNQUACER_EXIU_SIZE)
-      })
-      Name (_DSD, Package () {
-        ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
-        Package () {
-          Package () { "socionext,spi-base", 112 },
-        }
+       Interrupt (ResourceConsumer, Edge, ActiveHigh, ExclusiveAndWake) { 152 }
       })
+      OperationRegion (EXIU, SystemMemory, SYNQUACER_EXIU_BASE, 0x20)
+      Field (EXIU, DWordAcc, NoLock, Preserve)
+      {
+          MASK,   32,
+          SRCS,   32,
+          REQS,   32,
+          RAWR,   32,
+          REQC,   32,
+          LEVL,   32,
+          EDGC,   32,
+          SWIR,   32,
+      }
+
+      Method (_INI) {
+        REQC = 0xffffffff
+        MASK = 0xffffffff
+
+        /* enable the power button on line 8 as edge active low */
+        LEVL &= ~0x100
+        EDGC |= 0x100
+        REQC = 0x100
+        MASK = 0xfffffeff
+      }
+
+      Method (_EVT) {
+        REQC = 0x100
+        Notify (\_SB.PWRB, 0x80)
+      }
     }

     Device (GPIO) {
@@ -215,9 +237,6 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "SNI", "SYNQUACR",
       Name (_UID, Zero)
       Name (_CRS, ResourceTemplate () {
         Memory32Fixed (ReadWrite, SYNQUACER_GPIO_BASE, SYNQUACER_GPIO_SIZE)
-        Interrupt (ResourceConsumer, Edge, ActiveLow, ExclusiveAndWake, 0, "\\_SB.EXIU") {
-          8,
-        }
       })
       Name (_DSD, Package () {
         ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
@@ -237,15 +256,6 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "SNI", "SYNQUACR",
           }
         }
       })
-      Name (_AEI, ResourceTemplate () {
-        GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullDefault, 0, "\\_SB.GPIO")
-        {
-          8
-        }
-      })
-      Method (_E08) {
-        Notify (\_SB.PWRB, 0x80)
-      }
     }

     Device (PWRB) {
--
2.17.1





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#59696): https://edk2.groups.io/g/devel/message/59696
Mute This Topic: https://groups.io/mt/74223376/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20200515/6c540a94/attachment.htm>


More information about the edk2-devel-archive mailing list