]> Git Repo - J-u-boot.git/blobdiff - arch/x86/lib/fsp/fsp_dram.c
x86: Rename e820entry to e820_entry
[J-u-boot.git] / arch / x86 / lib / fsp / fsp_dram.c
index e51ca96eb712fa514384cbe81278e4b5c091964d..662d4ace21612e78e5ab7def9887da22f3dfea92 100644 (file)
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <asm/fsp/fsp_support.h>
 #include <asm/e820.h>
+#include <asm/mrccache.h>
 #include <asm/post.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -32,13 +33,20 @@ int dram_init(void)
        gd->ram_size = ram_size;
        post_code(POST_DRAM);
 
+#ifdef CONFIG_ENABLE_MRC_CACHE
+       gd->arch.mrc_output = fsp_get_nvs_data(gd->arch.hob_list,
+                                              &gd->arch.mrc_output_len);
+#endif
+
        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;
 }
 
 /*
@@ -54,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 e820_entry *entries)
 {
-       unsigned num_entries = 0;
+       unsigned int num_entries = 0;
        const struct hob_header *hdr;
        struct hob_res_desc *res_desc;
 
@@ -84,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;
 }
This page took 0.026568 seconds and 4 git commands to generate.