tree: drop last paragraph of GPL copyright header
[coreboot.git] / src / mainboard / samsung / stumpy / smihandler.c
blob39df8a4a553226909775b308132ee8fe57990a30
1 /*
2 * This file is part of the coreboot project.
4 * Copyright (C) 2008-2009 coresystems GmbH
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.
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.
16 #include <arch/io.h>
17 #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>
25 /* FIXME: Include romstage serial for SIO helper functions */
26 #include <superio/ite/it8772f/early_init.c>
27 //#include <superio/ite/it8772f/it8772f.h>
28 #define DUMMY_DEV PNP_DEV(0x2e, 0)
31 * Change LED_POWER# (SIO GPIO 45) state based on sleep type.
32 * The IO address is hardcoded as we don't have device path in SMM.
34 #define SIO_GPIO_BASE_SET4 (0x730 + 3)
35 #define SIO_GPIO_BLINK_GPIO45 0x25
36 void mainboard_smi_sleep(u8 slp_typ)
38 u8 reg8;
40 switch (slp_typ) {
41 case 3:
42 case 4:
43 /* Blink LED */
44 it8772f_enter_conf(DUMMY_DEV);
45 it8772f_sio_write(DUMMY_DEV, IT8772F_CONFIG_REG_LDN, IT8772F_GPIO);
46 /* Enable blink pin map */
47 it8772f_sio_write(DUMMY_DEV, IT8772F_GPIO_LED_BLINK1_PINMAP,
48 SIO_GPIO_BLINK_GPIO45);
49 /* Enable 4HZ blink */
50 it8772f_sio_write(DUMMY_DEV, IT8772F_GPIO_LED_BLINK1_CONTROL, 0x02);
51 /* Set GPIO to alternate function */
52 reg8 = it8772f_sio_read(DUMMY_DEV, GPIO_REG_ENABLE(3));
53 reg8 &= ~(1 << 5);
54 it8772f_sio_write(DUMMY_DEV, GPIO_REG_ENABLE(3), reg8);
55 it8772f_exit_conf(DUMMY_DEV);
56 break;
58 case 5:
59 /* Turn off LED */
60 reg8 = inb(SIO_GPIO_BASE_SET4);
61 reg8 |= (1 << 5);
62 outb(reg8, SIO_GPIO_BASE_SET4);
63 break;