From dc05846ff29e6442579f03beb16648acf0cd8618 Mon Sep 17 00:00:00 2001 From: Devarsh Thakkar Date: Tue, 5 Mar 2024 18:14:10 +0530 Subject: 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 --- board/ti/am62px/evm.c | 21 +++++++++++++++++++++ board/ti/am62x/evm.c | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) 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 #include #include +#include #include #include #include @@ -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 #include #include +#include #include #include #include @@ -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 -- cgit v1.2.3