All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] board: stm32mp1: add splash screen on dk2
@ 2023-07-03 16:27 Dario Binacchi
  2023-07-04  8:11 ` Grzegorz Szymaszek
  0 siblings, 1 reply; 4+ messages in thread
From: Dario Binacchi @ 2023-07-03 16:27 UTC (permalink / raw)
  To: u-boot; +Cc: Dario Binacchi, Patrice Chotard, Patrick Delaunay, uboot-stm32

Display the STMicroelectronics logo.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---

 board/st/stm32mp1/stm32mp1.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
index 1a1b1844c8c0..c8c2a83b2acf 100644
--- a/board/st/stm32mp1/stm32mp1.c
+++ b/board/st/stm32mp1/stm32mp1.c
@@ -32,7 +32,10 @@
 #include <remoteproc.h>
 #include <reset.h>
 #include <syscon.h>
+#include <splash.h>
+#include <st_logo_data.h>
 #include <usb.h>
+#include <video.h>
 #include <watchdog.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
@@ -684,6 +687,15 @@ int board_init(void)
 	fw_images[0].fw_name = u"STM32MP-FIP";
 	fw_images[0].image_index = 1;
 #endif
+
+	if (IS_ENABLED(CONFIG_CMD_BMP)) {
+		if (board_is_stm32mp15x_dk2()) {
+			ulong logo =
+				(ulong)stmicroelectronics_uboot_logo_8bit_rle;
+			bmp_display(logo, BMP_ALIGN_CENTER, BMP_ALIGN_CENTER);
+		}
+	}
+
 	return 0;
 }
 
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] board: stm32mp1: add splash screen on dk2
  2023-07-03 16:27 [PATCH] board: stm32mp1: add splash screen on dk2 Dario Binacchi
@ 2023-07-04  8:11 ` Grzegorz Szymaszek
  2023-07-04  9:14   ` Dario Binacchi
  0 siblings, 1 reply; 4+ messages in thread
From: Grzegorz Szymaszek @ 2023-07-04  8:11 UTC (permalink / raw)
  To: Dario Binacchi; +Cc: Patrick Delaunay, Grzegorz Szymaszek, u-boot, uboot-stm32

[-- Attachment #1: Type: text/plain, Size: 558 bytes --]

Hi,

On Mon, Jul 03, 2023 at 06:27:54PM +0200, Dario Binacchi wrote:
> diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
> -%<-
>  #include <syscon.h>
> +#include <splash.h>
> +#include <st_logo_data.h>
>  #include <usb.h>

These two should be put above syscon.h if you want to keep the includes
sorted alphabetically.

> +			ulong logo =
> +				(ulong)stmicroelectronics_uboot_logo_8bit_rle;
> +			bmp_display(logo, BMP_ALIGN_CENTER, BMP_ALIGN_CENTER);

Technically logo is const.


All the best

-- 
Grzegorz

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] board: stm32mp1: add splash screen on dk2
  2023-07-04  8:11 ` Grzegorz Szymaszek
@ 2023-07-04  9:14   ` Dario Binacchi
  2023-07-04  9:35     ` Grzegorz Szymaszek
  0 siblings, 1 reply; 4+ messages in thread
From: Dario Binacchi @ 2023-07-04  9:14 UTC (permalink / raw)
  To: Dario Binacchi, Patrick Delaunay, u-boot, uboot-stm32; +Cc: Grzegorz Szymaszek

Hi all,

On Tue, Jul 4, 2023 at 10:11 AM Grzegorz Szymaszek <gszymaszek@short.pl> wrote:
>
> Hi,
>
> On Mon, Jul 03, 2023 at 06:27:54PM +0200, Dario Binacchi wrote:
> > diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
> > -%<-
> >  #include <syscon.h>
> > +#include <splash.h>
> > +#include <st_logo_data.h>
> >  #include <usb.h>
>
> These two should be put above syscon.h if you want to keep the includes
> sorted alphabetically.

yes, you are right. I will update in v2

>
> > +                     ulong logo =
> > +                             (ulong)stmicroelectronics_uboot_logo_8bit_rle;
> > +                     bmp_display(logo, BMP_ALIGN_CENTER, BMP_ALIGN_CENTER);
>
> Technically logo is const.

int bmp_display(ulong addr, int x, int y);
And throughout the code, I only find ulong parameters being passed to
this function.
Perhaps I can replace "logo" with "addr".

Thanks and regards,
Dario

>
>
> All the best
>
> --
> Grzegorz



-- 

Dario Binacchi

Senior Embedded Linux Developer

dario.binacchi@amarulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@amarulasolutions.com

www.amarulasolutions.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] board: stm32mp1: add splash screen on dk2
  2023-07-04  9:14   ` Dario Binacchi
@ 2023-07-04  9:35     ` Grzegorz Szymaszek
  0 siblings, 0 replies; 4+ messages in thread
From: Grzegorz Szymaszek @ 2023-07-04  9:35 UTC (permalink / raw)
  To: Dario Binacchi; +Cc: Patrick Delaunay, Grzegorz Szymaszek, u-boot, uboot-stm32

[-- Attachment #1: Type: text/plain, Size: 1020 bytes --]

On Tue, Jul 04, 2023 at 11:14:39AM +0200, Dario Binacchi wrote:
> On Tue, Jul 4, 2023 at 10:11 AM Grzegorz Szymaszek <gszymaszek@short.pl> wrote:
> > > +			ulong logo =
> > > +				(ulong)stmicroelectronics_uboot_logo_8bit_rle;
> > > +			bmp_display(logo, BMP_ALIGN_CENTER, BMP_ALIGN_CENTER);
> > 
> > Technically logo is const.
> 
> int bmp_display(ulong addr, int x, int y);
> And throughout the code, I only find ulong parameters being passed to
> this function.
> Perhaps I can replace "logo" with "addr".

I'm afraid my comment was perhaps too terse: I wanted to point out that
your "ulong logo" variable is assigned to only once, its value is never
changed, so instead of plain "ulong", you could declare its type as
"const ulong". I won't insist on this change since the code is trivial.

Consider simply removing the new variable and just passing
"(ulong)stmicroelectronics_uboot_logo_8bit_rle" directly as the
bmp_display()'s argument, like in
board/st/stm32f746-disco/stm32f746-disco.c.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-04  9:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-03 16:27 [PATCH] board: stm32mp1: add splash screen on dk2 Dario Binacchi
2023-07-04  8:11 ` Grzegorz Szymaszek
2023-07-04  9:14   ` Dario Binacchi
2023-07-04  9:35     ` Grzegorz Szymaszek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.