summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2015-05-21 10:32:59 +0200
committerVladimir Serbinenko <phcoder@gmail.com>2015-05-29 11:26:06 +0200
commitb06a249c3b766531ca247bb1278d34875f0d86e4 (patch)
tree1391e4ac2d85045e0eb80c423a4af53c44aad580
parent501cce8b181500bab8a6f6e8634ac8bb45abfd1c (diff)
downloadcoreboot-b06a249c3b766531ca247bb1278d34875f0d86e4.tar.xz
bd82x6x: Move calling of finalize() on resume to southbridge code
Change-Id: I6416cd5780fbda0b3c2e236ce98a9f9a508e70c6 Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/10293 Tested-by: build bot (Jenkins) Reviewed-by: Nicolas Reinecke <nr@das-labor.org>
-rw-r--r--src/mainboard/gigabyte/ga-b75m-d3h/mainboard.c6
-rw-r--r--src/mainboard/gigabyte/ga-b75m-d3v/mainboard.c6
-rw-r--r--src/mainboard/google/butterfly/mainboard.c8
-rw-r--r--src/mainboard/google/link/mainboard.c6
-rw-r--r--src/mainboard/google/parrot/mainboard.c4
-rw-r--r--src/mainboard/google/stout/mainboard.c3
-rw-r--r--src/mainboard/intel/emeraldlake2/mainboard.c8
-rw-r--r--src/mainboard/kontron/ktqm77/mainboard.c6
-rw-r--r--src/mainboard/lenovo/t420s/mainboard.c6
-rw-r--r--src/mainboard/lenovo/t430s/mainboard.c6
-rw-r--r--src/mainboard/lenovo/t520/mainboard.c6
-rw-r--r--src/mainboard/lenovo/t530/mainboard.c6
-rw-r--r--src/mainboard/lenovo/x220/mainboard.c6
-rw-r--r--src/mainboard/lenovo/x230/mainboard.c6
-rw-r--r--src/mainboard/samsung/lumpy/mainboard.c3
-rw-r--r--src/mainboard/samsung/stumpy/mainboard.c8
-rw-r--r--src/southbridge/intel/bd82x6x/lpc.c9
17 files changed, 9 insertions, 94 deletions
diff --git a/src/mainboard/gigabyte/ga-b75m-d3h/mainboard.c b/src/mainboard/gigabyte/ga-b75m-d3h/mainboard.c
index 142907aa61..6828330405 100644
--- a/src/mainboard/gigabyte/ga-b75m-d3h/mainboard.c
+++ b/src/mainboard/gigabyte/ga-b75m-d3h/mainboard.c
@@ -36,12 +36,6 @@
#include <device/pci.h>
#include <cbfs.h>
-void mainboard_suspend_resume(void)
-{
- /* Call SMM finalize() handlers before resume */
- outb(0xcb, 0xb2);
-}
-
static void mainboard_init(device_t dev)
{
RCBA32(0x38c8) = 0x00002005;
diff --git a/src/mainboard/gigabyte/ga-b75m-d3v/mainboard.c b/src/mainboard/gigabyte/ga-b75m-d3v/mainboard.c
index 142907aa61..6828330405 100644
--- a/src/mainboard/gigabyte/ga-b75m-d3v/mainboard.c
+++ b/src/mainboard/gigabyte/ga-b75m-d3v/mainboard.c
@@ -36,12 +36,6 @@
#include <device/pci.h>
#include <cbfs.h>
-void mainboard_suspend_resume(void)
-{
- /* Call SMM finalize() handlers before resume */
- outb(0xcb, 0xb2);
-}
-
static void mainboard_init(device_t dev)
{
RCBA32(0x38c8) = 0x00002005;
diff --git a/src/mainboard/google/butterfly/mainboard.c b/src/mainboard/google/butterfly/mainboard.c
index e09336d675..1c1814dcf7 100644
--- a/src/mainboard/google/butterfly/mainboard.c
+++ b/src/mainboard/google/butterfly/mainboard.c
@@ -183,14 +183,6 @@ static void program_keyboard_type(u32 search_address, u32 search_length)
ec_mem_write(EC_KBID_REG, kbd_type);
}
-void mainboard_suspend_resume(void)
-{
- /* Call SMM finalize() handlers before resume */
- outb(0xcb, 0xb2);
-}
-
-
-
static void mainboard_init(device_t dev)
{
u32 search_address = 0x0;
diff --git a/src/mainboard/google/link/mainboard.c b/src/mainboard/google/link/mainboard.c
index 01ac22cd52..fc95f593c5 100644
--- a/src/mainboard/google/link/mainboard.c
+++ b/src/mainboard/google/link/mainboard.c
@@ -54,12 +54,6 @@ void mainboard_post(u8 value)
*/
}
-void mainboard_suspend_resume(void)
-{
- /* Call SMM finalize() handlers before resume */
- outb(0xcb, 0xb2);
-}
-
#if CONFIG_VGA_ROM_RUN
static int int15_handler(void)
{
diff --git a/src/mainboard/google/parrot/mainboard.c b/src/mainboard/google/parrot/mainboard.c
index 998cb3cedf..3f29312b07 100644
--- a/src/mainboard/google/parrot/mainboard.c
+++ b/src/mainboard/google/parrot/mainboard.c
@@ -39,15 +39,11 @@
void mainboard_suspend_resume(void)
{
- /* Call SMM finalize() handlers before resume */
- outb(0xcb, 0xb2);
-
/* Enable ACPI mode before OS resume */
outb(0xe1, 0xb2);
}
-
static void mainboard_init(device_t dev)
{
/* Initialize the Embedded Controller */
diff --git a/src/mainboard/google/stout/mainboard.c b/src/mainboard/google/stout/mainboard.c
index fcae6e1ac7..0d3d8e001e 100644
--- a/src/mainboard/google/stout/mainboard.c
+++ b/src/mainboard/google/stout/mainboard.c
@@ -39,9 +39,6 @@
void mainboard_suspend_resume(void)
{
- /* Call SMM finalize() handlers before resume */
- outb(0xcb, 0xb2);
-
/* Stout EC needs to be put back in ACPI mode */
ec_write_cmd(EC_CMD_NOTIFY_ACPI_ENTER);
}
diff --git a/src/mainboard/intel/emeraldlake2/mainboard.c b/src/mainboard/intel/emeraldlake2/mainboard.c
index 19158d6d6f..2e1ed36ee9 100644
--- a/src/mainboard/intel/emeraldlake2/mainboard.c
+++ b/src/mainboard/intel/emeraldlake2/mainboard.c
@@ -33,14 +33,6 @@
#include <boot/coreboot_tables.h>
#include <southbridge/intel/bd82x6x/pch.h>
-void mainboard_suspend_resume(void)
-{
- /* Call SMM finalize() handlers before resume */
- outb(0xcb, 0xb2);
-}
-
-
-
// mainboard_enable is executed as first thing after
// enumerate_buses().
diff --git a/src/mainboard/kontron/ktqm77/mainboard.c b/src/mainboard/kontron/ktqm77/mainboard.c
index 35947494d9..9999e2ee02 100644
--- a/src/mainboard/kontron/ktqm77/mainboard.c
+++ b/src/mainboard/kontron/ktqm77/mainboard.c
@@ -35,12 +35,6 @@
#include <boot/coreboot_tables.h>
#include <southbridge/intel/bd82x6x/pch.h>
-void mainboard_suspend_resume(void)
-{
- /* Call SMM finalize() handlers before resume */
- outb(0xcb, 0xb2);
-}
-
#if CONFIG_VGA_ROM_RUN
static int int15_handler(void)
{
diff --git a/src/mainboard/lenovo/t420s/mainboard.c b/src/mainboard/lenovo/t420s/mainboard.c
index acebcae7f2..96180ec467 100644
--- a/src/mainboard/lenovo/t420s/mainboard.c
+++ b/src/mainboard/lenovo/t420s/mainboard.c
@@ -33,12 +33,6 @@
#include <pc80/keyboard.h>
#include <ec/lenovo/h8/h8.h>
-void mainboard_suspend_resume(void)
-{
- /* Call SMM finalize() handlers before resume */
- outb(0xcb, 0xb2);
-}
-
static void mainboard_init(device_t dev)
{
/* init spi */
diff --git a/src/mainboard/lenovo/t430s/mainboard.c b/src/mainboard/lenovo/t430s/mainboard.c
index 2bbb8bdf43..a5cd083f83 100644
--- a/src/mainboard/lenovo/t430s/mainboard.c
+++ b/src/mainboard/lenovo/t430s/mainboard.c
@@ -33,12 +33,6 @@
#include <pc80/keyboard.h>
#include <ec/lenovo/h8/h8.h>
-void mainboard_suspend_resume(void)
-{
- /* Call SMM finalize() handlers before resume */
- outb(0xcb, 0xb2);
-}
-
static void mainboard_init(device_t dev)
{
/* init spi */
diff --git a/src/mainboard/lenovo/t520/mainboard.c b/src/mainboard/lenovo/t520/mainboard.c
index 2bfe5430af..a67459da65 100644
--- a/src/mainboard/lenovo/t520/mainboard.c
+++ b/src/mainboard/lenovo/t520/mainboard.c
@@ -38,12 +38,6 @@
#include <pc80/keyboard.h>
#include <ec/lenovo/h8/h8.h>
-void mainboard_suspend_resume(void)
-{
- /* Call SMM finalize() handlers before resume */
- outb(0xcb, 0xb2);
-}
-
static void mainboard_init(device_t dev)
{
RCBA32(0x38c8) = 0x00002005;
diff --git a/src/mainboard/lenovo/t530/mainboard.c b/src/mainboard/lenovo/t530/mainboard.c
index fe99afad87..c25873131c 100644
--- a/src/mainboard/lenovo/t530/mainboard.c
+++ b/src/mainboard/lenovo/t530/mainboard.c
@@ -38,12 +38,6 @@
#include <pc80/keyboard.h>
#include <ec/lenovo/h8/h8.h>
-void mainboard_suspend_resume(void)
-{
- /* Call SMM finalize() handlers before resume */
- outb(0xcb, 0xb2);
-}
-
static void mainboard_init(device_t dev)
{
RCBA32(0x38c8) = 0x00002005;
diff --git a/src/mainboard/lenovo/x220/mainboard.c b/src/mainboard/lenovo/x220/mainboard.c
index 04b8e7fe9f..c5570312a4 100644
--- a/src/mainboard/lenovo/x220/mainboard.c
+++ b/src/mainboard/lenovo/x220/mainboard.c
@@ -33,12 +33,6 @@
#include <pc80/keyboard.h>
#include <ec/lenovo/h8/h8.h>
-void mainboard_suspend_resume(void)
-{
- /* Call SMM finalize() handlers before resume */
- outb(0xcb, 0xb2);
-}
-
static void mainboard_init(device_t dev)
{
RCBA32(0x38c8) = 0x00002005;
diff --git a/src/mainboard/lenovo/x230/mainboard.c b/src/mainboard/lenovo/x230/mainboard.c
index 09b8d69334..285020fc49 100644
--- a/src/mainboard/lenovo/x230/mainboard.c
+++ b/src/mainboard/lenovo/x230/mainboard.c
@@ -34,12 +34,6 @@
#include <pc80/keyboard.h>
#include <ec/lenovo/h8/h8.h>
-void mainboard_suspend_resume(void)
-{
- /* Call SMM finalize() handlers before resume */
- outb(0xcb, 0xb2);
-}
-
static void mainboard_init(device_t dev)
{
RCBA32(0x38c8) = 0x00002005;
diff --git a/src/mainboard/samsung/lumpy/mainboard.c b/src/mainboard/samsung/lumpy/mainboard.c
index e439d73bf5..f34f8872c4 100644
--- a/src/mainboard/samsung/lumpy/mainboard.c
+++ b/src/mainboard/samsung/lumpy/mainboard.c
@@ -38,9 +38,6 @@
void mainboard_suspend_resume(void)
{
- /* Call SMM finalize() handlers before resume */
- outb(0xcb, 0xb2);
-
/* Enable EC ACPI mode for the OS before resume */
send_ec_command(EC_SMI_DISABLE);
send_ec_command(EC_ACPI_ENABLE);
diff --git a/src/mainboard/samsung/stumpy/mainboard.c b/src/mainboard/samsung/stumpy/mainboard.c
index 19158d6d6f..2e1ed36ee9 100644
--- a/src/mainboard/samsung/stumpy/mainboard.c
+++ b/src/mainboard/samsung/stumpy/mainboard.c
@@ -33,14 +33,6 @@
#include <boot/coreboot_tables.h>
#include <southbridge/intel/bd82x6x/pch.h>
-void mainboard_suspend_resume(void)
-{
- /* Call SMM finalize() handlers before resume */
- outb(0xcb, 0xb2);
-}
-
-
-
// mainboard_enable is executed as first thing after
// enumerate_buses().
diff --git a/src/southbridge/intel/bd82x6x/lpc.c b/src/southbridge/intel/bd82x6x/lpc.c
index 842d9d994f..c1bc45fdaf 100644
--- a/src/southbridge/intel/bd82x6x/lpc.c
+++ b/src/southbridge/intel/bd82x6x/lpc.c
@@ -805,6 +805,14 @@ static void southbridge_fill_ssdt(void)
intel_acpi_pcie_hotplug_generator(chip->pcie_hotplug_map, 8);
}
+static void lpc_final(struct device *dev)
+{
+ if (CONFIG_HAVE_SMI_HANDLER && acpi_is_wakeup_s3()) {
+ /* Call SMM finalize() handlers before resume */
+ outb(0xcb, 0xb2);
+ }
+}
+
static struct pci_operations pci_ops = {
.set_subsystem = set_subsystem,
};
@@ -817,6 +825,7 @@ static struct device_operations device_ops = {
.acpi_inject_dsdt_generator = southbridge_inject_dsdt,
.acpi_fill_ssdt_generator = southbridge_fill_ssdt,
.init = lpc_init,
+ .final = lpc_final,
.enable = pch_lpc_enable,
.scan_bus = scan_static_bus,
.ops_pci = &pci_ops,