coreboot/src/include/option.h
Matt DeVillier bae5262c69 include/option: Add verstage stub for UEFI variable store backend
Verstage cannot use the UEFI variable store because it runs before
the SMMSTORE is initialized/available, and because the required EDK2
headers are x86-specific. Provide inline stub that returns fallback
values to satisfy console_init() dependency.

TEST=build google/dewatt with CFR enabled

Change-Id: Icaa493692006cf3e0bb194ee3fdd9caf2f51cda1
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/90295
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2025-12-02 15:17:33 +00:00

37 lines
1.1 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef _OPTION_H_
#define _OPTION_H_
#include <types.h>
void sanitize_cmos(void);
/* The CBFS file option backend cannot be used in SMM due to vboot
* dependencies, which are not added to SMM.
* The UEFI variable store option backend cannot be used in verstage because:
* - Verstage runs before SMM is available (needed for SMMSTORE access)
* - EDK2 headers required for UEFI variables are x86-specific and not available
* in ARM verstage (PSP verstage). */
#if CONFIG(OPTION_BACKEND_NONE) || \
(CONFIG(USE_CBFS_FILE_OPTION_BACKEND) && ENV_SMM) || \
(CONFIG(USE_UEFI_VARIABLE_STORE) && ENV_SEPARATE_VERSTAGE)
static inline unsigned int get_uint_option(const char *name, const unsigned int fallback)
{
return fallback;
}
static inline enum cb_err set_uint_option(const char *name, unsigned int value)
{
return CB_CMOS_OTABLE_DISABLED;
}
#else /* !OPTION_BACKEND_NONE */
unsigned int get_uint_option(const char *name, const unsigned int fallback);
enum cb_err set_uint_option(const char *name, unsigned int value);
#endif /* OPTION_BACKEND_NONE? */
#endif /* _OPTION_H_ */