Skip to contentSkip to conversation

rpi: Cleanup conditional compilation of framebuffer

PATCH In review Martin Stolpe 3 participants 5 messages Oct 23, 2024 – Oct 28, 2024 Broadcom BCM2711/BCM2835 Arm architecture

lore
Share & tools
lore
#0 lore raw

cover 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(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/1 rpi: Only add frame buffer node if CONFIG_FDT_SIMPLEFB is set

The functions fdt_simplefb_add_node and fdt_simplefb_enable_and_mem_rsv are only available if CONFIG_FDT_SIMPLEFB is enabled.

---

 board/raspberrypi/rpi/rpi.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
board/raspberrypi/rpi/rpi.c +7 -5
index ab5ea85cf9..47db441696 100644
@@ -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 */
Signature · 1 line
2.43.0
Acked-by on v1 1/1
#2 lore raw

Re: [PATCH v1 1/1] rpi: Only add frame buffer node if CONFIG_FDT_SIMPLEFB is set

Quoted 4 lines · Martin Stolpe

The functions fdt_simplefb_add_node and fdt_simplefb_enable_and_mem_rsv are only available if CONFIG_FDT_SIMPLEFB is enabled.

Quoted 28 lines

---

  board/raspberrypi/rpi/rpi.c | 12 +++++++-----
  1 file changed, 7 insertions(+), 5 deletions(-)
board/raspberrypi/rpi/rpi.c +7 -5
index ab5ea85cf9..47db441696 100644
@@ -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 */
#3 lore raw

Re: [PATCH v1 1/1] rpi: Only add frame buffer node if CONFIG_FDT_SIMPLEFB is set

In reply to Martin Stolpe

Hi Martin,

Quoted 2 lines

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

Quoted 32 lines

---

 board/raspberrypi/rpi/rpi.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
board/raspberrypi/rpi/rpi.c +7 -6
index ab5ea85cf9..47db441696 100644
@@ -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

#4 lore raw

Re: [PATCH v1 1/1] rpi: Only add frame buffer node if CONFIG_FDT_SIMPLEFB is set

Quoted 7 lines · Peter Robinson

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