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 | |
| 16 | #include <arch/io.h> |
Stefan Reinauer | e1ae4b2 | 2012-04-27 23:20:58 +0200 | [diff] [blame] | 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> |
| 24 | |
david | 80ef7b7 | 2015-01-19 17:11:36 +0800 | [diff] [blame] | 25 | /* Include for SIO helper functions */ |
| 26 | #include <superio/ite/it8772f/it8772f.h> |
Edward O'Callaghan | 1f9653a | 2014-07-14 16:31:25 +1000 | [diff] [blame] | 27 | #define DUMMY_DEV PNP_DEV(0x2e, 0) |
Stefan Reinauer | e1ae4b2 | 2012-04-27 23:20:58 +0200 | [diff] [blame] | 28 | |
Stefan Reinauer | e1ae4b2 | 2012-04-27 23:20:58 +0200 | [diff] [blame] | 29 | /* |
| 30 | * Change LED_POWER# (SIO GPIO 45) state based on sleep type. |
david | 80ef7b7 | 2015-01-19 17:11:36 +0800 | [diff] [blame] | 31 | */ |
Stefan Reinauer | e1ae4b2 | 2012-04-27 23:20:58 +0200 | [diff] [blame] | 32 | void mainboard_smi_sleep(u8 slp_typ) |
| 33 | { |
david | 80ef7b7 | 2015-01-19 17:11:36 +0800 | [diff] [blame] | 34 | printk(BIOS_DEBUG, "SMI: sleep S%d\n", slp_typ); |
Stefan Reinauer | e1ae4b2 | 2012-04-27 23:20:58 +0200 | [diff] [blame] | 35 | switch (slp_typ) { |
Marc Jones | da3087f | 2012-11-05 17:25:52 -0700 | [diff] [blame] | 36 | case 3: |
| 37 | case 4: |
david | 80ef7b7 | 2015-01-19 17:11:36 +0800 | [diff] [blame] | 38 | 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 Reinauer | e1ae4b2 | 2012-04-27 23:20:58 +0200 | [diff] [blame] | 42 | break; |
| 43 | |
Marc Jones | da3087f | 2012-11-05 17:25:52 -0700 | [diff] [blame] | 44 | case 5: |
david | 80ef7b7 | 2015-01-19 17:11:36 +0800 | [diff] [blame] | 45 | 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 Reinauer | e1ae4b2 | 2012-04-27 23:20:58 +0200 | [diff] [blame] | 51 | break; |
| 52 | } |
| 53 | } |