x86: acpi: Use an API to get the ACPI RSDP table address
[oweals/u-boot.git] / arch / x86 / lib / fsp / fsp_dram.c
index fcfe693ce5faec87e45aacec09c3f2a3d73850f3..1a7af576d549c55c06b930bad34eb60c3b383a44 100644 (file)
@@ -41,10 +41,12 @@ int dram_init(void)
        return 0;
 }
 
-void dram_init_banksize(void)
+int dram_init_banksize(void)
 {
        gd->bd->bi_dram[0].start = 0;
        gd->bd->bi_dram[0].size = gd->ram_size;
+
+       return 0;
 }
 
 /*
@@ -90,5 +92,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;
 }