<p>Marc Jones has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/22096">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">kahlee: Set Kahlee GPEs<br><br>Add GPE configuration table.<br><br>Remove GPE3 from the power button ASL and set the EC to GPE3(AGPIO22).<br><br>Set GPE ASL methods for:<br>  PCIE/WLAN      8h<br>  EHCI          18h<br>  XHCI          1fh<br><br>BUG=b:63268311<br>BRANCH=none<br>TEST=Test lidswitch powers the device on and off at the login screen.<br><br>Change-Id: I27c880ee84b6797d999d4d5951602b654ede948e<br>Signed-off-by: Marc Jones <marcj303@gmail.com><br>---<br>M src/mainboard/google/kahlee/acpi/gpe.asl<br>M src/mainboard/google/kahlee/dsdt.asl<br>M src/mainboard/google/kahlee/ec.h<br>M src/mainboard/google/kahlee/gpio.c<br>M src/mainboard/google/kahlee/mainboard.c<br>A src/mainboard/google/kahlee/mainboard.h<br>6 files changed, 66 insertions(+), 54 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/96/22096/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/mainboard/google/kahlee/acpi/gpe.asl b/src/mainboard/google/kahlee/acpi/gpe.asl<br>index eed4e81..6e0d547 100644<br>--- a/src/mainboard/google/kahlee/acpi/gpe.asl<br>+++ b/src/mainboard/google/kahlee/acpi/gpe.asl<br>@@ -15,68 +15,26 @@<br> <br> Scope (\_GPE)<br> {<br>-   /*  General event 3  */<br>-      Method (_L03)<br>-        {<br>-            /* DBGO ("\\_GPE\\_L00\n") */<br>-              Notify (\_SB.PWRB, 0x02) /* NOTIFY_DEVICE_WAKE */<br>-    }<br>-<br>- /*  Legacy PM event  */<br>+      /*  PCIE WLAN Wake event  */<br>  Method (_L08)<br>         {<br>             /* DBGO ("\\_GPE\\_L08\n") */<br>-      }<br>-<br>- /*  Temp warning (TWarn) event  */<br>-   Method (_L09)<br>-        {<br>-            /* DBGO ("\\_GPE\\_L09\n") */<br>-              /* Notify (\_TZ.TZ00, 0x80) */<br>-       }<br>-<br>- /*  USB controller PME#  */<br>-  Method (_L0B)<br>-        {<br>-            /* DBGO ("\\_GPE\\_L0B\n") */<br>-              Notify (\_SB.PCI0.UOH1, 0x02)   /* NOTIFY_DEVICE_WAKE */<br>-             Notify (\_SB.PCI0.UOH2, 0x02)   /* NOTIFY_DEVICE_WAKE */<br>-             Notify (\_SB.PCI0.UOH3, 0x02)   /* NOTIFY_DEVICE_WAKE */<br>-             Notify (\_SB.PCI0.UOH4, 0x02)   /* NOTIFY_DEVICE_WAKE */<br>-             Notify (\_SB.PCI0.UOH5, 0x02)   /* NOTIFY_DEVICE_WAKE */<br>-             Notify (\_SB.PCI0.UOH6, 0x02)   /* NOTIFY_DEVICE_WAKE */<br>-             Notify (\_SB.PCI0.XHC0, 0x02)   /* NOTIFY_DEVICE_WAKE */<br>              Notify (\_SB.PWRB, 0x02)        /* NOTIFY_DEVICE_WAKE */<br>      }<br> <br>- /*  ExtEvent0 SCI event  */<br>-  Method (_L10)<br>-        {<br>-            /* DBGO ("\\_GPE\\_L10\n") */<br>-      }<br>-<br>- /*  ExtEvent1 SCI event  */<br>-  Method (_L11)<br>-        {<br>-            /* DBGO ("\\_GPE\\_L11\n") */<br>-      }<br>-<br>- /*  GPIO0 or GEvent8 event  */<br>+       /*  EHCI USB controller PME#  SCIMAP24*/<br>      Method (_L18)<br>         {<br>-            /* DBGO ("\\_GPE\\_L18\n") */<br>-              Notify (\_SB.PCI0.PBR4, 0x02)   /* NOTIFY_DEVICE_WAKE */<br>-             Notify (\_SB.PCI0.PBR5, 0x02)   /* NOTIFY_DEVICE_WAKE */<br>-             Notify (\_SB.PCI0.PBR6, 0x02)   /* NOTIFY_DEVICE_WAKE */<br>-             Notify (\_SB.PCI0.PBR7, 0x02)   /* NOTIFY_DEVICE_WAKE */<br>+             /* DBGO ("\\_GPE\\_L0B\n") */<br>+              Notify (\_SB.PCI0.EHC0, 0x02)   /* NOTIFY_DEVICE_WAKE */<br>              Notify (\_SB.PWRB, 0x02)        /* NOTIFY_DEVICE_WAKE */<br>      }<br> <br>- /*  Azalia SCI event  */<br>-     Method (_L1B)<br>+        /*  XHCI USB controller PME#  SCIMAP56*/<br>+     Method (_L1F)<br>         {<br>-            /* DBGO("\\_GPE\\_L1B\n") */<br>-               Notify (\_SB.PCI0.AZHD, 0x02)   /* NOTIFY_DEVICE_WAKE */<br>+             /* DBGO ("\\_GPE\\_L0B\n") */<br>+              Notify (\_SB.PCI0.XHC0, 0x02)   /* NOTIFY_DEVICE_WAKE */<br>              Notify (\_SB.PWRB, 0x02)        /* NOTIFY_DEVICE_WAKE */<br>      }<br> }   /* End Scope GPE */<br>diff --git a/src/mainboard/google/kahlee/dsdt.asl b/src/mainboard/google/kahlee/dsdt.asl<br>index 3f91c7a..717d4bb 100644<br>--- a/src/mainboard/google/kahlee/dsdt.asl<br>+++ b/src/mainboard/google/kahlee/dsdt.asl<br>@@ -59,8 +59,6 @@<br>               Device(PWRB) {<br>                        Name(_HID, EISAID("PNP0C0C"))<br>                       Name(_UID, 0xAA)<br>-                     Name(_PRW, Package () {3, 0x04})<br>-                     Name(_STA, 0x0B)<br>              }<br> <br>          Device(PCI0) {<br>diff --git a/src/mainboard/google/kahlee/ec.h b/src/mainboard/google/kahlee/ec.h<br>index deb2cb1..495ad69 100644<br>--- a/src/mainboard/google/kahlee/ec.h<br>+++ b/src/mainboard/google/kahlee/ec.h<br>@@ -19,8 +19,8 @@<br> #include <ec/ec.h><br> #include <ec/google/chromeec/ec_commands.h><br> <br>-/* GPIO_S0_000 is EC_SCI#, but it is bit 24 in GPE_STS */<br>-#define EC_SCI_GPI   24<br>+/* AGPIO22 -> GPE3 */<br>+#define EC_SCI_GPI   3<br> /* GPIO_S5_07 is EC_SMI#, but it is bit 23 in GPE_STS and ALT_GPIO_SMI. */<br> #define EC_SMI_GPI   23<br> <br>diff --git a/src/mainboard/google/kahlee/gpio.c b/src/mainboard/google/kahlee/gpio.c<br>index f586c35..8eadab1 100644<br>--- a/src/mainboard/google/kahlee/gpio.c<br>+++ b/src/mainboard/google/kahlee/gpio.c<br>@@ -15,6 +15,8 @@<br> <br> #include <AGESA.h><br> #include <FchPlatform.h><br>+#include <mainboard.h><br>+#include <soc/smi.h><br> #include <soc/southbridge.h><br> #include <stdlib.h><br> <br>@@ -91,3 +93,28 @@<br> <br>    {-1}<br> };<br>+<br>+/*<br>+ * GPE setup table must match ACPI GPE ASL<br>+ *  { gevent, gpe, direction, level }<br>+ */<br>+static const struct sci_source_t gpe_table[] = {<br>+<br>+   /* EC AGPIO22/Gevent3 -> GPE 3 */<br>+ {3, 3, SMI_SCI_LVL_HIGH, SMI_SCI_LVL},<br>+<br>+    /* PCIE/WLAN AGPIO2/Gevent8 -> GPE8 */<br>+    {8, 8, SMI_SCI_LVL_HIGH, SMI_SCI_LVL},<br>+<br>+    /* EHCI USB_PME -> GPE24 */<br>+       {24, 24, SMI_SCI_LVL_HIGH, SMI_SCI_LVL},<br>+<br>+  /* XHCIC0_-> GPE31 */<br>+     {56, 31, SMI_SCI_LVL_HIGH, SMI_SCI_LVL},<br>+};<br>+<br>+const struct sci_source_t * get_gpe_table(size_t *num)<br>+{<br>+        *num = ARRAY_SIZE(gpe_table);<br>+        return gpe_table;<br>+}<br>diff --git a/src/mainboard/google/kahlee/mainboard.c b/src/mainboard/google/kahlee/mainboard.c<br>index 48a05a9..01225b8 100644<br>--- a/src/mainboard/google/kahlee/mainboard.c<br>+++ b/src/mainboard/google/kahlee/mainboard.c<br>@@ -19,6 +19,8 @@<br> #include <agesawrapper.h><br> #include <amd_pci_util.h><br> #include <ec.h><br>+#include <mainboard.h><br>+#include <soc/smi.h><br> #include <vendorcode/google/chromeos/chromeos.h><br> <br> /***********************************************************<br>@@ -79,7 +81,13 @@<br> <br> static void mainboard_init(void *chip_info)<br> {<br>+    const struct sci_source_t* gpes;<br>+     size_t num;<br>+<br>        mainboard_ec_init();<br>+<br>+      gpes = get_gpe_table(&num);<br>+      gpe_configure_sci(gpes, num);<br> }<br> <br> /*************************************************<br>diff --git a/src/mainboard/google/kahlee/mainboard.h b/src/mainboard/google/kahlee/mainboard.h<br>new file mode 100644<br>index 0000000..ecda535<br>--- /dev/null<br>+++ b/src/mainboard/google/kahlee/mainboard.h<br>@@ -0,0 +1,21 @@<br>+/*<br>+ * This file is part of the coreboot project.<br>+ *<br>+ * Copyright (C) 2017 Advanced Micro Devices, Inc.<br>+ *<br>+ * This program is free software; you can redistribute it and/or modify<br>+ * it under the terms of the GNU General Public License as published by<br>+ * the Free Software Foundation; version 2 of the License.<br>+ *<br>+ * This program is distributed in the hope that it will be useful,<br>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>+ * GNU General Public License for more details.<br>+ */<br>+<br>+#ifndef MAINBOARD_H<br>+#define MAINBOARD_H<br>+<br>+const struct sci_source_t * get_gpe_table(size_t *num);<br>+<br>+#endif /* MAINBOARD_H */<br></pre><p>To view, visit <a href="https://review.coreboot.org/22096">change 22096</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/22096"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I27c880ee84b6797d999d4d5951602b654ede948e </div>
<div style="display:none"> Gerrit-Change-Number: 22096 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Marc Jones <marc@marcjonesconsulting.com> </div>