From 23b5f7c09292256f1b40572a24451778d918330d Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Wed, 2 Aug 2017 14:33:16 -0700 Subject: colibri_imx7: carve out PMD aligned amount of memory If the Cortex-M4 is running we carve out 1MiB of memory for rpmsg communication and/or the firmware running from DDR. On the Colibri iMX7D this area is in the middle of its 512MiB of memory. Linux seems not to handle the sparse memory area well and shows only the first 254MiB of memory as available. Enabling highmem seems to work around this issue. However, enabling highmem is not ideal since memory from the highmem area is more restricted then lowmem. Aligning the carved out memory to ARM Linux' PMD (page middle directory) size of 2MiB seem to allow allocating all available memory as lowmem. Hence increase the carveout region to 2MiB. Signed-off-by: Stefan Agner Acked-by: Marcel Ziswiler --- board/toradex/colibri_imx7/colibri_imx7.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'board/toradex/colibri_imx7/colibri_imx7.c') diff --git a/board/toradex/colibri_imx7/colibri_imx7.c b/board/toradex/colibri_imx7/colibri_imx7.c index 22dd61b0d4..0a2c121a57 100644 --- a/board/toradex/colibri_imx7/colibri_imx7.c +++ b/board/toradex/colibri_imx7/colibri_imx7.c @@ -408,7 +408,7 @@ ulong board_get_usable_ram_top(ulong total_size) { /* Reserve last 1MiB for M4 on modules with 256MiB RAM */ if (gd->ram_size == SZ_256M) - return gd->ram_top - SZ_1M; + return gd->ram_top - SZ_2M; else return gd->ram_top; } @@ -438,7 +438,7 @@ int ft_board_setup(void *blob, bd_t *bd) * alignment for Linux due to MMU section size restrictions). */ start[0] = gd->bd->bi_dram[0].start; - size[0] = SZ_256M - SZ_1M; + size[0] = SZ_256M - SZ_2M; /* If needed, create a second entry for memory beyond 256M */ if (gd->bd->bi_dram[0].size > SZ_256M) { -- cgit v1.2.3