2012-04-27 23:20:58 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the coreboot project.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2008-2009 coresystems GmbH
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2016-07-13 20:01:13 +02:00
|
|
|
#include <arch/acpi.h>
|
2012-04-27 23:20:58 +02:00
|
|
|
#include <console/console.h>
|
|
|
|
#include <cpu/x86/smm.h>
|
|
|
|
#include <southbridge/intel/bd82x6x/nvs.h>
|
|
|
|
#include <southbridge/intel/bd82x6x/pch.h>
|
|
|
|
#include <southbridge/intel/bd82x6x/me.h>
|
|
|
|
#include <northbridge/intel/sandybridge/sandybridge.h>
|
|
|
|
#include <cpu/intel/model_206ax/model_206ax.h>
|
|
|
|
|
2015-01-19 10:11:36 +01:00
|
|
|
/* Include for SIO helper functions */
|
|
|
|
#include <superio/ite/it8772f/it8772f.h>
|
2018-04-26 09:43:03 +02:00
|
|
|
#define SUPERIO_DEV PNP_DEV(0x2e, 0)
|
2012-04-27 23:20:58 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Change LED_POWER# (SIO GPIO 45) state based on sleep type.
|
2015-01-19 10:11:36 +01:00
|
|
|
*/
|
2012-04-27 23:20:58 +02:00
|
|
|
void mainboard_smi_sleep(u8 slp_typ)
|
|
|
|
{
|
2015-01-19 10:11:36 +01:00
|
|
|
printk(BIOS_DEBUG, "SMI: sleep S%d\n", slp_typ);
|
2012-04-27 23:20:58 +02:00
|
|
|
switch (slp_typ) {
|
2016-07-13 20:01:13 +02:00
|
|
|
case ACPI_S3:
|
|
|
|
case ACPI_S4:
|
2018-04-26 09:43:03 +02:00
|
|
|
it8772f_gpio_led(SUPERIO_DEV, 4 /* set */, (0x1 << 5) /* select */,
|
2016-09-19 17:47:16 +02:00
|
|
|
(0x1 << 5) /* polarity */, (0x1 << 5) /* 1 = pullup */,
|
|
|
|
(0x1 << 5) /* output */, 0x00, /* 0 = Alternate function */
|
2015-01-19 10:11:36 +01:00
|
|
|
SIO_GPIO_BLINK_GPIO45, IT8772F_GPIO_BLINK_FREQUENCY_1_HZ);
|
2012-04-27 23:20:58 +02:00
|
|
|
break;
|
|
|
|
|
2016-07-13 20:01:13 +02:00
|
|
|
case ACPI_S5:
|
2018-04-26 09:43:03 +02:00
|
|
|
it8772f_gpio_led(SUPERIO_DEV, 4 /* set */, (0x1 << 5) /* select */,
|
2016-09-19 17:47:16 +02:00
|
|
|
0x00 /* polarity: non-inverting */, 0x00 /* 0 = pulldown */,
|
|
|
|
(0x1 << 5) /* output */, (0x1 << 5) /* 1 = Simple IO function */,
|
2015-01-19 10:11:36 +01:00
|
|
|
SIO_GPIO_BLINK_GPIO45, IT8772F_GPIO_BLINK_FREQUENCY_1_HZ);
|
|
|
|
break;
|
|
|
|
default:
|
2012-04-27 23:20:58 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|