From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.2073.1589581230349097906 for ; Fri, 15 May 2020 15:20:30 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ard.biesheuvel@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C05F7113E; Fri, 15 May 2020 15:20:28 -0700 (PDT) Received: from [192.168.1.81] (unknown [10.37.8.5]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B4DD33F71E; Fri, 15 May 2020 15:20:27 -0700 (PDT) Subject: Re: [edk2-devel] [PATCH edk2-platforms 1/1] Silicon/Socionext/SynQuacer: use Generic Event Device for power button To: Andrei Warkentin , "devel@edk2.groups.io" Cc: "leif@nuviainc.com" , "andrey.warkentin@gmail.com" References: <20200515083235.13415-1-ard.biesheuvel@arm.com> From: "Ard Biesheuvel" Message-ID: Date: Sat, 16 May 2020 00:20:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 5/15/20 10:00 PM, Andrei Warkentin wrote: > I've not tested this, but it looks good. You wouldn't happen to have a= =20 > capsule handy that I or others could try? >=20 Sure. https://people.linaro.org/~ard.biesheuvel/SYNQUACERFIRMWAREUPDATECAPSULEFM= PPKCS7.Cap > Is there any value behind explicitly testing for the right pin in _EVT?= =20 > Just to be patently obvious that this is where the demux could happen to= = =20 > trigger other events (just building on top of yesterday's discussion) >=20 Not really. This SoC has 32 individual SPIs for the GPIO interrupt=20 block, and so no demuxing is necessary. I was going to use the _E98=20 method instead, but it turned out it was not implemented in Linux yet=20 [0], so that is why I am using _EVT. > Regardless - Reviewed-by: Andrey Warkentin Thanks [0]=20 https://lore.kernel.org/linux-acpi/20200515093613.18691-1-ardb@kernel.org/ > ------------------------------------------------------------------------ > *From:* devel@edk2.groups.io on behalf of Ard=20 > Biesheuvel via groups.io > *Sent:* Friday, May 15, 2020 3:32 AM > *To:* devel@edk2.groups.io > *Cc:* leif@nuviainc.com ; andrey.warkentin@gmail.com= =20 > ; Ard Biesheuvel > *Subject:* [edk2-devel] [PATCH edk2-platforms 1/1]=20 > 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. >=20 > Signed-off-by: Ard Biesheuvel > --- > =A0Silicon/Socionext/SynQuacer/AcpiTables/Dsdt.asl | 52 ++++++++++++---= ----- > =A01 file changed, 31 insertions(+), 21 deletions(-) >=20 > diff --git a/Silicon/Socionext/SynQuacer/AcpiTables/Dsdt.asl=20 > 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,=20 > "SNI", "SYNQUACR", > =A0=A0=A0=A0=A0=A0 }) > =A0=A0=A0=A0 } >=20 > -=A0=A0=A0 Device (EXIU) { > -=A0=A0=A0=A0=A0 Name (_HID, "SCX0008") > +=A0=A0=A0 Device (GED0) { > +=A0=A0=A0=A0=A0 Name (_HID, "ACPI0013") > =A0=A0=A0=A0=A0=A0 Name (_UID, Zero) > =A0=A0=A0=A0=A0=A0 Name (_CRS, ResourceTemplate () { > -=A0=A0=A0=A0=A0=A0=A0 Memory32Fixed (ReadWrite, SYNQUACER_EXIU_BASE, SY= NQUACER_EXIU_SIZE) > -=A0=A0=A0=A0=A0 }) > -=A0=A0=A0=A0=A0 Name (_DSD, Package () { > -=A0=A0=A0=A0=A0=A0=A0 ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), > -=A0=A0=A0=A0=A0=A0=A0 Package () { > -=A0=A0=A0=A0=A0=A0=A0=A0=A0 Package () { "socionext,spi-base", 112 }, > -=A0=A0=A0=A0=A0=A0=A0 } > +=A0=A0=A0=A0=A0=A0 Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclu= siveAndWake)=20 > { 152 } > =A0=A0=A0=A0=A0=A0 }) > +=A0=A0=A0=A0=A0 OperationRegion (EXIU, SystemMemory, SYNQUACER_EXIU_BAS= E, 0x20) > +=A0=A0=A0=A0=A0 Field (EXIU, DWordAcc, NoLock, Preserve) > +=A0=A0=A0=A0=A0 { > +=A0=A0=A0=A0=A0=A0=A0=A0=A0 MASK,=A0=A0 32, > +=A0=A0=A0=A0=A0=A0=A0=A0=A0 SRCS,=A0=A0 32, > +=A0=A0=A0=A0=A0=A0=A0=A0=A0 REQS,=A0=A0 32, > +=A0=A0=A0=A0=A0=A0=A0=A0=A0 RAWR,=A0=A0 32, > +=A0=A0=A0=A0=A0=A0=A0=A0=A0 REQC,=A0=A0 32, > +=A0=A0=A0=A0=A0=A0=A0=A0=A0 LEVL,=A0=A0 32, > +=A0=A0=A0=A0=A0=A0=A0=A0=A0 EDGC,=A0=A0 32, > +=A0=A0=A0=A0=A0=A0=A0=A0=A0 SWIR,=A0=A0 32, > +=A0=A0=A0=A0=A0 } > + > +=A0=A0=A0=A0=A0 Method (_INI) { > +=A0=A0=A0=A0=A0=A0=A0 REQC =3D 0xffffffff > +=A0=A0=A0=A0=A0=A0=A0 MASK =3D 0xffffffff > + > +=A0=A0=A0=A0=A0=A0=A0 /* enable the power button on line 8 as edge acti= ve low */ > +=A0=A0=A0=A0=A0=A0=A0 LEVL &=3D ~0x100 > +=A0=A0=A0=A0=A0=A0=A0 EDGC |=3D 0x100 > +=A0=A0=A0=A0=A0=A0=A0 REQC =3D 0x100 > +=A0=A0=A0=A0=A0=A0=A0 MASK =3D 0xfffffeff > +=A0=A0=A0=A0=A0 } > + > +=A0=A0=A0=A0=A0 Method (_EVT) { > +=A0=A0=A0=A0=A0=A0=A0 REQC =3D 0x100 > +=A0=A0=A0=A0=A0=A0=A0 Notify (\_SB.PWRB, 0x80) > +=A0=A0=A0=A0=A0 } > =A0=A0=A0=A0 } >=20 > =A0=A0=A0=A0 Device (GPIO) { > @@ -215,9 +237,6 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "SNI",= =20 > "SYNQUACR", > =A0=A0=A0=A0=A0=A0 Name (_UID, Zero) > =A0=A0=A0=A0=A0=A0 Name (_CRS, ResourceTemplate () { > =A0=A0=A0=A0=A0=A0=A0=A0 Memory32Fixed (ReadWrite, SYNQUACER_GPIO_BASE,= = =20 > SYNQUACER_GPIO_SIZE) > -=A0=A0=A0=A0=A0=A0=A0 Interrupt (ResourceConsumer, Edge, ActiveLow, Exc= lusiveAndWake,=20 > 0, "\\_SB.EXIU") { > -=A0=A0=A0=A0=A0=A0=A0=A0=A0 8, > -=A0=A0=A0=A0=A0=A0=A0 } > =A0=A0=A0=A0=A0=A0 }) > =A0=A0=A0=A0=A0=A0 Name (_DSD, Package () { > =A0=A0=A0=A0=A0=A0=A0=A0 ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"= ), > @@ -237,15 +256,6 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "SNI",= = =20 > "SYNQUACR", > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 } > =A0=A0=A0=A0=A0=A0=A0=A0 } > =A0=A0=A0=A0=A0=A0 }) > -=A0=A0=A0=A0=A0 Name (_AEI, ResourceTemplate () { > -=A0=A0=A0=A0=A0=A0=A0 GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullD= efault, 0,=20 > "\\_SB.GPIO") > -=A0=A0=A0=A0=A0=A0=A0 { > -=A0=A0=A0=A0=A0=A0=A0=A0=A0 8 > -=A0=A0=A0=A0=A0=A0=A0 } > -=A0=A0=A0=A0=A0 }) > -=A0=A0=A0=A0=A0 Method (_E08) { > -=A0=A0=A0=A0=A0=A0=A0 Notify (\_SB.PWRB, 0x80) > -=A0=A0=A0=A0=A0 } > =A0=A0=A0=A0 } >=20 > =A0=A0=A0=A0 Device (PWRB) { > --=20 > 2.17.1 >=20 >=20 >=20 >=20