public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH edk2-platforms 1/1] Silicon/Socionext/SynQuacer: use Generic Event Device for power button
@ 2020-05-15  8:32 Ard Biesheuvel
  2020-05-15 20:00 ` [edk2-devel] " Andrei Warkentin
  2020-05-18 17:20 ` Leif Lindholm
  0 siblings, 2 replies; 6+ messages in thread
From: Ard Biesheuvel @ 2020-05-15  8:32 UTC (permalink / raw)
  To: devel; +Cc: leif, andrey.warkentin, Ard Biesheuvel

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@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


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

* Re: [edk2-devel] [PATCH edk2-platforms 1/1] Silicon/Socionext/SynQuacer: use Generic Event Device for power button
  2020-05-15  8:32 [PATCH edk2-platforms 1/1] Silicon/Socionext/SynQuacer: use Generic Event Device for power button Ard Biesheuvel
@ 2020-05-15 20:00 ` Andrei Warkentin
  2020-05-15 22:20   ` Ard Biesheuvel
  2020-05-17 11:03   ` Ard Biesheuvel
  2020-05-18 17:20 ` Leif Lindholm
  1 sibling, 2 replies; 6+ messages in thread
From: Andrei Warkentin @ 2020-05-15 20:00 UTC (permalink / raw)
  To: devel@edk2.groups.io, ard.biesheuvel@arm.com
  Cc: leif@nuviainc.com, andrey.warkentin@gmail.com

[-- Attachment #1: Type: text/plain, Size: 3869 bytes --]

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@gmail.com>

A
________________________________
From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Ard Biesheuvel via groups.io <ard.biesheuvel=arm.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@gmail.com <andrey.warkentin@gmail.com>; Ard Biesheuvel <ard.biesheuvel@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@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





[-- Attachment #2: Type: text/html, Size: 8290 bytes --]

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

* Re: [edk2-devel] [PATCH edk2-platforms 1/1] Silicon/Socionext/SynQuacer: use Generic Event Device for power button
  2020-05-15 20:00 ` [edk2-devel] " Andrei Warkentin
@ 2020-05-15 22:20   ` Ard Biesheuvel
  2020-05-17 11:03   ` Ard Biesheuvel
  1 sibling, 0 replies; 6+ messages in thread
From: Ard Biesheuvel @ 2020-05-15 22:20 UTC (permalink / raw)
  To: Andrei Warkentin, devel@edk2.groups.io
  Cc: leif@nuviainc.com, andrey.warkentin@gmail.com

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 
> capsule handy that I or others could try?
> 

Sure.

https://people.linaro.org/~ard.biesheuvel/SYNQUACERFIRMWAREUPDATECAPSULEFMPPKCS7.Cap

> 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)
> 

Not really. This SoC has 32 individual SPIs for the GPIO interrupt 
block, and so no demuxing is necessary. I was going to use the _E98 
method instead, but it turned out it was not implemented in Linux yet 
[0], so that is why I am using _EVT.

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

Thanks


[0] 
https://lore.kernel.org/linux-acpi/20200515093613.18691-1-ardb@kernel.org/

> ------------------------------------------------------------------------
> *From:* devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Ard 
> Biesheuvel via groups.io <ard.biesheuvel=arm.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@gmail.com 
> <andrey.warkentin@gmail.com>; Ard Biesheuvel <ard.biesheuvel@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@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
> 
> 
> 
> 


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

* Re: [edk2-devel] [PATCH edk2-platforms 1/1] Silicon/Socionext/SynQuacer: use Generic Event Device for power button
  2020-05-15 20:00 ` [edk2-devel] " Andrei Warkentin
  2020-05-15 22:20   ` Ard Biesheuvel
@ 2020-05-17 11:03   ` Ard Biesheuvel
  1 sibling, 0 replies; 6+ messages in thread
From: Ard Biesheuvel @ 2020-05-17 11:03 UTC (permalink / raw)
  To: Andrei Warkentin, devel@edk2.groups.io
  Cc: leif@nuviainc.com, andrey.warkentin@gmail.com

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 
> capsule handy that I or others could try?
> 

BTW I have incorporated this patch and the NetSec ones I sent out 
yesterday (to fix the annoying 5s freeze at boot) here:

http://snapshots.linaro.org/components/kernel/leg-96boards-developerbox-edk2/75/

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

* Re: [PATCH edk2-platforms 1/1] Silicon/Socionext/SynQuacer: use Generic Event Device for power button
  2020-05-15  8:32 [PATCH edk2-platforms 1/1] Silicon/Socionext/SynQuacer: use Generic Event Device for power button Ard Biesheuvel
  2020-05-15 20:00 ` [edk2-devel] " Andrei Warkentin
@ 2020-05-18 17:20 ` Leif Lindholm
  2020-05-19 12:30   ` [edk2-devel] " Ard Biesheuvel
  1 sibling, 1 reply; 6+ messages in thread
From: Leif Lindholm @ 2020-05-18 17:20 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: devel, andrey.warkentin

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 <ard.biesheuvel@arm.com>

Acked-by: Leif Lindholm <leif@nuviainc.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
> 

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

* Re: [edk2-devel] [PATCH edk2-platforms 1/1] Silicon/Socionext/SynQuacer: use Generic Event Device for power button
  2020-05-18 17:20 ` Leif Lindholm
@ 2020-05-19 12:30   ` Ard Biesheuvel
  0 siblings, 0 replies; 6+ messages in thread
From: Ard Biesheuvel @ 2020-05-19 12:30 UTC (permalink / raw)
  To: devel, leif; +Cc: andrey.warkentin

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 <ard.biesheuvel@arm.com>
> 
> Acked-by: Leif Lindholm <leif@nuviainc.com>
> 

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
>>
> 
> 
> 


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

end of thread, other threads:[~2020-05-19 12:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-15  8:32 [PATCH edk2-platforms 1/1] Silicon/Socionext/SynQuacer: use Generic Event Device for power button Ard Biesheuvel
2020-05-15 20:00 ` [edk2-devel] " Andrei Warkentin
2020-05-15 22:20   ` Ard Biesheuvel
2020-05-17 11:03   ` Ard Biesheuvel
2020-05-18 17:20 ` Leif Lindholm
2020-05-19 12:30   ` [edk2-devel] " Ard Biesheuvel

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