From: Devarsh Thakkar <devarsht@ti.com>
To: <u-boot@lists.denx.de>, <sjg@chromium.org>, <agust@denx.de>,
<trini@konsulko.com>
Cc: <bmeng@tinylab.org>, <xypron.glpk@gmx.de>,
<patrick.delaunay@foss.st.com>, <patrice.chotard@foss.st.com>,
<hvilleneuve@dimonoff.com>, <michal.simek@amd.com>,
<troykiskyboundary@gmail.com>, <j-humphreys@ti.com>, <afd@ti.com>,
<praneeth@ti.com>, <nm@ti.com>, <vigneshr@ti.com>,
<a-bhatia1@ti.com>, <j-luthra@ti.com>, <nsekhar@ti.com>,
<n-jain1@ti.com>, <devarsht@ti.com>
Subject: [PATCH 3/4] boot: Move framebuffer reservation to separate helper
Date: Thu, 22 Feb 2024 18:38:10 +0530 [thread overview]
Message-ID: <20240222130811.3878567-4-devarsht@ti.com> (raw)
In-Reply-To: <20240222130811.3878567-1-devarsht@ti.com>
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>
---
boot/fdt_simplefb.c | 12 +-----------
boot/fdt_support.c | 21 +++++++++++++++++++++
include/fdt_support.h | 2 ++
3 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/boot/fdt_simplefb.c b/boot/fdt_simplefb.c
index b0221eaf2a..837920bd3a 100644
--- a/boot/fdt_simplefb.c
+++ b/boot/fdt_simplefb.c
@@ -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
diff --git a/boot/fdt_support.c b/boot/fdt_support.c
index 090d82ee80..07aa7337e8 100644
--- a/boot/fdt_support.c
+++ b/boot/fdt_support.c
@@ -22,6 +22,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
@@ -2042,6 +2045,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 25600d62f2..4b71b8948d 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -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);
--
2.34.1
next prev parent reply other threads:[~2024-02-22 13:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-22 13:08 [PATCH 0/4] Simplefb and fb reservation related updates Devarsh Thakkar
2024-02-22 13:08 ` [PATCH 1/4] boot: fdt_simplefb: Enumerate framebuffer info from video handoff Devarsh Thakkar
2024-03-06 10:42 ` Nikhil Jain
2024-02-22 13:08 ` [PATCH 2/4] video: Assume video to be active if SPL is passing video hand-off Devarsh Thakkar
2024-03-06 10:46 ` Nikhil Jain
2024-02-22 13:08 ` Devarsh Thakkar [this message]
2024-03-06 10:51 ` [PATCH 3/4] boot: Move framebuffer reservation to separate helper Nikhil Jain
2024-02-22 13:08 ` [PATCH 4/4] board: ti: am62x: evm: Update simple-framebuffer node in device-tree Devarsh Thakkar
2024-03-05 10:28 ` Devarsh Thakkar
2024-03-08 11:08 ` [PATCH 0/4] Simplefb and fb reservation related updates Devarsh Thakkar
2024-04-05 14:49 ` Devarsh Thakkar
2024-04-20 23:09 ` Anatolij Gustschin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240222130811.3878567-4-devarsht@ti.com \
--to=devarsht@ti.com \
--cc=a-bhatia1@ti.com \
--cc=afd@ti.com \
--cc=agust@denx.de \
--cc=bmeng@tinylab.org \
--cc=hvilleneuve@dimonoff.com \
--cc=j-humphreys@ti.com \
--cc=j-luthra@ti.com \
--cc=michal.simek@amd.com \
--cc=n-jain1@ti.com \
--cc=nm@ti.com \
--cc=nsekhar@ti.com \
--cc=patrice.chotard@foss.st.com \
--cc=patrick.delaunay@foss.st.com \
--cc=praneeth@ti.com \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=troykiskyboundary@gmail.com \
--cc=u-boot@lists.denx.de \
--cc=vigneshr@ti.com \
--cc=xypron.glpk@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox