[U-Boot] Porting TPM support (from Linux) to U-Boot

Huewe.external at infineon.com Huewe.external at infineon.com
Tue Feb 22 11:49:42 CET 2011


Hi,

we at Infineon would like to port TPM support to U-Boot, especially in regard to our new I2C TPM chips.
TPM in u-boot would be a key element to verified/trusted booting.

As we already have a working linux device driver for this device we thought it might be a good starting point to port tpm functionality to u-boot.
The Linux driver consists of two parts, the generic tpm.c [1] and a vendor/hardware specific part, in our case tpm_tis_i2c.c [2].

For a proof of concept / prototype implementation, we experimented with the tpm.c, tpm.h and our tpm_tis_i2c.c driver, added some glue/compatibility layer.
On top of this driver with glue layer we put a so called TDDL (tddl.c) which handles the TIS protocol.
In addition to that we implemented a new tpm U-Boot command (cmd_tpm.c).

We put the driver files, together with the tddl in lib/libtddl/and added a new include file (tddl.h) in include.
The cmd_tpm.c includes this file.
All other (internally used) header files reside in lib/libtddl/ in order to not pollute the include/ dir.


This setup works quite fine.
But I'm almost sure that this is not the correct way to port a linux driver to u-boot. ;)

Can you perhaps point me to some resources how to do it correctly?
How would you start? And how would you split up the files?


Furthermore I have some related questions:
-       Is U-Boot using a libc / can I use functions from the glibc/ulibc? Are there any constraints?
-       Is there an equivalent for jiffies in u-boot? Or rather what is the correct way to handle timeouts?
-       Is there an equivalent for be32_to_cpu ? (big endian to whatever endianess the cpu uses) in u-boot?



Would be great if you could help me out on this issue.

Thanks,
Peter

References:
[1] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=tree;f=drivers/char/tpm;
[2] https://patchwork.kernel.org/patch/577781/


Glossary:
TPM: Trusted Platform Module
TCG: Trusted Computing Group
TDDL: TCG device driver library
TIS: TCG Interface Specification







Peter Huewe

Infineon Technologies AG
CCS TI SWT SW ESW
Tel:    +49 821 25851-86
Fax:    +49 89 234-9552849

huewe.external at infineon.com<mailto:huewe.external at infineon.com>

****VISIT US AT: www.infineon.com<http://www.infineon.com/> *****
Infineon Technologies AG
Vorsitzender des Aufsichtsrats: Prof. Dr. Klaus Wucherer
Vorstand: Peter Bauer (Vorsitzender), Dominik Asam, Dr. Reinhard Ploss
Sitz der Gesellschaft: Neubiberg

Registergericht: München HRB 126492

"This email and any attachments are confidential and may be subject to legal or some other professional privilege. They are intended solely for the attention and use of the named addressee(s). If you are not the named addressee(s) you must not use, disclose, retain or reproduce all or any part of the information contained in this email or any attachments. Any unauthorised use or disclosure may be unlawful. If you have received this email by mistake, please inform the sender immediately and delete it and all copies from your system and destroy any hard copies of it."






More information about the U-Boot mailing list