Stefan Reinauer | 6651da3 | 2012-04-27 23:16:30 +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 | 6651da3 | 2012-04-27 23:16:30 +0200 | [diff] [blame] | 14 | */ |
| 15 | |
Aaron Durbin | 30b0c7a | 2016-07-13 13:01:13 -0500 | [diff] [blame] | 16 | #include <arch/acpi.h> |
Stefan Reinauer | 6651da3 | 2012-04-27 23:16:30 +0200 | [diff] [blame] | 17 | #include <arch/io.h> |
Stefan Reinauer | 6651da3 | 2012-04-27 23:16:30 +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 | |
Stefan Reinauer | 6651da3 | 2012-04-27 23:16:30 +0200 | [diff] [blame] | 26 | /* |
| 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 |
| 32 | void mainboard_smi_sleep(u8 slp_typ) |
| 33 | { |
| 34 | u8 reg8; |
| 35 | |
| 36 | switch (slp_typ) { |
Aaron Durbin | 30b0c7a | 2016-07-13 13:01:13 -0500 | [diff] [blame] | 37 | case ACPI_S3: |
| 38 | case ACPI_S4: |
Stefan Reinauer | 6651da3 | 2012-04-27 23:16:30 +0200 | [diff] [blame] | 39 | break; |
| 40 | |
Aaron Durbin | 30b0c7a | 2016-07-13 13:01:13 -0500 | [diff] [blame] | 41 | case ACPI_S5: |
Stefan Reinauer | 6651da3 | 2012-04-27 23:16:30 +0200 | [diff] [blame] | 42 | /* 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 | } |