summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevarsh Thakkar <devarsht@ti.com>2024-03-05 18:14:10 +0530
committerFrancesco Dolcini <francesco.dolcini@toradex.com>2024-03-21 14:26:33 +0000
commitdc05846ff29e6442579f03beb16648acf0cd8618 (patch)
tree031f01ff79a08eda6b59eda75d1a8ef48eda7a91
parent5a3055dad3b5acc883fd2b2cc2222d1c34d3d7f2 (diff)
board: ti: am62x: am62px: evm: Update simple-framebuffer node in device-tree
Update simple-framebuffer device-tree node by enumerating framebuffer related information in existing simple-framebuffer node in Linux device-tree file and enabling it. While at it, ignore error return value for framebuffer related DT node updates as a non-zero return value for ft_board_setup is treated as a fatal error causing board reset. In case there is no simple-framebuffer stub detected in Linux kernel device-tree and video is still active, then update the device-tree to reserve the framebuffer region for the active splash screen. This helps preserve the splash screen till the display server takes over after OS is booted. In case the simplefb node update or the framebuffer reservation fails we treat it as a non-fatal error and avoid returning error to parent function as the non-zero return value of ft_board_setup is treated as fatal error which leads to board reset Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
-rw-r--r--board/ti/am62px/evm.c21
-rw-r--r--board/ti/am62x/evm.c21
2 files changed, 42 insertions, 0 deletions
diff --git a/board/ti/am62px/evm.c b/board/ti/am62px/evm.c
index 5ab56260a4..060c150b56 100644
--- a/board/ti/am62px/evm.c
+++ b/board/ti/am62px/evm.c
@@ -12,6 +12,7 @@
#include <cpu_func.h>
#include <dm/uclass.h>
#include <env.h>
+#include <fdt_simplefb.h>
#include <fdt_support.h>
#include <spl.h>
#include <splash.h>
@@ -83,3 +84,23 @@ void spl_board_init(void)
splash_display();
}
#endif
+
+#if defined(CONFIG_OF_BOARD_SETUP)
+int ft_board_setup(void *blob, struct bd_info *bd)
+{
+ int ret = -1;
+
+ if (IS_ENABLED(CONFIG_VIDEO)) {
+ if (IS_ENABLED(CONFIG_FDT_SIMPLEFB))
+ ret = fdt_simplefb_enable_and_mem_rsv(blob);
+
+ /* If simplefb is not enabled and video is active, then at least reserve
+ * the framebuffer region to preserve the splash screen while OS is booting
+ */
+ if (ret && video_is_active())
+ fdt_add_fb_mem_rsv(blob);
+ }
+
+ return 0;
+}
+#endif
diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c
index 6a5a7804b1..9146361b3a 100644
--- a/board/ti/am62x/evm.c
+++ b/board/ti/am62x/evm.c
@@ -15,6 +15,7 @@
#include <splash.h>
#include <cpu_func.h>
#include <k3-ddrss.h>
+#include <fdt_simplefb.h>
#include <fdt_support.h>
#include <asm/io.h>
#include <asm/arch/hardware.h>
@@ -400,3 +401,23 @@ int board_late_init(void)
return 0;
}
#endif
+
+#if defined(CONFIG_OF_BOARD_SETUP)
+int ft_board_setup(void *blob, struct bd_info *bd)
+{
+ int ret = -1;
+
+ if (IS_ENABLED(CONFIG_VIDEO)) {
+ if (IS_ENABLED(CONFIG_FDT_SIMPLEFB))
+ ret = fdt_simplefb_enable_and_mem_rsv(blob);
+
+ /* If simplefb is not enabled and video is active, then at least reserve
+ * the framebuffer region to preserve the splash screen while OS is booting
+ */
+ if (ret && video_is_active())
+ fdt_add_fb_mem_rsv(blob);
+ }
+
+ return 0;
+}
+#endif