]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
boot: Move framebuffer reservation to separate helper
authorDevarsh Thakkar <devarsht@ti.com>
Thu, 22 Feb 2024 13:08:10 +0000 (18:38 +0530)
committerAnatolij Gustschin <agust@denx.de>
Sun, 21 Apr 2024 07:07:02 +0000 (09:07 +0200)
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>
boot/fdt_simplefb.c
boot/fdt_support.c
include/fdt_support.h

index b0221eaf2ab9edfdba6a2d4bf45fd8b54f804f4b..837920bd3a33fe939426d614fa7cbecd4fb2c009 100644 (file)
@@ -107,7 +107,6 @@ static int fdt_simplefb_enable_existing_node(void *blob)
 #if IS_ENABLED(CONFIG_VIDEO)
 int fdt_simplefb_enable_and_mem_rsv(void *blob)
 {
-       struct fdt_memory mem;
        int ret;
 
        /* nothing to do when video is not active */
@@ -118,15 +117,6 @@ int fdt_simplefb_enable_and_mem_rsv(void *blob)
        if (ret)
                return ret;
 
-       /* 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);
+       return fdt_add_fb_mem_rsv(blob);
 }
 #endif
index 9844c70be8061f59b1a61baf5b236445b29224bb..2bd80a9dfb18e5d0fcb5605d9e1bce0ff53fdbb6 100644 (file)
@@ -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.
index 25600d62f2915b78731a87074674caa1dcf45d81..4b71b8948d99c9bccaa8f5383b5985ec9ad0be2d 100644 (file)
@@ -423,6 +423,8 @@ int arch_fixup_memory_node(void *blob);
 int fdt_setup_simplefb_node(void *fdt, int node, u64 base_address, u32 width,
                            u32 height, u32 stride, const char *format);
 
+int fdt_add_fb_mem_rsv(void *blob);
+
 int fdt_overlay_apply_verbose(void *fdt, void *fdto);
 
 int fdt_valid(struct fdt_header **blobp);