summaryrefslogtreecommitdiff
path: root/include/rom.sh
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-10-06 02:28:24 +0100
committerLeah Rowe <leah@libreboot.org>2025-10-06 04:03:36 +0100
commitc716341c130b3746c0994af780f407f4fbd75004 (patch)
treea02abf7c5b7d69c16ddba67db591d289028ec2ab /include/rom.sh
parentb5ad829ffe9dfb9f5a32f4ac95159a35d2662877 (diff)
cb/kabylake: don't hardcode power_on_after_fail
I realised that the Dell OptiPlex 3050 Micro has NVRAM available. Use that backend, and hardcode power_on_after_fail to Disable, which is already done in cmos.default. The Lenovo ThinkPad T480 currently has no option table in coreboot, besides the CBFS one. For this, the CBFS option table has been enabled, and the build system has been modified to insert a relevant config for power_on_after_fail. Nicholas Chin informs me that Kabylake generally has legacy NVRAM, so enabling it for the T480/T480s should work, but we'll need to use it in the future anyway; better to just use CBFS now. I *could* use the CBFS backend on 3050micro as well. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/rom.sh')
-rw-r--r--include/rom.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/rom.sh b/include/rom.sh
index 2efe4919..19637b6c 100644
--- a/include/rom.sh
+++ b/include/rom.sh
@@ -175,6 +175,9 @@ mkcorebootbin_real()
initmode="${initmode%%_*}"
cbfstool="elf/coreboot/$tree/cbfstool"
+ # cbfstool option backends, if they exist
+ cbfscfg="config/coreboot/$target/cbfs.cfg"
+
elfrom="elf/coreboot/$tree/$target/$initmode"
if [ -n "$displaymode" ]; then
elfrom="${elfrom}_$displaymode"
@@ -232,6 +235,10 @@ mkcorebootbin_real()
payload_grubsea="n"
fi
+ if [ -f "$cbfscfg" ]; then
+ dx_ add_cbfs_option "$cbfscfg"
+ fi
+
if $if_not_dry_build grep "CONFIG_PAYLOAD_NONE=y" "$defconfig"; then
if [ "$payload_seabios" = "y" ]; then
pname="seabios"
@@ -250,6 +257,25 @@ mkcorebootbin_real()
fi; :
}
+# options for cbfs backend (as opposed to nvram/smmstore):
+
+add_cbfs_option()
+{
+ # TODO: input sanitization (currently mitigated by careful config)
+
+ op_name="`printf "%s\n" "$1" | awk '{print $1}'`"
+ op_arg="`printf "%s\n" "$1" | awk '{print $2}'`"
+
+ if [ -z "$op_name" ] || [ -z "$op_arg" ]; then
+ return 0
+ fi
+
+ ( x_ "$cbfstool" "$tmprom" remove -n "option/$op_name" 1>/dev/null \
+ 2>/dev/null ) || :
+
+ x_ "$cbfstool" "$tmprom" add-int -i "$op_arg" -n "option/$op_name"
+}
+
# in our design, SeaBIOS is also responsible for starting either
# a GRUB or U-Boot payload. this is because SeaBIOS is generally
# a more reliable codebase, so it's less likely to cause a brick