diff mbox series

[v5,1/1] package/wolftpm: Add config options for TPM 2.0 extra capabilities

Message ID 20220618044659.4800-1-dimi@tpm.dev
State Handled Elsewhere
Headers show
Series [v5,1/1] package/wolftpm: Add config options for TPM 2.0 extra capabilities | expand

Commit Message

Dimi Tomov June 18, 2022, 4:46 a.m. UTC
From: Dimitar Tomov <dimi@tpm.dev>

Some TPM 2.0 chips offer extra capabilities. This patch adds additional
configuration options to the wolftpm package, so such capabilities can
be available to the user. For example, the STMicroelectronics ST33 and
Nuvoton NPCT750 both offer secure GPIO. Due to chip differences, wolfTPM
requires explicit configuration options to enable the extra capabilities.

Signed-off-by: Dimitar Tomov <dimi@tpm.dev>
---
Changes v4 -> v5:
- Style: Fix some lines in Config.in that were longer than 72 characters
Changes v3 -> v4:
- Fix commit message. For some reason the update was not included in patch v3.
Changes v2 -> v3:
- Better commit message
Changes v1 -> v2:
- Remove a not needed package description change
---
 package/wolftpm/Config.in  | 14 ++++++++++++++
 package/wolftpm/wolftpm.mk | 12 ++++++++++++
 2 files changed, 26 insertions(+)

Comments

Dimi Tomov June 18, 2022, 4:57 a.m. UTC | #1
Hi Thomas,

This patch is ready for review. Thanks to Fabrice for the good feedback.

ps: I am unable to enter patchwork after password reset, so v4 still 
holds new status.

Regards,
Dimi
diff mbox series

Patch

diff --git a/package/wolftpm/Config.in b/package/wolftpm/Config.in
index 0b964c3d7e..52a9005d66 100644
--- a/package/wolftpm/Config.in
+++ b/package/wolftpm/Config.in
@@ -23,6 +23,20 @@  config BR2_PACKAGE_WOLFTPM_WOLFCRYPT
 	  encryption. Disabling this option is not recommended as it
 	  could create a security breach in most environments.
 
+config BR2_PACKAGE_WOLFTPM_ST33
+	bool "st33"
+	default n
+	help
+	  Enable support of TPM 2.0 extra functionality offered by the
+	  STMicroelectronics ST33 chip.
+
+config BR2_PACKAGE_WOLFTPM_NUVOTON
+	bool "npct750"
+	default n
+	help
+	  Enable support of TPM 2.0 extra functionality offered by the
+	  Nuvoton NPCT750 chip.
+
 comment "wolfCrypt hooks need a toolchain w/ threads, dynamic library"
 	depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
 
diff --git a/package/wolftpm/wolftpm.mk b/package/wolftpm/wolftpm.mk
index a4a9edce85..d0423cd06b 100644
--- a/package/wolftpm/wolftpm.mk
+++ b/package/wolftpm/wolftpm.mk
@@ -35,4 +35,16 @@  else
 WOLFTPM_CONF_OPTS += --disable-wolfcrypt
 endif
 
+ifeq ($(BR2_PACKAGE_WOLFTPM_ST33),y)
+WOLFTPM_CONF_OPTS += --enable-st33
+else
+WOLFTPM_CONF_OPTS += --disable-st33
+endif
+
+ifeq ($(BR2_PACKAGE_WOLFTPM_NPCT750),y)
+WOLFTPM_CONF_OPTS += --enable-nuvoton
+else
+WOLFTPM_CONF_OPTS += --disable-nuvoton
+endif
+
 $(eval $(autotools-package))