When passing framebuffer address using bloblist, check
that passed address is overlapping with current relocation
address, if so move the relocation address after the framebuffer
region to avoid overlap.

Fixes: 5bc610a7d9d ("common: board_f: Pass frame buffer info from
SPL to u-boot")
Signed-off-by: Devarsh Thakkar <devar...@ti.com>
---
 common/board_f.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/common/board_f.c b/common/board_f.c
index 7d2c380e91..20fa17207a 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -419,7 +419,10 @@ static int reserve_video(void)
                if (!ho)
                        return log_msg_ret("blf", -ENOENT);
                video_reserve_from_bloblist(ho);
-               gd->relocaddr = ho->fb;
+               /* Relocate after framebuffer area to avoid overlap */
+               if (gd->relocaddr > (unsigned long)ho->fb)
+                       gd->relocaddr = ho->fb;
+
        } else if (CONFIG_IS_ENABLED(VIDEO)) {
                ulong addr;
                int ret;
-- 
2.34.1

Reply via email to