From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.87]) by mx.groups.io with SMTP id smtpd.web12.21802.1589572813850967734 for ; Fri, 15 May 2020 13:00:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@vmware.com header.s=selector2 header.b=XqCl94WB; spf=pass (domain: vmware.com, ip: 40.107.223.87, mailfrom: awarkentin@vmware.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RXUAqTpo3xkJAMcLndlb6U2aTxCWkOltHq4BGySqtIwz5CcDrxUwwq1MeBTjvo77Uf5q1f+F2qEyqmeVN0TO2kIAMjCph8nEycjnzEltYhYdmODFLxAiJiuuRnlu/ChnmT4AnPl8C1cefwdWrGA9ccVZTI1vo2Wvv1oj0YIzSLHRP2kPCUUTuCuSRT10EIHy6pAX4azv08tvu5tki/lGKOtcsXxUtO+BqkrnK/NuXCI3JMR5OC0JPLBOS9Lae1qzgOzKr0Qw6Z/7CjPeytnrEZXvV2j+D6Q2J/N8oORp1kwfhZ2DAZxkiMB0MEoq13+9oaQX3UAD9gmRVa35rMU0ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Cg2Uc1VDN9QzqUWS3wq4xvRZo4TfZf3yFT1evIUAgC0=; b=c2hdTGfDvzNgA8f7TI2L3LBmmEgF9sl2kN1Bkrgy0OVtiKUf1EK19CwHV6vorYtZc7Z8CFtbCFBi71gMGvQtgNSz5bTmYCfbYz2ilbdWaMo3adwthFLbrVGaH3pQwTlVHNVfuuMUNp/SMuQmttu/fQdDikRuDBZOu4oSbZGy6DNUXYpYZw2zhuWrDA/GONX03q2ybvuUink60dxcmgTIR/yoMrrLmxq/Wquhn/GDsmX2MfhqT1ktOFzrAIK25Zzqc8RIEpI4qpwVbRXiuR2isBcwiP34szUPVXkI9vz4guLTp3wLuCDzGHnpwYPorrHOc5fF7ivWhKkr1P3czpX/+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vmware.com; dmarc=pass action=none header.from=vmware.com; dkim=pass header.d=vmware.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Cg2Uc1VDN9QzqUWS3wq4xvRZo4TfZf3yFT1evIUAgC0=; b=XqCl94WBfkQH+CAWdMdGD6NTxQjHTzx1sLlS6BXnqnwVFrAu5p8HuMIDVEQ1JTHu71g5+gGluJYP/szzHfpKYOAKDVlfLbLqD4REtb2qGQ0WyYWDFOa1laaLOPDFpPhPlWh4Ki5NoM3Mt3YDlTaTqquW1fVstg9hWpmEgV0w2Q0= Received: from BN6PR05MB3411.namprd05.prod.outlook.com (2603:10b6:405:43::23) by BN6PR05MB2835.namprd05.prod.outlook.com (2603:10b6:404:32::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.11; Fri, 15 May 2020 20:00:12 +0000 Received: from BN6PR05MB3411.namprd05.prod.outlook.com ([fe80::f463:db64:43d8:5a0f]) by BN6PR05MB3411.namprd05.prod.outlook.com ([fe80::f463:db64:43d8:5a0f%3]) with mapi id 15.20.3021.010; Fri, 15 May 2020 20:00:12 +0000 From: "Andrei Warkentin" To: "devel@edk2.groups.io" , "ard.biesheuvel@arm.com" CC: "leif@nuviainc.com" , "andrey.warkentin@gmail.com" Subject: Re: [edk2-devel] [PATCH edk2-platforms 1/1] Silicon/Socionext/SynQuacer: use Generic Event Device for power button Thread-Topic: [edk2-devel] [PATCH edk2-platforms 1/1] Silicon/Socionext/SynQuacer: use Generic Event Device for power button Thread-Index: AQHWKpNoJMzEqQddC0W8ybsRdtcak6ipkMIW Date: Fri, 15 May 2020 20:00:07 +0000 Message-ID: References: <20200515083235.13415-1-ard.biesheuvel@arm.com> In-Reply-To: <20200515083235.13415-1-ard.biesheuvel@arm.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=vmware.com; x-originating-ip: [98.214.99.181] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7d958511-ae0c-46fa-aee9-08d7f90a93ce x-ms-traffictypediagnostic: BN6PR05MB2835: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 04041A2886 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: hNT8QZEIfQyTyLsL+IVJaXi30FT+GozHQeFjo9hbEE7NVm4s6k9/Dl7q808K1OS28/wh2JD3oINGHoc9Ol+Pty7oGfmNowpqphMioiRffIempjAKe8zdpvm5oAxKrRiCRbD/Q/9ajezLk4SXltals7yScdX8/wn+isyufKWVEHK3u/ptA32ffq+GduOoZucyiyMghLZ51KU+Cl099/zlRjHTfXHaB1AgiAMSXL8mlxycvlxOPKSJip2zM/bSCJNTubeW+iWeeu9CWx3/i9CN1WLnCacO7H9yNQImdgfMek05W3Qa7b6RqcF0a83/bE7I/vrjr9G9G2e6HpMBXrMvS33K49OmmIMeWnMWMburhFT5VzYP8p2s+eZ0l+2bBdgzOtcB1o0p8L8YNhjnl67vxBSppir2YbvN4hx6nvszbNDMpGFobDoHO526Z4c/S3i7 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR05MB3411.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(396003)(136003)(366004)(346002)(39860400002)(376002)(52536014)(6666004)(64756008)(86362001)(5660300002)(66946007)(66556008)(66476007)(76116006)(2906002)(166002)(71200400001)(4326008)(45080400002)(8936002)(55016002)(66446008)(6506007)(53546011)(9686003)(478600001)(26005)(8676002)(316002)(110136005)(19627405001)(7696005)(33656002)(966005)(186003)(54906003)(41533002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: 7HYmu9aXrKS8ZnOV6vUcPhBhutlnvYvXsN3ONGNoOnYh35vGrqGTlc1VgniG04E6DRwqefrXMr5bibfrI9oTLFoDo/pqFDmOZY7efSkcOU3/KQ8AfwVEEDJsyqVWgMXGJGDpjiGCfn8N8IKH7NlQ555ZrN0Pze85pJ11FkFpwfAIrFyJ6Le0Nlop4vW52ZS97IL5+E2x2RZCodM4h6GRnM9Rvb+isM0wGrO1ZQ5e5sYRzHDKu87nsd6TCLPnC54z39h7ForOptIKKsj/tIak7nvZLFjKLfz7Bry1VyM4lmoqe6upGLE2w1KG9xTtsMzzAX8t/Muj+DpEpK8oPu9vRHAdFUOPsqFOaWBoAhJ6unPi4TWx21JHsETgJno84C6OVSDXG5E6aEW6w7lI6vX8oiHbgxgGVzZbE/mNKfDPouSoXYcTun5Qk5SCjoZi42HPqXsCyt9D2wi0w4UwL9Do+s0FNE8uqJoobXMre1CiJ+0= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d958511-ae0c-46fa-aee9-08d7f90a93ce X-MS-Exchange-CrossTenant-originalarrivaltime: 15 May 2020 20:00:07.8074 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: TbVS8DJj8wXrOAmtqgvBmpi2kJM1Uz1eSVEBp0lyGtkoo+Eh/no7feQ6OM7b1Iqrp4wkIiuU2eTmmoTL2XNHAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR05MB2835 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BN6PR05MB3411DDEEE370284E792D34F4B9BD0BN6PR05MB3411namp_" --_000_BN6PR05MB3411DDEEE370284E792D34F4B9BD0BN6PR05MB3411namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I've not tested this, but it looks good. You wouldn't happen to have a caps= ule handy that I or others could try? Is there any value behind explicitly testing for the right pin in _EVT? Ju= st to be patently obvious that this is where the demux could happen to trig= ger other events (just building on top of yesterday's discussion) Regardless - Reviewed-by: Andrey Warkentin A ________________________________ From: devel@edk2.groups.io on behalf of Ard Biesheu= vel via groups.io Sent: Friday, May 15, 2020 3:32 AM To: devel@edk2.groups.io Cc: leif@nuviainc.com ; andrey.warkentin@gmail.com ; Ard Biesheuvel Subject: [edk2-devel] [PATCH edk2-platforms 1/1] Silicon/Socionext/SynQuac= er: 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 --- 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/Soc= ionext/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_SIZ= E) - }) - 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 =3D 0xffffffff + MASK =3D 0xffffffff + + /* enable the power button on line 8 as edge active low */ + LEVL &=3D ~0x100 + EDGC |=3D 0x100 + REQC =3D 0x100 + MASK =3D 0xfffffeff + } + + Method (_EVT) { + REQC =3D 0x100 + Notify (\_SB.PWRB, 0x80) + } } Device (GPIO) { @@ -215,9 +237,6 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "SNI", "S= YNQUACR", Name (_UID, Zero) Name (_CRS, ResourceTemplate () { Memory32Fixed (ReadWrite, SYNQUACER_GPIO_BASE, SYNQUACER_GPIO_SIZ= E) - 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, "\\_S= B.GPIO") - { - 8 - } - }) - Method (_E08) { - Notify (\_SB.PWRB, 0x80) - } } Device (PWRB) { -- 2.17.1 --_000_BN6PR05MB3411DDEEE370284E792D34F4B9BD0BN6PR05MB3411namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
I've not tested this, but it looks good. You wouldn't happen to have a cap= sule handy that I or others could try?

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

Regardless - Reviewed-by: Andrey Warkentin <andrey.warkentin@gmail.com&= gt;

A

From: devel@edk2.groups.io= <devel@edk2.groups.io> on behalf of Ard Biesheuvel via groups.io <= ;ard.biesheuvel=3Darm.com@groups.io>
Sent: Friday, May 15, 2020 3:32 AM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: leif@nuviainc.com <leif@nuviainc.com>; andrey.warkentin@g= mail.com <andrey.warkentin@gmail.com>; Ard Biesheuvel <ard.biesheu= vel@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 pa= rt 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@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/Soc= ionext/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", &quo= t;DSDT", 1, "SNI", "SYNQUACR",
       })
     }
 
-    Device (EXIU) {
-      Name (_HID, "SCX0008")
+    Device (GED0) {
+      Name (_HID, "ACPI0013")
       Name (_UID, Zero)
       Name (_CRS, ResourceTemplate () {
-        Memory32Fixed (ReadWrite, SYNQ= UACER_EXIU_BASE, SYNQUACER_EXIU_SIZE)
-      })
-      Name (_DSD, Package () {
-        ToUUID ("daffd814-6eba-4d= 8c-8a91-bc9bbf4aa301"),
-        Package () {
-          Package () { "= ;socionext,spi-base", 112 },
-        }
+       Interrupt (ResourceConsumer, Edg= e, ActiveHigh, ExclusiveAndWake) { 152 }
       })
+      OperationRegion (EXIU, SystemMemory, S= YNQUACER_EXIU_BASE, 0x20)
+      Field (EXIU, DWordAcc, NoLock, Preserv= e)
+      {
+          MASK, &nb= sp; 32,
+          SRCS, &nb= sp; 32,
+          REQS, &nb= sp; 32,
+          RAWR, &nb= sp; 32,
+          REQC, &nb= sp; 32,
+          LEVL, &nb= sp; 32,
+          EDGC, &nb= sp; 32,
+          SWIR, &nb= sp; 32,
+      }
+
+      Method (_INI) {
+        REQC =3D 0xffffffff
+        MASK =3D 0xffffffff
+
+        /* enable the power button= on line 8 as edge active low */
+        LEVL &=3D ~0x100
+        EDGC |=3D 0x100
+        REQC =3D 0x100
+        MASK =3D 0xfffffeff
+      }
+
+      Method (_EVT) {
+        REQC =3D 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, E= dge, ActiveLow, ExclusiveAndWake, 0, "\\_SB.EXIU") {
-          8,
-        }
       })
       Name (_DSD, Package () {
         ToUUID ("daffd814-6e= ba-4d8c-8a91-bc9bbf4aa301"),
@@ -237,15 +256,6 @@ DefinitionBlock ("DsdtTable.aml", "= ;DSDT", 1, "SNI", "SYNQUACR",
           }
         }
       })
-      Name (_AEI, ResourceTemplate () {
-        GpioInt (Edge, ActiveLow, Excl= usiveAndWake, PullDefault, 0, "\\_SB.GPIO")
-        {
-          8
-        }
-      })
-      Method (_E08) {
-        Notify (\_SB.PWRB, 0x80)
-      }
     }
 
     Device (PWRB) {
--
2.17.1




--_000_BN6PR05MB3411DDEEE370284E792D34F4B9BD0BN6PR05MB3411namp_--