1swtpm_bios(8)                                                    swtpm_bios(8)
2
3
4

NAME

6       swtpm_bios - BIOS simulation tool for swtpm
7

SYNOPSIS

9       swtpm_bios [OPTIONS]
10

DESCRIPTION

12       swtpm_bios is a tool that can send the commands to the TPM (swtpm
13       program) that typically are used by the BIOS to initialize the TPM.
14       The user can choose among several command line options to choose the
15       state the TPM should be set to.
16
17       This command requires the environment variable TCSD_USE_TCP_DEVICE to
18       be set for communication via TCP. Otherwise it will use the device set
19       in the environment variable TPM_DEVICE or fall back to use /dev/tpm0 to
20       send the commands to. In TCP mode, the environment variable
21       TCSD_TCP_DEVICE_HOSTNAME is used to indicate the host to send the
22       commands to. By default localhost is assumed. The default TCP port is
23       6545 unless the environment variable TCSD_TCP_DEVICE_PORT indicates
24       another port.
25
26       In case of success 0 will be returned. In case a TPM error was
27       encountered the return code will be 128. In case of communcation
28       failure 255 is returned. In case the TPM needs to be reset to become
29       activated, 129 will be returned.
30
31       This command will send the following sequence of commands to the TPM.
32
33       TPM_Startup(chosen mode) -- startup TPM
34       TSC_PhysicalPresence(0x20) -- PhysicalPresenceCMDEnable
35       TSC_PhysicalPresence(0x08) -- turn on physical presence
36       TPM_GetCapability -- get permanent flags
37       TPM_PhysicalEnable -- enable the TPM
38       TPM_PhysicalSetDeactivated(0x0) -- activate TPM
39       TPM_ContinueSelfTest -- continue self test
40       TSC_PhysicalPresence(0x20) -- PhysicalPresenceCMDEnable
41       TSC_PhysicalPresence(0x14) -- turn off physical presence & lock it
42
43       The following options are supported:
44
45       --tpm-device <device>
46           Use the given device rather than the default /dev/tpm0. This option
47           overrides the TPM_DEVICE environment variable.
48
49       --tcp <server>:<port>
50           Connect to the given server and port; if no server is given,
51           127.0.0.1 is used; if port is not given, the default port 6545 is
52           used.
53
54       --unix <path>
55           Connect to the given UnixIO path.
56
57       -tpm2
58           The device is a TPM 2.
59
60       -c  Send TPM_Startup(ST_CLEAR) (default). This instructs the TPM to
61           start with clear state.
62
63       -s  Send TPM_Startup(ST_STATE). This instructs the TPM to start by
64           restoring previously saved state.
65
66       -d  Send TPM_Startup(ST_DEACTIVATED). This instructs the TPM to start
67           in deactivated mode. This option has no effect on a TPM 2.
68
69       -n  Don't send a TPM_Startup command.
70
71       -o  Only send the startup command and nothing else.
72
73       -ea Make sure that the TPM is activated; if the TPM requires a reset,
74           the program will exist and return a return code of 129.
75
76       -cs Send a TPM_ContinueSelfTest command to a TPM 1.2 and a
77           TPM2_IncrementalSelfTest command to a TPM 2.
78
79       -u  Give up physical presence on a TPM 1.2. In case of a TPM 2 set the
80           platform hierarchy to a random password.
81
82       -v  Display version and exit.
83
84       -h  Display the help screen and exit.
85

SEE ALSO

REPORTING BUGS

88       Report bugs to Stefan Berger <stefanb@linux.vnet.ibm.com>
89
90
91
92swtpm                             2021-11-09                     swtpm_bios(8)
Impressum