summaryrefslogtreecommitdiff
path: root/doc/driver-model/UDM-tpm.txt
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut@gmail.com>2012-08-08 01:42:17 +0000
committerWolfgang Denk <wd@denx.de>2012-09-02 17:55:53 +0200
commit15c6935b0c8267d0cd70e18a0cf6e31345f50266 (patch)
tree65df664daf670c2e7d97a9cc409ec825da401b83 /doc/driver-model/UDM-tpm.txt
parentc20dbf64a976a40d39694a991d3bf51985cb35f6 (diff)
downloadu-boot-imx-15c6935b0c8267d0cd70e18a0cf6e31345f50266.zip
u-boot-imx-15c6935b0c8267d0cd70e18a0cf6e31345f50266.tar.gz
u-boot-imx-15c6935b0c8267d0cd70e18a0cf6e31345f50266.tar.bz2
dm: Initial import of design documents
This patch contains UDM-design.txt, which is document containing general description of the driver model. The remaining files contains descriptions of conversion process of particular subsystems. Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Diffstat (limited to 'doc/driver-model/UDM-tpm.txt')
-rw-r--r--doc/driver-model/UDM-tpm.txt48
1 files changed, 48 insertions, 0 deletions
diff --git a/doc/driver-model/UDM-tpm.txt b/doc/driver-model/UDM-tpm.txt
new file mode 100644
index 0000000..91a953a
--- /dev/null
+++ b/doc/driver-model/UDM-tpm.txt
@@ -0,0 +1,48 @@
+The U-Boot Driver Model Project
+===============================
+TPM system analysis
+===================
+Marek Vasut <marek.vasut@gmail.com>
+2012-02-23
+
+I) Overview
+-----------
+
+There is currently only one TPM chip driver available and therefore the API
+controlling it is very much based on this. The API is very simple:
+
+ int tis_open(void);
+ int tis_close(void);
+ int tis_sendrecv(const u8 *sendbuf, size_t send_size,
+ u8 *recvbuf, size_t *recv_len);
+
+The command operating the TPM chip only provides operations to send and receive
+bytes from the chip.
+
+II) Approach
+------------
+
+The API can't be generalised too much considering there's only one TPM chip
+supported. But it's a good idea to split the tis_sendrecv() function in two
+functions. Therefore the new API will use register the TPM chip by calling:
+
+ tpm_device_register(struct instance *i, const struct tpm_ops *ops);
+
+And the struct tpm_ops will contain the following members:
+
+ struct tpm_ops {
+ int (*tpm_open)(struct instance *i);
+ int (*tpm_close)(struct instance *i);
+ int (*tpm_send)(const uint8_t *buf, const size_t size);
+ int (*tpm_recv)(uint8_t *buf, size_t *size);
+ };
+
+The behaviour of "tpm_open()" and "tpm_close()" will basically copy the
+behaviour of "tis_open()" and "tis_close()". The "tpm_send()" will be based on
+the "tis_senddata()" and "tis_recv()" will be based on "tis_readresponse()".
+
+III) Analysis of in-tree drivers
+--------------------------------
+
+There is only one in-tree driver present, the "drivers/tpm/generic_lpc_tpm.c",
+which will be simply converted as outlined in previous chapter.