<p>Martin Roth has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/22186">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">mainboard/google/kahlee: Add Grunt variant framework<br><br>Update common files and add files for grunt to the variant directory.<br>These will be updated in following commits.<br><br>BUG=b:68293392<br>TEST=Build only<br><br>Change-Id: I7b80e470058872d6613e66e64c8dd1494942e9b9<br>Signed-off-by: Martin Roth <martinroth@google.com><br>---<br>M src/mainboard/google/kahlee/Kconfig<br>M src/mainboard/google/kahlee/Kconfig.name<br>M src/mainboard/google/kahlee/ec.h<br>A src/mainboard/google/kahlee/variants/grunt/OemCustomize.c<br>A src/mainboard/google/kahlee/variants/grunt/acpi/usb_oc.asl<br>A src/mainboard/google/kahlee/variants/grunt/boardid.c<br>A src/mainboard/google/kahlee/variants/grunt/chromeos.c<br>A src/mainboard/google/kahlee/variants/grunt/devicetree.cb<br>A src/mainboard/google/kahlee/variants/grunt/gpio.c<br>9 files changed, 233 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/22186/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/mainboard/google/kahlee/Kconfig b/src/mainboard/google/kahlee/Kconfig<br>index ddb1955..ab6c0f9 100644<br>--- a/src/mainboard/google/kahlee/Kconfig<br>+++ b/src/mainboard/google/kahlee/Kconfig<br>@@ -13,7 +13,7 @@<br> # GNU General Public License for more details.<br> #<br> <br>-if BOARD_GOOGLE_KAHLEE<br>+if BOARD_GOOGLE_KAHLEE || BOARD_GOOGLE_GRUNT<br> <br> config BOARD_SPECIFIC_OPTIONS # dummy<br>      def_bool y<br>@@ -37,10 +37,12 @@<br> <br> config VARIANT_DIR<br>       string<br>+       default "grunt" if BOARD_GOOGLE_GRUNT<br>       default "kahlee" if BOARD_GOOGLE_KAHLEE<br> <br> config MAINBOARD_PART_NUMBER<br>   string<br>+       default "Grunt" if BOARD_GOOGLE_GRUNT<br>       default "Kahlee" if BOARD_GOOGLE_KAHLEE<br> <br> config DEVICETREE<br>@@ -74,10 +76,11 @@<br> config GBB_HWID<br>       string<br>        depends on CHROMEOS<br>+  default "GRUNT TEST XXXX" if BOARD_GOOGLE_GRUNT<br>     default "KAHLEE TEST 6421" if BOARD_GOOGLE_KAHLEE<br> <br> config AMD_FWM_POSITION_INDEX<br>        int<br>   default 1<br> <br>-endif # BOARD_GOOGLE_KAHLEE<br>+endif # BOARD_GOOGLE_KAHLEE || BOARD_GOOGLE_GRUNT<br>diff --git a/src/mainboard/google/kahlee/Kconfig.name b/src/mainboard/google/kahlee/Kconfig.name<br>index 8b2174b..c480612 100644<br>--- a/src/mainboard/google/kahlee/Kconfig.name<br>+++ b/src/mainboard/google/kahlee/Kconfig.name<br>@@ -1,2 +1,4 @@<br>+config BOARD_GOOGLE_GRUNT<br>+ bool "Grunt"<br> config BOARD_GOOGLE_KAHLEE<br>   bool "Kahlee"<br>diff --git a/src/mainboard/google/kahlee/ec.h b/src/mainboard/google/kahlee/ec.h<br>index c3374d8..381a19a 100644<br>--- a/src/mainboard/google/kahlee/ec.h<br>+++ b/src/mainboard/google/kahlee/ec.h<br>@@ -26,6 +26,12 @@<br> #define EC_SMI_GPI   23<br> #endif<br> <br>+#if IS_ENABLED(CONFIG_BOARD_GOOGLE_GRUNT)<br>+// TODO: UPDATE THESE GPIOS<br>+#define EC_SCI_GPI   0<br>+#define EC_SMI_GPI   0<br>+#endif<br>+<br> #define MAINBOARD_EC_SCI_EVENTS \<br>        (EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED)        |\<br>        EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN)          |\<br>diff --git a/src/mainboard/google/kahlee/variants/grunt/OemCustomize.c b/src/mainboard/google/kahlee/variants/grunt/OemCustomize.c<br>new file mode 100644<br>index 0000000..a76ad24<br>--- /dev/null<br>+++ b/src/mainboard/google/kahlee/variants/grunt/OemCustomize.c<br>@@ -0,0 +1,23 @@<br>+/*<br>+ * This file is part of the coreboot project.<br>+ *<br>+ * Copyright (C) 2015-2016 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>+#include <AGESA.h><br>+#include <agesawrapper.h><br>+#include <PlatformMemoryConfiguration.h><br>+<br>+void OemPostParams(AMD_POST_PARAMS *PostParams)<br>+{<br>+<br>+}<br>diff --git a/src/mainboard/google/kahlee/variants/grunt/acpi/usb_oc.asl b/src/mainboard/google/kahlee/variants/grunt/acpi/usb_oc.asl<br>new file mode 100644<br>index 0000000..72f26d8<br>--- /dev/null<br>+++ b/src/mainboard/google/kahlee/variants/grunt/acpi/usb_oc.asl<br>@@ -0,0 +1,29 @@<br>+/*<br>+ * This file is part of the coreboot project.<br>+ *<br>+ * Copyright (C) 2015 Advanced Micro Devices, Inc.<br>+ * Copyright (C) 2013 Sage Electronic Engineering, LLC<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>+/* USB overcurrent mapping pins.   */<br>+Name (UOM0, 0)<br>+Name (UOM1, 0)<br>+Name (UOM2, 0)<br>+Name (UOM3, 0)<br>+Name (UOM4, 0)<br>+Name (UOM5, 0)<br>+Name (UOM6, 0)<br>+Name (UOM7, 0)<br>+Name (UOM8, 0)<br>+Name (UOM9, 0)<br>+<br>+/* USB Overcurrent GPEs */<br>diff --git a/src/mainboard/google/kahlee/variants/grunt/boardid.c b/src/mainboard/google/kahlee/variants/grunt/boardid.c<br>new file mode 100644<br>index 0000000..48de438<br>--- /dev/null<br>+++ b/src/mainboard/google/kahlee/variants/grunt/boardid.c<br>@@ -0,0 +1,37 @@<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>+#include <boardid.h><br>+#include <console/console.h><br>+#include <gpio.h><br>+<br>+uint8_t board_id(void)<br>+{<br>+ MAYBE_STATIC int id = -1;<br>+<br>+ gpio_t gpios[] = {<br>+           //GPIO_,<br>+             //GPIO_,<br>+             //GPIO_,<br>+             //GPIO_,<br>+     };<br>+<br>+        if (id < 0) {<br>+             id = gpio_base2_value(gpios, ARRAY_SIZE(gpios));<br>+             printk(BIOS_SPEW, "Board ID: %#x.\n", id);<br>+ }<br>+<br>+ return id;<br>+}<br>diff --git a/src/mainboard/google/kahlee/variants/grunt/chromeos.c b/src/mainboard/google/kahlee/variants/grunt/chromeos.c<br>new file mode 100644<br>index 0000000..6d20ab2<br>--- /dev/null<br>+++ b/src/mainboard/google/kahlee/variants/grunt/chromeos.c<br>@@ -0,0 +1,42 @@<br>+/*<br>+ * This file is part of the coreboot project.<br>+ *<br>+ * Copyright (C) 2014 Google Inc.<br>+ * Copyright (C) 2016 Intel Corporation.<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>+#include <vendorcode/google/chromeos/chromeos.h><br>+#include <boot/coreboot_tables.h><br>+#include <console/console.h><br>+#include <gpio.h><br>+<br>+void fill_lb_gpios(struct lb_gpios *gpios)<br>+{<br>+ struct lb_gpio chromeos_gpios[] = {<br>+  };<br>+   lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));<br>+}<br>+<br>+int get_write_protect_state(void)<br>+{<br>+      int TODO = 0;<br>+        return TODO;<br>+}<br>+<br>+static const struct cros_gpio cros_gpios[] = {<br>+};<br>+<br>+void mainboard_chromeos_acpi_generate(void)<br>+{<br>+       chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios));<br>+}<br>diff --git a/src/mainboard/google/kahlee/variants/grunt/devicetree.cb b/src/mainboard/google/kahlee/variants/grunt/devicetree.cb<br>new file mode 100644<br>index 0000000..6558dec<br>--- /dev/null<br>+++ b/src/mainboard/google/kahlee/variants/grunt/devicetree.cb<br>@@ -0,0 +1,48 @@<br>+#<br>+# This file is part of the coreboot project.<br>+#<br>+# Copyright (C) 2015-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>+chip soc/amd/stoneyridge<br>+ device cpu_cluster 0 on<br>+              device lapic 10 on end<br>+       end<br>+  device domain 0 on<br>+           subsystemid 0x1022 0x1410 inherit<br>+            device pci 0.0 on  end # Root Complex<br>+                device pci 1.0 on  end # Internal Graphics P2P bridge 0x98e4<br>+         device pci 1.1 on  end # Internal Multimedia<br>+         device pci 2.0 on  end # PCIe Host Bridge<br>+            device pci 2.1 on  end #<br>+             device pci 2.2 on  end #<br>+             device pci 2.3 on  end #<br>+             device pci 2.4 on  end #<br>+             device pci 2.5 on  end #<br>+             device pci 8.0 on  end # PSP<br>+         device pci 9.0 on  end # PCIe Host Bridge<br>+            device pci 9.2 on  end # HDA<br>+         device pci 10.0 on  end # xHCI<br>+               device pci 11.0 on  end # SATA<br>+               device pci 12.0 on  end # EHCI<br>+               device pci 14.0 on      # SMbus<br>+              end # SMbus<br>+          device pci 14.3 on<br>+           end # LPC<br>+            device pci 14.7 on  end # SD<br>+         device pci 18.0 on  end<br>+              device pci 18.1 on  end<br>+              device pci 18.2 on  end<br>+              device pci 18.3 on  end<br>+              device pci 18.4 on  end<br>+              device pci 18.5 on  end<br>+      end #domain<br>+end       #chip soc/amd/stoneyridge<br>diff --git a/src/mainboard/google/kahlee/variants/grunt/gpio.c b/src/mainboard/google/kahlee/variants/grunt/gpio.c<br>new file mode 100644<br>index 0000000..55067af<br>--- /dev/null<br>+++ b/src/mainboard/google/kahlee/variants/grunt/gpio.c<br>@@ -0,0 +1,41 @@<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>+#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>+const GPIO_CONTROL oem_kahlee_gpio[] = {<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 gpe_table[] = {<br>+<br>+<br>+};<br>+<br>+const struct sci_source *get_gpe_table(size_t *num)<br>+{<br>+        *num = ARRAY_SIZE(gpe_table);<br>+        return gpe_table;<br>+}<br></pre><p>To view, visit <a href="https://review.coreboot.org/22186">change 22186</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/22186"/><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: I7b80e470058872d6613e66e64c8dd1494942e9b9 </div>
<div style="display:none"> Gerrit-Change-Number: 22186 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Martin Roth <martinroth@google.com> </div>