2 * This file is part of the coreboot project.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
16 #include <arch/acpi.h>
18 #if IS_ENABLED(CONFIG_CBMEM_TOP_BACKUP)
22 static void *cbmem_top_backup
;
25 if (ENV_RAMSTAGE
&& cbmem_top_backup
!= NULL
)
26 return cbmem_top_backup
;
28 /* Top of CBMEM is at highest usable DRAM address below 4GiB. */
29 top_backup
= (void *)restore_top_of_low_cacheable();
32 cbmem_top_backup
= top_backup
;
37 #endif /* CBMEM_TOP_BACKUP */
39 /* Something went wrong, our high memory area got wiped */
40 void cbmem_fail_resume(void)
42 #if !defined(__PRE_RAM__) && IS_ENABLED(CONFIG_HAVE_ACPI_RESUME)
43 /* ACPI resume needs to be cleared in the fail-to-recover case, but that
44 * condition is only handled during ramstage. */