blob: 56e94d52aebff726a458fda28b2d7ec840c7fbaf [file] [log] [blame]
Elyes HAOUASf7b2fe62020-05-07 12:38:15 +02001# SPDX-License-Identifier: GPL-2.0-only
Daisuke Nojiri742fc8d2014-10-10 10:51:06 -07002
Julius Werner58c39382017-02-13 17:53:29 -08003menu "Verified Boot (vboot)"
Lee Leahy33efd982017-03-13 17:25:36 -07004
Bill XIEcdf6f3a2019-12-17 15:56:43 +08005config VBOOT_LIB
6 bool
Bill XIEcdf6f3a2019-12-17 15:56:43 +08007 help
8 Build and link the vboot library. Makes the vboot API accessible across
9 all coreboot stages, without enabling vboot verification. For verification,
10 please see the VBOOT option below.
11
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070012config VBOOT
13 bool "Verify firmware with vboot."
14 default n
Bill XIEcdf6f3a2019-12-17 15:56:43 +080015 select VBOOT_LIB
Kyösti Mälkkif303b4f2021-05-27 19:33:57 +030016 select VBOOT_MOCK_SECDATA if !TPM
Julius Wernerb38586f2020-01-14 16:25:56 -080017 depends on 0 = 0 # Must have a 'depends on' or board overrides will break it.
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070018 help
19 Enabling VBOOT will use vboot to verify the components of the firmware
20 (stages, payload, etc).
Julius Werner58c39382017-02-13 17:53:29 -080021
22if VBOOT
23
Christian Walter0bd84ed2019-07-23 10:26:30 +020024comment "Anti-Rollback Protection disabled because mocking secdata is enabled."
25 depends on VBOOT_MOCK_SECDATA
26
Philipp Deppenwiesea558ca92018-07-28 23:30:49 +020027config VBOOT_SLOTS_RW_A
28 bool "Firmware RO + RW_A"
29 help
30 Have one update partition beside the RO partition.
31
32config VBOOT_SLOTS_RW_AB
33 bool "Firmware RO + RW_A + RW_B"
34 select VBOOT_SLOTS_RW_A
35 help
36 Have two update partitions beside the RO partition.
37
Jakub Czapiga967a76b2022-08-19 12:25:27 +020038config VBOOT_CBFS_INTEGRATION
39 bool "Enable vboot and CBFS integration"
40 default n
41 depends on VBOOT_SLOTS_RW_A
42 depends on CBFS_VERIFICATION
Julius Werner7a9bd2b2022-11-30 15:18:36 -080043 select INCLUDE_CONFIG_FILE # futility needs this to auto-detect signing type
Jakub Czapiga967a76b2022-08-19 12:25:27 +020044 help
45 Say yes here to enable cryptographic verification of RW slots CBFS
46 metadata. This will replace body hash verification.
47
48 This option enables integration of vboot and CBFS. Verification of RW
49 slots is performed by calculation of their CBFS metadata hash.
50 It also requires CBFS_VERIFICATION to be enabled, so that CBFS files
51 contents are correctly verified.
52
Julius Werner58c39382017-02-13 17:53:29 -080053config VBOOT_VBNV_CMOS
54 bool
55 default n
56 depends on PC80_SYSTEM
57 help
58 VBNV is stored in CMOS
59
60config VBOOT_VBNV_OFFSET
61 hex
62 default 0x26
63 depends on VBOOT_VBNV_CMOS
64 help
65 CMOS offset for VbNv data. This value must match cmos.layout
66 in the mainboard directory, minus 14 bytes for the RTC.
67
68config VBOOT_VBNV_CMOS_BACKUP_TO_FLASH
69 bool
70 default n
71 depends on VBOOT_VBNV_CMOS && BOOT_DEVICE_SUPPORTS_WRITES
72 help
73 Vboot non-volatile storage data will be backed up from CMOS to flash
74 and restored from flash if the CMOS is invalid due to power loss.
75
Julius Werner58c39382017-02-13 17:53:29 -080076config VBOOT_VBNV_FLASH
77 bool
78 default n
79 depends on BOOT_DEVICE_SUPPORTS_WRITES
80 help
81 VBNV is stored in flash storage
82
Martin Roth8a3a3c82020-05-04 10:13:45 -060083config VBOOT_STARTS_BEFORE_BOOTBLOCK
84 def_bool n
85 select VBOOT_SEPARATE_VERSTAGE
86 help
87 Firmware verification happens before the main processor is brought
88 online.
89
Julius Werner58c39382017-02-13 17:53:29 -080090config VBOOT_STARTS_IN_BOOTBLOCK
91 bool
92 default n
Arthur Heymansa2bc2542021-05-29 08:10:49 +020093 depends on SEPARATE_ROMSTAGE
Julius Werner58c39382017-02-13 17:53:29 -080094 help
95 Firmware verification happens during the end of or right after the
96 bootblock. This implies that a static VBOOT2_WORK() buffer must be
97 allocated in memlayout.
98
99config VBOOT_STARTS_IN_ROMSTAGE
100 bool
101 default n
102 depends on !VBOOT_STARTS_IN_BOOTBLOCK
103 help
104 Firmware verification happens during the end of romstage (after
Yu-Ping Wu214fb9b2020-02-14 17:16:53 +0800105 memory initialization). This implies that the vboot work buffer is
106 in CBMEM from the start and doesn't need to be reserved in memlayout.
Julius Werner58c39382017-02-13 17:53:29 -0800107
108config VBOOT_MOCK_SECDATA
109 bool "Mock secdata for firmware verification"
110 default n
111 help
112 Enabling VBOOT_MOCK_SECDATA will mock secdata for the firmware
113 verification to avoid access to a secdata storage (typically TPM).
114 All operations for a secdata storage will be successful. This option
115 can be used during development when a TPM is not present or broken.
116 THIS SHOULD NOT BE LEFT ON FOR PRODUCTION DEVICES.
117
118config VBOOT_DISABLE_DEV_ON_RECOVERY
119 bool
120 default n
121 help
Jon Murphyc4e90452022-06-28 10:36:23 -0600122 When this option is enabled, the ChromeOS device leaves the
Julius Werner58c39382017-02-13 17:53:29 -0800123 developer mode as soon as recovery request is detected. This is
124 handy on embedded devices with limited input capabilities.
125
126config VBOOT_SEPARATE_VERSTAGE
127 bool
128 default n
Martin Roth8a3a3c82020-05-04 10:13:45 -0600129 depends on VBOOT_STARTS_IN_BOOTBLOCK || VBOOT_STARTS_BEFORE_BOOTBLOCK
Julius Werner58c39382017-02-13 17:53:29 -0800130 help
131 If this option is set, vboot verification runs in a standalone stage
132 that is loaded from the bootblock and exits into romstage. If it is
133 not set, the verification code is linked directly into the bootblock
134 or the romstage and runs as part of that stage (cf. related options
135 VBOOT_STARTS_IN_BOOTBLOCK/_ROMSTAGE and VBOOT_RETURN_FROM_VERSTAGE).
136
137config VBOOT_RETURN_FROM_VERSTAGE
138 bool
139 default n
140 depends on VBOOT_SEPARATE_VERSTAGE
141 help
142 If this is set, the verstage returns back to the calling stage instead
143 of exiting to the succeeding stage so that the verstage space can be
144 reused by the succeeding stage. This is useful if a RAM space is too
145 small to fit both the verstage and the succeeding stage.
146
Joel Kitching6672bd82019-04-10 16:06:21 +0800147config VBOOT_MUST_REQUEST_DISPLAY
Julius Werner58c39382017-02-13 17:53:29 -0800148 bool
Julius Werner9993b6f2019-03-28 18:01:26 -0700149 default y if VGA_ROM_RUN
Julius Werner58c39382017-02-13 17:53:29 -0800150 default n
151 help
152 Set this option to indicate to vboot that this platform will skip its
153 display initialization on a normal (non-recovery, non-developer) boot.
Joel Kitching6672bd82019-04-10 16:06:21 +0800154 Unless display is specifically requested, the video option ROM is not
155 loaded, and any other native display initialization code is not run.
Julius Werner58c39382017-02-13 17:53:29 -0800156
Wim Vervoorne7087a12019-11-15 14:02:02 +0100157config VBOOT_ALWAYS_ENABLE_DISPLAY
158 bool "Force to always enable display"
159 default n
160 help
161 Set this option to indicate to vboot that display should always be enabled.
162
Wim Vervoorn50337f162020-01-14 16:18:27 +0100163config VBOOT_ALWAYS_ALLOW_UDC
164 bool "Always allow UDC"
165 default n
166 depends on !CHROMEOS
167 help
168 This option allows UDC to be enabled regardless of the vboot state.
169
Julius Werner58c39382017-02-13 17:53:29 -0800170config VBOOT_HAS_REC_HASH_SPACE
171 bool
Shelley Chen9f8ac642020-10-16 12:20:16 -0700172 default y if MRC_SAVE_HASH_IN_TPM && HAS_RECOVERY_MRC_CACHE
Julius Werner58c39382017-02-13 17:53:29 -0800173 default n
174 help
175 Set this option to indicate to vboot that recovery data hash space
176 is present in TPM.
177
Julius Werner58c39382017-02-13 17:53:29 -0800178config VBOOT_LID_SWITCH
179 bool
180 default n
181 help
182 Whether this platform has a lid switch. If it does, vboot will not
183 decrement try counters for boot failures if the lid is closed.
184
185config VBOOT_WIPEOUT_SUPPORTED
186 bool
187 default n
188 help
189 When this option is enabled, the firmware provides the ability to
190 signal the application the need for factory reset (a.k.a. wipe
191 out) of the device
192
193config VBOOT_FWID_MODEL
194 string "Firmware ID model"
Patrick Georgib8fba862020-06-17 21:06:53 +0200195 default "Google_\$(CONFIG_MAINBOARD_PART_NUMBER)" if CHROMEOS
196 default "\$(CONFIG_MAINBOARD_VENDOR)_\$(CONFIG_MAINBOARD_PART_NUMBER)"
Julius Werner58c39382017-02-13 17:53:29 -0800197 help
198 This is the first part of the FWID written to various regions of a
199 vboot firmware image to identify its version.
200
201config VBOOT_FWID_VERSION
202 string "Firmware ID version"
Patrick Georgib8fba862020-06-17 21:06:53 +0200203 default ".\$(KERNELVERSION)"
Julius Werner58c39382017-02-13 17:53:29 -0800204 help
205 This is the second part of the FWID written to various regions of a
206 vboot firmware image to identify its version.
207
Philipp Deppenwiese7410f8b2017-10-18 15:29:26 +0200208config VBOOT_NO_BOARD_SUPPORT
209 bool "Allow the use of vboot without board support"
210 default n
211 help
212 Enable weak functions for get_write_protect_state and
213 get_recovery_mode_switch in order to proceed with refactoring
214 of the vboot2 code base. Later on this code is removed and replaced
215 by interfaces.
216
Martin Rothbbd5ee412017-10-05 13:53:16 -0600217config RO_REGION_ONLY
218 string "Additional files that should not be copied to RW"
219 default ""
220 help
221 Add a space delimited list of filenames that should only be in the
222 RO section.
223
Wim Vervoorna1c259b2019-11-01 10:47:01 +0100224config RW_REGION_ONLY
225 string
226 default ""
227 depends on VBOOT_SLOTS_RW_A
228 help
229 Add a space delimited list of filenames that should only be in the
230 RW sections.
Wim Vervoorn114e2e82019-11-05 14:09:16 +0100231
Martin Roth63036712020-06-25 17:20:32 -0600232config RWA_REGION_ONLY
233 string
234 default ""
235 depends on VBOOT_SLOTS_RW_AB
236 help
237 Add a space-delimited list of filenames that should only be in the
238 RW-A section.
239
240config RWB_REGION_ONLY
241 string
242 default ""
243 depends on VBOOT_SLOTS_RW_AB
244 help
245 Add a space-delimited list of filenames that should only be in the
246 RW-B section.
247
Julius Werner40acfe72021-05-12 15:59:58 -0700248config CBFS_MCACHE_RW_PERCENTAGE
249 int "Percentage of CBFS metadata cache used for RW CBFS"
250 depends on !NO_CBFS_MCACHE
251 default 50
252 help
253 The amount of the CBFS_MCACHE area that's used for the RW CBFS, in
254 percent from 0 to 100. The remaining area will be used for the RO
255 CBFS. Default is an even 50/50 split. When VBOOT is disabled, this
256 will automatically be 0 (meaning the whole MCACHE is used for RO).
257 Do NOT change this value for vboot RW updates!
258
Michał Żygowskia87ab392023-04-11 16:01:14 +0200259config VBOOT_CLEAR_RECOVERY_IN_RAMSTAGE
260 bool "Clear the recovery request at the end of ramstage"
261 default n
262 help
263 If this option is enabled, the recovery request will be cleared and
264 saved to VBNV storage at the end of ramstage. This is useful for
265 platforms without vboot-integrated payloads, to avoid being stuck in
266 the recovery mode.
267
Wim Vervoorn114e2e82019-11-05 14:09:16 +0100268config VBOOT_ENABLE_CBFS_FALLBACK
269 bool
270 default n
271 depends on VBOOT_SLOTS_RW_A
272 help
Julius Werner9f376472021-08-11 18:20:11 -0700273 When this option is enabled, the CBFS code will look for a file in the
274 RO (COREBOOT) region if it isn't available in the active RW region.
Wim Vervoorn114e2e82019-11-05 14:09:16 +0100275
Tim Wawrzynczakd6fc5572019-10-25 14:58:15 -0600276config VBOOT_EARLY_EC_SYNC
277 bool
278 default n
279 depends on EC_GOOGLE_CHROMEEC
280 help
281 Enables CrOS EC software sync in romstage, before memory training
282 runs. This is useful mainly as a way to achieve full USB-PD
283 negotiation earlier in the boot flow, as the EC will only do this once
284 it has made the sysjump to its RW firmware. It should not
285 significantly impact boot time, as this operation will be performed
286 later in the boot flow if it is disabled here.
287
Sam McNallyeded5002020-03-04 16:08:06 +1100288config VBOOT_EC_EFS
289 bool "Early firmware selection (EFS) EC"
290 default n
291 help
292 CrosEC can support EFS: Early Firmware Selection. If it's enabled,
293 software sync needs to also support it. This setting tells vboot to
294 perform EFS software sync.
295
Subrata Banik94790372021-06-17 19:27:12 +0530296config VBOOT_X86_SHA256_ACCELERATION
297 bool "Use sha extension for sha256 hash calculation"
298 default n
299 depends on ARCH_X86
300 help
301 Use sha256msg1, sha256msg2, sha256rnds2 instruction to accelerate
302 SHA hash calculation in vboot.
303
Jeremy Compostellab6dfcb72023-11-27 14:56:29 -0800304config VBOOT_X86_RSA_ACCELERATION
305 bool "Use SSE2 instructions for RSA signature verification"
306 default n
307 depends on ARCH_X86
308 help
309 Use paddq, pmuludq, psrlq, punpckldq and punpcklqdq SSE2
310 instructions to accelerate the modulus exponentiation which
311 is part of the RSA signature verification process.
312
Yidi Linbd6b81d2023-01-31 15:18:57 +0800313config VBOOT_ARMV8_CE_SHA256_ACCELERATION
314 bool "Use ARMv8 Crypto Extension for sha256 hash calculation"
315 default y if CHROMEOS
316 default n
317 depends on ARCH_ARM64
318 help
319 Use ARMv8 Crypto Extension to accelerate SHA hash calculation in vboot.
320
Karthikeyan Ramasubramanian4fcf13a2021-11-17 17:33:08 -0700321config VBOOT_DEFINE_WIDEVINE_COUNTERS
322 bool
323 default n
324 help
325 Set up Widevine Secure Counters in TPM NVRAM by defining space. Enabling this
326 config will only define the counter space. Counters need to be incremented
327 separately before any read operation is performed on them.
328
Julius Werner5eda52a2022-05-19 14:37:21 -0700329config VBOOT_HASH_BLOCK_SIZE
330 hex
331 default 0x400
332 help
333 Set the default hash size. Generally 1k is reasonable, but in some
334 cases it may improve hashing speed to increase the size.
335
336 Note that this buffer is allocated in the stack. Although the
337 build should fail if the stack size is exceeded, it's something to
338 be aware of when changing the size.
339
340config VBOOT_GSCVD
341 bool "Generate GSC verification data"
342 depends on TPM_GOOGLE
343 select CBFS_VERIFICATION
344 default n if TPM_GOOGLE_CR50
345 default y
346 help
347 Generate a Google Security Chip Verification Data (GSCVD) structure on the flash to
348 allow the GSC to verify the CBFS verification anchor. Used by default with Ti50 GSCs.
349 Requires an RO_GSCVD FMAP section.
350
351config VBOOT_GSC_BOARD_ID
352 string
353 depends on VBOOT_GSCVD
354 default "ZZCR"
355 help
356 GSC board ID to be embedded in the GSCVD. Usually each specific mainboard variant
357 has its own. Google engineers can find these in the go/cros-dlm database ("Products").
Reka Normanb9dd0372023-06-05 09:54:45 +1000358 The specific board IDs are filled in as part of the production signing process, so
359 this value is just a default and doesn't need to be set per-variant in coreboot.
Julius Werner5eda52a2022-05-19 14:37:21 -0700360 (Note: This is a completely separate thing from coreboot's `board_id()` function.)
361
Julius Werner58c39382017-02-13 17:53:29 -0800362menu "GBB configuration"
363
364config GBB_HWID
365 string "Hardware ID"
Hung-Te Lin117453e2019-09-27 12:23:20 +0800366 default ""
367 help
Jon Murphyc4e90452022-06-28 10:36:23 -0600368 A hardware identifier for device. On ChromeOS this is used for auto
Hung-Te Lin117453e2019-09-27 12:23:20 +0800369 update and recovery, and will be generated when manufacturing by the
370 factory software, in a strictly defined format.
Jon Murphyc4e90452022-06-28 10:36:23 -0600371 Leave empty to get a test-only ChromeOS HWID v2 string generated.
Julius Werner58c39382017-02-13 17:53:29 -0800372
373config GBB_BMPFV_FILE
374 string "Path to bmpfv image"
375 default ""
376
377config GBB_FLAG_DEV_SCREEN_SHORT_DELAY
378 bool "Reduce dev screen delay"
379 default n
380
381config GBB_FLAG_LOAD_OPTION_ROMS
382 bool "Load option ROMs"
383 default n
384
385config GBB_FLAG_ENABLE_ALTERNATE_OS
Jon Murphyc4e90452022-06-28 10:36:23 -0600386 bool "Allow booting a non-ChromeOS kernel if dev switch is on"
Julius Werner58c39382017-02-13 17:53:29 -0800387 default n
388
389config GBB_FLAG_FORCE_DEV_SWITCH_ON
390 bool "Force dev switch on"
391 default n
392
393config GBB_FLAG_FORCE_DEV_BOOT_USB
394 bool "Allow booting from USB in dev mode even if dev_boot_usb=0"
395 default y
396
397config GBB_FLAG_DISABLE_FW_ROLLBACK_CHECK
398 bool "Disable firmware rollback protection"
399 default y
400
401config GBB_FLAG_ENTER_TRIGGERS_TONORM
402 bool "Return to normal boot with Enter"
403 default n
404
Joel Kitchinga904fd62021-02-19 18:10:58 +0800405config GBB_FLAG_FORCE_DEV_BOOT_ALTFW
406 bool "Allow booting altfw in dev mode even if dev_boot_altfw=0"
Julius Werner58c39382017-02-13 17:53:29 -0800407 default n
408
Joel Kitching984d0c62019-12-04 15:33:57 +0800409config GBB_FLAG_RUNNING_FAFT
410 bool "Running FAFT tests; used as a hint to disable other debug features"
Julius Werner58c39382017-02-13 17:53:29 -0800411 default n
412
413config GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC
414 bool "Disable EC software sync"
415 default n
416
Joel Kitchinga904fd62021-02-19 18:10:58 +0800417config GBB_FLAG_DEFAULT_DEV_BOOT_ALTFW
418 bool "Default to booting altfw in dev mode"
Julius Werner58c39382017-02-13 17:53:29 -0800419 default n
420
421config GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC
422 bool "Disable PD software sync"
423 default n
424
425config GBB_FLAG_DISABLE_LID_SHUTDOWN
426 bool "Disable shutdown on closed lid"
427 default n
428
Julius Wernerae423852018-03-23 21:02:48 -0700429config GBB_FLAG_FORCE_MANUAL_RECOVERY
430 bool "Always assume manual recovery in recovery mode"
431 default n
432
433config GBB_FLAG_DISABLE_FWMP
434 bool "Disable Firmware Management Parameters (FWMP)"
Julius Werner58c39382017-02-13 17:53:29 -0800435 default n
436
Eric Lai1cf24272021-01-29 16:14:37 +0800437config GBB_FLAG_ENABLE_UDC
438 bool "Enable USB Device Controller"
439 default n
440
Julius Werner58c39382017-02-13 17:53:29 -0800441endmenu # GBB
442
443menu "Vboot Keys"
444config VBOOT_ROOT_KEY
445 string "Root key (public)"
Patrick Georgib8fba862020-06-17 21:06:53 +0200446 default "\$(VBOOT_SOURCE)/tests/devkeys/root_key.vbpubk"
Julius Werner58c39382017-02-13 17:53:29 -0800447
448config VBOOT_RECOVERY_KEY
449 string "Recovery key (public)"
Patrick Georgib8fba862020-06-17 21:06:53 +0200450 default "\$(VBOOT_SOURCE)/tests/devkeys/recovery_key.vbpubk"
Julius Werner58c39382017-02-13 17:53:29 -0800451
452config VBOOT_FIRMWARE_PRIVKEY
453 string "Firmware key (private)"
Patrick Georgib8fba862020-06-17 21:06:53 +0200454 default "\$(VBOOT_SOURCE)/tests/devkeys/firmware_data_key.vbprivk"
Julius Werner58c39382017-02-13 17:53:29 -0800455
456config VBOOT_KERNEL_KEY
457 string "Kernel subkey (public)"
Patrick Georgib8fba862020-06-17 21:06:53 +0200458 default "\$(VBOOT_SOURCE)/tests/devkeys/kernel_subkey.vbpubk"
Julius Werner58c39382017-02-13 17:53:29 -0800459
460config VBOOT_KEYBLOCK
461 string "Keyblock to use for the RW regions"
Patrick Georgib8fba862020-06-17 21:06:53 +0200462 default "\$(VBOOT_SOURCE)/tests/devkeys/firmware.keyblock"
Julius Werner58c39382017-02-13 17:53:29 -0800463
464config VBOOT_KEYBLOCK_VERSION
465 int "Keyblock version number"
466 default 1
467
468config VBOOT_KEYBLOCK_PREAMBLE_FLAGS
469 hex "Keyblock preamble flags"
470 default 0x0
471
Julius Werner5eda52a2022-05-19 14:37:21 -0700472if VBOOT_GSCVD
Martin Roth8839b7f2020-10-28 11:38:57 -0600473
Julius Werner5eda52a2022-05-19 14:37:21 -0700474config VBOOT_GSCVD_ROOT_PUBKEY
475 string "GSCVD root key (public)"
476 default "\$(VBOOT_SOURCE)/tests/devkeys/arv_root.vbpubk"
477
478config VBOOT_GSCVD_PLATFORM_PRIVKEY
479 string "GSCVD platform key (private)"
480 default "\$(VBOOT_SOURCE)/tests/devkeys/arv_platform.vbprivk"
481
482config VBOOT_GSCVD_PLATFORM_KEYBLOCK
483 string "GSCVD platform keyblock (public)"
484 default "\$(VBOOT_SOURCE)/tests/devkeys/arv_platform.keyblock"
485
486endif # VBOOT_GSCVD
Martin Roth8839b7f2020-10-28 11:38:57 -0600487
Julius Werner58c39382017-02-13 17:53:29 -0800488endmenu # Keys
489endif # VBOOT
490endmenu # Verified Boot (vboot)