blob: 9f9a08173fb575d1662b90b3415df638a3cf4789 [file] [log] [blame]
Angel Pons60ec3652020-04-03 01:22:13 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Stefan Reinauer6651da32012-04-27 23:16:30 +02002
Furquan Shaikh76cedd22020-05-02 10:24:23 -07003#include <acpi/acpi.h>
Stefan Reinauer6651da32012-04-27 23:16:30 +02004#include <arch/io.h>
Stefan Reinauer6651da32012-04-27 23:16:30 +02005#include <cpu/x86/smm.h>
Kyösti Mälkki661ad462020-12-29 06:26:21 +02006#include <soc/nvs.h>
Stefan Reinauer6651da32012-04-27 23:16:30 +02007#include <southbridge/intel/bd82x6x/pch.h>
8#include <southbridge/intel/bd82x6x/me.h>
9#include <northbridge/intel/sandybridge/sandybridge.h>
Stefan Reinauer6651da32012-04-27 23:16:30 +020010
Stefan Reinauer6651da32012-04-27 23:16:30 +020011/*
12 * Change LED_POWER# (SIO GPIO 45) state based on sleep type.
13 * The IO address is hardcoded as we don't have device path in SMM.
14 */
15#define SIO_GPIO_BASE_SET4 (0x730 + 3)
16#define SIO_GPIO_BLINK_GPIO45 0x25
17void mainboard_smi_sleep(u8 slp_typ)
18{
19 u8 reg8;
20
21 switch (slp_typ) {
Aaron Durbin30b0c7a2016-07-13 13:01:13 -050022 case ACPI_S3:
23 case ACPI_S4:
Stefan Reinauer6651da32012-04-27 23:16:30 +020024 break;
25
Aaron Durbin30b0c7a2016-07-13 13:01:13 -050026 case ACPI_S5:
Stefan Reinauer6651da32012-04-27 23:16:30 +020027 /* Turn off LED */
28 reg8 = inb(SIO_GPIO_BASE_SET4);
29 reg8 |= (1 << 5);
30 outb(reg8, SIO_GPIO_BASE_SET4);
31 break;
32 }
33}