soc/common/lockdown: Guard sa_lock_pam

Guard sa_lock_pam with PAM0_REGISTER so it doesn't run on platforms
that don't select this.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I5055d09c634851e9f869ab0b67a7bcab130f928c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/66492
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Sean Rhodes 2022-08-07 20:59:57 +01:00 committed by Felix Held
parent 026f00476e
commit 9a3e9a495c
2 changed files with 7 additions and 1 deletions

View File

@ -31,4 +31,10 @@ config ACPI_BERT_SIZE
Specify the amount of DRAM reserved for gathering the data used to
generate the ACPI table.
config HAVE_PAM0_REGISTER
bool
default y
help
Specify if the SOC has a PAM0 register
endif

View File

@ -305,7 +305,7 @@ void enable_power_aware_intr(void)
void sa_lock_pam(void)
{
const struct device *dev = pcidev_path_on_root(SA_DEVFN_ROOT);
if (!dev)
if (!CONFIG(HAVE_PAM0_REGISTER) || !dev)
return;
pci_or_config8(dev, PAM0, PAM_LOCK);