Kyösti Mälkki | e4c17ce | 2014-10-21 18:22:32 +0300 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2012 Advanced Micro Devices, Inc. |
| 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. |
Kyösti Mälkki | e4c17ce | 2014-10-21 18:22:32 +0300 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #include <arch/acpi.h> |
| 17 | #include <bootstate.h> |
| 18 | #include <console/console.h> |
| 19 | #include <device/device.h> |
| 20 | #include <device/pci_def.h> |
| 21 | #include <device/pci_ops.h> |
| 22 | |
Kyösti Mälkki | 023ed1f | 2014-10-22 08:05:36 +0300 | [diff] [blame] | 23 | #include <northbridge/amd/pi/agesawrapper.h> |
Kyösti Mälkki | e4c17ce | 2014-10-21 18:22:32 +0300 | [diff] [blame] | 24 | #include <northbridge/amd/pi/agesawrapper_call.h> |
| 25 | |
| 26 | static void agesawrapper_post_device(void *unused) |
| 27 | { |
| 28 | if (acpi_is_wakeup_s3()) |
| 29 | return; |
| 30 | |
| 31 | AGESAWRAPPER(amdinitlate); |
| 32 | |
Kyösti Mälkki | e4c17ce | 2014-10-21 18:22:32 +0300 | [diff] [blame] | 33 | if (!acpi_s3_resume_allowed()) |
| 34 | return; |
| 35 | |
| 36 | AGESAWRAPPER(amdS3Save); |
| 37 | } |
| 38 | |
Aaron Durbin | 9ef9d85 | 2015-03-16 17:30:09 -0500 | [diff] [blame] | 39 | BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE, BS_ON_EXIT, |
| 40 | agesawrapper_post_device, NULL); |