1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <device/mmio.h>
4 #include <intelblocks/cfg.h>
5 #include <intelblocks/pmclib.h>
6 #include <intelpch/lockdown.h>
9 static void pmc_lock_pmsync(void)
14 pmcbase
= pmc_mmio_regs();
16 pmsyncreg
= read32(pmcbase
+ PMSYNC_TPR_CFG
);
17 pmsyncreg
|= PCH2CPU_TPR_CFG_LOCK
;
18 write32(pmcbase
+ PMSYNC_TPR_CFG
, pmsyncreg
);
21 static void pmc_lock_abase(void)
26 pmcbase
= pmc_mmio_regs();
28 reg32
= read32(pmcbase
+ GEN_PMCON_B
);
29 reg32
|= (SLP_STR_POL_LOCK
| ACPI_BASE_LOCK
);
30 write32(pmcbase
+ GEN_PMCON_B
, reg32
);
33 static void pmc_lock_smi(void)
38 pmcbase
= pmc_mmio_regs();
40 reg8
= read8(pmcbase
+ GEN_PMCON_B
);
42 write8(pmcbase
+ GEN_PMCON_B
, reg8
);
45 static void pmc_lockdown_cfg(int chipset_lockdown
)
49 /* Lock down ABASE and sleep stretching policy */
51 /* Make sure payload/OS can't trigger global reset */
52 pmc_global_reset_disable_and_lock();
54 if (chipset_lockdown
== CHIPSET_LOCKDOWN_COREBOOT
)
58 void soc_lockdown_config(int chipset_lockdown
)
60 /* PMC lock down configuration */
61 pmc_lockdown_cfg(chipset_lockdown
);