blob: 3662e6e6d8cb2fb3b5459b8f05e232a3f8a52d1e [file] [log] [blame]
Stefan Reinauer6651da32012-04-27 23:16:30 +02001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2008-2009 coresystems GmbH
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Stefan Reinauer6651da32012-04-27 23:16:30 +020014 */
15
Aaron Durbin30b0c7a2016-07-13 13:01:13 -050016#include <arch/acpi.h>
Stefan Reinauer6651da32012-04-27 23:16:30 +020017#include <arch/io.h>
Stefan Reinauer6651da32012-04-27 23:16:30 +020018#include <console/console.h>
19#include <cpu/x86/smm.h>
20#include <southbridge/intel/bd82x6x/nvs.h>
21#include <southbridge/intel/bd82x6x/pch.h>
22#include <southbridge/intel/bd82x6x/me.h>
23#include <northbridge/intel/sandybridge/sandybridge.h>
24#include <cpu/intel/model_206ax/model_206ax.h>
25
Stefan Reinauer6651da32012-04-27 23:16:30 +020026/*
27 * Change LED_POWER# (SIO GPIO 45) state based on sleep type.
28 * The IO address is hardcoded as we don't have device path in SMM.
29 */
30#define SIO_GPIO_BASE_SET4 (0x730 + 3)
31#define SIO_GPIO_BLINK_GPIO45 0x25
32void mainboard_smi_sleep(u8 slp_typ)
33{
34 u8 reg8;
35
36 switch (slp_typ) {
Aaron Durbin30b0c7a2016-07-13 13:01:13 -050037 case ACPI_S3:
38 case ACPI_S4:
Stefan Reinauer6651da32012-04-27 23:16:30 +020039 break;
40
Aaron Durbin30b0c7a2016-07-13 13:01:13 -050041 case ACPI_S5:
Stefan Reinauer6651da32012-04-27 23:16:30 +020042 /* Turn off LED */
43 reg8 = inb(SIO_GPIO_BASE_SET4);
44 reg8 |= (1 << 5);
45 outb(reg8, SIO_GPIO_BASE_SET4);
46 break;
47 }
48}