Angel Pons would like Patrick Rudolph to review this change.

View Change

mb/prodrive/hermes: Add power resource for Key M slot

Add methods to enable/disable the power to Key M slot.

Change-Id: I21d0a4ad9d7f130a1402e6320c1f005b8475d047
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
---
M src/mainboard/prodrive/hermes/dsdt.asl
M src/mainboard/prodrive/hermes/mainboard.c
M src/mainboard/prodrive/hermes/variants/baseboard/gpio.c
3 files changed, 53 insertions(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/48809/1
diff --git a/src/mainboard/prodrive/hermes/dsdt.asl b/src/mainboard/prodrive/hermes/dsdt.asl
index 9eb91c5..841faf7 100644
--- a/src/mainboard/prodrive/hermes/dsdt.asl
+++ b/src/mainboard/prodrive/hermes/dsdt.asl
@@ -19,6 +19,53 @@
Device (PCI0) {
#include <soc/intel/common/block/acpi/acpi/northbridge.asl>
#include <soc/intel/cannonlake/acpi/southbridge.asl>
+
+ Scope (RP09)
+ {
+ Device (DEV0)
+ {
+ Name (_ADR, 0)
+ Name (STA, 1)
+
+ Method (_PS0, 0, Serialized)
+ {
+ If (STA == 0) {
+ STXS (GPP_K7)
+ Sleep (1)
+ STA = 1
+ }
+ }
+
+ Method (_PS3, 0, Serialized)
+ {
+ If (STA == 1) {
+ CTXS (GPP_K7)
+ STA = 0
+ }
+ }
+
+ Method (_PSC, 0, Serialized)
+ {
+ If (STA == 0) {
+ Return (3)
+ } Else {
+ Return (0)
+ }
+ }
+
+ Method (_PSE, 1, Serialized)
+ {
+ If (Arg0 == 0) {
+ _PS3 ()
+ } Else {
+ _PS0 ()
+ }
+ }
+
+ Name (_S3D, 2)
+ Name (_S4D, 2)
+ }
+ }
}
}

diff --git a/src/mainboard/prodrive/hermes/mainboard.c b/src/mainboard/prodrive/hermes/mainboard.c
index 6893eb7..860c992 100644
--- a/src/mainboard/prodrive/hermes/mainboard.c
+++ b/src/mainboard/prodrive/hermes/mainboard.c
@@ -119,6 +119,9 @@
{
acpigen_write_if_lequal_op_int(ARG0_OP, 5);
{
+ /* Turn off Key M slot power */
+ acpigen_soc_clear_tx_gpio(GPP_K7);
+
for (size_t i = 0; i < ARRAY_SIZE(usb_power_gpios); i++)
acpigen_write_soc_gpio_op(usb_power_gpios[i]);
}
diff --git a/src/mainboard/prodrive/hermes/variants/baseboard/gpio.c b/src/mainboard/prodrive/hermes/variants/baseboard/gpio.c
index 096dc35..a53a646 100644
--- a/src/mainboard/prodrive/hermes/variants/baseboard/gpio.c
+++ b/src/mainboard/prodrive/hermes/variants/baseboard/gpio.c
@@ -375,6 +375,9 @@
PAD_CFG_GPO(GPP_K1, 1, DEEP), /* PERST_CPU_SLOTS_n */
PAD_CFG_GPO(GPP_K2, 1, DEEP), /* PERST_CNVI_SLOTS_n */

+ /* Power Key M slot */
+ PAD_CFG_GPO(GPP_K7, 1, DEEP), /* EN_3V3_KEYM_PCH */
+
/* SMB */
PAD_CFG_NF(GPP_C0, NONE, DEEP, NF1), /* PCH_SMB_CLK */
PAD_CFG_NF(GPP_C1, NONE, DEEP, NF1), /* PCH_SMB_DATA */

To view, visit change 48809. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I21d0a4ad9d7f130a1402e6320c1f005b8475d047
Gerrit-Change-Number: 48809
Gerrit-PatchSet: 1
Gerrit-Owner: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Christian Walter <christian.walter@9elements.com>
Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph@9elements.com>
Gerrit-MessageType: newchange