diff options
author | Aamir Bohra <aamir.bohra@intel.com> | 2020-05-18 11:11:19 +0530 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-05-20 09:11:51 +0000 |
commit | 88712991ba390c309b4586864aa04a9680fd8320 (patch) | |
tree | e6d3d87ab722d94d91e25d88aedd5da0dd33e86f | |
parent | a2789328f77c5b47006f4a48f59f278e699821dc (diff) | |
download | coreboot-88712991ba390c309b4586864aa04a9680fd8320.tar.xz |
soc/intel/jasperlake: Add ACPI method to get GPIO PCR PID
Add method acpi method GPID to return the GPIO PCR port ID.
This method is further planned to be used for GPIO power
management configuration.
TEST=Build waddledoo board
Change-Id: Ic45b40bbe39e303cddcc82e0e848786b7311ab64
Signed-off-by: Aamir Bohra <aamir.bohra@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41501
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
-rw-r--r-- | src/soc/intel/jasperlake/acpi/gpio.asl | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/soc/intel/jasperlake/acpi/gpio.asl b/src/soc/intel/jasperlake/acpi/gpio.asl index d8326c7789..60951f0b6b 100644 --- a/src/soc/intel/jasperlake/acpi/gpio.asl +++ b/src/soc/intel/jasperlake/acpi/gpio.asl @@ -6,6 +6,8 @@ #include <soc/pcr_ids.h> #include "gpio_op.asl" +#include <soc/intel/common/acpi/gpio.asl> + Device (GPIO) { Name (_HID, CROS_GPIO_NAME) @@ -103,3 +105,35 @@ Method (GADD, 1, NotSerialized) Local2 = PCRB(Local0) + PAD_CFG_BASE + (Local1 * 16) Return (Local2) } + +/* + * Return PCR Port ID of GPIO Communities + * + * Arg0: GPIO Community (0-5) + */ +Method (GPID, 1, Serialized) +{ + Switch (ToInteger (Arg0)) + { + Case (0) { + Local0 = PID_GPIOCOM0 + } + Case (1) { + Local0 = PID_GPIOCOM1 + } + Case (2) { + Local0 = PID_GPIOCOM2 + } + Case (4) { + Local0 = PID_GPIOCOM4 + } + Case (5) { + Local0 = PID_GPIOCOM5 + } + Default { + Return (0) + } + } + + Return (Local0) +} |