From 6265921fbeebcf9aea599dedf9d8d1ca77012a94 Mon Sep 17 00:00:00 2001 From: Anup Patel Date: Fri, 8 Feb 2019 14:20:46 +0530 Subject: [PATCH] bbl: Have more gap between DTB destination and payload_end Latest Linux 5.0-rc2 and above have BSS section moved to the end to reduce kernel flat image size by 1MB and kernel clears the BSS section very early in head.S. Currently, BBL places DTB at the next 2MB aligned address after payload_end. The 2MB is not sufficient if BSS section grows by increasing drivers enabled in Linux kernel. It is likely that with more drivers enabled the Linux kernel early boot-up code will clear DTB overlapping with BSS section. This patch updates dtb_output() to have more gap between DTB destination and payload_end. Signed-off-by: Anup Patel --- bbl/bbl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bbl/bbl.c b/bbl/bbl.c index ce1be95d..b6b521b4 100644 --- a/bbl/bbl.c +++ b/bbl/bbl.c @@ -24,7 +24,7 @@ static uintptr_t dtb_output() * thus mandating device-tree is in physical memory after the kernel. */ uintptr_t end = kernel_end ? (uintptr_t)kernel_end : (uintptr_t)&_payload_end; - return (end + MEGAPAGE_SIZE - 1) / MEGAPAGE_SIZE * MEGAPAGE_SIZE; + return (end + 16 * MEGAPAGE_SIZE - 1) / MEGAPAGE_SIZE * MEGAPAGE_SIZE; } static void filter_dtb(uintptr_t source)