From 6b2f0383012c4b20526265f523e274b82d116979 Mon Sep 17 00:00:00 2001 From: Ye Li Date: Thu, 7 Mar 2019 20:06:04 -0800 Subject: [PATCH] MLK-16049 imx8qm/qxp: Add support for reserving DDR memory for M4 We assign the DDR memory from 0x88000000 to 0x8FFFFFFF to M4 on QM and QXP. The M4 can allocate this memory by two ways, in SCD or u-boot. In this patch, u-boot addes the memory reserve node to DTB to pass the info to kernel, no matter the M4 memory is reserved in SCD or u-boot. So kernel won't access M4 reserved memory. Signed-off-by: Ye Li --- arch/arm/mach-imx/imx8/cpu.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c index 18bd33ef94..7361dbc042 100644 --- a/arch/arm/mach-imx/imx8/cpu.c +++ b/arch/arm/mach-imx/imx8/cpu.c @@ -20,6 +20,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -455,6 +456,22 @@ int mmc_get_env_dev(void) } #endif +#ifdef CONFIG_OF_SYSTEM_SETUP +int ft_system_setup(void *blob, bd_t *bd) +{ +#ifdef BOOTAUX_RESERVED_MEM_BASE + int off; + off = fdt_add_mem_rsv(blob, BOOTAUX_RESERVED_MEM_BASE, + BOOTAUX_RESERVED_MEM_SIZE); + if (off < 0) + printf("Failed to reserve memory for bootaux: %s\n", + fdt_strerror(off)); +#endif + + return 0; +} +#endif + #define MEMSTART_ALIGNMENT SZ_2M /* Align the memory start with 2MB */ static int get_owned_memreg(sc_rm_mr_t mr, sc_faddr_t *addr_start, -- 2.17.1