diff mbox

[U-Boot,v5,3/7] ls2080ardb: Reserve DP-DDR RAM

Message ID 1476525795-27483-4-git-send-email-agraf@suse.de
State Superseded
Delegated to: Alexander Graf
Headers show

Commit Message

Alexander Graf Oct. 15, 2016, 10:03 a.m. UTC
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>
---
 board/freescale/ls2080ardb/ls2080ardb.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

York Sun Oct. 15, 2016, 4:48 p.m. UTC | #1
On 10/15/2016 03:03 AM, Alexander Graf wrote:
> 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>
> ---
>  board/freescale/ls2080ardb/ls2080ardb.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/board/freescale/ls2080ardb/ls2080ardb.c b/board/freescale/ls2080ardb/ls2080ardb.c
> index fab44b9..55199ca 100644
> --- a/board/freescale/ls2080ardb/ls2080ardb.c
> +++ b/board/freescale/ls2080ardb/ls2080ardb.c
> @@ -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");
>
> +#ifdef CONFIG_EFI_LOADER
> +	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;
>  }
>
>
Reviewed-by: York Sun <york.sun@nxp.com>
diff mbox

Patch

diff --git a/board/freescale/ls2080ardb/ls2080ardb.c b/board/freescale/ls2080ardb/ls2080ardb.c
index fab44b9..55199ca 100644
--- a/board/freescale/ls2080ardb/ls2080ardb.c
+++ b/board/freescale/ls2080ardb/ls2080ardb.c
@@ -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");
 
+#ifdef CONFIG_EFI_LOADER
+	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;
 }