summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2015-10-06 22:54:43 +0200
committerSimon Glass <sjg@chromium.org>2015-10-23 09:42:28 -0600
commitc2b0f600a1707450ef985e28363893987f36fd8a (patch)
tree981149157b60b2df47424e14a7ebdd71cefde480 /common
parent302c5dba0a6eeb5846b628d3d59978dc0751def9 (diff)
downloadu-boot-imx-c2b0f600a1707450ef985e28363893987f36fd8a.zip
u-boot-imx-c2b0f600a1707450ef985e28363893987f36fd8a.tar.gz
u-boot-imx-c2b0f600a1707450ef985e28363893987f36fd8a.tar.bz2
dm: tpm: Remove every compilation switch for TPM driver model
As every TPM drivers support UCLASS_TPM, we can only rely on DM_TPM functions. This simplify a bit the code. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Reviewed-by: Tom Rini <trini@konsulko.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_tpm.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/common/cmd_tpm.c b/common/cmd_tpm.c
index 97501cc..add6bfb 100644
--- a/common/cmd_tpm.c
+++ b/common/cmd_tpm.c
@@ -443,7 +443,6 @@ TPM_COMMAND_NO_ARG(tpm_force_clear)
TPM_COMMAND_NO_ARG(tpm_physical_enable)
TPM_COMMAND_NO_ARG(tpm_physical_disable)
-#ifdef CONFIG_DM_TPM
static int get_tpm(struct udevice **devp)
{
int rc;
@@ -476,11 +475,11 @@ static int do_tpm_info(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
-#endif
static int do_tpm_raw_transfer(cmd_tbl_t *cmdtp, int flag,
int argc, char * const argv[])
{
+ struct udevice *dev;
void *command;
uint8_t response[1024];
size_t count, response_length = sizeof(response);
@@ -492,17 +491,11 @@ static int do_tpm_raw_transfer(cmd_tbl_t *cmdtp, int flag,
return CMD_RET_FAILURE;
}
-#ifdef CONFIG_DM_TPM
- struct udevice *dev;
-
rc = get_tpm(&dev);
if (rc)
return rc;
rc = tpm_xfer(dev, command, count, response, &response_length);
-#else
- rc = tis_sendrecv(command, count, response, &response_length);
-#endif
free(command);
if (!rc) {
puts("tpm response:\n");
@@ -657,9 +650,7 @@ TPM_COMMAND_NO_ARG(tpm_end_oiap)
U_BOOT_CMD_MKENT(cmd, 0, 1, do_tpm_ ## cmd, "", "")
static cmd_tbl_t tpm_commands[] = {
-#ifdef CONFIG_DM_TPM
U_BOOT_CMD_MKENT(info, 0, 1, do_tpm_info, "", ""),
-#endif
U_BOOT_CMD_MKENT(init, 0, 1,
do_tpm_init, "", ""),
U_BOOT_CMD_MKENT(startup, 0, 1,
@@ -730,9 +721,7 @@ U_BOOT_CMD(tpm, CONFIG_SYS_MAXARGS, 1, do_tpm,
"cmd args...\n"
" - Issue TPM command <cmd> with arguments <args...>.\n"
"Admin Startup and State Commands:\n"
-#ifdef CONFIG_DM_TPM
" info - Show information about the TPM\n"
-#endif
" init\n"
" - Put TPM into a state where it waits for 'startup' command.\n"
" startup mode\n"