blob: a55ebd896f44b25b71cf6a61b95ed5c254b5da0f [file] [log] [blame]
Kyösti Mälkki005028e2014-06-19 23:12:15 +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älkki005028e2014-06-19 23:12:15 +030014 */
15
16#include <arch/acpi.h>
17#include <bootstate.h>
Kyösti Mälkki005028e2014-06-19 23:12:15 +030018
Kyösti Mälkkif21c2ac2014-10-19 09:35:18 +030019#include <northbridge/amd/agesa/agesawrapper.h>
Kyösti Mälkki005028e2014-06-19 23:12:15 +030020
Kyösti Mälkkib6f3da42014-07-07 15:06:00 +030021#if CONFIG_AMD_SB_CIMX
22#include <sb_cimx.h>
23#endif
24
Kyösti Mälkki005028e2014-06-19 23:12:15 +030025static void agesawrapper_post_device(void *unused)
26{
Kyösti Mälkki005028e2014-06-19 23:12:15 +030027 if (acpi_is_wakeup_s3())
28 return;
29
Kyösti Mälkki1aa35c62014-10-21 14:19:04 +030030 agesawrapper_amdinitlate();
Kyösti Mälkki005028e2014-06-19 23:12:15 +030031
Kyösti Mälkkib6f3da42014-07-07 15:06:00 +030032#if CONFIG_AMD_SB_CIMX
33 sb_Late_Post();
34#endif
Kyösti Mälkki005028e2014-06-19 23:12:15 +030035 if (!acpi_s3_resume_allowed())
36 return;
37
Kyösti Mälkki1aa35c62014-10-21 14:19:04 +030038 agesawrapper_amdS3Save();
Kyösti Mälkki005028e2014-06-19 23:12:15 +030039}
40
Aaron Durbin9ef9d852015-03-16 17:30:09 -050041BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE, BS_ON_EXIT,
42 agesawrapper_post_device, NULL);