meta-google: linux: Add configurations

Upstream: 3c2cdab65317061f819ca0f48448821ea4ab79cf
Change-Id: I7c519c5d1b4d404727aee909ea7582165c9f4dd4
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/meta-google/conf/layer.conf b/meta-google/conf/layer.conf
index a8fda28..24a8480 100644
--- a/meta-google/conf/layer.conf
+++ b/meta-google/conf/layer.conf
@@ -4,6 +4,13 @@
 BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
             ${LAYERDIR}/recipes-*/*/*.bbappend"
 
+BBFILES_DYNAMIC += " \
+  aspeed-layer:${LAYERDIR}/dynamic-layers/aspeed-layer/recipes-*/*/*.bb \
+  aspeed-layer:${LAYERDIR}/dynamic-layers/aspeed-layer/recipes-*/*/*.bbappend \
+  nuvoton-layer:${LAYERDIR}/dynamic-layers/nuvoton-layer/recipes-*/*/*.bb \
+  nuvoton-layer:${LAYERDIR}/dynamic-layers/nuvoton-layer/recipes-*/*/*.bbappend \
+  "
+
 BBFILE_COLLECTIONS += "google-layer"
 BBFILE_PATTERN_google-layer := "^${LAYERDIR}/"
 LAYERVERSION_google-layer = "1"
diff --git a/meta-google/dynamic-layers/aspeed-layer/recipes-kernel/linux/linux-aspeed_%.bbappend b/meta-google/dynamic-layers/aspeed-layer/recipes-kernel/linux/linux-aspeed_%.bbappend
new file mode 100644
index 0000000..1f704ca
--- /dev/null
+++ b/meta-google/dynamic-layers/aspeed-layer/recipes-kernel/linux/linux-aspeed_%.bbappend
@@ -0,0 +1,4 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/../../../../recipes-kernel/linux/files:"
+SRC_URI_append_gbmc = " file://gbmc.cfg"
+SRC_URI_append_gbmc_dev = " file://gbmc-dev.cfg"
+SRC_URI_append_gbmc_prod = " file://gbmc-prod.cfg"
diff --git a/meta-google/dynamic-layers/nuvoton-layer/recipes-kernel/linux/files/gbmc-nuvoton.cfg b/meta-google/dynamic-layers/nuvoton-layer/recipes-kernel/linux/files/gbmc-nuvoton.cfg
new file mode 100644
index 0000000..3bc14d5
--- /dev/null
+++ b/meta-google/dynamic-layers/nuvoton-layer/recipes-kernel/linux/files/gbmc-nuvoton.cfg
@@ -0,0 +1,5 @@
+# Enable EDAC support
+CONFIG_EDAC_SUPPORT=y
+CONFIG_EDAC=y
+CONFIG_EDAC_NPCM7XX=y
+CONFIG_RAS=y
diff --git a/meta-google/dynamic-layers/nuvoton-layer/recipes-kernel/linux/linux-nuvoton_%.bbappend b/meta-google/dynamic-layers/nuvoton-layer/recipes-kernel/linux/linux-nuvoton_%.bbappend
new file mode 100644
index 0000000..8de09b1
--- /dev/null
+++ b/meta-google/dynamic-layers/nuvoton-layer/recipes-kernel/linux/linux-nuvoton_%.bbappend
@@ -0,0 +1,5 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:${THISDIR}/../../../../recipes-kernel/linux/files:"
+SRC_URI_append_gbmc = " file://gbmc.cfg"
+SRC_URI_append_gbmc = " file://gbmc-nuvoton.cfg"
+SRC_URI_append_gbmc_dev = " file://gbmc-dev.cfg"
+SRC_URI_append_gbmc_prod = " file://gbmc-prod.cfg"
diff --git a/meta-google/recipes-kernel/linux/files/gbmc-dev.cfg b/meta-google/recipes-kernel/linux/files/gbmc-dev.cfg
new file mode 100644
index 0000000..d37b116
--- /dev/null
+++ b/meta-google/recipes-kernel/linux/files/gbmc-dev.cfg
@@ -0,0 +1,15 @@
+# Enable all kinds of kernel debug features
+CONFIG_DEBUG_KERNEL=y
+CONFIG_DYNAMIC_DEBUG=y
+CONFIG_DEBUG_FS=y
+# Turn off DEBUG_INFO to compress image size.
+CONFIG_DEBUG_INFO=n
+CONFIG_FUNCTION_TRACER=y
+CONFIG_FUNCTION_GRAPH_TRACER=y
+CONFIG_STACK_TRACER=y
+CONFIG_DYNAMIC_FTRACE=y
+
+# We want to allow for sysrqs over the console
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_MAGIC_SYSRQ_SERIAL=y
+CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1
diff --git a/meta-google/recipes-kernel/linux/files/gbmc-prod.cfg b/meta-google/recipes-kernel/linux/files/gbmc-prod.cfg
new file mode 100644
index 0000000..e1a4ce8
--- /dev/null
+++ b/meta-google/recipes-kernel/linux/files/gbmc-prod.cfg
@@ -0,0 +1,2 @@
+# Prod builds should not have SYSRQ
+CONFIG_MAGIC_SYSRQ=n
diff --git a/meta-google/recipes-kernel/linux/files/gbmc.cfg b/meta-google/recipes-kernel/linux/files/gbmc.cfg
new file mode 100644
index 0000000..4385cc9
--- /dev/null
+++ b/meta-google/recipes-kernel/linux/files/gbmc.cfg
@@ -0,0 +1,38 @@
+# Appended gBMC kernel commandline
+CONFIG_CMDLINE="dummy.numdummies=0"
+CONFIG_CMDLINE_EXTEND=y
+
+# We still have commandline users of /dev/mem
+CONFIG_DEVMEM=y
+CONFIG_DEVMEM_BOOTPARAM=n
+
+# Unused implicitly included functionality
+CONFIG_IPV6_SIT=n
+
+# Used by gbmc nftables configurations
+CONFIG_NETFILTER=y
+CONFIG_NF_CONNTRACK=y
+CONFIG_NF_CONNTRACK_MARK=y
+CONFIG_NF_TABLES=y
+CONFIG_NFT_CT=y
+CONFIG_NF_TABLES_INET=y
+CONFIG_NFT_REJECT=y
+CONFIG_NFT_LOG=y
+CONFIG_IP_NF_IPTABLES=y
+CONFIG_NF_LOG_IPV4=y
+CONFIG_NFT_FIB_IPV4=y
+CONFIG_IP_NF_FILTER=y
+CONFIG_IP_NF_TARGET_REJECT=y
+CONFIG_IP6_NF_IPTABLES=y
+CONFIG_NF_LOG_IPV6=y
+CONFIG_NFT_FIB_IPV6=y
+CONFIG_IP6_NF_FILTER=y
+CONFIG_IP6_NF_TARGET_REJECT=y
+
+# MGMT Bridge Required Features
+CONFIG_BRIDGE=y
+CONFIG_DUMMY=y
+# Support for bridge filter
+CONFIG_BRIDGE_NETFILTER=y
+CONFIG_NF_TABLES_BRIDGE=y
+CONFIG_BRIDGE_NF_EBTABLES=y