Stefan Reinauer | e1ae4b2 | 2012-04-27 23:20:58 +0200 | [diff] [blame] | 1 | /* |
| 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 Reinauer | e1ae4b2 | 2012-04-27 23:20:58 +0200 | [diff] [blame] | 14 | */ |
| 15 | |
Aaron Durbin | 30b0c7a | 2016-07-13 13:01:13 -0500 | [diff] [blame] | 16 | #include <arch/acpi.h> |
Stefan Reinauer | e1ae4b2 | 2012-04-27 23:20:58 +0200 | [diff] [blame] | 17 | #include <arch/io.h> |
Stefan Reinauer | e1ae4b2 | 2012-04-27 23:20:58 +0200 | [diff] [blame] | 18 | #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 | |
david | 80ef7b7 | 2015-01-19 17:11:36 +0800 | [diff] [blame] | 26 | /* Include for SIO helper functions */ |
| 27 | #include <superio/ite/it8772f/it8772f.h> |
Edward O'Callaghan | 1f9653a | 2014-07-14 16:31:25 +1000 | [diff] [blame] | 28 | #define DUMMY_DEV PNP_DEV(0x2e, 0) |
Stefan Reinauer | e1ae4b2 | 2012-04-27 23:20:58 +0200 | [diff] [blame] | 29 | |
Stefan Reinauer | e1ae4b2 | 2012-04-27 23:20:58 +0200 | [diff] [blame] | 30 | /* |
| 31 | * Change LED_POWER# (SIO GPIO 45) state based on sleep type. |
david | 80ef7b7 | 2015-01-19 17:11:36 +0800 | [diff] [blame] | 32 | */ |
Stefan Reinauer | e1ae4b2 | 2012-04-27 23:20:58 +0200 | [diff] [blame] | 33 | void mainboard_smi_sleep(u8 slp_typ) |
| 34 | { |
david | 80ef7b7 | 2015-01-19 17:11:36 +0800 | [diff] [blame] | 35 | printk(BIOS_DEBUG, "SMI: sleep S%d\n", slp_typ); |
Stefan Reinauer | e1ae4b2 | 2012-04-27 23:20:58 +0200 | [diff] [blame] | 36 | switch (slp_typ) { |
Aaron Durbin | 30b0c7a | 2016-07-13 13:01:13 -0500 | [diff] [blame] | 37 | case ACPI_S3: |
| 38 | case ACPI_S4: |
Elyes HAOUAS | a5aad2e | 2016-09-19 09:47:16 -0600 | [diff] [blame] | 39 | it8772f_gpio_led(DUMMY_DEV, 4 /* set */, (0x1 << 5) /* select */, |
| 40 | (0x1 << 5) /* polarity */, (0x1 << 5) /* 1 = pullup */, |
| 41 | (0x1 << 5) /* output */, 0x00, /* 0 = Alternate function */ |
david | 80ef7b7 | 2015-01-19 17:11:36 +0800 | [diff] [blame] | 42 | SIO_GPIO_BLINK_GPIO45, IT8772F_GPIO_BLINK_FREQUENCY_1_HZ); |
Stefan Reinauer | e1ae4b2 | 2012-04-27 23:20:58 +0200 | [diff] [blame] | 43 | break; |
| 44 | |
Aaron Durbin | 30b0c7a | 2016-07-13 13:01:13 -0500 | [diff] [blame] | 45 | case ACPI_S5: |
Elyes HAOUAS | a5aad2e | 2016-09-19 09:47:16 -0600 | [diff] [blame] | 46 | it8772f_gpio_led(DUMMY_DEV, 4 /* set */, (0x1 << 5) /* select */, |
| 47 | 0x00 /* polarity: non-inverting */, 0x00 /* 0 = pulldown */, |
| 48 | (0x1 << 5) /* output */, (0x1 << 5) /* 1 = Simple IO function */, |
david | 80ef7b7 | 2015-01-19 17:11:36 +0800 | [diff] [blame] | 49 | SIO_GPIO_BLINK_GPIO45, IT8772F_GPIO_BLINK_FREQUENCY_1_HZ); |
| 50 | break; |
| 51 | default: |
Stefan Reinauer | e1ae4b2 | 2012-04-27 23:20:58 +0200 | [diff] [blame] | 52 | break; |
| 53 | } |
| 54 | } |