[coreboot-gerrit] Change in coreboot[master]: mainboard/google/kahlee: Add Grunt variant framework

Martin Roth (Code Review) gerrit at coreboot.org
Thu Oct 26 12:51:14 CEST 2017


Martin Roth has uploaded this change for review. ( https://review.coreboot.org/22186


Change subject: mainboard/google/kahlee: Add Grunt variant framework
......................................................................

mainboard/google/kahlee: Add Grunt variant framework

Update common files and add files for grunt to the variant directory.
These will be updated in following commits.

BUG=b:68293392
TEST=Build only

Change-Id: I7b80e470058872d6613e66e64c8dd1494942e9b9
Signed-off-by: Martin Roth <martinroth at google.com>
---
M src/mainboard/google/kahlee/Kconfig
M src/mainboard/google/kahlee/Kconfig.name
M src/mainboard/google/kahlee/ec.h
A src/mainboard/google/kahlee/variants/grunt/OemCustomize.c
A src/mainboard/google/kahlee/variants/grunt/acpi/usb_oc.asl
A src/mainboard/google/kahlee/variants/grunt/boardid.c
A src/mainboard/google/kahlee/variants/grunt/chromeos.c
A src/mainboard/google/kahlee/variants/grunt/devicetree.cb
A src/mainboard/google/kahlee/variants/grunt/gpio.c
9 files changed, 233 insertions(+), 2 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/22186/1

diff --git a/src/mainboard/google/kahlee/Kconfig b/src/mainboard/google/kahlee/Kconfig
index ddb1955..ab6c0f9 100644
--- a/src/mainboard/google/kahlee/Kconfig
+++ b/src/mainboard/google/kahlee/Kconfig
@@ -13,7 +13,7 @@
 # GNU General Public License for more details.
 #
 
-if BOARD_GOOGLE_KAHLEE
+if BOARD_GOOGLE_KAHLEE || BOARD_GOOGLE_GRUNT
 
 config BOARD_SPECIFIC_OPTIONS # dummy
 	def_bool y
@@ -37,10 +37,12 @@
 
 config VARIANT_DIR
 	string
+	default "grunt" if BOARD_GOOGLE_GRUNT
 	default "kahlee" if BOARD_GOOGLE_KAHLEE
 
 config MAINBOARD_PART_NUMBER
 	string
+	default "Grunt" if BOARD_GOOGLE_GRUNT
 	default "Kahlee" if BOARD_GOOGLE_KAHLEE
 
 config DEVICETREE
@@ -74,10 +76,11 @@
 config GBB_HWID
 	string
 	depends on CHROMEOS
+	default "GRUNT TEST XXXX" if BOARD_GOOGLE_GRUNT
 	default "KAHLEE TEST 6421" if BOARD_GOOGLE_KAHLEE
 
 config AMD_FWM_POSITION_INDEX
 	int
 	default 1
 
-endif # BOARD_GOOGLE_KAHLEE
+endif # BOARD_GOOGLE_KAHLEE || BOARD_GOOGLE_GRUNT
diff --git a/src/mainboard/google/kahlee/Kconfig.name b/src/mainboard/google/kahlee/Kconfig.name
index 8b2174b..c480612 100644
--- a/src/mainboard/google/kahlee/Kconfig.name
+++ b/src/mainboard/google/kahlee/Kconfig.name
@@ -1,2 +1,4 @@
+config BOARD_GOOGLE_GRUNT
+	bool "Grunt"
 config BOARD_GOOGLE_KAHLEE
 	bool "Kahlee"
diff --git a/src/mainboard/google/kahlee/ec.h b/src/mainboard/google/kahlee/ec.h
index c3374d8..381a19a 100644
--- a/src/mainboard/google/kahlee/ec.h
+++ b/src/mainboard/google/kahlee/ec.h
@@ -26,6 +26,12 @@
 #define EC_SMI_GPI   23
 #endif
 
+#if IS_ENABLED(CONFIG_BOARD_GOOGLE_GRUNT)
+// TODO: UPDATE THESE GPIOS
+#define EC_SCI_GPI   0
+#define EC_SMI_GPI   0
+#endif
+
 #define MAINBOARD_EC_SCI_EVENTS \
 	(EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED)        |\
 	 EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN)          |\
diff --git a/src/mainboard/google/kahlee/variants/grunt/OemCustomize.c b/src/mainboard/google/kahlee/variants/grunt/OemCustomize.c
new file mode 100644
index 0000000..a76ad24
--- /dev/null
+++ b/src/mainboard/google/kahlee/variants/grunt/OemCustomize.c
@@ -0,0 +1,23 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015-2016 Advanced Micro Devices, Inc.
+ *
+ * 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; version 2 of the License.
+ *
+ * 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 <AGESA.h>
+#include <agesawrapper.h>
+#include <PlatformMemoryConfiguration.h>
+
+void OemPostParams(AMD_POST_PARAMS *PostParams)
+{
+
+}
diff --git a/src/mainboard/google/kahlee/variants/grunt/acpi/usb_oc.asl b/src/mainboard/google/kahlee/variants/grunt/acpi/usb_oc.asl
new file mode 100644
index 0000000..72f26d8
--- /dev/null
+++ b/src/mainboard/google/kahlee/variants/grunt/acpi/usb_oc.asl
@@ -0,0 +1,29 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 Advanced Micro Devices, Inc.
+ * Copyright (C) 2013 Sage Electronic Engineering, LLC
+ *
+ * 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; version 2 of the License.
+ *
+ * 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.
+ */
+
+/* USB overcurrent mapping pins.   */
+Name (UOM0, 0)
+Name (UOM1, 0)
+Name (UOM2, 0)
+Name (UOM3, 0)
+Name (UOM4, 0)
+Name (UOM5, 0)
+Name (UOM6, 0)
+Name (UOM7, 0)
+Name (UOM8, 0)
+Name (UOM9, 0)
+
+/* USB Overcurrent GPEs */
diff --git a/src/mainboard/google/kahlee/variants/grunt/boardid.c b/src/mainboard/google/kahlee/variants/grunt/boardid.c
new file mode 100644
index 0000000..48de438
--- /dev/null
+++ b/src/mainboard/google/kahlee/variants/grunt/boardid.c
@@ -0,0 +1,37 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2017 Advanced Micro Devices, Inc.
+ *
+ * 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; version 2 of the License.
+ *
+ * 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 <boardid.h>
+#include <console/console.h>
+#include <gpio.h>
+
+uint8_t board_id(void)
+{
+	MAYBE_STATIC int id = -1;
+
+	gpio_t gpios[] = {
+		//GPIO_,
+		//GPIO_,
+		//GPIO_,
+		//GPIO_,
+	};
+
+	if (id < 0) {
+		id = gpio_base2_value(gpios, ARRAY_SIZE(gpios));
+		printk(BIOS_SPEW, "Board ID: %#x.\n", id);
+	}
+
+	return id;
+}
diff --git a/src/mainboard/google/kahlee/variants/grunt/chromeos.c b/src/mainboard/google/kahlee/variants/grunt/chromeos.c
new file mode 100644
index 0000000..6d20ab2
--- /dev/null
+++ b/src/mainboard/google/kahlee/variants/grunt/chromeos.c
@@ -0,0 +1,42 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2016 Intel Corporation.
+ * Copyright (C) 2017 Advanced Micro Devices, Inc.
+ *
+ * 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; version 2 of the License.
+ *
+ * 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 <vendorcode/google/chromeos/chromeos.h>
+#include <boot/coreboot_tables.h>
+#include <console/console.h>
+#include <gpio.h>
+
+void fill_lb_gpios(struct lb_gpios *gpios)
+{
+	struct lb_gpio chromeos_gpios[] = {
+	};
+	lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
+}
+
+int get_write_protect_state(void)
+{
+	int TODO = 0;
+	return TODO;
+}
+
+static const struct cros_gpio cros_gpios[] = {
+};
+
+void mainboard_chromeos_acpi_generate(void)
+{
+	chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios));
+}
diff --git a/src/mainboard/google/kahlee/variants/grunt/devicetree.cb b/src/mainboard/google/kahlee/variants/grunt/devicetree.cb
new file mode 100644
index 0000000..6558dec
--- /dev/null
+++ b/src/mainboard/google/kahlee/variants/grunt/devicetree.cb
@@ -0,0 +1,48 @@
+#
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2015-2017 Advanced Micro Devices, Inc.
+#
+# 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; version 2 of the License.
+#
+# 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.
+#
+chip soc/amd/stoneyridge
+	device cpu_cluster 0 on
+		device lapic 10 on end
+	end
+	device domain 0 on
+		subsystemid 0x1022 0x1410 inherit
+		device pci 0.0 on  end # Root Complex
+		device pci 1.0 on  end # Internal Graphics P2P bridge 0x98e4
+		device pci 1.1 on  end # Internal Multimedia
+		device pci 2.0 on  end # PCIe Host Bridge
+		device pci 2.1 on  end #
+		device pci 2.2 on  end #
+		device pci 2.3 on  end #
+		device pci 2.4 on  end #
+		device pci 2.5 on  end #
+		device pci 8.0 on  end # PSP
+		device pci 9.0 on  end # PCIe Host Bridge
+		device pci 9.2 on  end # HDA
+		device pci 10.0 on  end # xHCI
+		device pci 11.0 on  end # SATA
+		device pci 12.0 on  end # EHCI
+		device pci 14.0 on      # SMbus
+		end # SMbus
+		device pci 14.3 on
+		end # LPC
+		device pci 14.7 on  end # SD
+		device pci 18.0 on  end
+		device pci 18.1 on  end
+		device pci 18.2 on  end
+		device pci 18.3 on  end
+		device pci 18.4 on  end
+		device pci 18.5 on  end
+	end #domain
+end	#chip soc/amd/stoneyridge
diff --git a/src/mainboard/google/kahlee/variants/grunt/gpio.c b/src/mainboard/google/kahlee/variants/grunt/gpio.c
new file mode 100644
index 0000000..55067af
--- /dev/null
+++ b/src/mainboard/google/kahlee/variants/grunt/gpio.c
@@ -0,0 +1,41 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2017 Advanced Micro Devices, Inc.
+ *
+ * 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; version 2 of the License.
+ *
+ * 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 <AGESA.h>
+#include <FchPlatform.h>
+#include <mainboard.h>
+#include <soc/smi.h>
+#include <soc/southbridge.h>
+#include <stdlib.h>
+
+const GPIO_CONTROL oem_kahlee_gpio[] = {
+
+	{-1}
+};
+
+/*
+ * GPE setup table must match ACPI GPE ASL
+ *  { gevent, gpe, direction, level }
+ */
+static const struct sci_source gpe_table[] = {
+
+
+};
+
+const struct sci_source *get_gpe_table(size_t *num)
+{
+	*num = ARRAY_SIZE(gpe_table);
+	return gpe_table;
+}

-- 
To view, visit https://review.coreboot.org/22186
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b80e470058872d6613e66e64c8dd1494942e9b9
Gerrit-Change-Number: 22186
Gerrit-PatchSet: 1
Gerrit-Owner: Martin Roth <martinroth at google.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20171026/c03bbc31/attachment-0001.html>


More information about the coreboot-gerrit mailing list