Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: AT91SAM9G45-EKES + U-Boot + Splash image
PostPosted: Wed Sep 29, 2010 2:41 pm 
Offline

Joined: Wed Sep 08, 2010 9:52 am
Posts: 6
Hi all

I have the AT91SAM9G45-EKES kit and I'm trying to make U-Boot
do want I want it to do...

What I want to do is to make U-Boot displaying a Splash image.
(Later on the kernel should reuse this image, somehow)

I started out using the demo binary, u-boot-1.3.4-exp.4-at91sam9g45ekes-nandflash.bin, from: http://www.at91.com/linux4sam/bin/view/Linux4SAM/U-Boot
But found out that this wasn't compiled with the BMP option.

So I have downloaded the source for U-Boot (v1.3.4) and applied the patch. I have added the following to the include/configs/at91sam9m10g45ek.h:
Code:
#define CONFIG_CMD_BMP       1  /* BMP support         */
#define CONFIG_CMD_DISPLAY   1   /* Display support      */
#define CONFIG_SPLASH_SCREEN 1

But when I'm compiling I get following errors:
Quote:
cmd_display.c:39: error: ‘CFG_DISP_CWORD’ undeclared (first use in this function)
cmd_display.c:49: error: ‘CFG_DISP_CHR_RAM’ undeclared (first use in this function)

Yes, it's this line doing it, but I need it (I think):
Code:
#define CONFIG_CMD_DISPLAY   1   /* Display support      */

I've tried the result on the kit but the bmp function isn't there.

How should I declare CFG_DISP_CWORD and CFG_DISP_CHR_RAM?

Or am I doing this in completely wrong?

Hoping for help, as this is a must for my project

Regards
Thomas S :-)


Top
 Profile  
 
 Post subject: Re: AT91SAM9G45-EKES + U-Boot + Splash image
PostPosted: Wed Oct 13, 2010 10:56 am 
Offline

Joined: Wed Sep 08, 2010 9:52 am
Posts: 6
Got it!

I'm posting my personal notes and hopes that someone might find it useful.

Short version:
Build the current stable release of U-Boot (v2010.09) boot it and you will see a boot logo and some text on the display!
This is a strong indication of that the display is working correctly. :-)

Change the at91sam9m10g45.h (in include/configs/) and rebuild.

Flash an image.bmp to a well known location in the Nand Flash and boot the new u-boot.bin.
Now the image is showing up!
Sweet.

Long version:
Get source code:
git clone git://git.denx.de/u-boot.git u-boot/
git checkout v2010.09
git checkout -b v2010.09_sam9g45ekes

Configure:
gedit u-boot-1.3.4/include/configs/at91sam9m10g45ek.h
(Created with: git diff at91sam9m10g45ek.h):
--------------------------------------
diff --git a/include/configs/at91sam9m10g45ek.h b/include/configs/at91sam9m10g45
index 44c5496..51266cf 100644
--- a/include/configs/at91sam9m10g45ek.h
+++ b/include/configs/at91sam9m10g45ek.h
@@ -49,6 +49,9 @@
#define CONFIG_SKIP_LOWLEVEL_INIT
#define CONFIG_SKIP_RELOCATE_UBOOT

+/* pre-boot commands */
+#define CONFIG_PREBOOT "nand read 22000000 100000 40000 ;bmp display 22000000
+
/*
* Hardware drivers
*/
@@ -62,14 +65,15 @@
/* LCD */
#define CONFIG_LCD 1
#define LCD_BPP LCD_COLOR8
-#define CONFIG_LCD_LOGO 1
+//#define CONFIG_LCD_LOGO 1
#undef LCD_TEST_PATTERN
-#define CONFIG_LCD_INFO 1
-#define CONFIG_LCD_INFO_BELOW_LOGO 1
-#define CONFIG_SYS_WHITE_ON_BLACK 1
+//#define CONFIG_LCD_INFO 1
+//#define CONFIG_LCD_INFO_BELOW_LOGO 1
+//#define CONFIG_SYS_WHITE_ON_BLACK 1
#define CONFIG_ATMEL_LCD 1
#define CONFIG_ATMEL_LCD_RGB565 1
#define CONFIG_SYS_CONSOLE_IS_IN_ENV 1
+#define CONFIG_SPLASH_SCREEN 1
/* board specific(not enough SRAM) */
#define CONFIG_AT91SAM9G45_LCD_BASE 0x73E00000

@@ -103,6 +107,7 @@
#define CONFIG_CMD_DHCP 1
#define CONFIG_CMD_NAND 1
#define CONFIG_CMD_USB 1
+#define CONFIG_CMD_BMP 1

/* SDRAM */
#define CONFIG_NR_DRAM_BANKS 1
--------------------------------------

Build:
make distclean
make at91sam9g45ekes_nandflash_config
make CROSS_COMPILE=arm-linux-
wait for it...

When done u-boot.bin is the file to flash to the Nand flash at addr 0x20000 using either SAM-BA (Under Windows!) or by using TFTP.

TFTP (Note that I'm using BOOTP to assign IP addresses and paths):
(Halt autoboot)
U-Boot> bootp
U-Boot> tftp 22000000 u-boot/u-boot.bin
U-Boot> nand erase 20000 40000
U-Boot> nand write 22000000 20000 40000
NAND write: device 0 offset 0x20000, size 0x40000
262144 bytes written: OK

Flashing the image over TFTP:
U-Boot> bootp
U-Boot> tftp 22000000 bootsplash.bmp
U-Boot> bmp info 22000000
U-Boot> nand erase 100000 40000
U-Boot> nand write $(fileaddr) 100000 40000
U-Boot> printenv preboot
preboot=nand read 22000000 100000 40000 ; bmp display 22000000
U-Boot> reset

Can you see the image?
Either you did something wrong or else I missed writing it all down.

Kernel splash:
Great with a picture at start up but is only displayed on till the kernel is (re)initializing the display/framebuffers.

I hadn't found a solution to this and reading http://www.denx.de/wiki/DULG/LinuxSplashScreen doesn't help much.

Any one who got that one?(!)


// Thomas S


Top
 Profile  
 
 Post subject: Re: AT91SAM9G45-EKES + U-Boot + Splash image
PostPosted: Fri Oct 22, 2010 2:12 pm 
Offline

Joined: Thu Apr 29, 2010 11:14 am
Posts: 1
Hello Thomas,
I have the same problem with AT91SAM9263.

I had an idea to load framebuffer as module as soon as FS will be mounted (framebuffer not be initialized by kernel immediatelly after unpack kernel and FB keeps data and settings from uBoot, so splash image should be visible ). After module load should be initialized FB and displayed image using Splashy.

That was only idea, i tested it, but without useful result. So, solution of this is topic interesting for me too. Any help appreciated.

Radovan V.


Top
 Profile  
 
 Post subject: Re: AT91SAM9G45-EKES + U-Boot + Splash image
PostPosted: Thu Oct 28, 2010 10:01 pm 
Offline

Joined: Sat Sep 11, 2010 1:32 am
Posts: 23
Hi Thomas,

I like your way but I tried another which has also worked so far. I placed the *.BMP in serial flash (data flash or spi flash) then init the LCD and splash the screen within the bootstrap. However, now I have to have U-Boot skip the init of the LCD. I'll post a reply if this also works completely.


Top
 Profile  
 
 Post subject: Re: AT91SAM9G45-EKES + U-Boot + Splash image
PostPosted: Wed Dec 01, 2010 9:23 pm 
Offline

Joined: Sat Sep 11, 2010 1:32 am
Posts: 23
Hi Thomas,

So, it was easy to get U-boot to not mess with the image but there are two places in the kernel where the image is destroyed. One is in the frame buffer allocate in the atmel_lcdfb.c driver. You can see the call as it allocates around a half of meg of memory (480x272x32bits). I changed this to simply memcpy my spash to the frame buffer that was just allocated (watch physical to virtual memory pointers here). Of course, the penguin shows up next and it clears the entire screen thus destroying my splash screen. I am looking into the logo splash code now and trying to figure out why it doesn't just layer on to the screen instead of blanking the entire screen.

//memset(info->screen_base, 0, info->fix.smem_len);
memcpy(info->screen_base, (void *)phys_to_virt(UBOOT_LCD_ADDR), info->fix.smem_len);

Gary


Top
 Profile  
 
 Post subject: Re: AT91SAM9G45-EKES + U-Boot + Splash image
PostPosted: Thu Dec 02, 2010 12:20 am 
Offline

Joined: Sat Sep 11, 2010 1:32 am
Posts: 23
I added the following lines of code:
#if !defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_LOGO)
if (fb_prepare_logo(info, FB_ROTATE_UR))
{
fb_show_logo(info, FB_ROTATE_UR);
}
#endif

to the bottom of the function:
static int __init atmel_lcdfb_probe(struct platform_device *pdev)

in the file:
atmel_lcdfb.c

This allowed the linux logo (or custom using gimp) to be overlayed my splash screen. Now, on to the Progress Bar design during the lengthy linux boot process.


Top
 Profile  
 
 Post subject: Re: AT91SAM9G45-EKES + U-Boot + Splash image
PostPosted: Thu Dec 02, 2010 1:08 pm 
Offline

Joined: Wed Sep 08, 2010 9:52 am
Posts: 6
Hi Gary

Nice to have one to do the hard work. Keep it up! ;-)

I have been working on another project and just returned to this one.
I have to focus on the application instead of the OS for a while,
but I am willing to support you with some cheering to do the Progress Bar!

It could be SO cool to have!

Nice detail to let the Bootstrap show the splash instead of the Bootloader.
I might try to do this also to get an instant (aka. INSTANT) splash.
I found your post about this: http://www.at91.com/forum/viewtopic.php/f,12/t,19748/

If you manage to get the Progress Bar done, please PLEASE consider to post a detailed
how to in here, as this something that I really could use and so could many others I think.


Thomas


Top
 Profile  
 
 Post subject: Re: AT91SAM9G45-EKES + U-Boot + Splash image
PostPosted: Thu Dec 02, 2010 3:27 pm 
Offline

Joined: Sat Sep 11, 2010 1:32 am
Posts: 23
Hi Thomas,

I get to work on these fun but necessary features until my custom hardware arrives. My main HW differences are LPDDR, cheaper and larger NAND, new Ethernet PHY, new LCD, new Backlight, and of course our measurement PCB. Once the new hardware arrives, I have to debug that and soon after that people will start yelling for the application. I will post some threads with code snippits as I slowly learn. Good Luck on your project.


Top
 Profile  
 
 Post subject: Re: AT91SAM9G45-EKES + U-Boot + Splash image
PostPosted: Fri Dec 03, 2010 10:44 am 
Offline

Joined: Wed Sep 08, 2010 9:52 am
Posts: 6
Hi Gary

Yes, unfortunately we are not allowed just have fun. :-)
I currently have "The Yelling Crowd Syndrome" for the application and have to wait with
the HW.

Thanks for your tips for now and I am looking forward to see more posts from you.
I will scan this forum more often (will not take long, as there isn't much going on inhere)

Good Luck on your project too.

Regards
Thomas


Top
 Profile  
 
 Post subject: Re: AT91SAM9G45-EKES + U-Boot + Splash image
PostPosted: Mon Dec 06, 2010 10:18 am 
Offline

Joined: Thu Jan 14, 2010 12:30 pm
Posts: 23
Hi guys,

I work with same problem at the moment: I wanna show our logo from the U-Boot an hold it until our application (Qt based) starts. Unfortunately I have no much time too. But at the moment I awaiting for our prototyping board and can to do something here. To get our logo in U-Boot was very easy. And I found more elegant way as Thomas described. What me a little bit disappoint that in a BMP-File for a logo MUST be stored color palette. Otherwise it will show completely wrong data.
Now I trying to find how is possible to switch off initialization in Kernel, since this blinking white screen erase our nice picture :)

Have a nice day,
Velik


Top
 Profile  
 
 Post subject: Re: AT91SAM9G45-EKES + U-Boot + Splash image
PostPosted: Tue Aug 30, 2011 5:10 pm 
Offline

Joined: Mon Aug 08, 2011 5:59 pm
Posts: 18
Did anyone managed to make it work recently ?
I'm using at91sam9m10ekes board,
The uboot bmp is showing until linux starts, the code above didn't change anything...:(


Top
 Profile  
 
 Post subject: Re: AT91SAM9G45-EKES + U-Boot + Splash image
PostPosted: Thu Sep 01, 2011 7:52 am 
Offline

Joined: Wed May 25, 2011 9:44 am
Posts: 31
Hi Ramonf,

I'm working on at91sam9g45-ekes with linux 3.0.3.
I have managed to display a 8 bit bmp logo with Uboot. When Linux starts then there is a reset of LCD (completely black & then white) and then my boot screen is displayed (24 bit bmp image).

If this is fine with you, then this is what I have done:
- Disable Linux logo
- Then as someone already explained, you have to modify the frame buffers initialization in the file drivers/video/atmel_lcdfb.c in the function atmel_lcdfb_alloc_video_memory()

I'm also not an expert, so I what I did to modify the frame buffer init:
I created a header file with my pixel information of the 24 bit bmp. (you have to write a program to create a header file) Now use this pixel information to set the memory buffers.

For example, lets say that you have to display a 24 bit bmp image (google it to find out how pixel information is packed into this and how to extract information) after that make an array that will store pixel information in the format:

unsigned char custom_boot_screen_pixel_info[] = {

/*Pixel 1*/ <Blue Byte>, <Green Byte>, <Red Byte>, 0x00,
/*Pixel 2*/ <Blue Byte>, <Green Byte>, <Red Byte>, 0x00,
/*Pixel 3*/ <Blue Byte>, <Green Byte>, <Red Byte>, 0x00,
.
.
.

};

Now in the atmel_lcdfb.c file: in function atmel_lcdfb_alloc_video_memory()

remove: memset(info->screen_base,0,info->fix.smem_len);
unsigned int i;
unsigned int temp_base=info->screen_base;
for(i=0;i<info->fix.smem_len;i++){
memset(temp_base,custom_boot_screen_pixel_info[i],1);
temp_base++;
}

This will modify the frame buffers.

It worked for me. It will add size to your kernel image, but worst case it works.

I'm still trying to remove the LCD reset (complete black & then complete white) when kernel boots. Not succeeded though.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: