[coreboot-gerrit] Change in coreboot[master]: mainboard/google/poppy: Provide baseboard and variant concepts

Furquan Shaikh (Code Review) gerrit at coreboot.org
Sat Apr 15 23:56:54 CEST 2017


Furquan Shaikh has uploaded a new change for review. ( https://review.coreboot.org/19322 )

Change subject: mainboard/google/poppy: Provide baseboard and variant concepts
......................................................................

mainboard/google/poppy: Provide baseboard and variant concepts

In order to be able to share code across different poppy variants,
provide the concept of baseboard and variants. New directory layout:

variants/baseboard - code
variants/baseboard/include/baseboard - headers
variants/poppy - code
variants/poppy/include/variant - headers

New boards would then add themselves unders their board name within
"variants" directory.

This is purely an organizational change.

BUG=b:37375693

Change-Id: If6c1c5f479cfffe768abf27495d379744104e2dc
---
M src/mainboard/google/poppy/Kconfig
M src/mainboard/google/poppy/Makefile.inc
M src/mainboard/google/poppy/bootblock.c
M src/mainboard/google/poppy/chromeos.c
M src/mainboard/google/poppy/dsdt.asl
M src/mainboard/google/poppy/ec.c
M src/mainboard/google/poppy/ramstage.c
M src/mainboard/google/poppy/smihandler.c
M src/mainboard/google/poppy/spd/spd.c
R src/mainboard/google/poppy/variants/baseboard/devicetree.cb
R src/mainboard/google/poppy/variants/baseboard/include/baseboard/acpi/dptf.asl
R src/mainboard/google/poppy/variants/baseboard/include/baseboard/ec.h
R src/mainboard/google/poppy/variants/baseboard/include/baseboard/gpio.h
A src/mainboard/google/poppy/variants/poppy/include/variant/acpi/dptf.asl
A src/mainboard/google/poppy/variants/poppy/include/variant/ec.h
A src/mainboard/google/poppy/variants/poppy/include/variant/gpio.h
16 files changed, 88 insertions(+), 16 deletions(-)


  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/19322/1

diff --git a/src/mainboard/google/poppy/Kconfig b/src/mainboard/google/poppy/Kconfig
index ce74b45..66f7fe7 100644
--- a/src/mainboard/google/poppy/Kconfig
+++ b/src/mainboard/google/poppy/Kconfig
@@ -17,6 +17,10 @@
 
 if BOARD_GOOGLE_BASEBOARD_POPPY
 
+config DEVICETREE
+	string
+	default "variants/baseboard/devicetree.cb"
+
 config DRIVER_TPM_SPI_BUS
 	default 0x1
 
@@ -58,6 +62,10 @@
 	select SPI_TPM
 	select TPM2
 
+config VARIANT_DIR
+	string
+	default "poppy" if BOARD_GOOGLE_POPPY
+
 config VBOOT
 	select EC_GOOGLE_CHROMEEC_SWITCHES
 	select VBOOT_LID_SWITCH
diff --git a/src/mainboard/google/poppy/Makefile.inc b/src/mainboard/google/poppy/Makefile.inc
index 64a948c..b151b0c 100644
--- a/src/mainboard/google/poppy/Makefile.inc
+++ b/src/mainboard/google/poppy/Makefile.inc
@@ -30,3 +30,9 @@
 ramstage-y += ramstage.c
 
 smm-$(CONFIG_HAVE_SMI_HANDLER) += smihandler.c
+
+subdirs-y += variants/baseboard
+CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/baseboard/include
+
+subdirs-y += variants/$(VARIANT_DIR)
+CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include
diff --git a/src/mainboard/google/poppy/bootblock.c b/src/mainboard/google/poppy/bootblock.c
index 2fdbe40..7057916 100644
--- a/src/mainboard/google/poppy/bootblock.c
+++ b/src/mainboard/google/poppy/bootblock.c
@@ -16,7 +16,7 @@
 #include <bootblock_common.h>
 #include <soc/gpio.h>
 
-#include "gpio.h"
+#include <variant/gpio.h>
 
 static void early_config_gpio(void)
 {
diff --git a/src/mainboard/google/poppy/chromeos.c b/src/mainboard/google/poppy/chromeos.c
index b7877aa..250effd 100644
--- a/src/mainboard/google/poppy/chromeos.c
+++ b/src/mainboard/google/poppy/chromeos.c
@@ -21,7 +21,7 @@
 #include <tpm.h>
 #include <vendorcode/google/chromeos/chromeos.h>
 
-#include "gpio.h"
+#include <variant/gpio.h>
 
 #if ENV_RAMSTAGE
 #include <boot/coreboot_tables.h>
diff --git a/src/mainboard/google/poppy/dsdt.asl b/src/mainboard/google/poppy/dsdt.asl
index 2007691..c61dbf3 100644
--- a/src/mainboard/google/poppy/dsdt.asl
+++ b/src/mainboard/google/poppy/dsdt.asl
@@ -13,8 +13,8 @@
  * GNU General Public License for more details.
  */
 
-#include "ec.h"
-#include "gpio.h"
+#include <variant/ec.h>
+#include <variant/gpio.h>
 
 DefinitionBlock(
 	"dsdt.aml",
@@ -65,6 +65,6 @@
 	Scope (\_SB)
 	{
 		/* Dynamic Platform Thermal Framework */
-		#include "acpi/dptf.asl"
+		#include <variant/acpi/dptf.asl>
 	}
 }
diff --git a/src/mainboard/google/poppy/ec.c b/src/mainboard/google/poppy/ec.c
index ad60e49..f0559ca 100644
--- a/src/mainboard/google/poppy/ec.c
+++ b/src/mainboard/google/poppy/ec.c
@@ -16,7 +16,7 @@
 #include <arch/acpi.h>
 #include <ec/google/chromeec/ec.h>
 
-#include "ec.h"
+#include <variant/ec.h>
 
 void mainboard_ec_init(void)
 {
diff --git a/src/mainboard/google/poppy/ramstage.c b/src/mainboard/google/poppy/ramstage.c
index 821dcca..b2c0ed7 100644
--- a/src/mainboard/google/poppy/ramstage.c
+++ b/src/mainboard/google/poppy/ramstage.c
@@ -15,7 +15,7 @@
 
 #include <soc/ramstage.h>
 
-#include "gpio.h"
+#include <variant/gpio.h>
 
 void mainboard_silicon_init_params(FSP_SIL_UPD *params)
 {
diff --git a/src/mainboard/google/poppy/smihandler.c b/src/mainboard/google/poppy/smihandler.c
index a17ae67..88aa905 100644
--- a/src/mainboard/google/poppy/smihandler.c
+++ b/src/mainboard/google/poppy/smihandler.c
@@ -17,7 +17,7 @@
 #include <ec/google/chromeec/smm.h>
 #include <soc/smm.h>
 
-#include "ec.h"
+#include <variant/ec.h>
 
 void mainboard_smi_espi_handler(void)
 {
diff --git a/src/mainboard/google/poppy/spd/spd.c b/src/mainboard/google/poppy/spd/spd.c
index 9b99679..fa0012a 100644
--- a/src/mainboard/google/poppy/spd/spd.c
+++ b/src/mainboard/google/poppy/spd/spd.c
@@ -23,7 +23,7 @@
 #include <soc/romstage.h>
 #include <string.h>
 
-#include "../gpio.h"
+#include <variant/gpio.h>
 #include "spd.h"
 
 static void mainboard_print_spd_info(uint8_t spd[])
diff --git a/src/mainboard/google/poppy/devicetree.cb b/src/mainboard/google/poppy/variants/baseboard/devicetree.cb
similarity index 100%
rename from src/mainboard/google/poppy/devicetree.cb
rename to src/mainboard/google/poppy/variants/baseboard/devicetree.cb
diff --git a/src/mainboard/google/poppy/acpi/dptf.asl b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/acpi/dptf.asl
similarity index 100%
rename from src/mainboard/google/poppy/acpi/dptf.asl
rename to src/mainboard/google/poppy/variants/baseboard/include/baseboard/acpi/dptf.asl
diff --git a/src/mainboard/google/poppy/ec.h b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/ec.h
similarity index 96%
rename from src/mainboard/google/poppy/ec.h
rename to src/mainboard/google/poppy/variants/baseboard/include/baseboard/ec.h
index 331bbbc..157dc8f 100644
--- a/src/mainboard/google/poppy/ec.h
+++ b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/ec.h
@@ -13,13 +13,13 @@
  * GNU General Public License for more details.
  */
 
-#ifndef __MAINBOARD_EC_H__
-#define __MAINBOARD_EC_H__
+#ifndef __BASEBOARD_EC_H__
+#define __BASEBOARD_EC_H__
 
 #include <ec/ec.h>
 #include <ec/google/chromeec/ec_commands.h>
 
-#include "gpio.h"
+#include <variant/gpio.h>
 
 #define MAINBOARD_EC_SCI_EVENTS \
 	(EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED)        |\
diff --git a/src/mainboard/google/poppy/gpio.h b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/gpio.h
similarity index 98%
rename from src/mainboard/google/poppy/gpio.h
rename to src/mainboard/google/poppy/variants/baseboard/include/baseboard/gpio.h
index aa477cf..57d5e18 100644
--- a/src/mainboard/google/poppy/gpio.h
+++ b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/gpio.h
@@ -13,8 +13,8 @@
  * GNU General Public License for more details.
  */
 
-#ifndef __MAINBOARD_GPIO_H__
-#define __MAINBOARD_GPIO_H__
+#ifndef __BASEBOARD_GPIO_H__
+#define __BASEBOARD_GPIO_H__
 
 #include <soc/gpe.h>
 #include <soc/gpio.h>
@@ -396,6 +396,6 @@
 	PAD_CFG_GPI_APIC_INVERT(GPP_E0, NONE, PLTRST),
 };
 
-#endif
+#endif /* __ACPI__ */
 
-#endif
+#endif /* BASEBOARD_GPIO_H */
diff --git a/src/mainboard/google/poppy/variants/poppy/include/variant/acpi/dptf.asl b/src/mainboard/google/poppy/variants/poppy/include/variant/acpi/dptf.asl
new file mode 100644
index 0000000..a9ec742
--- /dev/null
+++ b/src/mainboard/google/poppy/variants/poppy/include/variant/acpi/dptf.asl
@@ -0,0 +1,16 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2017 Google 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 <baseboard/acpi/dptf.asl>
diff --git a/src/mainboard/google/poppy/variants/poppy/include/variant/ec.h b/src/mainboard/google/poppy/variants/poppy/include/variant/ec.h
new file mode 100644
index 0000000..ef47d37
--- /dev/null
+++ b/src/mainboard/google/poppy/variants/poppy/include/variant/ec.h
@@ -0,0 +1,21 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2017 Google 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.
+ */
+
+#ifndef __MAINBOARD_EC_H__
+#define __MAINBOARD_EC_H__
+
+#include <baseboard/ec.h>
+
+#endif /* __MAINBOARD_EC_H__ */
diff --git a/src/mainboard/google/poppy/variants/poppy/include/variant/gpio.h b/src/mainboard/google/poppy/variants/poppy/include/variant/gpio.h
new file mode 100644
index 0000000..4f79495
--- /dev/null
+++ b/src/mainboard/google/poppy/variants/poppy/include/variant/gpio.h
@@ -0,0 +1,21 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2017 Google 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.
+ */
+
+#ifndef __MAINBOARD_GPIO_H__
+#define __MAINBOARD_GPIO_H__
+
+#include <baseboard/gpio.h>
+
+#endif /* __MAINBOARD_GPIO_H__ */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If6c1c5f479cfffe768abf27495d379744104e2dc
Gerrit-PatchSet: 1
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Furquan Shaikh <furquan at google.com>



More information about the coreboot-gerrit mailing list