summaryrefslogtreecommitdiff
path: root/boot/fdt_support.c
diff options
context:
space:
mode:
authorDevarsh Thakkar <devarsht@ti.com>2024-02-22 18:38:10 +0530
committerAnatolij Gustschin <agust@denx.de>2024-04-21 09:07:02 +0200
commitefe1ceec7ef0c2ce2344dbe066fca0d389a0b4f3 (patch)
treecde9e85a76794dc9d18c5afb9a60f38af95f9c86 /boot/fdt_support.c
parent4ac7ffb60ee9a342337dce6e4fda3cbac827c398 (diff)
boot: Move framebuffer reservation to separate helper
Create separate helper for just reserving framebuffer region without creating or enabling simple-framebuffer node. This is useful for scenarios where user want to preserve the bootloader splash screen till OS boots up and display server gets started without displaying anything else in between and thus not requiring simple-framebuffer. Signed-off-by: Devarsh Thakkar <devarsht@ti.com> Reviewed-by: Nikhil M Jain <n-jain1@ti.com>
Diffstat (limited to 'boot/fdt_support.c')
-rw-r--r--boot/fdt_support.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/boot/fdt_support.c b/boot/fdt_support.c
index 9844c70be80..2bd80a9dfb1 100644
--- a/boot/fdt_support.c
+++ b/boot/fdt_support.c
@@ -23,6 +23,9 @@
#include <exports.h>
#include <fdtdec.h>
#include <version.h>
+#include <video.h>
+
+DECLARE_GLOBAL_DATA_PTR;
/**
* fdt_getprop_u32_default_node - Return a node's property or a default
@@ -2043,6 +2046,24 @@ int fdt_setup_simplefb_node(void *fdt, int node, u64 base_address, u32 width,
return 0;
}
+#if CONFIG_IS_ENABLED(VIDEO)
+int fdt_add_fb_mem_rsv(void *blob)
+{
+ struct fdt_memory mem;
+
+ /* nothing to do when the frame buffer is not defined */
+ if (gd->video_bottom == gd->video_top)
+ return 0;
+
+ /* reserved with no-map tag the video buffer */
+ mem.start = gd->video_bottom;
+ mem.end = gd->video_top - 1;
+
+ return fdtdec_add_reserved_memory(blob, "framebuffer", &mem, NULL, 0, NULL,
+ FDTDEC_RESERVED_MEMORY_NO_MAP);
+}
+#endif
+
/*
* Update native-mode in display-timings from display environment variable.
* The node to update are specified by path.