blob: d9a5b437435d67b573c5409347a76d7beb54d047 [file] [log] [blame]
Kyösti Mälkkie4c17ce2014-10-21 18:22:32 +03001/*
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älkkie4c17ce2014-10-21 18:22:32 +030014 */
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älkki023ed1f2014-10-22 08:05:36 +030023#include <northbridge/amd/pi/agesawrapper.h>
Kyösti Mälkkie4c17ce2014-10-21 18:22:32 +030024#include <northbridge/amd/pi/agesawrapper_call.h>
25
26static void agesawrapper_post_device(void *unused)
27{
28 if (acpi_is_wakeup_s3())
29 return;
30
31 AGESAWRAPPER(amdinitlate);
32
Kyösti Mälkkie4c17ce2014-10-21 18:22:32 +030033 if (!acpi_s3_resume_allowed())
34 return;
35
36 AGESAWRAPPER(amdS3Save);
37}
38
Aaron Durbin9ef9d852015-03-16 17:30:09 -050039BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE, BS_ON_EXIT,
40 agesawrapper_post_device, NULL);