Vladimir Serbinenko (phcoder@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10293
-gerrit
commit 23519b132d8118e5f67240ccbabbaa424f904226 Author: Vladimir Serbinenko phcoder@gmail.com Date: Thu May 21 10:32:59 2015 +0200
bd82x6x: Move calling of finalize() on resume to southbridge code
Change-Id: I6416cd5780fbda0b3c2e236ce98a9f9a508e70c6 Signed-off-by: Vladimir Serbinenko phcoder@gmail.com --- src/mainboard/gigabyte/ga-b75m-d3h/mainboard.c | 6 ------ src/mainboard/gigabyte/ga-b75m-d3v/mainboard.c | 6 ------ src/mainboard/google/butterfly/mainboard.c | 8 -------- src/mainboard/google/link/mainboard.c | 6 ------ src/mainboard/google/parrot/mainboard.c | 4 ---- src/mainboard/google/stout/mainboard.c | 3 --- src/mainboard/intel/emeraldlake2/mainboard.c | 8 -------- src/mainboard/kontron/ktqm77/mainboard.c | 6 ------ src/mainboard/lenovo/t420s/mainboard.c | 6 ------ src/mainboard/lenovo/t430s/mainboard.c | 6 ------ src/mainboard/lenovo/t520/mainboard.c | 6 ------ src/mainboard/lenovo/t530/mainboard.c | 6 ------ src/mainboard/lenovo/x220/mainboard.c | 6 ------ src/mainboard/lenovo/x230/mainboard.c | 6 ------ src/mainboard/samsung/lumpy/mainboard.c | 3 --- src/mainboard/samsung/stumpy/mainboard.c | 8 -------- src/southbridge/intel/bd82x6x/lpc.c | 9 +++++++++ 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 142907a..6828330 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 142907a..6828330 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 e09336d..1c1814d 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 01ac22c..fc95f59 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 998cb3c..3f29312 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 fcae6e1..0d3d8e0 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 19158d6..2e1ed36 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 3594749..9999e2e 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 e9a400b..afe14ab 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 49e828e..f759499 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 609d616..7034c8a 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 a81b5b2..9cc0baf 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 570e74a..c22744b 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 8ea18de..dfbc244 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 e439d73..f34f887 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 19158d6..2e1ed36 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 19e5407..14b3920 100644 --- a/src/southbridge/intel/bd82x6x/lpc.c +++ b/src/southbridge/intel/bd82x6x/lpc.c @@ -846,6 +846,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, }; @@ -858,6 +866,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,