blob: 65667b9bdc85acd35f200529e1f254ff7070695b [file] [log] [blame]
Marc Jones21cde8b2017-05-07 16:47:36 -06001/*
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.
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
Richard Spiegel0ad74ac2017-12-08 16:53:29 -070023#include <amdblocks/agesawrapper.h>
24#include <amdblocks/agesawrapper_call.h>
Marc Jones21cde8b2017-05-07 16:47:36 -060025
26static void agesawrapper_post_device(void *unused)
27{
28 if (acpi_is_wakeup_s3())
29 return;
30
31 AGESAWRAPPER(amdinitlate);
32
33 if (!acpi_s3_resume_allowed())
34 return;
35
36 AGESAWRAPPER(amdS3Save);
37}
38
39BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE, BS_ON_EXIT,
40 agesawrapper_post_device, NULL);