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.web12.10729.1589891452199480635 for ; Tue, 19 May 2020 05:30:52 -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 129D730E; Tue, 19 May 2020 05:30:51 -0700 (PDT) Received: from [192.168.1.81] (unknown [10.37.8.132]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 163F73F52E; Tue, 19 May 2020 05:30:49 -0700 (PDT) Subject: Re: [edk2-devel] [PATCH edk2-platforms 1/1] Silicon/Socionext/SynQuacer: use Generic Event Device for power button To: devel@edk2.groups.io, leif@nuviainc.com Cc: andrey.warkentin@gmail.com References: <20200515083235.13415-1-ard.biesheuvel@arm.com> <20200518172015.GE10467@vanye> From: "Ard Biesheuvel" Message-ID: Date: Tue, 19 May 2020 14:30:48 +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: <20200518172015.GE10467@vanye> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 5/18/20 7:20 PM, Leif Lindholm via groups.io wrote: > On Fri, May 15, 2020 at 10:32:35 +0200, Ard Biesheuvel wrote: >> 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 > > Acked-by: Leif Lindholm > Thanks Pushed as 0a4db1fd4544138db5030a48fd9dcbb19de8b480 >> --- >> 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 >> > > >