diff mbox series

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

Message ID 20241023131012.2445564-2-martin.stolpe@gmail.com
State New
Delegated to: Peter Robinson
Headers show
Series rpi: Cleanup conditional compilation of framebuffer | expand

Commit Message

Martin Stolpe Oct. 23, 2024, 1:09 p.m. UTC
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(-)

Comments

Matthias Brugger Oct. 23, 2024, 3:42 p.m. UTC | #1
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 */
Peter Robinson Oct. 24, 2024, 11:29 a.m. UTC | #2
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
>
Martin Stolpe Oct. 28, 2024, 8:58 a.m. UTC | #3
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
diff mbox series

Patch

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 */