David Wu has uploaded this change for review. ( https://review.coreboot.org/28962
Change subject: mb/google/fizz: Provide baseboard and variant concepts ......................................................................
mb/google/fizz: Provide baseboard and variant concepts
In order to be able to share code across different fizz variants, provide the concept of baseboard and variants. New directory layout:
variants/baseboard - code variants/baseboard/include/baseboard - headers variants/fizz - code variants/fizz/include/variant - headers
New boards would then add themselves under their board name within "variants" directory.
This is purely an organizational change.
BUG=b:117066935 BRANCH=Fizz TEST=emerge-fizz coreboot
Change-Id: I28cc41681e7af88ddeba2e847dc0a4686606feb2 Signed-off-by: David Wu david_wu@quanta.corp-partner.google.com --- M src/mainboard/google/fizz/Kconfig M src/mainboard/google/fizz/Makefile.inc M src/mainboard/google/fizz/bootblock.c M src/mainboard/google/fizz/chromeos.c M src/mainboard/google/fizz/dsdt.asl M src/mainboard/google/fizz/ec.c M src/mainboard/google/fizz/mainboard.c M src/mainboard/google/fizz/ramstage.c M src/mainboard/google/fizz/smihandler.c R src/mainboard/google/fizz/variants/baseboard/devicetree.cb R src/mainboard/google/fizz/variants/baseboard/include/baseboard/acpi/dptf.asl R src/mainboard/google/fizz/variants/baseboard/include/baseboard/ec.h R src/mainboard/google/fizz/variants/baseboard/include/baseboard/gpio.h A src/mainboard/google/fizz/variants/fizz/include/variant/acpi/dptf.asl A src/mainboard/google/fizz/variants/fizz/include/variant/ec.h A src/mainboard/google/fizz/variants/fizz/include/variant/gpio.h 16 files changed, 88 insertions(+), 17 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/62/28962/1
diff --git a/src/mainboard/google/fizz/Kconfig b/src/mainboard/google/fizz/Kconfig index 7f4989b..6ab94c9 100644 --- a/src/mainboard/google/fizz/Kconfig +++ b/src/mainboard/google/fizz/Kconfig @@ -25,6 +25,10 @@
if BOARD_GOOGLE_BASEBOARD_FIZZ
+config DEVICETREE + string + default "variants/baseboard/devicetree.cb" + config VBOOT select EC_GOOGLE_CHROMEEC_SWITCHES select VBOOT_EC_EFS @@ -68,6 +72,10 @@ int default 64 # GPE0_DW2_00 (GPP_E0)
+config VARIANT_DIR + string + default "fizz" if BOARD_GOOGLE_FIZZ + config INCLUDE_NHLT_BLOBS bool "Include blobs for audio." select NHLT_RT5663 diff --git a/src/mainboard/google/fizz/Makefile.inc b/src/mainboard/google/fizz/Makefile.inc index 534968c..59f84b5 100644 --- a/src/mainboard/google/fizz/Makefile.inc +++ b/src/mainboard/google/fizz/Makefile.inc @@ -26,3 +26,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/fizz/bootblock.c b/src/mainboard/google/fizz/bootblock.c index dc5dde1..4114cd5 100644 --- a/src/mainboard/google/fizz/bootblock.c +++ b/src/mainboard/google/fizz/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/fizz/chromeos.c b/src/mainboard/google/fizz/chromeos.c index e52ac72..98bee6b 100644 --- a/src/mainboard/google/fizz/chromeos.c +++ b/src/mainboard/google/fizz/chromeos.c @@ -18,7 +18,7 @@ #include <soc/gpio.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/fizz/dsdt.asl b/src/mainboard/google/fizz/dsdt.asl index dc2fcfa..8a35197 100644 --- a/src/mainboard/google/fizz/dsdt.asl +++ b/src/mainboard/google/fizz/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", @@ -61,7 +61,7 @@ Scope (_SB) { /* Dynamic Platform Thermal Framework */ - #include "acpi/dptf.asl" + #include <variant/acpi/dptf.asl> }
/* USB port entries */ diff --git a/src/mainboard/google/fizz/ec.c b/src/mainboard/google/fizz/ec.c index 6b3ec9e..63a32a8 100644 --- a/src/mainboard/google/fizz/ec.c +++ b/src/mainboard/google/fizz/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/fizz/mainboard.c b/src/mainboard/google/fizz/mainboard.c index 501510c..9865f40 100644 --- a/src/mainboard/google/fizz/mainboard.c +++ b/src/mainboard/google/fizz/mainboard.c @@ -20,7 +20,7 @@ #include <ec/ec.h> #include <ec/google/chromeec/ec.h> #include <gpio.h> -#include <mainboard/google/fizz/gpio.h> +#include <variant/gpio.h> #include <smbios.h> #include <soc/gpio.h> #include <soc/pci_devs.h> diff --git a/src/mainboard/google/fizz/ramstage.c b/src/mainboard/google/fizz/ramstage.c index 231ed87..e208a67 100644 --- a/src/mainboard/google/fizz/ramstage.c +++ b/src/mainboard/google/fizz/ramstage.c @@ -18,12 +18,11 @@ #include <delay.h> #include <ec/google/chromeec/ec.h> #include <gpio.h> -#include <mainboard/google/fizz/gpio.h> #include <soc/gpio.h> #include <soc/ramstage.h> #include <timer.h>
-#include "gpio.h" +#include <variant/gpio.h>
#define GPIO_HDMI_HPD GPP_E13 #define GPIO_DP_HPD GPP_E14 diff --git a/src/mainboard/google/fizz/smihandler.c b/src/mainboard/google/fizz/smihandler.c index 5f05b2e..3aa9ddb 100644 --- a/src/mainboard/google/fizz/smihandler.c +++ b/src/mainboard/google/fizz/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/fizz/devicetree.cb b/src/mainboard/google/fizz/variants/baseboard/devicetree.cb similarity index 100% rename from src/mainboard/google/fizz/devicetree.cb rename to src/mainboard/google/fizz/variants/baseboard/devicetree.cb diff --git a/src/mainboard/google/fizz/acpi/dptf.asl b/src/mainboard/google/fizz/variants/baseboard/include/baseboard/acpi/dptf.asl similarity index 100% rename from src/mainboard/google/fizz/acpi/dptf.asl rename to src/mainboard/google/fizz/variants/baseboard/include/baseboard/acpi/dptf.asl diff --git a/src/mainboard/google/fizz/ec.h b/src/mainboard/google/fizz/variants/baseboard/include/baseboard/ec.h similarity index 96% rename from src/mainboard/google/fizz/ec.h rename to src/mainboard/google/fizz/variants/baseboard/include/baseboard/ec.h index 4b40445..a372f8d 100644 --- a/src/mainboard/google/fizz/ec.h +++ b/src/mainboard/google/fizz/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_AC_CONNECTED) |\ diff --git a/src/mainboard/google/fizz/gpio.h b/src/mainboard/google/fizz/variants/baseboard/include/baseboard/gpio.h similarity index 98% rename from src/mainboard/google/fizz/gpio.h rename to src/mainboard/google/fizz/variants/baseboard/include/baseboard/gpio.h index 9a94af4..05d9d03 100644 --- a/src/mainboard/google/fizz/gpio.h +++ b/src/mainboard/google/fizz/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> @@ -281,6 +281,6 @@ /* SATA_DEVSLP1 */ PAD_CFG_NF(GPP_E5, NONE, DEEP, NF1), /* DEVSLP1_MB */ };
-#endif +#endif /* __ACPI__ */
-#endif +#endif /* BASEBOARD_GPIO_H */ diff --git a/src/mainboard/google/fizz/variants/fizz/include/variant/acpi/dptf.asl b/src/mainboard/google/fizz/variants/fizz/include/variant/acpi/dptf.asl new file mode 100644 index 0000000..a9afa73 --- /dev/null +++ b/src/mainboard/google/fizz/variants/fizz/include/variant/acpi/dptf.asl @@ -0,0 +1,16 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2018 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/fizz/variants/fizz/include/variant/ec.h b/src/mainboard/google/fizz/variants/fizz/include/variant/ec.h new file mode 100644 index 0000000..3d4fc8f --- /dev/null +++ b/src/mainboard/google/fizz/variants/fizz/include/variant/ec.h @@ -0,0 +1,21 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2018 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/fizz/variants/fizz/include/variant/gpio.h b/src/mainboard/google/fizz/variants/fizz/include/variant/gpio.h new file mode 100644 index 0000000..cd34cf0 --- /dev/null +++ b/src/mainboard/google/fizz/variants/fizz/include/variant/gpio.h @@ -0,0 +1,21 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2018 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__ */