[coreboot-gerrit] Change in coreboot[master]: mainboard/google/kahlee: Prepare for variants

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


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


Change subject: mainboard/google/kahlee: Prepare for variants
......................................................................

mainboard/google/kahlee: Prepare for variants

BUG=b:68293392

Move files that are particularly specific to the mainboard into the
variant directory.  Files that only have small areas of mainboard
specific pieces use #if to separate between the boards.

Change-Id: I7c1beb45f571f2547f3b5b0d7ec78923d0cec761
Signed-off-by: Martin Roth <martinroth at google.com>
---
M src/mainboard/google/kahlee/BiosCallOuts.c
M src/mainboard/google/kahlee/Kconfig
M src/mainboard/google/kahlee/Makefile.inc
M src/mainboard/google/kahlee/ec.h
R src/mainboard/google/kahlee/variants/kahlee/OemCustomize.c
R src/mainboard/google/kahlee/variants/kahlee/acpi/usb_oc.asl
R src/mainboard/google/kahlee/variants/kahlee/boardid.c
R src/mainboard/google/kahlee/variants/kahlee/chromeos.c
R src/mainboard/google/kahlee/variants/kahlee/devicetree.cb
R src/mainboard/google/kahlee/variants/kahlee/gpio.c
10 files changed, 28 insertions(+), 15 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/85/22185/1

diff --git a/src/mainboard/google/kahlee/BiosCallOuts.c b/src/mainboard/google/kahlee/BiosCallOuts.c
index bf590ec..e5f7f98 100644
--- a/src/mainboard/google/kahlee/BiosCallOuts.c
+++ b/src/mainboard/google/kahlee/BiosCallOuts.c
@@ -31,5 +31,6 @@
 	FchParams_env->PostOemGpioTable = (void *)oem_kahlee_gpio;
 
 	/* SDHCI/MMC configuration */
-	FchParams_env->Sd.SdSlotType = 1; // EMMC
+	if (IS_ENABLED(CONFIG_BOARD_GOOGLE_KAHLEE))
+		FchParams_env->Sd.SdSlotType = 1; // EMMC
 }
diff --git a/src/mainboard/google/kahlee/Kconfig b/src/mainboard/google/kahlee/Kconfig
index 76e8ead..ddb1955 100644
--- a/src/mainboard/google/kahlee/Kconfig
+++ b/src/mainboard/google/kahlee/Kconfig
@@ -35,9 +35,17 @@
 	string
 	default google/kahlee
 
+config VARIANT_DIR
+	string
+	default "kahlee" if BOARD_GOOGLE_KAHLEE
+
 config MAINBOARD_PART_NUMBER
 	string
-	default "Kahlee"
+	default "Kahlee" if BOARD_GOOGLE_KAHLEE
+
+config DEVICETREE
+	string
+	default "variants/${CONFIG_VARIANT_DIR}/devicetree.cb"
 
 config MAX_CPUS
 	int
@@ -66,7 +74,7 @@
 config GBB_HWID
 	string
 	depends on CHROMEOS
-	default "KAHLEE TEST 6421"
+	default "KAHLEE TEST 6421" if BOARD_GOOGLE_KAHLEE
 
 config AMD_FWM_POSITION_INDEX
 	int
diff --git a/src/mainboard/google/kahlee/Makefile.inc b/src/mainboard/google/kahlee/Makefile.inc
index fb381bf..bbf14e0 100644
--- a/src/mainboard/google/kahlee/Makefile.inc
+++ b/src/mainboard/google/kahlee/Makefile.inc
@@ -13,26 +13,28 @@
 # GNU General Public License for more details.
 #
 
+bootblock-y += ec.c
 bootblock-y += bootblock/bootblock.c
 bootblock-y += BiosCallOuts.c
 bootblock-y += bootblock/OemCustomize.c
-bootblock-y += ec.c
-bootblock-y += gpio.c
+bootblock-y += variants/$(VARIANT_DIR)/gpio.c
 
 romstage-y += BiosCallOuts.c
-romstage-y += boardid.c
-romstage-y += chromeos.c
-romstage-y += gpio.c
-romstage-y += OemCustomize.c
+romstage-y += variants/$(VARIANT_DIR)/boardid.c
+romstage-y += variants/$(VARIANT_DIR)/chromeos.c
+romstage-y += variants/$(VARIANT_DIR)/gpio.c
+romstage-y += variants/$(VARIANT_DIR)/OemCustomize.c
 
-ramstage-y += BiosCallOuts.c
-ramstage-y += boardid.c
-ramstage-y += chromeos.c
 ramstage-y += ec.c
-ramstage-y += gpio.c
-ramstage-y += OemCustomize.c
+ramstage-y += BiosCallOuts.c
+ramstage-y += variants/$(VARIANT_DIR)/boardid.c
+ramstage-y += variants/$(VARIANT_DIR)/chromeos.c
+ramstage-y += variants/$(VARIANT_DIR)/gpio.c
+ramstage-y += variants/$(VARIANT_DIR)/OemCustomize.c
 
-verstage-y += chromeos.c
 verstage-y += ec.c
+verstage-y += variants/$(VARIANT_DIR)/chromeos.c
 
 smm-$(CONFIG_HAVE_SMI_HANDLER) += smihandler.c
+
+CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)
diff --git a/src/mainboard/google/kahlee/ec.h b/src/mainboard/google/kahlee/ec.h
index 495ad69..c3374d8 100644
--- a/src/mainboard/google/kahlee/ec.h
+++ b/src/mainboard/google/kahlee/ec.h
@@ -19,10 +19,12 @@
 #include <ec/ec.h>
 #include <ec/google/chromeec/ec_commands.h>
 
+#if IS_ENABLED(CONFIG_BOARD_GOOGLE_KAHLEE)
 /* AGPIO22 -> GPE3 */
 #define EC_SCI_GPI   3
 /* GPIO_S5_07 is EC_SMI#, but it is bit 23 in GPE_STS and ALT_GPIO_SMI. */
 #define EC_SMI_GPI   23
+#endif
 
 #define MAINBOARD_EC_SCI_EVENTS \
 	(EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED)        |\
diff --git a/src/mainboard/google/kahlee/OemCustomize.c b/src/mainboard/google/kahlee/variants/kahlee/OemCustomize.c
similarity index 100%
rename from src/mainboard/google/kahlee/OemCustomize.c
rename to src/mainboard/google/kahlee/variants/kahlee/OemCustomize.c
diff --git a/src/mainboard/google/kahlee/acpi/usb_oc.asl b/src/mainboard/google/kahlee/variants/kahlee/acpi/usb_oc.asl
similarity index 100%
rename from src/mainboard/google/kahlee/acpi/usb_oc.asl
rename to src/mainboard/google/kahlee/variants/kahlee/acpi/usb_oc.asl
diff --git a/src/mainboard/google/kahlee/boardid.c b/src/mainboard/google/kahlee/variants/kahlee/boardid.c
similarity index 100%
rename from src/mainboard/google/kahlee/boardid.c
rename to src/mainboard/google/kahlee/variants/kahlee/boardid.c
diff --git a/src/mainboard/google/kahlee/chromeos.c b/src/mainboard/google/kahlee/variants/kahlee/chromeos.c
similarity index 100%
rename from src/mainboard/google/kahlee/chromeos.c
rename to src/mainboard/google/kahlee/variants/kahlee/chromeos.c
diff --git a/src/mainboard/google/kahlee/devicetree.cb b/src/mainboard/google/kahlee/variants/kahlee/devicetree.cb
similarity index 100%
rename from src/mainboard/google/kahlee/devicetree.cb
rename to src/mainboard/google/kahlee/variants/kahlee/devicetree.cb
diff --git a/src/mainboard/google/kahlee/gpio.c b/src/mainboard/google/kahlee/variants/kahlee/gpio.c
similarity index 100%
rename from src/mainboard/google/kahlee/gpio.c
rename to src/mainboard/google/kahlee/variants/kahlee/gpio.c

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

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c1beb45f571f2547f3b5b0d7ec78923d0cec761
Gerrit-Change-Number: 22185
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/d9ea8a6f/attachment-0001.html>


More information about the coreboot-gerrit mailing list