1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <device/mmio.h>
4 #include <intelblocks/cfg.h>
5 #include <intelpch/lockdown.h>
8 static void pmc_lock_pmsync(void)
13 pmcbase
= pmc_mmio_regs();
15 pmsyncreg
= read32(pmcbase
+ PMSYNC_TPR_CFG
);
16 pmsyncreg
|= PCH2CPU_TPR_CFG_LOCK
;
17 write32(pmcbase
+ PMSYNC_TPR_CFG
, pmsyncreg
);
20 static void pmc_lock_abase(void)
25 pmcbase
= pmc_mmio_regs();
27 reg32
= read32(pmcbase
+ GEN_PMCON_B
);
28 reg32
|= (SLP_STR_POL_LOCK
| ACPI_BASE_LOCK
);
29 write32(pmcbase
+ GEN_PMCON_B
, reg32
);
32 static void pmc_lock_smi(void)
37 pmcbase
= pmc_mmio_regs();
39 reg8
= read8(pmcbase
+ GEN_PMCON_B
);
41 write8(pmcbase
+ GEN_PMCON_B
, reg8
);
44 static void pmc_lockdown_cfg(int chipset_lockdown
)
48 /* Lock down ABASE and sleep stretching policy */
51 if (chipset_lockdown
== CHIPSET_LOCKDOWN_COREBOOT
)
55 void soc_lockdown_config(int chipset_lockdown
)
57 /* PMC lock down configuration */
58 pmc_lockdown_cfg(chipset_lockdown
);