[PATCH v3 06/11] tpm: Add a basic API implementation for TPMv2