]> git.sur5r.net Git - u-boot/blobdiff - arch/x86/lib/fsp/fsp_dram.c
x86: Use 'unsigned int' in install_e820_map() functions
[u-boot] / arch / x86 / lib / fsp / fsp_dram.c
index 8b880cd59455a5d1a710fe5fab63c8f6478e1f33..c1c6c5481a49ccbe1683c5fd207170adbba0a675 100644 (file)
@@ -62,9 +62,10 @@ ulong board_get_usable_ram_top(ulong total_size)
        return fsp_get_usable_lowmem_top(gd->arch.hob_list);
 }
 
-unsigned install_e820_map(unsigned max_entries, struct e820entry *entries)
+unsigned int install_e820_map(unsigned int max_entries,
+                             struct e820entry *entries)
 {
-       unsigned num_entries = 0;
+       unsigned int num_entries = 0;
        const struct hob_header *hdr;
        struct hob_res_desc *res_desc;
 
@@ -92,5 +93,17 @@ unsigned install_e820_map(unsigned max_entries, struct e820entry *entries)
        entries[num_entries].type = E820_RESERVED;
        num_entries++;
 
+#ifdef CONFIG_HAVE_ACPI_RESUME
+       /*
+        * Everything between U-Boot's stack and ram top needs to be
+        * reserved in order for ACPI S3 resume to work.
+        */
+       entries[num_entries].addr = gd->start_addr_sp - CONFIG_STACK_SIZE;
+       entries[num_entries].size = gd->ram_top - gd->start_addr_sp + \
+               CONFIG_STACK_SIZE;
+       entries[num_entries].type = E820_RESERVED;
+       num_entries++;
+#endif
+
        return num_entries;
 }