Difference between revisions of "U-Boot Splash Screen"

From ArmadeusWiki
Jump to: navigation, search
(Installation)
 
(6 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{Under Construction}}
 
 
 
=Introduction=
 
=Introduction=
On this page you will learn how to activate LCD support in U-Boot and display a Splash Screen at boot. The following instructions have only be tested on [[OPOS6UL]].
+
On this page you will learn how to activate LCD support in U-Boot and display a Splash Screen at boot.
 +
{{Note|The following instructions have only be tested on [[OPOS6UL]].}}
  
 
=Installation=
 
=Installation=
* Save your image as BMP file (in Gimp use Run-Length (RLE) encoding, no alpha channel and no color informations (compatibility options))
+
* Save your image as BMP file (in Gimp use Run-Length (RLE) encoding, no alpha channel and no color informations (compatibility options). If the RLE option is grayed out, go to Image > Mode and select Indexed...)
* Activate LCD in U-Boot:
+
* Activate LCD in U-Boot (here ST0700):
 
<pre class="apf">
 
<pre class="apf">
BIOS> setenv videomode video=ctfb:x:800,y:480,depth:18,pclk:33000033,le:8,ri:4,up:2,lo:4,hs:41,vs:10,sync:0,vmode:0
+
BIOS> setenv videomode video=ctfb:x:800,y:480,depth:18,pclk:33033,le:8,ri:4,up:2,lo:4,hs:64,vs:4,sync:0,vmode:0
 
</pre>
 
</pre>
  
Line 14: Line 13:
 
<pre class="apf">
 
<pre class="apf">
 
BIOS> tftpboot ${loadaddr} xxx.bmp
 
BIOS> tftpboot ${loadaddr} xxx.bmp
BIOS> bmp info ${loadaddr}        
+
BIOS> bmp info ${loadaddr}
 
Image size    : 296 x 72
 
Image size    : 296 x 72
 
Bits per pixel: 8
 
Bits per pixel: 8
Line 25: Line 24:
  
 
=Deploy it=
 
=Deploy it=
 +
* Here we assume that logo is stored in ''/boot'' directory of rootfs eMMC partition as ''logo.bmp'':
 
<pre class="apf">
 
<pre class="apf">
 
BIOS> setenv splashimage 0x80000000
 
BIOS> setenv splashimage 0x80000000
BIOS> setenv splashfile /boot/Logo_800x480.bmp
+
BIOS> setenv splashfile /boot/logo.bmp
 
BIOS> setenv splashsource mmc_fs
 
BIOS> setenv splashsource mmc_fs
 
</pre>
 
</pre>
 +
 +
=Continuity with Linux Boot Logo=
 +
* If you want Linux to keep your U-Boot Logo during boot process, then some tweaks are needed:
 +
** define CONFIG_SYS_MEM_TOP_HIDE in U-Boot configuration file, here we reserve 2MBytes: <source lang="c">#define CONFIG_SYS_MEM_TOP_HIDE        (2 << 20)</source>
 +
* Force framebuffer RAM address in U-Boot LCD driver ([[OPOS6UL]] has 256MBytes (0x10000000) RAM starting at physical 0x80000000):<source lang="diff">@@ -197,8 +197,8 @@
 +
panel.memSize = mode.xres * mode.yres * panel.gdfBytesPP;
 +
 +
/* Allocate framebuffer */
 +
- fb = memalign(ARCH_DMA_MINALIGN,
 +
-       roundup(panel.memSize, ARCH_DMA_MINALIGN));
 +
+ fb = (void *)0x8fe00000; /*memalign(ARCH_DMA_MINALIGN,
 +
+       roundup(panel.memSize, ARCH_DMA_MINALIGN));*/
 +
if (!fb) {
 +
printf("MXSFB: Error allocating framebuffer!\n");
 +
return NULL;
 +
</source>
 +
 +
* Tell Linux to not print cursor on Framebuffer and to not use last 2M of RAM: <pre class="apf">BIOS> setenv extrabootargs vt.global_cursor_default=0 mem=248M</pre>
 +
 +
* Force framebuffer RAM address to same value in Linux LCD driver: <source lang="diff">@@ -825,17 +824,18 @@
 +
        var->vmode = FB_VMODE_NONINTERLACED;
 +
 +
        /* Memory allocation for framebuffer */
 +
+#define FORCED_FB_ADDR 0x8fe00000
 +
        fb_size = SZ_2M;
 +
-      fb_virt = dma_alloc_wc(dev, PAGE_ALIGN(fb_size), &fb_phys, GFP_KERNEL);
 +
+      fb_virt = ioremap_wc(FORCED_FB_ADDR, fb_size);
 +
        if (!fb_virt)
 +
                return -ENOMEM;
 +
 +
+      fb_phys = FORCED_FB_ADDR;
 +
        fb_info->fix.smem_start = fb_phys;
 +
        fb_info->screen_base = fb_virt;
 +
        fb_info->screen_size = fb_info->fix.smem_len = fb_size;
 +
 +
-      if (mxsfb_restore_mode(host, vmode))
 +
-              memset(fb_virt, 0, fb_size);
 +
+      mxsfb_restore_mode(host, vmode);
 +
 +
        return 0;
 +
}</source>
 +
* Remove following options of your Linux config file:
 +
<source lang="diff">-CONFIG_FRAMEBUFFER_CONSOLE=y
 +
-CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
 +
-CONFIG_FONTS=y
 +
-CONFIG_FONT_8x8=y
 +
-CONFIG_FONT_8x16=y</source>
 +
 +
* Reflash all that on your board and... That's it ! ;-)
  
 
=Links=
 
=Links=
 
* http://www.denx.de/wiki/DULG/UBootSplashScreen
 
* http://www.denx.de/wiki/DULG/UBootSplashScreen
 +
 +
[[Category:Boot Logo]]

Latest revision as of 08:15, 15 March 2018

Introduction

On this page you will learn how to activate LCD support in U-Boot and display a Splash Screen at boot.

Note Note: The following instructions have only be tested on OPOS6UL.


Installation

  • Save your image as BMP file (in Gimp use Run-Length (RLE) encoding, no alpha channel and no color informations (compatibility options). If the RLE option is grayed out, go to Image > Mode and select Indexed...)
  • Activate LCD in U-Boot (here ST0700):
BIOS> setenv videomode video=ctfb:x:800,y:480,depth:18,pclk:33033,le:8,ri:4,up:2,lo:4,hs:64,vs:4,sync:0,vmode:0

Test it

BIOS> tftpboot ${loadaddr} xxx.bmp
BIOS> bmp info ${loadaddr}
Image size    : 296 x 72
Bits per pixel: 8
Compression   : 0
BIOS> bmp display ${loadaddr} 100 50

Deploy it

  • Here we assume that logo is stored in /boot directory of rootfs eMMC partition as logo.bmp:
BIOS> setenv splashimage 0x80000000
BIOS> setenv splashfile /boot/logo.bmp
BIOS> setenv splashsource mmc_fs

  • If you want Linux to keep your U-Boot Logo during boot process, then some tweaks are needed:
    • define CONFIG_SYS_MEM_TOP_HIDE in U-Boot configuration file, here we reserve 2MBytes:
      #define CONFIG_SYS_MEM_TOP_HIDE         (2 << 20)
      
  • Force framebuffer RAM address in U-Boot LCD driver (OPOS6UL has 256MBytes (0x10000000) RAM starting at physical 0x80000000):
    @@ -197,8 +197,8 @@
     	panel.memSize = mode.xres * mode.yres * panel.gdfBytesPP;
     
     	/* Allocate framebuffer */
    -	fb = memalign(ARCH_DMA_MINALIGN,
    -		      roundup(panel.memSize, ARCH_DMA_MINALIGN));
    +	fb = (void *)0x8fe00000; /*memalign(ARCH_DMA_MINALIGN,
    +		      roundup(panel.memSize, ARCH_DMA_MINALIGN));*/
     	if (!fb) {
     		printf("MXSFB: Error allocating framebuffer!\n");
     		return NULL;
    
  • Tell Linux to not print cursor on Framebuffer and to not use last 2M of RAM:
    BIOS> setenv extrabootargs vt.global_cursor_default=0 mem=248M
  • Force framebuffer RAM address to same value in Linux LCD driver:
    @@ -825,17 +824,18 @@
            var->vmode = FB_VMODE_NONINTERLACED;
    
            /* Memory allocation for framebuffer */
    +#define FORCED_FB_ADDR 0x8fe00000
            fb_size = SZ_2M;
    -       fb_virt = dma_alloc_wc(dev, PAGE_ALIGN(fb_size), &fb_phys, GFP_KERNEL);
    +       fb_virt = ioremap_wc(FORCED_FB_ADDR, fb_size);
            if (!fb_virt)
                    return -ENOMEM;
    
    +       fb_phys = FORCED_FB_ADDR;
            fb_info->fix.smem_start = fb_phys;
            fb_info->screen_base = fb_virt;
            fb_info->screen_size = fb_info->fix.smem_len = fb_size;
    
    -       if (mxsfb_restore_mode(host, vmode))
    -               memset(fb_virt, 0, fb_size);
    +       mxsfb_restore_mode(host, vmode);
    
            return 0;
     }
    
  • Remove following options of your Linux config file:
-CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
-CONFIG_FONTS=y
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
  • Reflash all that on your board and... That's it ! ;-)

Links