Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: drivers/tpm/slb9635_i2c/ifx_v05.c

Issue 6683023: Add Infineon v05 TPM driver (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/u-boot-next.git@chromeos-v2010.09
Patch Set: Fix nits Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « drivers/tpm/slb9635_i2c/ifx_v03.c ('k') | drivers/tpm/slb9635_i2c/tddl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: drivers/tpm/slb9635_i2c/ifx_v05.c
diff --git a/drivers/tpm/slb9635_i2c/ifx_v05.c b/drivers/tpm/slb9635_i2c/ifx_v05.c
new file mode 100644
index 0000000000000000000000000000000000000000..c39d8e765b3fd17595114e2a9e314984f15ba333
--- /dev/null
+++ b/drivers/tpm/slb9635_i2c/ifx_v05.c
@@ -0,0 +1,46 @@
+/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include <config.h>
+#include <common.h>
+#include <i2c.h>
+#include "tddl.h"
+
+#define TPM_V05_DEFAULT_ADDR (0x20)
+
+#ifdef CONFIG_TPM_SLB9635_I2C_ADDR
+#define TPM_V05_ADDR CONFIG_TPM_SLB9635_I2C_ADDR
+#else
+#define TPM_V05_ADDR TPM_V05_DEFAULT_ADDR
+#endif
+
+int tpm_init_v05(void)
+{
+ return i2c_probe(TPM_V05_ADDR );
+}
+
+int tpm_open_v05(void)
+{
+ if (TDDL_Open(TPM_V05_ADDR ))
+ return -1;
+ return 0;
+}
+
+int tpm_close_v05(void)
+{
+ if (TDDL_Close())
+ return -1;
+ return 0;
+}
+
+int tpm_sendrecv_v05(const uint8_t *sendbuf, size_t buf_size,
+ uint8_t *recvbuf, size_t *recv_len)
+{
+ if (TDDL_TransmitData((uint8_t*)sendbuf, (uint32_t)buf_size, recvbuf,
+ (uint32_t*)recv_len))
+ return -1;
+ return 0;
+}
+
« no previous file with comments | « drivers/tpm/slb9635_i2c/ifx_v03.c ('k') | drivers/tpm/slb9635_i2c/tddl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698