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 <zaolin@das-labor.org>
Reviewed-on: https://review.coreboot.org/22102
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Philipp Deppenwiese 2017-10-18 15:29:26 +02:00 committed by Martin Roth
parent 6522bf1a81
commit 7410f8be8f
2 changed files with 26 additions and 0 deletions

View File

@ -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 ""

View File

@ -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