blob: 0beff4a85726d38d7bad0030bde59dfd7626a366 [file] [log] [blame]
Marek Vasut909bbcc2012-08-08 01:42:17 +00001The U-Boot Driver Model Project
2===============================
3TPM system analysis
4===================
5Marek Vasut <marek.vasut@gmail.com>
62012-02-23
7
8I) Overview
9-----------
10
11There is currently only one TPM chip driver available and therefore the API
12controlling it is very much based on this. The API is very simple:
13
14 int tis_open(void);
15 int tis_close(void);
16 int tis_sendrecv(const u8 *sendbuf, size_t send_size,
Wolfgang Denkec7fbf52013-10-04 17:43:24 +020017 u8 *recvbuf, size_t *recv_len);
Marek Vasut909bbcc2012-08-08 01:42:17 +000018
19The command operating the TPM chip only provides operations to send and receive
20bytes from the chip.
21
22II) Approach
23------------
24
25The API can't be generalised too much considering there's only one TPM chip
26supported. But it's a good idea to split the tis_sendrecv() function in two
27functions. Therefore the new API will use register the TPM chip by calling:
28
29 tpm_device_register(struct instance *i, const struct tpm_ops *ops);
30
31And the struct tpm_ops will contain the following members:
32
33 struct tpm_ops {
34 int (*tpm_open)(struct instance *i);
35 int (*tpm_close)(struct instance *i);
36 int (*tpm_send)(const uint8_t *buf, const size_t size);
37 int (*tpm_recv)(uint8_t *buf, size_t *size);
38 };
39
40The behaviour of "tpm_open()" and "tpm_close()" will basically copy the
41behaviour of "tis_open()" and "tis_close()". The "tpm_send()" will be based on
42the "tis_senddata()" and "tis_recv()" will be based on "tis_readresponse()".
43
44III) Analysis of in-tree drivers
45--------------------------------
46
47There is only one in-tree driver present, the "drivers/tpm/generic_lpc_tpm.c",
48which will be simply converted as outlined in previous chapter.