This patch performs locking of the PMC soft strap message interface. BUG=b:211954778 TEST=Able to build and boot google/redrix to OS. Verified Bit 0 of PMC MMIO register 0x104c is set as below. > localhost ~ # iotools mmio_read32 0xfe00104c 0x00000001 Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: I1ae972a203affa54c03de71f0f702356334cbf7d Reviewed-on: https://review.coreboot.org/c/coreboot/+/63690 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
38 lines
960 B
C
38 lines
960 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
/*
|
|
* This file is created based on Intel Alder Lake Processor PCH Datasheet
|
|
* Document number: 621483
|
|
* Chapter number: 4
|
|
*/
|
|
|
|
#include <device/mmio.h>
|
|
#include <intelblocks/cfg.h>
|
|
#include <intelpch/lockdown.h>
|
|
#include <soc/pm.h>
|
|
#include <stdint.h>
|
|
|
|
static void pmc_lockdown_cfg(int chipset_lockdown)
|
|
{
|
|
uint8_t *pmcbase = pmc_mmio_regs();
|
|
|
|
/* PMSYNC */
|
|
setbits32(pmcbase + PMSYNC_TPR_CFG, PCH2CPU_TPR_CFG_LOCK);
|
|
/* Lock down ABASE and sleep stretching policy */
|
|
setbits32(pmcbase + GEN_PMCON_B, SLP_STR_POL_LOCK | ACPI_BASE_LOCK);
|
|
|
|
if (chipset_lockdown == CHIPSET_LOCKDOWN_COREBOOT)
|
|
setbits32(pmcbase + GEN_PMCON_B, SMI_LOCK);
|
|
|
|
if (!CONFIG(USE_FSP_NOTIFY_PHASE_POST_PCI_ENUM)) {
|
|
setbits32(pmcbase + ST_PG_FDIS1, ST_FDIS_LOCK);
|
|
setbits32(pmcbase + SSML, SSML_SSL_EN);
|
|
}
|
|
}
|
|
|
|
void soc_lockdown_config(int chipset_lockdown)
|
|
{
|
|
/* PMC lock down configuration */
|
|
pmc_lockdown_cfg(chipset_lockdown);
|
|
}
|