xref: /aosp_15_r20/external/vboot_reference/tests/tpm_lite/startup.c (revision 8617a60d3594060b7ecbd21bc622a7c14f3cf2bc)
1 /* Copyright 2010 The ChromiumOS Authors
2  * Use of this source code is governed by a BSD-style license that can be
3  * found in the LICENSE file.
4  */
5 
6 /* Only perform a TPM_Startup command.
7  */
8 
9 #include <stdio.h>
10 
11 #include "tlcl.h"
12 
main(int argc,char ** argv)13 int main(int argc, char** argv) {
14 	uint32_t result;
15 	TlclLibInit();
16 	result = TlclStartup();
17 	if (result != 0) {
18 		printf("tpm startup failed with %#x\n", result);
19 	}
20 	result = TlclGetFlags(NULL, NULL, NULL);
21 	if (result != 0) {
22 		printf("tpm getflags failed with %#x\n", result);
23 	}
24 	printf("executing SelfTestFull\n");
25 	TlclSelfTestFull();
26 	result = TlclGetFlags(NULL, NULL, NULL);
27 	if (result != 0) {
28 		printf("tpm getflags failed with %#x\n", result);
29 	}
30 	printf("TEST SUCCEEDED\n");
31 	return 0;
32 }
33