blob: 31c0f5de26712dd4d68457811f8c63ce08cdec31 [file] [log] [blame]
Daisuke Nojiri742fc8d2014-10-10 10:51:06 -07001##
2## This file is part of the coreboot project.
3##
4## Copyright (C) 2014 The ChromiumOS Authors. All rights reserved.
Philipp Deppenwiesea558ca92018-07-28 23:30:49 +02005## Copyright (C) 2018 Siemens AG
Daisuke Nojiri742fc8d2014-10-10 10:51:06 -07006##
7## This program is free software; you can redistribute it and/or modify
8## it under the terms of the GNU General Public License as published by
9## the Free Software Foundation; version 2 of the License.
10##
11## This program is distributed in the hope that it will be useful,
12## but WITHOUT ANY WARRANTY; without even the implied warranty of
13## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14## GNU General Public License for more details.
15##
Daisuke Nojiri742fc8d2014-10-10 10:51:06 -070016
Julius Werner5fc7c282017-03-17 14:29:10 -070017ifeq ($(CONFIG_VBOOT),y)
18
Furquan Shaikh0325dc62016-07-25 13:02:36 -070019bootblock-y += bootmode.c
20romstage-y += bootmode.c
21ramstage-y += bootmode.c
22verstage-y += bootmode.c
23postcar-y += bootmode.c
24
Joel Kitchingd6f71d02019-02-21 12:37:55 +080025# When VBOOT_STARTS_IN_ROMSTAGE is selected, DRAM is already up by
26# the time verstage runs.
27ifneq ($(CONFIG_VBOOT_STARTS_IN_ROMSTAGE),y)
28verstage-generic-ccopts += -D__PRE_RAM__
29endif
30
31verstage-generic-ccopts += -D__VERSTAGE__
Daisuke Nojiri742fc8d2014-10-10 10:51:06 -070032
Furquan Shaikh7632ce02018-03-29 14:49:40 -070033ramstage-y += gbb.c
34
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070035bootblock-y += vbnv.c
36verstage-y += vbnv.c
37romstage-y += vbnv.c
38ramstage-y += vbnv.c
39
40bootblock-$(CONFIG_VBOOT_VBNV_CMOS) += vbnv_cmos.c
41verstage-$(CONFIG_VBOOT_VBNV_CMOS) += vbnv_cmos.c
42romstage-$(CONFIG_VBOOT_VBNV_CMOS) += vbnv_cmos.c
43ramstage-$(CONFIG_VBOOT_VBNV_CMOS) += vbnv_cmos.c
44
45bootblock-$(CONFIG_VBOOT_VBNV_CMOS_BACKUP_TO_FLASH) += vbnv_flash.c
46verstage-$(CONFIG_VBOOT_VBNV_CMOS_BACKUP_TO_FLASH) += vbnv_flash.c
47romstage-$(CONFIG_VBOOT_VBNV_CMOS_BACKUP_TO_FLASH) += vbnv_flash.c
48ramstage-$(CONFIG_VBOOT_VBNV_CMOS_BACKUP_TO_FLASH) += vbnv_flash.c
49
50bootblock-$(CONFIG_VBOOT_VBNV_EC) += vbnv_ec.c
51verstage-$(CONFIG_VBOOT_VBNV_EC) += vbnv_ec.c
52romstage-$(CONFIG_VBOOT_VBNV_EC) += vbnv_ec.c
53ramstage-$(CONFIG_VBOOT_VBNV_EC) += vbnv_ec.c
54
55bootblock-$(CONFIG_VBOOT_VBNV_FLASH) += vbnv_flash.c
56verstage-$(CONFIG_VBOOT_VBNV_FLASH) += vbnv_flash.c
57romstage-$(CONFIG_VBOOT_VBNV_FLASH) += vbnv_flash.c
58ramstage-$(CONFIG_VBOOT_VBNV_FLASH) += vbnv_flash.c
59
Aaron Durbin17200ad2015-05-01 16:48:54 -050060bootblock-y += vboot_loader.c
61romstage-y += vboot_loader.c
62ramstage-y += vboot_loader.c
63verstage-y += vboot_loader.c
Andrey Petrov60c64322016-04-14 14:12:47 -070064postcar-y += vboot_loader.c
Aaron Durbin17200ad2015-05-01 16:48:54 -050065
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070066bootblock-y += vboot_common.c
67verstage-y += vboot_common.c
68romstage-y += vboot_common.c
69ramstage-y += vboot_common.c
70postcar-y += vboot_common.c
Daisuke Nojiri742fc8d2014-10-10 10:51:06 -070071
Philipp Deppenwiese66f9a092018-11-08 10:59:40 +010072ifeq ($(CONFIG_VBOOT_MEASURED_BOOT),y)
Frans Hendriksc1b77c12019-05-16 14:46:12 +020073bootblock-y += vboot_crtm.c
Philipp Deppenwiese66f9a092018-11-08 10:59:40 +010074verstage-y += vboot_crtm.c
75romstage-y += vboot_crtm.c
76ramstage-y += vboot_crtm.c
77postcar-y += vboot_crtm.c
78endif
79
Daisuke Nojiri54af6252014-11-04 12:32:29 -080080bootblock-y += common.c
Julius Wernere91d1702017-03-20 15:32:15 -070081verstage-y += vboot_logic.c
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070082verstage-y += common.c
Julius Wernere91d1702017-03-20 15:32:15 -070083verstage-$(CONFIG_VBOOT_SEPARATE_VERSTAGE) += verstage.c
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070084ifeq (${CONFIG_VBOOT_MOCK_SECDATA},y)
Julius Wernere91d1702017-03-20 15:32:15 -070085verstage-y += secdata_mock.c
Julius Werner58c39382017-02-13 17:53:29 -080086romstage-$(CONFIG_VBOOT_SEPARATE_VERSTAGE) += secdata_mock.c
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070087else
Julius Wernere91d1702017-03-20 15:32:15 -070088verstage-y += secdata_tpm.c
Julius Werner58c39382017-02-13 17:53:29 -080089romstage-$(CONFIG_VBOOT_SEPARATE_VERSTAGE) += secdata_tpm.c
Daisuke Nojiri5d302c72015-04-09 08:18:22 -070090endif
Christian Walter0bd84ed2019-07-23 10:26:30 +020091
92ifneq ($(CONFIG_TPM1)$(CONFIG_TPM2),)
93verstage-y += tpm_common.c
94endif
95
Joel Kitching532e0c72019-06-16 17:23:03 +080096romstage-y += vboot_logic.c
Joel Kitchingeb203202019-06-16 17:26:53 +080097romstage-y += common.c
Daisuke Nojiri742fc8d2014-10-10 10:51:06 -070098
Aaron Durbin17200ad2015-05-01 16:48:54 -050099ramstage-y += common.c
Andrey Petrov60c64322016-04-14 14:12:47 -0700100postcar-y += common.c
Aaron Durbin17200ad2015-05-01 16:48:54 -0500101
Philipp Deppenwiese80961af2018-02-27 22:14:34 +0100102romstage-$(CONFIG_FSP2_0_USES_TPM_MRC_HASH) += mrc_cache_hash_tpm.c
103
Julius Wernerfaa3d462019-01-24 16:13:16 -0800104vboot-fixup-includes = $(patsubst -I%,-I$(top)/%,\
105 $(patsubst $(src)/%.h,$(top)/$(src)/%.h,\
106 $(filter-out -I$(obj),$(1))))
Aaron Durbind1cf44c2015-05-08 15:58:06 -0500107
Patrick Georgi5220aea2018-10-24 15:57:03 +0200108# call with $1 = stage name to create rules for building the library
109# for the stage and adding it to the stage's set of object files.
110define vboot-for-stage
111VB2_LIB_$(1) = $(obj)/external/vboot_reference-$(1)/vboot_fw20.a
Julius Wernerfaa3d462019-01-24 16:13:16 -0800112VBOOT_CFLAGS_$(1) += $$(call vboot-fixup-includes,$$(CPPFLAGS_$(1)))
Patrick Georgi5220aea2018-10-24 15:57:03 +0200113VBOOT_CFLAGS_$(1) += $$(CFLAGS_$(1))
Julius Wernerfaa3d462019-01-24 16:13:16 -0800114VBOOT_CFLAGS_$(1) += $$(call vboot-fixup-includes,$$($(1)-c-ccopts))
Patrick Georgi5220aea2018-10-24 15:57:03 +0200115VBOOT_CFLAGS_$(1) += -I$(abspath $(obj)) -Wno-missing-prototypes
116VBOOT_CFLAGS_$(1) += -DVBOOT_DEBUG
Daisuke Nojiri742fc8d2014-10-10 10:51:06 -0700117
Patrick Georgi5220aea2018-10-24 15:57:03 +0200118$$(VB2_LIB_$(1)): $(obj)/config.h
Patrick Georgi78a5f222017-01-30 15:29:34 +0100119 printf " MAKE $(subst $(obj)/,,$(@))\n"
Patrick Georgi5220aea2018-10-24 15:57:03 +0200120 +FIRMWARE_ARCH=$$(ARCHDIR-$$(ARCH-$(1)-y)) \
121 CC="$$(CC_$(1))" \
122 CFLAGS="$$(VBOOT_CFLAGS_$(1))" VBOOT2="y" \
Paul Kocialkowski46114512016-07-24 12:10:38 +0200123 $(MAKE) -C $(VBOOT_SOURCE) \
Patrick Georgi5220aea2018-10-24 15:57:03 +0200124 BUILD=$$(abspath $$(dir $$(VB2_LIB_$(1)))) \
Daisuke Nojiri742fc8d2014-10-10 10:51:06 -0700125 V=$(V) \
Bill Richardsonc8603152015-01-27 17:28:18 -0800126 fwlib20
Daisuke Nojiri742fc8d2014-10-10 10:51:06 -0700127
Patrick Georgi5220aea2018-10-24 15:57:03 +0200128$(1)-srcs += $$(VB2_LIB_$(1))
129
130endef # vboot-for-stage
131
Werner Zeh30cf14f2018-10-23 07:40:08 +0200132CFLAGS_common += -I3rdparty/vboot/firmware/2lib/include
133
Werner Zeh30cf14f2018-10-23 07:40:08 +0200134$(eval $(call vboot-for-stage,bootblock))
Werner Zeh3c6d9e12018-11-26 06:54:13 +0100135$(eval $(call vboot-for-stage,romstage))
Werner Zeh30cf14f2018-10-23 07:40:08 +0200136$(eval $(call vboot-for-stage,ramstage))
Werner Zehce3d8c22018-11-05 07:29:23 +0100137$(eval $(call vboot-for-stage,postcar))
Patrick Georgiba808872015-04-27 18:09:22 +0200138
Julius Werner58c39382017-02-13 17:53:29 -0800139ifeq ($(CONFIG_VBOOT_SEPARATE_VERSTAGE),y)
Furquan Shaikhb038f412016-11-07 23:47:11 -0800140
Werner Zeh3c6d9e12018-11-26 06:54:13 +0100141$(eval $(call vboot-for-stage,verstage))
Furquan Shaikhb038f412016-11-07 23:47:11 -0800142
Julius Werner58c39382017-02-13 17:53:29 -0800143cbfs-files-$(CONFIG_VBOOT_SEPARATE_VERSTAGE) += $(CONFIG_CBFS_PREFIX)/verstage
Patrick Georgi1cab0122015-11-26 16:39:23 +0100144$(CONFIG_CBFS_PREFIX)/verstage-file := $(objcbfs)/verstage.elf
145$(CONFIG_CBFS_PREFIX)/verstage-type := stage
Julius Werner09f29212015-09-29 13:51:35 -0700146$(CONFIG_CBFS_PREFIX)/verstage-compression := $(CBFS_PRERAM_COMPRESS_FLAG)
Furquan Shaikh94b18a12016-05-04 23:25:16 -0700147
Patrick Georgi1cab0122015-11-26 16:39:23 +0100148ifeq ($(CONFIG_ARCH_VERSTAGE_X86_32)$(CONFIG_ARCH_VERSTAGE_X86_64),y)
Furquan Shaikh94b18a12016-05-04 23:25:16 -0700149$(CONFIG_CBFS_PREFIX)/verstage-options := -a 64 -S ".car.data"
150
151# If CAR does not support execution of code, verstage on x86 is expected to be
152# xip.
153ifneq ($(CONFIG_NO_XIP_EARLY_STAGES),y)
154$(CONFIG_CBFS_PREFIX)/verstage-options += --xip
155endif
Patrick Georgi1cab0122015-11-26 16:39:23 +0100156
157endif
Patrick Rudolphd9c799c2019-02-19 10:57:16 +0100158$(CONFIG_CBFS_PREFIX)/verstage-options += $(TXTIBB)
Patrick Georgi1cab0122015-11-26 16:39:23 +0100159
Julius Wernere91d1702017-03-20 15:32:15 -0700160else # CONFIG_VBOOT_SEPARATE_VERSTAGE
Aaron Durbind1cf44c2015-05-08 15:58:06 -0500161ifeq ($(CONFIG_VBOOT_STARTS_IN_BOOTBLOCK),y)
Julius Wernere91d1702017-03-20 15:32:15 -0700162postinclude-hooks += $$(eval bootblock-srcs += $$(verstage-srcs))
Aaron Durbin57e37282015-04-28 16:17:25 -0500163else
Julius Wernere91d1702017-03-20 15:32:15 -0700164postinclude-hooks += $$(eval romstage-srcs += $$(verstage-srcs))
Patrick Georgiefc6aa02015-04-27 18:13:50 +0200165endif
Julius Werner58c39382017-02-13 17:53:29 -0800166endif # CONFIG_VBOOT_SEPARATE_VERSTAGE
Patrick Georgic8d4abd2016-01-20 15:54:31 +0100167
Philipp Deppenwiesea558ca92018-07-28 23:30:49 +0200168#RO-Partition is always there!
169VBOOT_PARTITIONS := COREBOOT
170# Check for RW_A partition
171ifeq ($(CONFIG_VBOOT_SLOTS_RW_A),y)
172VBOOT_PARTITIONS += FW_MAIN_A
173endif
174# Check for RW_B partition
175ifeq ($(CONFIG_VBOOT_SLOTS_RW_AB),y)
176VBOOT_PARTITIONS += FW_MAIN_B
177endif
178
Patrick Georgic8d4abd2016-01-20 15:54:31 +0100179# Define a list of files that need to be in RO only.
180# All other files will be installed into RO and RW regions
181# Use $(sort) to cut down on extra spaces that would be translated to commas
182regions-for-file = $(subst $(spc),$(comma),$(sort \
183 $(if $(filter \
184 $(if $(filter y,$(CONFIG_VBOOT_STARTS_IN_BOOTBLOCK)),, \
185 %/romstage) \
186 mts \
187 %/verstage \
Patrick Georgieda794d2016-02-05 11:01:24 +0100188 locales \
189 locale_%.bin \
190 font.bin \
191 vbgfx.bin \
Lee Leahy5e347522017-01-04 08:51:52 -0800192 rmu.bin \
Patrick Rudolph9554b262018-06-05 15:12:56 +0200193 cmos_layout.bin \
194 cmos.default \
Martin Rothbbd5ee412017-10-05 13:53:16 -0600195 $(call strip_quotes,$(CONFIG_RO_REGION_ONLY)) \
Philipp Deppenwiesea558ca92018-07-28 23:30:49 +0200196 ,$(1)),COREBOOT,$(VBOOT_PARTITIONS))))
Furquan Shaikh0325dc62016-07-25 13:02:36 -0700197
Julius Werner58c39382017-02-13 17:53:29 -0800198CONFIG_GBB_HWID := $(call strip_quotes,$(CONFIG_GBB_HWID))
199CONFIG_GBB_BMPFV_FILE := $(call strip_quotes,$(CONFIG_GBB_BMPFV_FILE))
200CONFIG_VBOOT_KEYBLOCK := $(call strip_quotes,$(CONFIG_VBOOT_KEYBLOCK))
201CONFIG_VBOOT_FIRMWARE_PRIVKEY := $(call strip_quotes,$(CONFIG_VBOOT_FIRMWARE_PRIVKEY))
202CONFIG_VBOOT_KERNEL_KEY := $(call strip_quotes,$(CONFIG_VBOOT_KERNEL_KEY))
203CONFIG_VBOOT_FWID_MODEL := $(call strip_quotes,$(CONFIG_VBOOT_FWID_MODEL))
204CONFIG_VBOOT_FWID_VERSION := $(call strip_quotes,$(CONFIG_VBOOT_FWID_VERSION))
205
206# bool-to-mask(var, value)
207# return "value" if var is "y", 0 otherwise
208bool-to-mask = $(if $(filter y,$(1)),$(2),0)
209
210GBB_FLAGS := $(call int-add, \
211 $(call bool-to-mask,$(CONFIG_GBB_FLAG_DEV_SCREEN_SHORT_DELAY),0x1) \
212 $(call bool-to-mask,$(CONFIG_GBB_FLAG_LOAD_OPTION_ROMS),0x2) \
213 $(call bool-to-mask,$(CONFIG_GBB_FLAG_ENABLE_ALTERNATE_OS),0x4) \
214 $(call bool-to-mask,$(CONFIG_GBB_FLAG_FORCE_DEV_SWITCH_ON),0x8) \
215 $(call bool-to-mask,$(CONFIG_GBB_FLAG_FORCE_DEV_BOOT_USB),0x10) \
216 $(call bool-to-mask,$(CONFIG_GBB_FLAG_DISABLE_FW_ROLLBACK_CHECK),0x20) \
217 $(call bool-to-mask,$(CONFIG_GBB_FLAG_ENTER_TRIGGERS_TONORM),0x40) \
218 $(call bool-to-mask,$(CONFIG_GBB_FLAG_FORCE_DEV_BOOT_LEGACY),0x80) \
219 $(call bool-to-mask,$(CONFIG_GBB_FLAG_FAFT_KEY_OVERIDE),0x100) \
220 $(call bool-to-mask,$(CONFIG_GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC),0x200) \
221 $(call bool-to-mask,$(CONFIG_GBB_FLAG_DEFAULT_DEV_BOOT_LEGACY),0x400) \
222 $(call bool-to-mask,$(CONFIG_GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC),0x800) \
223 $(call bool-to-mask,$(CONFIG_GBB_FLAG_DISABLE_LID_SHUTDOWN),0x1000) \
Julius Wernerae423852018-03-23 21:02:48 -0700224 $(call bool-to-mask,$(CONFIG_GBB_FLAG_FORCE_MANUAL_RECOVERY),0x4000) \
225 $(call bool-to-mask,$(CONFIG_GBB_FLAG_DISABLE_FWMP),0x8000) \
Julius Werner58c39382017-02-13 17:53:29 -0800226 )
227
228ifneq ($(CONFIG_GBB_BMPFV_FILE),)
229$(obj)/gbb.sizetmp: $(obj)/coreboot.rom
230 $(CBFSTOOL) $< read -r GBB -f $@
231
232$(obj)/gbb.stub: $(obj)/coreboot.rom $(FUTILITY) $(obj)/gbb.sizetmp
233 @printf " CREATE GBB (with BMPFV)\n"
234 $(FUTILITY) gbb_utility -c 0x100,0x1000,$(call int-subtract,$(call file-size,$(obj)/gbb.sizetmp) 0x2180),0x1000 $@.tmp
235 mv $@.tmp $@
236else
237$(obj)/gbb.stub: $(obj)/coreboot.rom $(FUTILITY)
238 @printf " CREATE GBB (without BMPFV)\n"
239 $(FUTILITY) gbb_utility -c 0x100,0x1000,0,0x1000 $@.tmp
240 mv $@.tmp $@
241endif
242
Hung-Te Lin117453e2019-09-27 12:23:20 +0800243# Generate a test-only HWID
244ifeq ($(CONFIG_GBB_HWID),)
245CONFIG_GBB_HWID := $$($(top)/util/chromeos/gen_test_hwid.sh "$(CONFIG_MAINBOARD_PART_NUMBER)")
246endif
247
Julius Werner58c39382017-02-13 17:53:29 -0800248$(obj)/gbb.region: $(obj)/gbb.stub
249 @printf " SETUP GBB\n"
250 cp $< $@.tmp
251 $(FUTILITY) gbb_utility -s \
252 --hwid="$(CONFIG_GBB_HWID)" \
253 --rootkey="$(CONFIG_VBOOT_ROOT_KEY)" \
254 --recoverykey="$(CONFIG_VBOOT_RECOVERY_KEY)" \
255 --flags=$(GBB_FLAGS) \
256 $@.tmp
257ifneq ($(CONFIG_GBB_BMPFV_FILE),)
258 $(FUTILITY) gbb_utility -s \
259 --bmpfv="$(CONFIG_GBB_BMPFV_FILE)" \
260 $@.tmp
261endif
262 mv $@.tmp $@
263
Raul E Rangel8c38a8b2018-08-06 16:13:14 -0600264$(obj)/fwid.version:
265 echo -n "$(CONFIG_VBOOT_FWID_VERSION)" > $@
266
267$(obj)/fwid.region: $(obj)/fwid.version
268 printf "%s%s\0" \
269 "$(CONFIG_VBOOT_FWID_MODEL)" \
Raul E Rangel128b0cf2018-08-09 12:30:39 -0600270 "$$(cat "$(obj)/fwid.version")" > $@
Julius Werner58c39382017-02-13 17:53:29 -0800271
272build_complete:: $(obj)/gbb.region $(obj)/fwid.region
273 @printf " WRITE GBB\n"
274 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r GBB -i 0 -f $(obj)/gbb.region
275 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r RO_FRID -i 0 -f $(obj)/fwid.region
Philipp Deppenwiesea558ca92018-07-28 23:30:49 +0200276ifeq ($(CONFIG_VBOOT_SLOTS_RW_A),y)
Julius Werner58c39382017-02-13 17:53:29 -0800277 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r RW_FWID_A -i 0 -f $(obj)/fwid.region
Philipp Deppenwiesea558ca92018-07-28 23:30:49 +0200278endif
279ifeq ($(CONFIG_VBOOT_SLOTS_RW_AB),y)
Julius Werner58c39382017-02-13 17:53:29 -0800280 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r RW_FWID_B -i 0 -f $(obj)/fwid.region
Philipp Deppenwiesea558ca92018-07-28 23:30:49 +0200281endif
Julius Werner58c39382017-02-13 17:53:29 -0800282
283ifneq ($(shell grep "SHARED_DATA" "$(CONFIG_FMDFILE)"),)
284build_complete::
285 printf "\0" > $(obj)/shared_data.region
286 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r SHARED_DATA -i 0 -f $(obj)/shared_data.region
287endif
288
289# Extract FW_MAIN_? region and minimize it if the last file is empty, so it
290# doesn't contain this empty file (that can have a significant size),
291# improving a lot on hash times due to a smaller amount of data loaded from
292# firmware storage.
293# When passing the minimized image to vbutil_firmware, its length is recorded
294# in the keyblock, and coreboot's vboot code clips the region_device to match,
295# which prevents any potential extension attacks.
296$(obj)/FW_MAIN_%.bin: $(obj)/coreboot.rom
Patrick Georgibf375e32017-09-20 12:01:28 +0200297 $(CBFSTOOL) $< truncate -r $(basename $(notdir $@)) > $@.tmp.size
Julius Werner58c39382017-02-13 17:53:29 -0800298 $(CBFSTOOL) $< read -r $(basename $(notdir $@)) -f $@.tmp
Patrick Georgibf375e32017-09-20 12:01:28 +0200299 head -c $$( printf "%d" $$(cat $@.tmp.size)) $@.tmp > $@.tmp2
300 mv $@.tmp2 $@
301 rm -f $@.tmp $@.tmp.size
Julius Werner58c39382017-02-13 17:53:29 -0800302
303$(obj)/VBLOCK_%.bin: $(obj)/FW_MAIN_%.bin $(FUTILITY)
304 $(FUTILITY) vbutil_firmware \
305 --vblock $@ \
306 --keyblock "$(CONFIG_VBOOT_KEYBLOCK)" \
307 --signprivate "$(CONFIG_VBOOT_FIRMWARE_PRIVKEY)" \
308 --version $(CONFIG_VBOOT_KEYBLOCK_VERSION) \
309 --fv $< \
310 --kernelkey "$(CONFIG_VBOOT_KERNEL_KEY)" \
311 --flags $(CONFIG_VBOOT_KEYBLOCK_PREAMBLE_FLAGS)
312
Philipp Deppenwiesea558ca92018-07-28 23:30:49 +0200313ifeq ($(CONFIG_VBOOT_SLOTS_RW_AB),y)
Julius Werner58c39382017-02-13 17:53:29 -0800314files_added:: $(obj)/VBLOCK_A.bin $(obj)/VBLOCK_B.bin
315 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r VBLOCK_A -f $(obj)/VBLOCK_A.bin
316 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r VBLOCK_B -f $(obj)/VBLOCK_B.bin
Philipp Deppenwiesea558ca92018-07-28 23:30:49 +0200317 @printf " FLASHMAP Layout generated for RO, A and B partition.\n"
318else ifeq ($(CONFIG_VBOOT_SLOTS_RW_A),y)
319files_added:: $(obj)/VBLOCK_A.bin
320 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r VBLOCK_A -f $(obj)/VBLOCK_A.bin
321 @printf " FLASHMAP Layout generated for RO and A partition.\n"
322else
323files_added::
324 @printf " FLASHMAP Layout generated for RO partition only.\n"
325 @printf " Beware that there is no failure safety in case of update now!\n"
326endif
Julius Werner58c39382017-02-13 17:53:29 -0800327
Furquan Shaikh0325dc62016-07-25 13:02:36 -0700328endif # CONFIG_VBOOT