2017-08-01 20:32:06 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the coreboot project.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2008-2009 coresystems GmbH
|
|
|
|
* Copyright (C) 2014 Google Inc.
|
2020-02-20 07:39:45 +01:00
|
|
|
* Copyright (C) 2017-2020 Intel Corporation.
|
2017-08-01 20:32:06 +02:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; version 2 of the License.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*/
|
|
|
|
|
2017-12-20 05:41:33 +01:00
|
|
|
#include <console/console.h>
|
2018-02-20 07:19:45 +01:00
|
|
|
#include <device/pci_def.h>
|
2020-02-20 07:39:45 +01:00
|
|
|
#include <intelblocks/cse.h>
|
2017-08-01 20:32:06 +02:00
|
|
|
#include <intelblocks/smihandler.h>
|
2020-02-20 07:39:45 +01:00
|
|
|
#include <soc/soc_chip.h>
|
2018-02-20 07:19:45 +01:00
|
|
|
#include <soc/pci_devs.h>
|
2017-09-14 23:51:12 +02:00
|
|
|
#include <soc/pm.h>
|
2017-08-01 20:32:06 +02:00
|
|
|
|
2018-02-20 07:19:45 +01:00
|
|
|
/*
|
|
|
|
* Specific SOC SMI handler during ramstage finalize phase
|
|
|
|
*
|
|
|
|
* BIOS can't make CSME function disable as is due to POSTBOOT_SAI
|
|
|
|
* restriction in place from CNP chipset. Hence create SMI Handler to
|
|
|
|
* perform CSME function disabling logic during SMM mode.
|
|
|
|
*/
|
|
|
|
void smihandler_soc_at_finalize(void)
|
|
|
|
{
|
|
|
|
const struct soc_intel_cannonlake_config *config;
|
|
|
|
|
2019-09-27 23:20:27 +02:00
|
|
|
config = config_of_soc();
|
2018-02-20 07:19:45 +01:00
|
|
|
|
2019-06-04 10:46:02 +02:00
|
|
|
if (!config->HeciEnabled && CONFIG(HECI_DISABLE_USING_SMM))
|
2018-05-17 14:58:26 +02:00
|
|
|
heci_disable();
|
2018-02-20 07:19:45 +01:00
|
|
|
}
|
|
|
|
|
2017-09-14 23:51:12 +02:00
|
|
|
const smi_handler_t southbridge_smi[SMI_STS_BITS] = {
|
2017-08-01 20:32:06 +02:00
|
|
|
[SMI_ON_SLP_EN_STS_BIT] = smihandler_southbridge_sleep,
|
|
|
|
[APM_STS_BIT] = smihandler_southbridge_apmc,
|
|
|
|
[PM1_STS_BIT] = smihandler_southbridge_pm1,
|
|
|
|
[GPE0_STS_BIT] = smihandler_southbridge_gpe0,
|
|
|
|
[GPIO_STS_BIT] = smihandler_southbridge_gpi,
|
|
|
|
[ESPI_SMI_STS_BIT] = smihandler_southbridge_espi,
|
|
|
|
[MCSMI_STS_BIT] = smihandler_southbridge_mc,
|
|
|
|
[TCO_STS_BIT] = smihandler_southbridge_tco,
|
|
|
|
[PERIODIC_STS_BIT] = smihandler_southbridge_periodic,
|
|
|
|
[MONITOR_STS_BIT] = smihandler_southbridge_monitor,
|
|
|
|
};
|