blob: 2e0f0dd25de92b3223fb2a128dc35096a1a3885b [file] [log] [blame]
Stefan Reinauere1ae4b22012-04-27 23:20:58 +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 Reinauere1ae4b22012-04-27 23:20:58 +020014 */
15
16#include <arch/io.h>
Stefan Reinauere1ae4b22012-04-27 23:20:58 +020017#include <console/console.h>
18#include <cpu/x86/smm.h>
19#include <southbridge/intel/bd82x6x/nvs.h>
20#include <southbridge/intel/bd82x6x/pch.h>
21#include <southbridge/intel/bd82x6x/me.h>
22#include <northbridge/intel/sandybridge/sandybridge.h>
23#include <cpu/intel/model_206ax/model_206ax.h>
24
david80ef7b72015-01-19 17:11:36 +080025/* Include for SIO helper functions */
26#include <superio/ite/it8772f/it8772f.h>
Edward O'Callaghan1f9653a2014-07-14 16:31:25 +100027#define DUMMY_DEV PNP_DEV(0x2e, 0)
Stefan Reinauere1ae4b22012-04-27 23:20:58 +020028
Stefan Reinauere1ae4b22012-04-27 23:20:58 +020029/*
30 * Change LED_POWER# (SIO GPIO 45) state based on sleep type.
david80ef7b72015-01-19 17:11:36 +080031*/
Stefan Reinauere1ae4b22012-04-27 23:20:58 +020032void mainboard_smi_sleep(u8 slp_typ)
33{
david80ef7b72015-01-19 17:11:36 +080034 printk(BIOS_DEBUG, "SMI: sleep S%d\n", slp_typ);
Stefan Reinauere1ae4b22012-04-27 23:20:58 +020035 switch (slp_typ) {
Marc Jonesda3087f2012-11-05 17:25:52 -070036 case 3:
37 case 4:
david80ef7b72015-01-19 17:11:36 +080038 it8772f_gpio_led(DUMMY_DEV, 4 /* set */, (0x1<<5) /* select */,
39 (0x1<<5) /* polarity */, (0x1<<5) /* 1=pullup */,
40 (0x1<<5) /* output */, 0x00, /* 0=Alternate function */
41 SIO_GPIO_BLINK_GPIO45, IT8772F_GPIO_BLINK_FREQUENCY_1_HZ);
Stefan Reinauere1ae4b22012-04-27 23:20:58 +020042 break;
43
Marc Jonesda3087f2012-11-05 17:25:52 -070044 case 5:
david80ef7b72015-01-19 17:11:36 +080045 it8772f_gpio_led(DUMMY_DEV, 4 /* set */, (0x1<<5) /* select */,
46 0x00 /* polarity: non-inverting */, 0x00 /* 0=pulldown */,
47 (0x1<<5) /* output */, (0x1<<5) /* 1=Simple IO function */,
48 SIO_GPIO_BLINK_GPIO45, IT8772F_GPIO_BLINK_FREQUENCY_1_HZ);
49 break;
50 default:
Stefan Reinauere1ae4b22012-04-27 23:20:58 +020051 break;
52 }
53}