summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilipp Deppenwiese <zaolin@das-labor.org>2017-10-18 15:29:26 +0200
committerMartin Roth <martinroth@google.com>2018-01-17 17:24:12 +0000
commit7410f8be8fc3c5f9bceb61c0c61e02c697968cbd (patch)
tree5e60dfd9101a0dced968c42058d8f16ee78f5204 /src
parent6522bf1a81735d8f0fa6f4b8f5285e0b7e60be01 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/security/vboot/Kconfig9
-rw-r--r--src/security/vboot/bootmode.c17
2 files changed, 26 insertions, 0 deletions
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