aboutsummaryrefslogtreecommitdiff
path: root/drivers/tpm/tpm-uclass.c
diff options
context:
space:
mode:
authorMiquel Raynal2018-07-19 22:35:09 +0200
committerTom Rini2018-07-28 11:57:38 -0400
commit2a2096ea6001cc65fa91e2bc622da48c8eb26a06 (patch)
tree1a4f9362a861e40c3c87f51e0736a53513a6c569 /drivers/tpm/tpm-uclass.c
parent8a7aa3e27921d330ed9828c7ef09079007c5fcee (diff)
tpm: allow TPM v1 and v2 to be compiled at the same time
While there is probably no reason to do so in a real life situation, it will allow to compile test both stacks with the same sandbox defconfig. As we cannot define two 'tpm' commands at the same time, the command for TPM v1 is still called 'tpm' and the one for TPM v2 'tpm2'. While this is the exact command name that must be written into eg. test files, any user already using the TPM v2 stack can continue to do so by just writing 'tpm' because as long as TPM v1 support is not compiled, U-Boot prompt will search for the closest command named after 'tpm'. The command set can also be changed at runtime (not supported yet, but ready to be), but as one can compile only either one stack or the other, there is still one spot in the code where conditionals are used: to retrieve the v1 or v2 command set. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: In sandbox_tpm2_fill_buf() use NULL not \0 to ensure NULL terminated string due to LLVM warning] Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'drivers/tpm/tpm-uclass.c')
-rw-r--r--drivers/tpm/tpm-uclass.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/tpm/tpm-uclass.c b/drivers/tpm/tpm-uclass.c
index 412697eedc4..c83f53ab86b 100644
--- a/drivers/tpm/tpm-uclass.c
+++ b/drivers/tpm/tpm-uclass.c
@@ -7,11 +7,8 @@
#include <common.h>
#include <dm.h>
#include <linux/unaligned/be_byteshift.h>
-#if defined(CONFIG_TPM_V1)
#include <tpm-v1.h>
-#elif defined(CONFIG_TPM_V2)
#include <tpm-v2.h>
-#endif
#include "tpm_internal.h"
int tpm_open(struct udevice *dev)