summaryrefslogtreecommitdiff
path: root/src/security/vboot
diff options
context:
space:
mode:
authorWim Vervoorn <wvervoorn@eltan.com>2019-11-01 10:47:01 +0100
committerPatrick Georgi <pgeorgi@google.com>2019-11-11 10:38:34 +0000
commita1c259beef553c072b890951a328c85153035437 (patch)
tree6aef7838a8b1d277575ce1e6d5123464d4ba4d68 /src/security/vboot
parent02a4a0d4717cc08d20b0b5b2afba1b80ba6f1f5b (diff)
downloadcoreboot-a1c259beef553c072b890951a328c85153035437.tar.xz
security/vboot: Add rw_region_only support to vboot
In some case where the flash space is limited or when a large payload such as LinuxBoot is used, the RO region may not be large enough to contain all components that would normally be added. This patch adds the possibility to add specific components to the RW regions only in the same way as the RO_ONLY_SUPPORT does for the RO region. Please note: this applies only to the items that would normally be added to all regions. If the payload is directed to the RW region only, a recovery payload needs to be added to the RO region manually. BUG=N/A TEST=build Change-Id: Ie0df9b5dfc6df4f24efc5582a1aec9ecfb48c44d Signed-off-by: Wim Vervoorn <wvervoorn@eltan.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/36544 Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Frans Hendriks <fhendriks@eltan.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/security/vboot')
-rw-r--r--src/security/vboot/Kconfig7
-rw-r--r--src/security/vboot/Makefile.inc12
2 files changed, 17 insertions, 2 deletions
diff --git a/src/security/vboot/Kconfig b/src/security/vboot/Kconfig
index 87bb80a561..70180c719a 100644
--- a/src/security/vboot/Kconfig
+++ b/src/security/vboot/Kconfig
@@ -220,6 +220,13 @@ config RO_REGION_ONLY
Add a space delimited list of filenames that should only be in the
RO section.
+config RW_REGION_ONLY
+ string
+ default ""
+ depends on VBOOT_SLOTS_RW_A
+ help
+ Add a space delimited list of filenames that should only be in the
+ RW sections.
config VBOOT_ENABLE_CBFS_FALLBACK
bool
diff --git a/src/security/vboot/Makefile.inc b/src/security/vboot/Makefile.inc
index 31c0f5de26..3e5956cb10 100644
--- a/src/security/vboot/Makefile.inc
+++ b/src/security/vboot/Makefile.inc
@@ -170,13 +170,17 @@ VBOOT_PARTITIONS := COREBOOT
# Check for RW_A partition
ifeq ($(CONFIG_VBOOT_SLOTS_RW_A),y)
VBOOT_PARTITIONS += FW_MAIN_A
+RW_PARTITIONS := FW_MAIN_A
endif
# Check for RW_B partition
ifeq ($(CONFIG_VBOOT_SLOTS_RW_AB),y)
VBOOT_PARTITIONS += FW_MAIN_B
+RW_PARTITIONS += FW_MAIN_B
endif
-# Define a list of files that need to be in RO only.
+# Return the regions a specific file should be placed in. The files listed below and the ones
+# that are specified in CONFIG_RO_REGION_ONLY are only specified in the RO region. The files
+# specified in the CONFIG_RW_REGION_ONLY are only placed in the RW regions.
# All other files will be installed into RO and RW regions
# Use $(sort) to cut down on extra spaces that would be translated to commas
regions-for-file = $(subst $(spc),$(comma),$(sort \
@@ -193,7 +197,11 @@ regions-for-file = $(subst $(spc),$(comma),$(sort \
cmos_layout.bin \
cmos.default \
$(call strip_quotes,$(CONFIG_RO_REGION_ONLY)) \
- ,$(1)),COREBOOT,$(VBOOT_PARTITIONS))))
+ ,$(1)),COREBOOT,\
+ $(if $(filter \
+ $(call strip_quotes,$(CONFIG_RW_REGION_ONLY)) \
+ ,$(1)), $(RW_PARTITIONS), $(VBOOT_PARTITIONS) ) \
+ )))
CONFIG_GBB_HWID := $(call strip_quotes,$(CONFIG_GBB_HWID))
CONFIG_GBB_BMPFV_FILE := $(call strip_quotes,$(CONFIG_GBB_BMPFV_FILE))