diff options
-rw-r--r-- | common/fdt_simplefb.c | 27 | ||||
-rw-r--r-- | include/fdt_simplefb.h | 1 |
2 files changed, 28 insertions, 0 deletions
diff --git a/common/fdt_simplefb.c b/common/fdt_simplefb.c index 32173030ab7..c52846f4bc5 100644 --- a/common/fdt_simplefb.c +++ b/common/fdt_simplefb.c @@ -89,3 +89,30 @@ int fdt_simplefb_enable_existing_node(void *blob) return fdt_simplefb_configure_node(blob, off); } + +#if CONFIG_IS_ENABLED(DM_VIDEO) +int fdt_simplefb_enable_and_mem_rsv(void *blob) +{ + struct fdt_memory mem; + int ret; + + /* nothing to do when video is not active */ + if (!video_is_active()) + return 0; + + ret = fdt_simplefb_enable_existing_node(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); +} +#endif diff --git a/include/fdt_simplefb.h b/include/fdt_simplefb.h index 7e547235912..41cd740ac05 100644 --- a/include/fdt_simplefb.h +++ b/include/fdt_simplefb.h @@ -10,4 +10,5 @@ #define _FDT_SIMPLEFB_H_ int fdt_simplefb_add_node(void *blob); int fdt_simplefb_enable_existing_node(void *blob); +int fdt_simplefb_enable_and_mem_rsv(void *blob); #endif |