blob: d0d3370c6db1b54cc296c44452afee32dbb3d182 [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
Bill XIEcdf6f3a2019-12-17 15:56:43 +080017ifeq ($(CONFIG_VBOOT_LIB),y)
18
Joel Kitchingec12bd02020-02-04 17:36:49 +080019bootblock-y += vboot_lib.c
20verstage-y += vboot_lib.c
21romstage-y += vboot_lib.c
22ramstage-y += vboot_lib.c
23postcar-y += vboot_lib.c
24
Bill XIEcdf6f3a2019-12-17 15:56:43 +080025vboot-fixup-includes = $(patsubst -I%,-I$(top)/%,\
26 $(patsubst $(src)/%.h,$(top)/$(src)/%.h,\
27 $(filter-out -I$(obj),$(1))))
28
29# call with $1 = stage name to create rules for building the library
30# for the stage and adding it to the stage's set of object files.
31define vboot-for-stage
32VBOOT_LIB_$(1) = $(obj)/external/vboot_reference-$(1)/vboot_fw.a
33VBOOT_CFLAGS_$(1) += $$(call vboot-fixup-includes,$$(CPPFLAGS_$(1)))
34VBOOT_CFLAGS_$(1) += $$(CFLAGS_$(1))
35VBOOT_CFLAGS_$(1) += $$(call vboot-fixup-includes,$$($(1)-c-ccopts))
36VBOOT_CFLAGS_$(1) += -I$(abspath $(obj)) -Wno-missing-prototypes
37VBOOT_CFLAGS_$(1) += -DVBOOT_DEBUG
38
39$$(VBOOT_LIB_$(1)): $(obj)/config.h
40 printf " MAKE $(subst $(obj)/,,$(@))\n"
41 +FIRMWARE_ARCH=$$(ARCHDIR-$$(ARCH-$(1)-y)) \
42 CC="$$(CC_$(1))" \
43 CFLAGS="$$(VBOOT_CFLAGS_$(1))" VBOOT2="y" \
Sam McNallyeded5002020-03-04 16:08:06 +110044 EC_EFS="$(CONFIG_VBOOT_EC_EFS)" \
Bill XIEcdf6f3a2019-12-17 15:56:43 +080045 $(MAKE) -C $(VBOOT_SOURCE) \
46 BUILD=$$(abspath $$(dir $$(VBOOT_LIB_$(1)))) \
47 V=$(V) \
48 fwlib
49
50$(1)-srcs += $$(VBOOT_LIB_$(1))
51
52endef # vboot-for-stage
53
54$(eval $(call vboot-for-stage,bootblock))
55$(eval $(call vboot-for-stage,romstage))
56$(eval $(call vboot-for-stage,ramstage))
57$(eval $(call vboot-for-stage,postcar))
58
59endif # CONFIG_VBOOT_LIB
60
Julius Werner5fc7c282017-03-17 14:29:10 -070061ifeq ($(CONFIG_VBOOT),y)
62
Furquan Shaikh0325dc62016-07-25 13:02:36 -070063bootblock-y += bootmode.c
64romstage-y += bootmode.c
65ramstage-y += bootmode.c
66verstage-y += bootmode.c
67postcar-y += bootmode.c
68
Joel Kitchingd6f71d02019-02-21 12:37:55 +080069verstage-generic-ccopts += -D__VERSTAGE__
Daisuke Nojiri742fc8d2014-10-10 10:51:06 -070070
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070071bootblock-y += vbnv.c
72verstage-y += vbnv.c
73romstage-y += vbnv.c
74ramstage-y += vbnv.c
75
Tim Wawrzynczakd6fc5572019-10-25 14:58:15 -060076romstage-$(CONFIG_VBOOT_EARLY_EC_SYNC) += ec_sync.c
77
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070078bootblock-$(CONFIG_VBOOT_VBNV_CMOS) += vbnv_cmos.c
79verstage-$(CONFIG_VBOOT_VBNV_CMOS) += vbnv_cmos.c
80romstage-$(CONFIG_VBOOT_VBNV_CMOS) += vbnv_cmos.c
81ramstage-$(CONFIG_VBOOT_VBNV_CMOS) += vbnv_cmos.c
82
83bootblock-$(CONFIG_VBOOT_VBNV_CMOS_BACKUP_TO_FLASH) += vbnv_flash.c
84verstage-$(CONFIG_VBOOT_VBNV_CMOS_BACKUP_TO_FLASH) += vbnv_flash.c
85romstage-$(CONFIG_VBOOT_VBNV_CMOS_BACKUP_TO_FLASH) += vbnv_flash.c
86ramstage-$(CONFIG_VBOOT_VBNV_CMOS_BACKUP_TO_FLASH) += vbnv_flash.c
87
88bootblock-$(CONFIG_VBOOT_VBNV_EC) += vbnv_ec.c
89verstage-$(CONFIG_VBOOT_VBNV_EC) += vbnv_ec.c
90romstage-$(CONFIG_VBOOT_VBNV_EC) += vbnv_ec.c
91ramstage-$(CONFIG_VBOOT_VBNV_EC) += vbnv_ec.c
92
93bootblock-$(CONFIG_VBOOT_VBNV_FLASH) += vbnv_flash.c
94verstage-$(CONFIG_VBOOT_VBNV_FLASH) += vbnv_flash.c
95romstage-$(CONFIG_VBOOT_VBNV_FLASH) += vbnv_flash.c
96ramstage-$(CONFIG_VBOOT_VBNV_FLASH) += vbnv_flash.c
97
Aaron Durbin17200ad2015-05-01 16:48:54 -050098bootblock-y += vboot_loader.c
99romstage-y += vboot_loader.c
100ramstage-y += vboot_loader.c
101verstage-y += vboot_loader.c
Andrey Petrov60c64322016-04-14 14:12:47 -0700102postcar-y += vboot_loader.c
Aaron Durbin17200ad2015-05-01 16:48:54 -0500103
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -0700104bootblock-y += vboot_common.c
105verstage-y += vboot_common.c
106romstage-y += vboot_common.c
107ramstage-y += vboot_common.c
108postcar-y += vboot_common.c
Daisuke Nojiri742fc8d2014-10-10 10:51:06 -0700109
Philipp Deppenwiese66f9a092018-11-08 10:59:40 +0100110ifeq ($(CONFIG_VBOOT_MEASURED_BOOT),y)
Frans Hendriksc1b77c12019-05-16 14:46:12 +0200111bootblock-y += vboot_crtm.c
Philipp Deppenwiese66f9a092018-11-08 10:59:40 +0100112verstage-y += vboot_crtm.c
113romstage-y += vboot_crtm.c
114ramstage-y += vboot_crtm.c
115postcar-y += vboot_crtm.c
116endif
117
Daisuke Nojiri54af6252014-11-04 12:32:29 -0800118bootblock-y += common.c
Julius Wernere91d1702017-03-20 15:32:15 -0700119verstage-y += vboot_logic.c
Daisuke Nojiri5d302c72015-04-09 08:18:22 -0700120verstage-y += common.c
Julius Wernere91d1702017-03-20 15:32:15 -0700121verstage-$(CONFIG_VBOOT_SEPARATE_VERSTAGE) += verstage.c
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -0700122ifeq (${CONFIG_VBOOT_MOCK_SECDATA},y)
Julius Wernere91d1702017-03-20 15:32:15 -0700123verstage-y += secdata_mock.c
Julius Werner58c39382017-02-13 17:53:29 -0800124romstage-$(CONFIG_VBOOT_SEPARATE_VERSTAGE) += secdata_mock.c
Daisuke Nojiri5d302c72015-04-09 08:18:22 -0700125else
Julius Wernere91d1702017-03-20 15:32:15 -0700126verstage-y += secdata_tpm.c
Julius Werner58c39382017-02-13 17:53:29 -0800127romstage-$(CONFIG_VBOOT_SEPARATE_VERSTAGE) += secdata_tpm.c
Daisuke Nojiri5d302c72015-04-09 08:18:22 -0700128endif
Christian Walter0bd84ed2019-07-23 10:26:30 +0200129
130ifneq ($(CONFIG_TPM1)$(CONFIG_TPM2),)
131verstage-y += tpm_common.c
132endif
133
Joel Kitching532e0c72019-06-16 17:23:03 +0800134romstage-y += vboot_logic.c
Joel Kitchingeb203202019-06-16 17:26:53 +0800135romstage-y += common.c
Daisuke Nojiri742fc8d2014-10-10 10:51:06 -0700136
Aaron Durbin17200ad2015-05-01 16:48:54 -0500137ramstage-y += common.c
Andrey Petrov60c64322016-04-14 14:12:47 -0700138postcar-y += common.c
Aaron Durbin17200ad2015-05-01 16:48:54 -0500139
Philipp Deppenwiese80961af2018-02-27 22:14:34 +0100140romstage-$(CONFIG_FSP2_0_USES_TPM_MRC_HASH) += mrc_cache_hash_tpm.c
141
Julius Werner58c39382017-02-13 17:53:29 -0800142ifeq ($(CONFIG_VBOOT_SEPARATE_VERSTAGE),y)
Furquan Shaikhb038f412016-11-07 23:47:11 -0800143
Werner Zeh3c6d9e12018-11-26 06:54:13 +0100144$(eval $(call vboot-for-stage,verstage))
Furquan Shaikhb038f412016-11-07 23:47:11 -0800145
Julius Werner58c39382017-02-13 17:53:29 -0800146cbfs-files-$(CONFIG_VBOOT_SEPARATE_VERSTAGE) += $(CONFIG_CBFS_PREFIX)/verstage
Patrick Georgi1cab0122015-11-26 16:39:23 +0100147$(CONFIG_CBFS_PREFIX)/verstage-file := $(objcbfs)/verstage.elf
148$(CONFIG_CBFS_PREFIX)/verstage-type := stage
Julius Werner09f29212015-09-29 13:51:35 -0700149$(CONFIG_CBFS_PREFIX)/verstage-compression := $(CBFS_PRERAM_COMPRESS_FLAG)
Furquan Shaikh94b18a12016-05-04 23:25:16 -0700150
Patrick Georgi1cab0122015-11-26 16:39:23 +0100151ifeq ($(CONFIG_ARCH_VERSTAGE_X86_32)$(CONFIG_ARCH_VERSTAGE_X86_64),y)
Furquan Shaikh94b18a12016-05-04 23:25:16 -0700152$(CONFIG_CBFS_PREFIX)/verstage-options := -a 64 -S ".car.data"
153
154# If CAR does not support execution of code, verstage on x86 is expected to be
155# xip.
156ifneq ($(CONFIG_NO_XIP_EARLY_STAGES),y)
157$(CONFIG_CBFS_PREFIX)/verstage-options += --xip
158endif
Patrick Georgi1cab0122015-11-26 16:39:23 +0100159
160endif
Patrick Rudolphd9c799c2019-02-19 10:57:16 +0100161$(CONFIG_CBFS_PREFIX)/verstage-options += $(TXTIBB)
Patrick Georgi1cab0122015-11-26 16:39:23 +0100162
Julius Wernere91d1702017-03-20 15:32:15 -0700163else # CONFIG_VBOOT_SEPARATE_VERSTAGE
Aaron Durbind1cf44c2015-05-08 15:58:06 -0500164ifeq ($(CONFIG_VBOOT_STARTS_IN_BOOTBLOCK),y)
Julius Wernere91d1702017-03-20 15:32:15 -0700165postinclude-hooks += $$(eval bootblock-srcs += $$(verstage-srcs))
Aaron Durbin57e37282015-04-28 16:17:25 -0500166else
Julius Wernere91d1702017-03-20 15:32:15 -0700167postinclude-hooks += $$(eval romstage-srcs += $$(verstage-srcs))
Patrick Georgiefc6aa02015-04-27 18:13:50 +0200168endif
Julius Werner58c39382017-02-13 17:53:29 -0800169endif # CONFIG_VBOOT_SEPARATE_VERSTAGE
Patrick Georgic8d4abd2016-01-20 15:54:31 +0100170
Philipp Deppenwiesea558ca92018-07-28 23:30:49 +0200171#RO-Partition is always there!
172VBOOT_PARTITIONS := COREBOOT
173# Check for RW_A partition
174ifeq ($(CONFIG_VBOOT_SLOTS_RW_A),y)
175VBOOT_PARTITIONS += FW_MAIN_A
Wim Vervoorna1c259b2019-11-01 10:47:01 +0100176RW_PARTITIONS := FW_MAIN_A
Philipp Deppenwiesea558ca92018-07-28 23:30:49 +0200177endif
178# Check for RW_B partition
179ifeq ($(CONFIG_VBOOT_SLOTS_RW_AB),y)
180VBOOT_PARTITIONS += FW_MAIN_B
Wim Vervoorna1c259b2019-11-01 10:47:01 +0100181RW_PARTITIONS += FW_MAIN_B
Philipp Deppenwiesea558ca92018-07-28 23:30:49 +0200182endif
183
Wim Vervoorna1c259b2019-11-01 10:47:01 +0100184# Return the regions a specific file should be placed in. The files listed below and the ones
185# that are specified in CONFIG_RO_REGION_ONLY are only specified in the RO region. The files
186# specified in the CONFIG_RW_REGION_ONLY are only placed in the RW regions.
Patrick Georgic8d4abd2016-01-20 15:54:31 +0100187# All other files will be installed into RO and RW regions
188# Use $(sort) to cut down on extra spaces that would be translated to commas
189regions-for-file = $(subst $(spc),$(comma),$(sort \
190 $(if $(filter \
191 $(if $(filter y,$(CONFIG_VBOOT_STARTS_IN_BOOTBLOCK)),, \
192 %/romstage) \
193 mts \
194 %/verstage \
Patrick Georgieda794d2016-02-05 11:01:24 +0100195 locales \
196 locale_%.bin \
197 font.bin \
198 vbgfx.bin \
Lee Leahy5e347522017-01-04 08:51:52 -0800199 rmu.bin \
Patrick Rudolph9554b262018-06-05 15:12:56 +0200200 cmos_layout.bin \
201 cmos.default \
Martin Rothbbd5ee412017-10-05 13:53:16 -0600202 $(call strip_quotes,$(CONFIG_RO_REGION_ONLY)) \
Wim Vervoorna1c259b2019-11-01 10:47:01 +0100203 ,$(1)),COREBOOT,\
204 $(if $(filter \
205 $(call strip_quotes,$(CONFIG_RW_REGION_ONLY)) \
206 ,$(1)), $(RW_PARTITIONS), $(VBOOT_PARTITIONS) ) \
207 )))
Furquan Shaikh0325dc62016-07-25 13:02:36 -0700208
Julius Werner58c39382017-02-13 17:53:29 -0800209CONFIG_GBB_HWID := $(call strip_quotes,$(CONFIG_GBB_HWID))
210CONFIG_GBB_BMPFV_FILE := $(call strip_quotes,$(CONFIG_GBB_BMPFV_FILE))
211CONFIG_VBOOT_KEYBLOCK := $(call strip_quotes,$(CONFIG_VBOOT_KEYBLOCK))
212CONFIG_VBOOT_FIRMWARE_PRIVKEY := $(call strip_quotes,$(CONFIG_VBOOT_FIRMWARE_PRIVKEY))
213CONFIG_VBOOT_KERNEL_KEY := $(call strip_quotes,$(CONFIG_VBOOT_KERNEL_KEY))
214CONFIG_VBOOT_FWID_MODEL := $(call strip_quotes,$(CONFIG_VBOOT_FWID_MODEL))
215CONFIG_VBOOT_FWID_VERSION := $(call strip_quotes,$(CONFIG_VBOOT_FWID_VERSION))
216
217# bool-to-mask(var, value)
218# return "value" if var is "y", 0 otherwise
219bool-to-mask = $(if $(filter y,$(1)),$(2),0)
220
221GBB_FLAGS := $(call int-add, \
222 $(call bool-to-mask,$(CONFIG_GBB_FLAG_DEV_SCREEN_SHORT_DELAY),0x1) \
223 $(call bool-to-mask,$(CONFIG_GBB_FLAG_LOAD_OPTION_ROMS),0x2) \
224 $(call bool-to-mask,$(CONFIG_GBB_FLAG_ENABLE_ALTERNATE_OS),0x4) \
225 $(call bool-to-mask,$(CONFIG_GBB_FLAG_FORCE_DEV_SWITCH_ON),0x8) \
226 $(call bool-to-mask,$(CONFIG_GBB_FLAG_FORCE_DEV_BOOT_USB),0x10) \
227 $(call bool-to-mask,$(CONFIG_GBB_FLAG_DISABLE_FW_ROLLBACK_CHECK),0x20) \
228 $(call bool-to-mask,$(CONFIG_GBB_FLAG_ENTER_TRIGGERS_TONORM),0x40) \
229 $(call bool-to-mask,$(CONFIG_GBB_FLAG_FORCE_DEV_BOOT_LEGACY),0x80) \
Joel Kitching984d0c62019-12-04 15:33:57 +0800230 $(call bool-to-mask,$(CONFIG_GBB_FLAG_RUNNING_FAFT),0x100) \
Julius Werner58c39382017-02-13 17:53:29 -0800231 $(call bool-to-mask,$(CONFIG_GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC),0x200) \
232 $(call bool-to-mask,$(CONFIG_GBB_FLAG_DEFAULT_DEV_BOOT_LEGACY),0x400) \
233 $(call bool-to-mask,$(CONFIG_GBB_FLAG_DISABLE_PD_SOFTWARE_SYNC),0x800) \
234 $(call bool-to-mask,$(CONFIG_GBB_FLAG_DISABLE_LID_SHUTDOWN),0x1000) \
Julius Wernerae423852018-03-23 21:02:48 -0700235 $(call bool-to-mask,$(CONFIG_GBB_FLAG_FORCE_MANUAL_RECOVERY),0x4000) \
236 $(call bool-to-mask,$(CONFIG_GBB_FLAG_DISABLE_FWMP),0x8000) \
Julius Werner58c39382017-02-13 17:53:29 -0800237 )
238
239ifneq ($(CONFIG_GBB_BMPFV_FILE),)
240$(obj)/gbb.sizetmp: $(obj)/coreboot.rom
241 $(CBFSTOOL) $< read -r GBB -f $@
242
243$(obj)/gbb.stub: $(obj)/coreboot.rom $(FUTILITY) $(obj)/gbb.sizetmp
244 @printf " CREATE GBB (with BMPFV)\n"
245 $(FUTILITY) gbb_utility -c 0x100,0x1000,$(call int-subtract,$(call file-size,$(obj)/gbb.sizetmp) 0x2180),0x1000 $@.tmp
246 mv $@.tmp $@
247else
248$(obj)/gbb.stub: $(obj)/coreboot.rom $(FUTILITY)
249 @printf " CREATE GBB (without BMPFV)\n"
250 $(FUTILITY) gbb_utility -c 0x100,0x1000,0,0x1000 $@.tmp
251 mv $@.tmp $@
252endif
253
Hung-Te Lin117453e2019-09-27 12:23:20 +0800254# Generate a test-only HWID
255ifeq ($(CONFIG_GBB_HWID),)
256CONFIG_GBB_HWID := $$($(top)/util/chromeos/gen_test_hwid.sh "$(CONFIG_MAINBOARD_PART_NUMBER)")
257endif
258
Julius Werner58c39382017-02-13 17:53:29 -0800259$(obj)/gbb.region: $(obj)/gbb.stub
260 @printf " SETUP GBB\n"
261 cp $< $@.tmp
262 $(FUTILITY) gbb_utility -s \
263 --hwid="$(CONFIG_GBB_HWID)" \
264 --rootkey="$(CONFIG_VBOOT_ROOT_KEY)" \
265 --recoverykey="$(CONFIG_VBOOT_RECOVERY_KEY)" \
266 --flags=$(GBB_FLAGS) \
267 $@.tmp
268ifneq ($(CONFIG_GBB_BMPFV_FILE),)
269 $(FUTILITY) gbb_utility -s \
270 --bmpfv="$(CONFIG_GBB_BMPFV_FILE)" \
271 $@.tmp
272endif
273 mv $@.tmp $@
274
Raul E Rangel8c38a8b2018-08-06 16:13:14 -0600275$(obj)/fwid.version:
276 echo -n "$(CONFIG_VBOOT_FWID_VERSION)" > $@
277
278$(obj)/fwid.region: $(obj)/fwid.version
279 printf "%s%s\0" \
280 "$(CONFIG_VBOOT_FWID_MODEL)" \
Raul E Rangel128b0cf2018-08-09 12:30:39 -0600281 "$$(cat "$(obj)/fwid.version")" > $@
Julius Werner58c39382017-02-13 17:53:29 -0800282
283build_complete:: $(obj)/gbb.region $(obj)/fwid.region
284 @printf " WRITE GBB\n"
285 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r GBB -i 0 -f $(obj)/gbb.region
286 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r RO_FRID -i 0 -f $(obj)/fwid.region
Philipp Deppenwiesea558ca92018-07-28 23:30:49 +0200287ifeq ($(CONFIG_VBOOT_SLOTS_RW_A),y)
Julius Werner58c39382017-02-13 17:53:29 -0800288 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r RW_FWID_A -i 0 -f $(obj)/fwid.region
Philipp Deppenwiesea558ca92018-07-28 23:30:49 +0200289endif
290ifeq ($(CONFIG_VBOOT_SLOTS_RW_AB),y)
Julius Werner58c39382017-02-13 17:53:29 -0800291 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r RW_FWID_B -i 0 -f $(obj)/fwid.region
Philipp Deppenwiesea558ca92018-07-28 23:30:49 +0200292endif
Julius Werner58c39382017-02-13 17:53:29 -0800293
294ifneq ($(shell grep "SHARED_DATA" "$(CONFIG_FMDFILE)"),)
295build_complete::
296 printf "\0" > $(obj)/shared_data.region
297 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r SHARED_DATA -i 0 -f $(obj)/shared_data.region
298endif
299
300# Extract FW_MAIN_? region and minimize it if the last file is empty, so it
301# doesn't contain this empty file (that can have a significant size),
302# improving a lot on hash times due to a smaller amount of data loaded from
303# firmware storage.
304# When passing the minimized image to vbutil_firmware, its length is recorded
305# in the keyblock, and coreboot's vboot code clips the region_device to match,
306# which prevents any potential extension attacks.
307$(obj)/FW_MAIN_%.bin: $(obj)/coreboot.rom
Patrick Georgibf375e32017-09-20 12:01:28 +0200308 $(CBFSTOOL) $< truncate -r $(basename $(notdir $@)) > $@.tmp.size
Julius Werner58c39382017-02-13 17:53:29 -0800309 $(CBFSTOOL) $< read -r $(basename $(notdir $@)) -f $@.tmp
Patrick Georgibf375e32017-09-20 12:01:28 +0200310 head -c $$( printf "%d" $$(cat $@.tmp.size)) $@.tmp > $@.tmp2
311 mv $@.tmp2 $@
312 rm -f $@.tmp $@.tmp.size
Julius Werner58c39382017-02-13 17:53:29 -0800313
314$(obj)/VBLOCK_%.bin: $(obj)/FW_MAIN_%.bin $(FUTILITY)
315 $(FUTILITY) vbutil_firmware \
316 --vblock $@ \
317 --keyblock "$(CONFIG_VBOOT_KEYBLOCK)" \
318 --signprivate "$(CONFIG_VBOOT_FIRMWARE_PRIVKEY)" \
319 --version $(CONFIG_VBOOT_KEYBLOCK_VERSION) \
320 --fv $< \
321 --kernelkey "$(CONFIG_VBOOT_KERNEL_KEY)" \
322 --flags $(CONFIG_VBOOT_KEYBLOCK_PREAMBLE_FLAGS)
323
Philipp Deppenwiesea558ca92018-07-28 23:30:49 +0200324ifeq ($(CONFIG_VBOOT_SLOTS_RW_AB),y)
Julius Werner58c39382017-02-13 17:53:29 -0800325files_added:: $(obj)/VBLOCK_A.bin $(obj)/VBLOCK_B.bin
326 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r VBLOCK_A -f $(obj)/VBLOCK_A.bin
327 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r VBLOCK_B -f $(obj)/VBLOCK_B.bin
Philipp Deppenwiesea558ca92018-07-28 23:30:49 +0200328 @printf " FLASHMAP Layout generated for RO, A and B partition.\n"
329else ifeq ($(CONFIG_VBOOT_SLOTS_RW_A),y)
330files_added:: $(obj)/VBLOCK_A.bin
331 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r VBLOCK_A -f $(obj)/VBLOCK_A.bin
332 @printf " FLASHMAP Layout generated for RO and A partition.\n"
333else
334files_added::
335 @printf " FLASHMAP Layout generated for RO partition only.\n"
336 @printf " Beware that there is no failure safety in case of update now!\n"
337endif
Julius Werner58c39382017-02-13 17:53:29 -0800338
Furquan Shaikh0325dc62016-07-25 13:02:36 -0700339endif # CONFIG_VBOOT