coreboot-kgpe-d16/src/soc/intel/apollolake/acpi/gpio.asl
Shaunak Saha 7f149c7bb4 soc/intel/apollolake: Add handler for SCI
This patch adds the handler to enable bit for gpio_tier1_sci_en.
gpio_tier1_sci_en enables the setting of the GPIO_TIER1_SCI_STS
bit to generate a wake event and/or an SCI or SMI#. We are setting
the bit for gpio_tier1_sci_en from the ASL code as OS clears this bit
if set from BIOS. As per ACPI spec _GPE is defined as the Named
Object  that evaluates to either an integer or a package. If _GPE
evaluates to an integer, the value is the bit assignment of the SCI
interrupt within the GPEx_STS register of a GPE block described in
the FADT that the embedded controller will trigger. FADT right now
has no mechanism to acheive the same.

Change-Id: I1e1bd3f5c89a5e6bea2d1858569a9d30e6da78fe
Signed-off-by: Shaunak Saha <shaunak.saha@intel.com>
Reviewed-on: https://review.coreboot.org/15578
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-07-12 20:37:57 +02:00

154 lines
3.4 KiB
Text

/*
* This file is part of the coreboot project.
*
* Copyright (C) 2016 Intel Corp.
* (Written by Lance Zhao <lijian.zhao@intel.com> for Intel Corp.)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <soc/gpio_defs.h>
scope (\_SB) {
Device (GPO0)
{
Name (_ADR, 0)
Name (_HID, "INT3452")
Name (_CID, "INT3452")
Name (_DDN, "General Purpose Input/Output (GPIO) Controller - North" )
Name (_UID, 1)
Name (RBUF, ResourceTemplate ()
{
Memory32Fixed (ReadWrite, 0, 0x4000, RMEM)
Interrupt (ResourceConsumer, Level, ActiveLow, Shared, , , )
{
GPIO_BANK_INT
}
})
Method (_CRS, 0x0, NotSerialized)
{
CreateDwordField (^RBUF, ^RMEM._BAS, RBAS)
ShiftLeft (GPIO_NORTH, 16, Local0)
Or (CONFIG_IOSF_BASE_ADDRESS, Local0, RBAS)
Return (^RBUF)
}
Method (_STA, 0x0, NotSerialized)
{
Return(0xf)
}
}
Device (GPO1)
{
Name (_ADR, 0)
Name (_HID, "INT3452")
Name (_CID, "INT3452")
Name (_DDN, "General Purpose Input/Output (GPIO) Controller - Northwest" )
Name (_UID, 2)
Name (RBUF, ResourceTemplate ()
{
Memory32Fixed (ReadWrite, 0, 0x4000, RMEM)
Interrupt (ResourceConsumer, Level, ActiveLow, Shared, , , )
{
GPIO_BANK_INT
}
})
Method (_CRS, 0x0, NotSerialized)
{
CreateDwordField (^RBUF, ^RMEM._BAS, RBAS)
ShiftLeft (GPIO_NORTHWEST, 16, Local0)
Or (CONFIG_IOSF_BASE_ADDRESS, Local0, RBAS)
Return (^RBUF)
}
Method (_STA, 0x0, NotSerialized)
{
Return(0xf)
}
}
Device (GPO2)
{
Name (_ADR, 0)
Name (_HID, "INT3452")
Name (_CID, "INT3452")
Name (_DDN, "General Purpose Input/Output (GPIO) Controller - West" )
Name (_UID, 3)
Name (RBUF, ResourceTemplate ()
{
Memory32Fixed (ReadWrite, 0, 0x4000, RMEM)
Interrupt (ResourceConsumer, Level, ActiveLow, Shared, , , )
{
GPIO_BANK_INT
}
})
Method (_CRS, 0x0, NotSerialized)
{
CreateDwordField (^RBUF, ^RMEM._BAS, RBAS)
ShiftLeft (GPIO_WEST, 16, Local0)
Or (CONFIG_IOSF_BASE_ADDRESS, Local0, RBAS)
Return (^RBUF)
}
Method (_STA, 0x0, NotSerialized)
{
Return(0xf)
}
}
Device (GPO3)
{
Name (_ADR, 0)
Name (_HID, "INT3452")
Name (_CID, "INT3452")
Name (_DDN, "General Purpose Input/Output (GPIO) Controller - Southwest" )
Name (_UID, 4)
Name (RBUF, ResourceTemplate ()
{
Memory32Fixed (ReadWrite, 0, 0x4000, RMEM)
Interrupt (ResourceConsumer, Level, ActiveLow, Shared, , , )
{
GPIO_BANK_INT
}
})
Method (_CRS, 0x0, NotSerialized)
{
CreateDwordField (^RBUF, ^RMEM._BAS, RBAS)
ShiftLeft (GPIO_SOUTHWEST, 16, Local0)
Or (CONFIG_IOSF_BASE_ADDRESS, Local0, RBAS)
Return (^RBUF)
}
Method (_STA, 0x0, NotSerialized)
{
Return(0xf)
}
}
}
Scope(\_GPE)
{
/* Dummy method for the Tier 1 GPIO SCI enable bit. When kernel reads
* _L0F in scope GPE it sets bit for gpio_tier1_sci_en in acpi enable
* register at 0x430. For APL acpi enable register DW0 i.e., ACPI
* GPE0a_EN at 0x430 is reserved.
*/
Method(_L0F, 0) {}
}