From 39bb6ea313b37e182635c5010b15c69d91d74c08 Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Tue, 20 Jun 2023 12:40:00 -0400 Subject: [PATCH] lock_chip: parametrize locking in function of board config exported config option kexec-boot: depend on io386 presence and board config option to call lock_chip --- initrd/bin/kexec-boot | 2 +- initrd/bin/lock_chip | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/initrd/bin/kexec-boot b/initrd/bin/kexec-boot index dfbfccd90..de59db6ef 100755 --- a/initrd/bin/kexec-boot +++ b/initrd/bin/kexec-boot @@ -150,7 +150,7 @@ if [ "$CONFIG_TPM" = "y" ]; then tpmr kexec_finalize fi -if [ -x /bin/io386 ]; then +if [ -x /bin/io386 -a "$CONFIG_FINALIZE_PLATFORM_LOCKING_PRESKYLAKE" = "y" ]; then lock_chip fi diff --git a/initrd/bin/lock_chip b/initrd/bin/lock_chip index 1331aebfe..8bf316b71 100755 --- a/initrd/bin/lock_chip +++ b/initrd/bin/lock_chip @@ -9,7 +9,15 @@ . /etc/ash_functions TRACE "Under /bin/lock_chip" -APM_CNT=0xb2 -FIN_CODE=0xcb -echo "Finalizing chipset" -io386 -o b -b x $APM_CNT $FIN_CODE +if [ "$CONFIG_FINALIZE_PLATFORM_LOCKING_PRESKYLAKE" = "y" ]; then + APM_CNT=0xb2 + FIN_CODE=0xcb +fi + +if [ -n "$APM_CNT" -a -n "$FIN_CODE" ]; then + echo "Finalizing chipset" + io386 -o b -b x $APM_CNT $FIN_CODE +else + echo "NOT Finalizing chipset" + echo "lock_chip called without valid APM_CNT and FIN_CODE defined under bin/lock_chip." +fi