[PATCH v1 0/1] rpi: Cleanup conditional compilation of framebuffer

If CONFIG_FDT_SIMPLEFB is not set fdt_simplefb.c will not be compiled which results in a compilation error if CONFIG_OF_BOARD_SETUP is enabled. This patch will fix this error by not trying to setup a framebuffer node in this case.
Martin Stolpe (1): rpi: Only add frame buffer node if CONFIG_FDT_SIMPLEFB is set
board/raspberrypi/rpi/rpi.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)

The functions fdt_simplefb_add_node and fdt_simplefb_enable_and_mem_rsv are only available if CONFIG_FDT_SIMPLEFB is enabled.
Signed-off-by: Martin Stolpe martin.stolpe@gmail.com ---
board/raspberrypi/rpi/rpi.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index ab5ea85cf9..47db441696 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -569,11 +569,13 @@ int ft_board_setup(void *blob, struct bd_info *bd)
update_fdt_from_fw(blob, (void *)fw_dtb_pointer);
- node = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer"); - if (node < 0) - fdt_simplefb_add_node(blob); - else - fdt_simplefb_enable_and_mem_rsv(blob); + if (CONFIG_IS_ENABLED(FDT_SIMPLEFB)) { + node = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer"); + if (node < 0) + fdt_simplefb_add_node(blob); + else + fdt_simplefb_enable_and_mem_rsv(blob); + }
#ifdef CONFIG_EFI_LOADER /* Reserve the spin table */

On 23/10/2024 15:09, Martin Stolpe wrote:
The functions fdt_simplefb_add_node and fdt_simplefb_enable_and_mem_rsv are only available if CONFIG_FDT_SIMPLEFB is enabled.
Signed-off-by: Martin Stolpe martin.stolpe@gmail.com
Acked-by: Matthias Brugger mbrugger@suse.com
board/raspberrypi/rpi/rpi.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index ab5ea85cf9..47db441696 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -569,11 +569,13 @@ int ft_board_setup(void *blob, struct bd_info *bd)
update_fdt_from_fw(blob, (void *)fw_dtb_pointer);
- node = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer");
- if (node < 0)
fdt_simplefb_add_node(blob);
- else
fdt_simplefb_enable_and_mem_rsv(blob);
if (CONFIG_IS_ENABLED(FDT_SIMPLEFB)) {
node = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer");
if (node < 0)
fdt_simplefb_add_node(blob);
else
fdt_simplefb_enable_and_mem_rsv(blob);
}
#ifdef CONFIG_EFI_LOADER /* Reserve the spin table */

Hi Martin,
The functions fdt_simplefb_add_node and fdt_simplefb_enable_and_mem_rsv are only available if CONFIG_FDT_SIMPLEFB is enabled.
Is this a follow up on the patch [1] you sent a month ago? If so it's not really a v1, and you should add a chnagelog as to what's changed as well as cc: the people that provided feedback.
[1] https://lists.denx.de/pipermail/u-boot/2024-September/565514.html
Signed-off-by: Martin Stolpe martin.stolpe@gmail.com
board/raspberrypi/rpi/rpi.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index ab5ea85cf9..47db441696 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -569,11 +569,13 @@ int ft_board_setup(void *blob, struct bd_info *bd)
update_fdt_from_fw(blob, (void *)fw_dtb_pointer);
node = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer");
if (node < 0)
fdt_simplefb_add_node(blob);
else
fdt_simplefb_enable_and_mem_rsv(blob);
if (CONFIG_IS_ENABLED(FDT_SIMPLEFB)) {
node = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer");
if (node < 0)
fdt_simplefb_add_node(blob);
else
fdt_simplefb_enable_and_mem_rsv(blob);
}
#ifdef CONFIG_EFI_LOADER /* Reserve the spin table */ -- 2.43.0

On 24/10/2024 13:29, Peter Robinson wrote:
Hi Martin,
Is this a follow up on the patch [1] you sent a month ago? If so it's not really a v1, and you should add a chnagelog as to what's changed as well as cc: the people that provided feedback.
[1] https://lists.denx.de/pipermail/u-boot/2024-September/565514.html
It's related but I would say it's separate. The problem before was, that when CONFIG_VIDEO was disabled and CONFIG_FDT_SIMPLEFB was enabled the compilation would fail with the following error message: undefined reference to `fdt_simplefb_enable_and_mem_rsv'
This was fixed by making CONFIG_VIDEO a dependency of CONFIG_FDT_SIMPLEFB in 392ff1449f7d30cc48fd4d17320d05882cd68f2e.
What this patch does is fix the following compilation error in case CONFIG_OF_BOARD_SETUP is enabled and both CONFIG_FDT_SIMPLEFB and CONFIG_VIDEO are disabled: undefined reference to `fdt_simplefb_add_node'
BR
Martin
participants (3)
-
Martin Stolpe
-
Matthias Brugger
-
Peter Robinson