Add the general description for GPIO on JUNO board. Define pin number 256 as power button function (for demo) in this patch. However,JUNO has no GPIO controller in hardware, Using GPIO event emulation which can trigger the GPIO action, then test the GPIO-signal event model for ACPI.
Signed-off-by: Yi Li yi.li@linaro.org --- ArmPlatformPkg/ArmJunoPkg/AcpiTables/juno/dsdt.asl | 42 ++++++++++++++++++++ 1 file changed, 42 insertions(+)
diff --git a/ArmPlatformPkg/ArmJunoPkg/AcpiTables/juno/dsdt.asl b/ArmPlatformPkg/ArmJunoPkg/AcpiTables/juno/dsdt.asl index 5bfd521..e4e9cad 100644 --- a/ArmPlatformPkg/ArmJunoPkg/AcpiTables/juno/dsdt.asl +++ b/ArmPlatformPkg/ArmJunoPkg/AcpiTables/juno/dsdt.asl @@ -58,6 +58,48 @@ DefinitionBlock ( } }
+ //GPIO controller description + Device (GPO0) + { + Name (_HID, "LNRO0009") + Name (_ADR, 0) + Name (_UID, 0) + + Name (_CRS, ResourceTemplate () { + //GPIO Register Interface(demo,need to modify by the real h/w setting) + Memory32Fixed (ReadWrite, 0x1c010000, 0x1000) + + //Interrupt vector 0x80 for GPIO controller(demo,need to modify by the real h/w setting) + Interrupt (ResourceConsumer, Edge, ActiveLow, Exclusive) {0x80} + }) + + Name (_AEI,ResourceTemplate () { + //Assume GPIO256 as PowerButton + GpioInt(Edge, ActiveLow, ExclusiveAndWake, PullUp, , " \_SB.GPO0") {0x100} + }) + + //Handle all ACPI Events signaled by GPIO Controller GPO0 + Method (_EVT, 0x1, Serialized) + { + //Arg0 - EventNumber. An Integer indicating the event number. + //(Controller-relative zero-based GPIO pin number) of the current event. + //Must be in the range 0x0000 - 0xffff. + Switch (ToInteger(Arg0)) + { + //Pin number 256 + Case (0x100) + { + //Notify OSPM the power button is pressed + Notify (PWRB, 0x80) + } + Default + { + + } + } + } + } + //Power button device description Device (PWRB) {