summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Rhodes <sean@starlabs.systems>2022-08-07 20:59:57 +0100
committerFelix Held <felix-coreboot@felixheld.de>2022-09-22 18:35:31 +0000
commit9a3e9a495c54915761a52fc45013208b9c018109 (patch)
tree5a2d93cadd0b6f3f597a5aa66a06714f26bcd99c
parent026f00476e11f6e9e53d19fba09d4d97c54e79cf (diff)
downloadcoreboot-9a3e9a495c54915761a52fc45013208b9c018109.tar.gz
coreboot-9a3e9a495c54915761a52fc45013208b9c018109.tar.bz2
coreboot-9a3e9a495c54915761a52fc45013208b9c018109.zip
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>
-rw-r--r--src/soc/intel/common/block/systemagent/Kconfig6
-rw-r--r--src/soc/intel/common/block/systemagent/systemagent.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/soc/intel/common/block/systemagent/Kconfig b/src/soc/intel/common/block/systemagent/Kconfig
index e7f6ba49d833..4ba83f881769 100644
--- a/src/soc/intel/common/block/systemagent/Kconfig
+++ b/src/soc/intel/common/block/systemagent/Kconfig
@@ -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
diff --git a/src/soc/intel/common/block/systemagent/systemagent.c b/src/soc/intel/common/block/systemagent/systemagent.c
index 0861e62fc8e2..c2ce999c9f54 100644
--- a/src/soc/intel/common/block/systemagent/systemagent.c
+++ b/src/soc/intel/common/block/systemagent/systemagent.c
@@ -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);