]> git.sur5r.net Git - u-boot/commitdiff
ls2080ardb: Reserve DP-DDR RAM
authorAlexander Graf <agraf@suse.de>
Thu, 17 Nov 2016 00:02:59 +0000 (01:02 +0100)
committerAlexander Graf <agraf@suse.de>
Thu, 17 Nov 2016 13:18:55 +0000 (14:18 +0100)
The DP-DDR shouldn't be exposed as conventional memory to an OS, so let's
rather claim it's a reserved region in the EFI memory map

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: York Sun <york.sun@nxp.com>
board/freescale/ls2080ardb/ls2080ardb.c

index fab44b96baac7f6507bb14b0a3ce02705139f273..02954ef6d760964a04a1c4d69b9572132ec757ad 100644 (file)
@@ -15,6 +15,7 @@
 #include <libfdt.h>
 #include <fsl-mc/fsl_mc.h>
 #include <environment.h>
+#include <efi_loader.h>
 #include <i2c.h>
 #include <asm/arch/soc.h>
 #include <fsl_sec.h>
@@ -201,6 +202,14 @@ int misc_init_r(void)
        if (adjust_vdd(0))
                printf("Warning: Adjusting core voltage failed.\n");
 
+#if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD)
+       if (soc_has_dp_ddr() && gd->bd->bi_dram[2].size) {
+               efi_add_memory_map(gd->bd->bi_dram[2].start,
+                                  gd->bd->bi_dram[2].size >> EFI_PAGE_SHIFT,
+                                  EFI_RESERVED_MEMORY_TYPE, false);
+       }
+#endif
+
        return 0;
 }