summaryrefslogtreecommitdiffstats
path: root/src/soc/intel/xeon_sp/smihandler.c
blob: 1c04b95d730c16d29c1b00d0214532de98bb98e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* SPDX-License-Identifier: GPL-2.0-only */

#include <console/console.h>
#include <cpu/x86/smm.h>
#include <device/pci.h>
#include <intelblocks/smihandler.h>
#include <soc/pci_devs.h>
#include <soc/pm.h>

/*
 * Specific SOC SMI handler during ramstage finalize phase
 */
void smihandler_soc_at_finalize(void)
{
	/* SMM_FEATURE_CONTROL can only be written within SMM. */
	printk(BIOS_DEBUG, "Lock SMM_FEATURE_CONTROL\n");
	const pci_devfn_t dev = UBOX_DEV_PMON;
	pci_or_config32(dev, SMM_FEATURE_CONTROL,
			SMM_CODE_CHK_EN | SMM_FEATURE_CONTROL_LOCK);

}

/* This is needed by common SMM code */
const smi_handler_t southbridge_smi[SMI_STS_BITS] = {
	[APM_STS_BIT] = smihandler_southbridge_apmc,
	[PM1_STS_BIT] = smihandler_southbridge_pm1,
#if CONFIG(SOC_INTEL_COMMON_BLOCK_SMM_TCO_ENABLE)
	[TCO_STS_BIT] = smihandler_southbridge_tco,
#endif
};