Patchwork [U-Boot,7/7] video: add an option to skip cfb console init

login
register
mail settings
Submitter Heiko Schocher
Date Aug. 3, 2013, 5:22 a.m.
Message ID <1375507373-13785-8-git-send-email-hs@denx.de>
Download mbox | patch
Permalink /patch/264390/
State Accepted
Delegated to: Anatolij Gustschin
Headers show

Comments

Heiko Schocher - Aug. 3, 2013, 5:22 a.m.
This patch add an option to skip cfb console init for boards
who want to show a logo, but not use the cfb console. This is
needed for the siemens boards, which have a bmp bootlogo, but
do not need the cfb console.

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Anatolij Gustschin <agust@denx.de>
---
 drivers/video/cfb_console.c | 18 ++++++++++++++++++
 1 Datei geändert, 18 Zeilen hinzugefügt(+)
Tom Rini - Aug. 6, 2013, 3:30 p.m.
On Sat, Aug 03, 2013 at 07:22:53AM +0200, Heiko Schocher wrote:

> This patch add an option to skip cfb console init for boards
> who want to show a logo, but not use the cfb console. This is
> needed for the siemens boards, which have a bmp bootlogo, but
> do not need the cfb console.
> 
> Signed-off-by: Heiko Schocher <hs@denx.de>
> Cc: Anatolij Gustschin <agust@denx.de>
> ---
>  drivers/video/cfb_console.c | 18 ++++++++++++++++++
>  1 Datei ge??ndert, 18 Zeilen hinzugef??gt(+)
> 
> diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
> index 96ef8f9..822ed28 100644
> --- a/drivers/video/cfb_console.c
> +++ b/drivers/video/cfb_console.c
> @@ -431,6 +431,19 @@ static const int video_font_draw_table32[16][4] = {
>  	{0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff}
>  };
>  
> +/*
> + * Implement a weak default function for boards that optionally
> + * need to skip the cfb initialization.
> + */
> +int __board_cfb_skip(void)
> +{
> +	/* As default, don't skip cfb init */
> +	return 0;
> +}
> +
> +int board_cfb_skip(void)
> +	__attribute__ ((weak, alias("__board_cfb_skip")));

Add <linux/compiler.h> and use '__weak int board_cfb_skip(void)'.
Anatolij Gustschin - Aug. 10, 2013, 9:04 a.m.
On Sat,  3 Aug 2013 07:22:53 +0200
Heiko Schocher <hs@denx.de> wrote:

> This patch add an option to skip cfb console init for boards
> who want to show a logo, but not use the cfb console. This is
> needed for the siemens boards, which have a bmp bootlogo, but
> do not need the cfb console.
> 
> Signed-off-by: Heiko Schocher <hs@denx.de>
> Cc: Anatolij Gustschin <agust@denx.de>
> ---
>  drivers/video/cfb_console.c | 18 ++++++++++++++++++
>  1 Datei geändert, 18 Zeilen hinzugefügt(+)

Applied to u-boot-video/master after changing to use __weak, thanks!

Anatolij

Patch

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 96ef8f9..822ed28 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -431,6 +431,19 @@  static const int video_font_draw_table32[16][4] = {
 	{0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff}
 };
 
+/*
+ * Implement a weak default function for boards that optionally
+ * need to skip the cfb initialization.
+ */
+int __board_cfb_skip(void)
+{
+	/* As default, don't skip cfb init */
+	return 0;
+}
+
+int board_cfb_skip(void)
+	__attribute__ ((weak, alias("__board_cfb_skip")));
+
 static void video_drawchars(int xx, int yy, unsigned char *s, int count)
 {
 	u8 *cdat, *dest, *dest0;
@@ -1996,6 +2009,8 @@  static void *video_logo(void)
 		return video_fb_address + video_logo_height * VIDEO_LINE_LEN;
 	}
 #endif
+	if (board_cfb_skip())
+		return 0;
 
 	sprintf(info, " %s", version_string);
 
@@ -2205,6 +2220,9 @@  int drv_video_init(void)
 	/* Init video chip - returns with framebuffer cleared */
 	skip_dev_init = (video_init() == -1);
 
+	if (board_cfb_skip())
+		return 0;
+
 #if !defined(CONFIG_VGA_AS_SINGLE_DEVICE)
 	debug("KBD: Keyboard init ...\n");
 	skip_dev_init |= (VIDEO_KBD_INIT_FCT == -1);