summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/security/vboot/Makefile.inc6
-rw-r--r--src/security/vboot/vboot_lib.c29
-rw-r--r--src/security/vboot/vboot_logic.c21
-rw-r--r--src/vendorcode/eltan/security/verified_boot/Makefile.inc2
4 files changed, 36 insertions, 22 deletions
diff --git a/src/security/vboot/Makefile.inc b/src/security/vboot/Makefile.inc
index a700e0051a..2fe2d92900 100644
--- a/src/security/vboot/Makefile.inc
+++ b/src/security/vboot/Makefile.inc
@@ -16,6 +16,12 @@
ifeq ($(CONFIG_VBOOT_LIB),y)
+bootblock-y += vboot_lib.c
+verstage-y += vboot_lib.c
+romstage-y += vboot_lib.c
+ramstage-y += vboot_lib.c
+postcar-y += vboot_lib.c
+
vboot-fixup-includes = $(patsubst -I%,-I$(top)/%,\
$(patsubst $(src)/%.h,$(top)/$(src)/%.h,\
$(filter-out -I$(obj),$(1))))
diff --git a/src/security/vboot/vboot_lib.c b/src/security/vboot/vboot_lib.c
new file mode 100644
index 0000000000..b2303c0295
--- /dev/null
+++ b/src/security/vboot/vboot_lib.c
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+
+#include <console/console.h>
+#include <console/vtxprintf.h>
+#include <vb2_api.h>
+
+/*
+ * vboot callbacks implemented by coreboot -- necessary for making general API
+ * calls when CONFIG_VBOOT_LIB is enabled. For callbacks specific to verstage
+ * (CONFIG_VBOOT), please see vboot_logic.c.
+ */
+
+void vb2ex_printf(const char *func, const char *fmt, ...)
+{
+ va_list args;
+
+ if (func)
+ printk(BIOS_INFO, "VB2:%s() ", func);
+
+ va_start(args, fmt);
+ vprintk(BIOS_INFO, fmt, args);
+ va_end(args);
+}
+
+void vb2ex_abort(void)
+{
+ die("vboot has aborted execution; exit\n");
+}
diff --git a/src/security/vboot/vboot_logic.c b/src/security/vboot/vboot_logic.c
index 1d17a17657..182128c547 100644
--- a/src/security/vboot/vboot_logic.c
+++ b/src/security/vboot/vboot_logic.c
@@ -17,8 +17,6 @@
#include <assert.h>
#include <bootmode.h>
#include <cbmem.h>
-#include <console/console.h>
-#include <console/vtxprintf.h>
#include <fmap.h>
#include <string.h>
#include <timestamp.h>
@@ -37,20 +35,6 @@
/* exports */
-void vb2ex_printf(const char *func, const char *fmt, ...)
-{
- va_list args;
-
- if (func)
- printk(BIOS_INFO, "VB2:%s() ", func);
-
- va_start(args, fmt);
- vprintk(BIOS_INFO, fmt, args);
- va_end(args);
-
- return;
-}
-
vb2_error_t vb2ex_read_resource(struct vb2_context *ctx,
enum vb2_resource_index index,
uint32_t offset,
@@ -83,11 +67,6 @@ vb2_error_t vb2ex_read_resource(struct vb2_context *ctx,
return VB2_SUCCESS;
}
-void vb2ex_abort(void)
-{
- die("vboot has aborted execution; exit\n");
-}
-
/* No-op stubs that can be overridden by SoCs with hardware crypto support. */
__weak vb2_error_t vb2ex_hwcrypto_digest_init(enum vb2_hash_algorithm hash_alg,
uint32_t data_size)
diff --git a/src/vendorcode/eltan/security/verified_boot/Makefile.inc b/src/vendorcode/eltan/security/verified_boot/Makefile.inc
index 827535b963..2acad84367 100644
--- a/src/vendorcode/eltan/security/verified_boot/Makefile.inc
+++ b/src/vendorcode/eltan/security/verified_boot/Makefile.inc
@@ -17,7 +17,7 @@ ifneq ($(filter y,$(CONFIG_VENDORCODE_ELTAN_VBOOT) $(CONFIG_VENDORCODE_ELTAN_MBO
CPPFLAGS_common += -I$(src)/security/vboot
-bootblock-y += ../../../../security/vboot/vboot_logic.c
+bootblock-y += ../../../../security/vboot/vboot_lib.c
bootblock-y += vboot_check.c
postcar-y += vboot_check.c
romstage-y += vboot_check.c