From dce337bc07955c8d2cdf8e22cd7d1397de11511b Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 22 Sep 2026 18:22:01 +0100 Subject: rom.sh: enable SMMSTORE backend for edk2 cook the config at build time. the problem is that we use the option table in other payloads. what i need to do therefore is lock the configs i want in code, or make coreboot still always check cbfs for example, and unify everything under cbfs, before the uefi payload takes over. Signed-off-by: Leah Rowe --- include/fw/rom.sh | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'include/fw/rom.sh') diff --git a/include/fw/rom.sh b/include/fw/rom.sh index 5f98040a..2ef54db4 100644 --- a/include/fw/rom.sh +++ b/include/fw/rom.sh @@ -60,15 +60,48 @@ corebootpremake() [ "$XBMK_RELEASE" = "y" ] && [ "$release" = "n" ] && \ return 0 + [ "$XBMK_RELEASE" = "y" ] \ + payload_edk2="" # source-only payload, for now. + forx 'check_coreboot_util %s' cbfstool ifdtool printf "%s\n" "${version%%-*}" > "$srcdir/.coreboot-version" || \ err "!mk $srcdir .coreboot-version" "corebootpremake" "$@" + cook_coreboot_config + [ "$target" != "$tree" ] && \ x_ "$mk" download "$target"; : } +cook_coreboot_config() +{ + [ -z "$payload_edk2" ] && return 0 + [ -n "$mode" ] && return 0 + [ -f "$srcdir/$cfgname" ] || return 0 + + # Enable SMMSTORE-related options for EDK2 variable storage. + # Because edk2 is source-only (release=n) in lbmk, we don't + # enable this in the configs themselves. Instead, we add it + # when building a board with EDK2 support in lbmk.git + + # TODO: this relpaces the option backend. i need to make + # coreboot always use a cbfs backend, and set all + # boards universally that way, before starting edk2 + + ecfg="CONFIG_SMMSTORE_BLOCK_SIZE=65536 \ + CONFIG_DRIVERS_EFI_VARIABLE_STORE=y \ + CONFIG_SMMSTORE=y \ + CONFIG_SMMSTORE_SIZE=0x80000 \ + CONFIG_SPI_FLASH_SMM=y \ + CONFIG_DRIVERS_GENERIC_CFR_ASSET_TAG=y \ + CONFIG_USE_UEFI_VARIABLE_STORE=y" # replace option backend + + for ecfgval in $ecfg; do + printf "%s\n" "$ecfgval" >> "$srcdir/$cfgname" + done +} + check_coreboot_util() { e "elf/coreboot/$tree/$1" f && \ @@ -122,9 +155,6 @@ mkcorebootbin_real() { [ "$target" = "$tree" ] && return 0 - [ "$XBMK_RELEASE" = "y" ] \ - payload_edk2="" # source-only payload, for now. - tmprom="$xbtmp/coreboot.rom" initmode="${buildcfg##*/}" -- cgit v1.2.1