summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2020-08-12 12:17:53 +0200
committerMichal Simek <michal.simek@xilinx.com>2020-08-20 09:58:16 +0200
commit2570cc6430cf191b2b0f71b9dcfed46c94a645dc (patch)
treeaa0e6c1b675f4b68315f2bc54abc76e224fd9d4d
parentca0f616530316f324516fd91a2d90e0449f1e526 (diff)
downloadu-boot-2570cc6430cf191b2b0f71b9dcfed46c94a645dc.tar.gz
u-boot-2570cc6430cf191b2b0f71b9dcfed46c94a645dc.tar.xz
u-boot-2570cc6430cf191b2b0f71b9dcfed46c94a645dc.zip
xilinx: common: Change bootm_size variable setting
Linux kernel for arm32 requires dtb and initrd to be placed in low memory to work properly. This requirement is described in chapter 4b) and 5) in Linux documentation (Documentation/arm/booting.rst). There is an issue on arm32 with 2GB of memory that bootm_size is bigger than Linux lowmem (for example with VMSPLIT_3G). That's why limit bootm size on these systems not to be above 768MB. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
-rw-r--r--board/xilinx/common/board.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c
index 581c88ad49..eab389d049 100644
--- a/board/xilinx/common/board.c
+++ b/board/xilinx/common/board.c
@@ -78,11 +78,15 @@ void *board_fdt_blob_setup(void)
int board_late_init_xilinx(void)
{
u32 ret = 0;
+ phys_size_t bootm_size = gd->ram_size;
+
+ if (CONFIG_IS_ENABLED(ARCH_ZYNQ))
+ bootm_size = min(bootm_size, (phys_size_t)(SZ_512M + SZ_256M));
ret |= env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET);
ret |= env_set_addr("bootm_low", (void *)gd->ram_base);
- ret |= env_set_addr("bootm_size", (void *)gd->ram_size);
+ ret |= env_set_addr("bootm_size", (void *)bootm_size);
if (ret)
printf("%s: Saving run time variables FAILED\n", __func__);