blob: ea13fa43c120d315226a3acfe71909bbf2b2c4d3 [file] [log] [blame]
Elyes HAOUASf7b2fe62020-05-07 12:38:15 +02001# SPDX-License-Identifier: GPL-2.0-only
Philipp Deppenwiese64e2d192017-10-18 17:13:07 +02002
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +01003source "src/security/tpm/tss/vendor/cr50/Kconfig"
4
Philipp Deppenwiese64e2d192017-10-18 17:13:07 +02005menu "Trusted Platform Module"
6
Julius Werner8ad93792021-05-18 17:15:50 -07007config NO_TPM
Sergii Dmytruk3e5cefc2022-11-01 00:48:43 +02008 bool
9 default y if !TPM1 && !TPM2
Julius Werner8ad93792021-05-18 17:15:50 -070010 help
11 No TPM support. Select this option if your system doesn't have a TPM,
12 or if you don't want coreboot to communicate with your TPM in any way.
13 (If your board doesn't offer a TPM interface, this will be the only
14 possible option.)
15
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010016config TPM1
Julius Werner8ad93792021-05-18 17:15:50 -070017 bool "TPM 1.2"
Jes B. Klinkec6b041a12022-04-19 14:00:33 -070018 depends on I2C_TPM || MEMORY_MAPPED_TPM || SPI_TPM || CRB_TPM
Sergii Dmytruk3e5cefc2022-11-01 00:48:43 +020019 default y if MAINBOARD_HAS_TPM1
Julius Werner8ad93792021-05-18 17:15:50 -070020 help
21 Select this option if your TPM uses the older TPM 1.2 protocol.
Philipp Deppenwiese64e2d192017-10-18 17:13:07 +020022
23config TPM2
Julius Werner8ad93792021-05-18 17:15:50 -070024 bool "TPM 2.0"
Jes B. Klinkec6b041a12022-04-19 14:00:33 -070025 depends on I2C_TPM || MEMORY_MAPPED_TPM || SPI_TPM || CRB_TPM
Sergii Dmytruk3e5cefc2022-11-01 00:48:43 +020026 default y if MAINBOARD_HAS_TPM2
Julius Werner8ad93792021-05-18 17:15:50 -070027 help
28 Select this option if your TPM uses the newer TPM 2.0 protocol.
29
Kyösti Mälkkid2b2a182021-04-29 15:33:07 +030030config TPM
31 bool
32 default y
33 depends on TPM1 || TPM2
34
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010035config MAINBOARD_HAS_TPM1
36 bool
Julius Werner8ad93792021-05-18 17:15:50 -070037 help
38 This option can be selected by a mainboard to represent that its TPM
39 always uses the 1.2 protocol, and that it should be on by default.
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010040
41config MAINBOARD_HAS_TPM2
42 bool
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010043 help
Julius Werner8ad93792021-05-18 17:15:50 -070044 This option can be selected by a mainboard to represent that its TPM
45 always uses the 2.0 protocol, and that it should be on by default.
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010046
47config TPM_DEACTIVATE
Sergii Dmytruk3e5cefc2022-11-01 00:48:43 +020048 bool "Deactivate TPM (for TPM1)"
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010049 default n
50 depends on !VBOOT
51 depends on TPM1
52 help
53 Deactivate TPM by issuing deactivate command.
Philipp Deppenwiese64e2d192017-10-18 17:13:07 +020054
55config DEBUG_TPM
56 bool "Output verbose TPM debug messages"
57 default n
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010058 select DRIVER_TPM_DISPLAY_TIS_BYTES if I2C_TPM
Kyösti Mälkkif303b4f2021-05-27 19:33:57 +030059 depends on TPM
Philipp Deppenwiese64e2d192017-10-18 17:13:07 +020060 help
61 This option enables additional TPM related debug messages.
62
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010063config TPM_RDRESP_NEED_DELAY
64 bool "Enable Delay Workaround for TPM"
Philipp Deppenwiese64e2d192017-10-18 17:13:07 +020065 default n
Jes B. Klinkec6b041a12022-04-19 14:00:33 -070066 depends on MEMORY_MAPPED_TPM
Philipp Deppenwiese64e2d192017-10-18 17:13:07 +020067 help
Philipp Deppenwiesec07f8fb2018-02-27 19:40:52 +010068 Certain TPMs seem to need some delay when reading response
69 to work around a race-condition-related issue, possibly
70 caused by ill-programmed TPM firmware.
Philipp Deppenwiese64e2d192017-10-18 17:13:07 +020071
Arthur Heymans6d5fcf42019-10-14 17:06:27 +020072config TPM_STARTUP_IGNORE_POSTINIT
73 bool
74 help
75 Select this to ignore POSTINIT INVALID return codes on TPM
76 startup. This is useful on platforms where a previous stage
77 issued a TPM startup. Examples of use cases are Intel TXT
Angel Pons31b7ee42020-02-17 14:04:28 +010078 or VBOOT on the Intel Arrandale processor, which issues a
Arthur Heymans6d5fcf42019-10-14 17:06:27 +020079 CPU-only reset during the romstage.
80
Bill XIEc79e96b2019-08-22 20:28:36 +080081config TPM_MEASURED_BOOT
82 bool "Enable Measured Boot"
83 default n
84 select VBOOT_LIB
Kyösti Mälkkif303b4f2021-05-27 19:33:57 +030085 depends on TPM
Bill XIEc79e96b2019-08-22 20:28:36 +080086 depends on !VBOOT_RETURN_FROM_VERSTAGE
87 help
88 Enables measured boot (experimental)
89
Sergii Dmytruk97fe17f2022-10-23 00:24:37 +030090choice
91 prompt "TPM event log format"
92 depends on TPM_MEASURED_BOOT
Sergii Dmytruk4191dbf2022-10-23 00:34:32 +030093 default TPM_LOG_TPM1 if TPM1
Sergii Dmytruk53db6772022-10-23 00:47:55 +030094 default TPM_LOG_TPM2 if TPM2
Sergii Dmytruk97fe17f2022-10-23 00:24:37 +030095
96config TPM_LOG_CB
97 bool "coreboot's custom format"
98 help
99 Custom coreboot-specific format of the log derived from TPM1 log format.
Sergii Dmytruk4191dbf2022-10-23 00:34:32 +0300100config TPM_LOG_TPM1
101 bool "TPM 1.2 format"
Sergii Dmytruk3e5cefc2022-11-01 00:48:43 +0200102 depends on TPM1 && !TPM2
Sergii Dmytruk4191dbf2022-10-23 00:34:32 +0300103 help
104 Log per TPM 1.2 specification.
105 See "TCG PC Client Specific Implementation Specification for Conventional BIOS".
Sergii Dmytruk53db6772022-10-23 00:47:55 +0300106config TPM_LOG_TPM2
107 bool "TPM 2.0 format"
Sergii Dmytruk3e5cefc2022-11-01 00:48:43 +0200108 depends on TPM1 || TPM2
Sergii Dmytruk53db6772022-10-23 00:47:55 +0300109 help
110 Log per TPM 2.0 specification.
111 See "TCG PC Client Platform Firmware Profile Specification".
112
113endchoice
114
115choice
116 prompt "TPM2 hashing algorithm"
117 depends on TPM_MEASURED_BOOT && TPM_LOG_TPM2
118 default TPM_HASH_SHA1 if TPM1
119 default TPM_HASH_SHA256 if TPM2
120
121config TPM_HASH_SHA1
122 bool "SHA1"
123config TPM_HASH_SHA256
124 bool "SHA256"
125config TPM_HASH_SHA384
126 bool "SHA384"
127config TPM_HASH_SHA512
128 bool "SHA512"
Sergii Dmytruk97fe17f2022-10-23 00:24:37 +0300129
130endchoice
131
Arthur Heymans6f8e9442021-03-29 14:23:53 +0200132config TPM_MEASURED_BOOT_INIT_BOOTBLOCK
133 bool
134 depends on TPM_MEASURED_BOOT && !VBOOT
135 help
136 Initialize TPM inside the bootblock instead of ramstage. This is
137 useful with some form of hardware assisted root of trust
138 measurement like Intel TXT/CBnT.
139
Bill XIEc79e96b2019-08-22 20:28:36 +0800140config TPM_MEASURED_BOOT_RUNTIME_DATA
141 string "Runtime data whitelist"
142 default ""
143 depends on TPM_MEASURED_BOOT
144 help
145 Runtime data whitelist of cbfs filenames. Needs to be a
harshitaae16332020-05-12 12:55:39 +0530146 space delimited list
Bill XIEc79e96b2019-08-22 20:28:36 +0800147
Sergii Dmytruk4129c262022-10-24 01:17:41 +0300148config PCR_BOOT_MODE
149 int
150 default 0 if CHROMEOS
151 default 1
152
153config PCR_HWID
154 int
155 default 1
156
157config PCR_SRTM
158 int
159 default 2
160
Yi Chou0f910e72023-08-11 14:40:37 +0800161config PCR_FW_VER
162 int
163 default 10
164
Sergii Dmytruk4129c262022-10-24 01:17:41 +0300165# PCR for measuring data which changes during runtime
166# e.g. CMOS, NVRAM...
167config PCR_RUNTIME_DATA
168 int
169 default 3
170
Philipp Deppenwiese64e2d192017-10-18 17:13:07 +0200171endmenu # Trusted Platform Module (tpm)
Jon Murphya2f08aa2023-09-05 11:43:14 -0600172
173config TPM_SETUP_HIBERNATE_ON_ERR
174 bool
175 depends on EC_GOOGLE_CHROMEEC
Jon Murphy3aa7bb02023-09-22 15:29:20 -0600176 default y
Jon Murphya2f08aa2023-09-05 11:43:14 -0600177 help
178 Select this to force a device to hibernate on the next AP shutdown when a TPM
179 setup error occurs. This will cause a cold boot of the system and offer an
180 opportunity to recover the TPM should it be hung. This is only effective if
181 the Z-State brings the power rail down.