Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / arch / x86 / lib / coreboot_table.c
index ceab3cf5e4f1bab37022c4bf520f13eb27d9ac6d..331c1b7e5a98b2ee8585bd8aae7a8ab73f236c91 100644 (file)
@@ -1,11 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2016, Bin Meng <bmeng.cn@gmail.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <malloc.h>
+#include <net.h>
 #include <vbe.h>
+#include <acpi/acpi_s3.h>
 #include <asm/coreboot_tables.h>
 #include <asm/e820.h>
 
@@ -19,7 +21,11 @@ int high_table_reserve(void)
        gd->arch.high_table_ptr = gd->start_addr_sp;
 
        /* clear the memory */
-       memset((void *)gd->arch.high_table_ptr, 0, CONFIG_HIGH_TABLE_SIZE);
+#ifdef CONFIG_HAVE_ACPI_RESUME
+       if (gd->arch.prev_sleep_state != ACPI_S3)
+#endif
+               memset((void *)gd->arch.high_table_ptr, 0,
+                      CONFIG_HIGH_TABLE_SIZE);
 
        gd->start_addr_sp &= ~0xf;
 
@@ -95,7 +101,7 @@ void write_coreboot_table(u32 addr, struct memory_area *cfg_tables)
        struct cb_record *cbr;
        struct cb_memory *mem;
        struct cb_memory_range *map;
-       struct e820entry e820[32];
+       struct e820_entry e820[32];
        struct cb_framebuffer *fb;
        struct vesa_mode_info *vesa;
        int i, num;