diff mbox series

[06/35] arm: friendlyarm: Avoid accessing global_data fb_base

Message ID 20240724150922.2343249-7-sjg@chromium.org
State Changes Requested
Delegated to: Tom Rini
Headers show
Series global_data: Reduce size of struct global_data | expand

Commit Message

Simon Glass July 24, 2024, 3:08 p.m. UTC
Use the new video function to get the framebuffer base.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 board/friendlyarm/nanopi2/board.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Comments

Stefan Bosch July 29, 2024, 5:57 p.m. UTC | #1
Hi Simon,

On 24.07.24 17:08, Simon Glass wrote:
> Use the new video function to get the framebuffer base.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---

Tested-by: Stefan Bosch <stefan_b@posteo.net>

Looks OK, tested on FriendlyElec-Board NanoPC-T2 
(s5p4418_nanopi2_defconfig).

Thanks!

> 
>   board/friendlyarm/nanopi2/board.c | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/board/friendlyarm/nanopi2/board.c b/board/friendlyarm/nanopi2/board.c
> index c8cbc5a15fa..b32dfc6b570 100644
> --- a/board/friendlyarm/nanopi2/board.c
> +++ b/board/friendlyarm/nanopi2/board.c
> @@ -11,6 +11,7 @@
>   #ifdef CONFIG_PWM_NX
>   #include <pwm.h>
>   #endif
> +#include <video.h>
>   #include <asm/global_data.h>
>   #include <asm/io.h>
>   
> @@ -492,12 +493,8 @@ int splash_screen_prepare(void)
>   					 ARRAY_SIZE(splash_locations));
>   	}
>   
> -	if (!err) {
> -		char addr[64];
> -
> -		sprintf(addr, "0x%lx", gd->fb_base);
> -		env_set("fb_addr", addr);
> -	}
> +	if (!err)
> +		env_set_hex("fb_addr", video_get_fb());
>   
>   	return err;
>   }

Regards,
Stefan
diff mbox series

Patch

diff --git a/board/friendlyarm/nanopi2/board.c b/board/friendlyarm/nanopi2/board.c
index c8cbc5a15fa..b32dfc6b570 100644
--- a/board/friendlyarm/nanopi2/board.c
+++ b/board/friendlyarm/nanopi2/board.c
@@ -11,6 +11,7 @@ 
 #ifdef CONFIG_PWM_NX
 #include <pwm.h>
 #endif
+#include <video.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 
@@ -492,12 +493,8 @@  int splash_screen_prepare(void)
 					 ARRAY_SIZE(splash_locations));
 	}
 
-	if (!err) {
-		char addr[64];
-
-		sprintf(addr, "0x%lx", gd->fb_base);
-		env_set("fb_addr", addr);
-	}
+	if (!err)
+		env_set_hex("fb_addr", video_get_fb());
 
 	return err;
 }