meta-aspeed: Enable tpm2 kernel config

Append tpm2 in MACHINE_FEATURES to enable related kernel configs
MACHINE_FEATURES:append = " tpm2"

Signed-off-by: Potin Lai <potin.lai@quantatw.com>
Change-Id: Ie6b50d81040de2863487cffc449193ec9462bf89
diff --git a/meta-aspeed/recipes-kernel/linux/linux-aspeed.inc b/meta-aspeed/recipes-kernel/linux/linux-aspeed.inc
index aa06029..6098885 100644
--- a/meta-aspeed/recipes-kernel/linux/linux-aspeed.inc
+++ b/meta-aspeed/recipes-kernel/linux/linux-aspeed.inc
@@ -12,6 +12,7 @@
              file://defconfig \
              file://rsa_oem_fitimage_key.key;sha256sum=eeb4ff2ebbfbd97b6254fe6dbaeea41067e54c65176c233ec7b2ab2decf1ddcd \
              file://rsa_oem_fitimage_key.crt;sha256sum=45f5a55497cce8040999bf9f3214d471ac7b83ab7acef41c4425a34662e8372e \
+             ${@bb.utils.contains('MACHINE_FEATURES', 'tpm2', 'file://tpm/tpm2.scc', '', d)} \
            "
 
 LINUX_VERSION_EXTENSION ?= "-${SRCREV}"
diff --git a/meta-aspeed/recipes-kernel/linux/linux-aspeed/tpm/tpm2.cfg b/meta-aspeed/recipes-kernel/linux/linux-aspeed/tpm/tpm2.cfg
new file mode 100644
index 0000000..9479a7b
--- /dev/null
+++ b/meta-aspeed/recipes-kernel/linux/linux-aspeed/tpm/tpm2.cfg
@@ -0,0 +1,6 @@
+CONFIG_HW_RANDOM_TPM=y
+CONFIG_TCG_TPM=y
+CONFIG_TCG_TIS_CORE=y
+CONFIG_TCG_TIS=y
+CONFIG_TCG_TIS_SPI=y
+CONFIG_SECURITYFS=y
diff --git a/meta-aspeed/recipes-kernel/linux/linux-aspeed/tpm/tpm2.scc b/meta-aspeed/recipes-kernel/linux/linux-aspeed/tpm/tpm2.scc
new file mode 100644
index 0000000..088148f
--- /dev/null
+++ b/meta-aspeed/recipes-kernel/linux/linux-aspeed/tpm/tpm2.scc
@@ -0,0 +1,3 @@
+define KFEATURE_DESCRIPTION "Enable TPM 2.0"
+
+kconf hardware tpm2.cfg