summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/fdt_simplefb.c12
-rw-r--r--common/fdt_support.c21
-rw-r--r--include/fdt_support.h2
3 files changed, 24 insertions, 11 deletions
diff --git a/common/fdt_simplefb.c b/common/fdt_simplefb.c
index c50cd7a66f..2c0ff5d5f9 100644
--- a/common/fdt_simplefb.c
+++ b/common/fdt_simplefb.c
@@ -102,7 +102,6 @@ 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 */
@@ -113,15 +112,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
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.
diff --git a/include/fdt_support.h b/include/fdt_support.h
index 5638bd4f16..de687bfed9 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -395,6 +395,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);