From 7410f8be8fc3c5f9bceb61c0c61e02c697968cbd Mon Sep 17 00:00:00 2001 From: Philipp Deppenwiese Date: Wed, 18 Oct 2017 15:29:26 +0200 Subject: security/vboot: Add two weak methods for vboot2 In order to make VBOOT2 independent from the CHROMEOS kconfig option a weak method for get_write_protect_state and get_recovery_mode_switch() is required. Introduce a kconfig option for controlling this behaviour. This is a temporary fix and will be removed afterwards. Change-Id: I3b1555bd93e1605e04d5c3ea6a752eb1459e426e Signed-off-by: Philipp Deppenwiese Reviewed-on: https://review.coreboot.org/22102 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- src/security/vboot/Kconfig | 9 +++++++++ src/security/vboot/bootmode.c | 17 +++++++++++++++++ 2 files changed, 26 insertions(+) (limited to 'src/security/vboot') diff --git a/src/security/vboot/Kconfig b/src/security/vboot/Kconfig index d5b5de291e..e2a3f20792 100644 --- a/src/security/vboot/Kconfig +++ b/src/security/vboot/Kconfig @@ -221,6 +221,15 @@ config VBOOT_FWID_VERSION This is the second part of the FWID written to various regions of a vboot firmware image to identify its version. +config VBOOT_NO_BOARD_SUPPORT + bool "Allow the use of vboot without board support" + default n + help + Enable weak functions for get_write_protect_state and + get_recovery_mode_switch in order to proceed with refactoring + of the vboot2 code base. Later on this code is removed and replaced + by interfaces. + config RO_REGION_ONLY string "Additional files that should not be copied to RW" default "" diff --git a/src/security/vboot/bootmode.c b/src/security/vboot/bootmode.c index 834bc481e1..05098b4304 100644 --- a/src/security/vboot/bootmode.c +++ b/src/security/vboot/bootmode.c @@ -169,3 +169,20 @@ int vboot_developer_mode_enabled(void) return 0; } + +#if IS_ENABLED(CONFIG_VBOOT_NO_BOARD_SUPPORT) +/** + * TODO: Create flash protection interface which implements get_write_protect_state. + * get_recovery_mode_switch should be implemented as default function. + */ +int __attribute__((weak)) get_write_protect_state(void) +{ + return 0; +} + +int __attribute__((weak)) get_recovery_mode_switch(void) +{ + return 0; +} + +#endif -- cgit v1.2.3