1 /* SPDX-License-Identifier: GPL-2.0-only */
4 * This file is created based on Intel Tiger Lake Processor PCH Datasheet
5 * Document number: 575857
9 #include <device/mmio.h>
10 #include <intelblocks/cfg.h>
11 #include <intelpch/lockdown.h>
15 static void pmc_lock_pmsync(void)
20 pmcbase
= pmc_mmio_regs();
22 pmsyncreg
= read32(pmcbase
+ PMSYNC_TPR_CFG
);
23 pmsyncreg
|= PCH2CPU_TPR_CFG_LOCK
;
24 write32(pmcbase
+ PMSYNC_TPR_CFG
, pmsyncreg
);
27 static void pmc_lock_abase(void)
32 pmcbase
= pmc_mmio_regs();
34 reg32
= read32(pmcbase
+ GEN_PMCON_B
);
35 reg32
|= (SLP_STR_POL_LOCK
| ACPI_BASE_LOCK
);
36 write32(pmcbase
+ GEN_PMCON_B
, reg32
);
39 static void pmc_lock_smi(void)
44 pmcbase
= pmc_mmio_regs();
46 reg8
= read8(pmcbase
+ GEN_PMCON_B
);
48 write8(pmcbase
+ GEN_PMCON_B
, reg8
);
51 static void pmc_lockdown_cfg(int chipset_lockdown
)
55 /* Lock down ABASE and sleep stretching policy */
58 if (chipset_lockdown
== CHIPSET_LOCKDOWN_COREBOOT
)
62 void soc_lockdown_config(int chipset_lockdown
)
64 /* PMC lock down configuration */
65 pmc_lockdown_cfg(chipset_lockdown
);