From patchwork Thu Jun 11 11:10:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 242131 List-Id: U-Boot discussion From: michal.simek at xilinx.com (Michal Simek) Date: Thu, 11 Jun 2020 13:10:54 +0200 Subject: [PATCH v2] common: fdt: Remove additional 4k space for fdt allocation Message-ID: From: Ashok Reddy Soma There is no technical reason to add additional 4k space for FDT. This space is completely unused and just increase memory requirements. This is problematic on systems with limited memory resources as Xilinx Zynq CSE/ZynqMP mini and Versal mini configurations. The patch is removing additional 4k space and also increasing alignment to 64 to be aligned with 64bit systems. EFI code is using copy_fdt() which copy FDT to different location. And all boot commands in case of using U-Boot's FDT pointed by $fdtcontroladdr are copying FDT to different locations by image_setup_libfdt(). That's why in proper flow none should modified DTB used by U-Boot that's why there is no need for additional space. Signed-off-by: Ashok Reddy Soma Signed-off-by: Michal Simek --- Changes in v2: - Change subject (was: common: Add Kconfig option for FDT mem alignment) - Remove Kconfig symbol - Extend description I have tested it on zcu104 --- common/board_f.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/board_f.c b/common/board_f.c index 01194eaa0e4d..7e99b2425a62 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -537,7 +537,7 @@ static int reserve_fdt(void) * will be relocated with other data. */ if (gd->fdt_blob) { - gd->fdt_size = ALIGN(fdt_totalsize(gd->fdt_blob) + 0x1000, 32); + gd->fdt_size = ALIGN(fdt_totalsize(gd->fdt_blob), 64); gd->start_addr_sp = reserve_stack_aligned(gd->fdt_size); gd->new_fdt = map_sysmem(gd->start_addr_sp, gd->fdt_size);