summaryrefslogtreecommitdiff
path: root/common/fdt_support.c
diff options
context:
space:
mode:
authorDevarsh Thakkar <devarsht@ti.com>2024-03-05 18:14:09 +0530
committerFrancesco Dolcini <francesco.dolcini@toradex.com>2024-03-21 14:26:33 +0000
commit5a3055dad3b5acc883fd2b2cc2222d1c34d3d7f2 (patch)
treee26bd712562b1548f264bc0ec92619d17d74f87e /common/fdt_support.c
parent3065e171cb9c12effdf5c1960b2db7664f6a99a5 (diff)
common: 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>
Diffstat (limited to 'common/fdt_support.c')
-rw-r--r--common/fdt_support.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/common/fdt_support.c b/common/fdt_support.c
index dbceec6f2d..0e2f12bd09 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -21,6 +21,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
@@ -1970,6 +1973,24 @@ int fdt_setup_simplefb_node(void *fdt, int node, u64 base_address, u32 width,
return 0;
}
+#if IS_ENABLED(CONFIG_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.