summaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@chromium.org>2017-04-13 14:15:56 -0700
committerFurquan Shaikh <furquan@google.com>2017-04-19 19:16:34 +0200
commit76c392d29481129ed425df62739666b94a3438d0 (patch)
tree1df0aa27e493b28d6b67428c20166489780f0bf8 /src/mainboard
parent3189ea6dd19c9a9df25af687cfaa014f37b68dd9 (diff)
downloadcoreboot-76c392d29481129ed425df62739666b94a3438d0.tar.xz
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 under their board name within "variants" directory. This is purely an organizational change. BUG=b:37375693 Change-Id: If6c1c5f479cfffe768abf27495d379744104e2dc Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://review.coreboot.org/19322 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/google/poppy/Kconfig8
-rw-r--r--src/mainboard/google/poppy/Makefile.inc6
-rw-r--r--src/mainboard/google/poppy/bootblock.c2
-rw-r--r--src/mainboard/google/poppy/chromeos.c2
-rw-r--r--src/mainboard/google/poppy/dsdt.asl6
-rw-r--r--src/mainboard/google/poppy/ec.c2
-rw-r--r--src/mainboard/google/poppy/ramstage.c2
-rw-r--r--src/mainboard/google/poppy/smihandler.c2
-rw-r--r--src/mainboard/google/poppy/spd/spd.c2
-rw-r--r--src/mainboard/google/poppy/variants/baseboard/devicetree.cb (renamed from src/mainboard/google/poppy/devicetree.cb)0
-rw-r--r--src/mainboard/google/poppy/variants/baseboard/include/baseboard/acpi/dptf.asl (renamed from src/mainboard/google/poppy/acpi/dptf.asl)0
-rw-r--r--src/mainboard/google/poppy/variants/baseboard/include/baseboard/ec.h (renamed from src/mainboard/google/poppy/ec.h)6
-rw-r--r--src/mainboard/google/poppy/variants/baseboard/include/baseboard/gpio.h (renamed from src/mainboard/google/poppy/gpio.h)8
-rw-r--r--src/mainboard/google/poppy/variants/poppy/include/variant/acpi/dptf.asl16
-rw-r--r--src/mainboard/google/poppy/variants/poppy/include/variant/ec.h21
-rw-r--r--src/mainboard/google/poppy/variants/poppy/include/variant/gpio.h21
16 files changed, 88 insertions, 16 deletions
diff --git a/src/mainboard/google/poppy/Kconfig b/src/mainboard/google/poppy/Kconfig
index e97df9b5ac..1bdda14907 100644
--- a/src/mainboard/google/poppy/Kconfig
+++ b/src/mainboard/google/poppy/Kconfig
@@ -18,6 +18,10 @@ config BOARD_GOOGLE_BASEBOARD_POPPY
if BOARD_GOOGLE_BASEBOARD_POPPY
+config DEVICETREE
+ string
+ default "variants/baseboard/devicetree.cb"
+
config DRIVER_TPM_SPI_BUS
default 0x1
@@ -59,6 +63,10 @@ config POPPY_USE_SPI_TPM
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 64a948c059..b151b0c140 100644
--- a/src/mainboard/google/poppy/Makefile.inc
+++ b/src/mainboard/google/poppy/Makefile.inc
@@ -30,3 +30,9 @@ ramstage-y += mainboard.c
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 2fdbe40671..7057916c68 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 b7877aadf3..250effd4a1 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 f92f8a9f25..55ca5d9662 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",
@@ -67,6 +67,6 @@ DefinitionBlock(
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 ad60e49b80..f0559ca6f7 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 821dcca46b..b2c0ed7df1 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 a17ae671ce..88aa90581b 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 9b9967916d..fa0012a908 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
index d232028544..d232028544 100644
--- a/src/mainboard/google/poppy/devicetree.cb
+++ b/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
index 7f6cd8e722..7f6cd8e722 100644
--- a/src/mainboard/google/poppy/acpi/dptf.asl
+++ b/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
index 331bbbc4a4..157dc8f424 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
index aa477cfc19..57d5e18b67 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 @@ static const struct pad_config early_gpio_table[] = {
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 0000000000..a9ec74269f
--- /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 0000000000..ef47d3751c
--- /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 0000000000..4f79495e4f
--- /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__ */