aboutsummaryrefslogtreecommitdiff
path: root/_TPM_Init.c
blob: 7c8fa7f60484948f3ed149cd1b5ad177ef6019fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// This file was extracted from the TCG Published
// Trusted Platform Module Library
// Part 3: Commands
// Family "2.0"
// Level 00 Revision 01.16
// October 30, 2014

#include "InternalRoutines.h"
LIB_EXPORT void
_TPM_Init(
   void
   )
{
   // Clear the failure mode flags
   g_inFailureMode = FALSE;
   g_forceFailureMode = FALSE;

   // Initialize the NvEnvironment.
   g_nvOk = NvPowerOn();

   // Initialize crypto engine
   CryptInitUnits();

   // Start clock
   TimePowerOn();

   // Set initialization state
   TPMInit();

   // Initialize object table
   ObjectStartup();

   // Set g_DRTMHandle as unassigned
   g_DRTMHandle = TPM_RH_UNASSIGNED;

   // No H-CRTM, yet.
   g_DrtmPreStartup = FALSE;

   return;
}