2016-05-13 09:47:14 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the coreboot project.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013 Google Inc.
|
|
|
|
* Copyright (C) 2015-2016 Intel Corp.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <arch/io.h>
|
|
|
|
#include <cpu/x86/smm.h>
|
2017-06-09 02:32:02 +02:00
|
|
|
#include <intelblocks/smihandler.h>
|
2016-05-13 09:47:14 +02:00
|
|
|
#include <soc/gpio.h>
|
|
|
|
#include <soc/iomap.h>
|
|
|
|
#include <soc/pci_devs.h>
|
2017-06-09 02:32:02 +02:00
|
|
|
#include <soc/pm.h>
|
2016-05-13 09:47:14 +02:00
|
|
|
|
2017-06-09 02:32:02 +02:00
|
|
|
int smihandler_disable_busmaster(device_t dev)
|
2016-05-13 09:47:14 +02:00
|
|
|
{
|
2017-03-05 08:07:00 +01:00
|
|
|
if (dev == PCH_DEV_PMC)
|
2016-05-13 09:47:14 +02:00
|
|
|
return 0;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
const struct smm_save_state_ops *get_smm_save_state_ops(void)
|
|
|
|
{
|
|
|
|
return &em64t100_smm_ops;
|
|
|
|
}
|
|
|
|
|
2016-07-25 05:50:12 +02:00
|
|
|
void __attribute__((weak))
|
|
|
|
mainboard_smi_gpi_handler(const struct gpi_status *sts) { }
|
|
|
|
|
2017-06-09 02:32:02 +02:00
|
|
|
static void southbridge_smi_gpi(
|
|
|
|
const struct smm_save_state_ops *save_state_ops)
|
2016-07-25 05:50:12 +02:00
|
|
|
{
|
|
|
|
struct gpi_status smi_sts;
|
|
|
|
|
|
|
|
gpi_clear_get_smi_status(&smi_sts);
|
|
|
|
mainboard_smi_gpi_handler(&smi_sts);
|
|
|
|
|
|
|
|
/* Clear again after mainboard handler */
|
|
|
|
gpi_clear_get_smi_status(&smi_sts);
|
|
|
|
}
|
|
|
|
|
2016-05-13 09:47:14 +02:00
|
|
|
const smi_handler_t southbridge_smi[32] = {
|
2017-06-09 02:32:02 +02:00
|
|
|
[SLP_SMI_STS] = smihandler_southbridge_sleep,
|
|
|
|
[APM_SMI_STS] = smihandler_southbridge_apmc,
|
|
|
|
[FAKE_PM1_SMI_STS] = smihandler_southbridge_pm1,
|
2016-07-25 05:50:12 +02:00
|
|
|
[GPIO_SMI_STS] = southbridge_smi_gpi,
|
2017-06-09 02:32:02 +02:00
|
|
|
[TCO_SMI_STS] = smihandler_southbridge_tco,
|
|
|
|
[PERIODIC_SMI_STS] = smihandler_southbridge_periodic,
|
2016-05-13 09:47:14 +02:00
|
|
|
};
|