From bae4a0b5a1e413a8cf0bdce9be51ca006a02758a Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Wed, 20 Apr 2022 13:14:16 +0530 Subject: [PATCH] soc/intel/alderlake: Implement PMC feature lock This patch locks PMC features like: debug mode configuration and host read access to PMC XRAM. BUG=b:211954778 TEST=Able to build and boot google/redrix to OS. Signed-off-by: Subrata Banik Change-Id: I29178bdd9a94a24ca7056eb7377625f41a43c33c Reviewed-on: https://review.coreboot.org/c/coreboot/+/63691 Tested-by: build bot (Jenkins) Reviewed-by: Lean Sheng Tan Reviewed-by: Eric Lai Reviewed-by: Angel Pons --- src/soc/intel/alderlake/include/soc/pmc.h | 4 ++++ src/soc/intel/alderlake/lockdown.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/soc/intel/alderlake/include/soc/pmc.h b/src/soc/intel/alderlake/include/soc/pmc.h index ca11ae933a..d1e63bc5cf 100644 --- a/src/soc/intel/alderlake/include/soc/pmc.h +++ b/src/soc/intel/alderlake/include/soc/pmc.h @@ -76,6 +76,10 @@ extern struct device_operations pmc_ops; #define PRSTS 0x1810 +#define PM_CFG 0x1818 +#define PM_CFG_DBG_MODE_LOCK (1 << 27) +#define PM_CFG_XRAM_READ_DISABLE (1 << 22) + #define S3_PWRGATE_POL 0x1828 #define S3DC_GATE_SUS (1 << 1) #define S3AC_GATE_SUS (1 << 0) diff --git a/src/soc/intel/alderlake/lockdown.c b/src/soc/intel/alderlake/lockdown.c index f018dbd28d..4b260da1af 100644 --- a/src/soc/intel/alderlake/lockdown.c +++ b/src/soc/intel/alderlake/lockdown.c @@ -27,6 +27,8 @@ static void pmc_lockdown_cfg(int chipset_lockdown) if (!CONFIG(USE_FSP_NOTIFY_PHASE_POST_PCI_ENUM)) { setbits32(pmcbase + ST_PG_FDIS1, ST_FDIS_LOCK); setbits32(pmcbase + SSML, SSML_SSL_EN); + setbits32(pmcbase + PM_CFG, PM_CFG_DBG_MODE_LOCK | + PM_CFG_XRAM_READ_DISABLE); } }