r1050 - developers/werner developers/werner/splash trunk/src/target/u-boot/patches

werner at sita.openmoko.org werner at sita.openmoko.org
Tue Feb 20 06:08:55 CET 2007


Author: werner
Date: 2007-02-20 06:08:48 +0100 (Tue, 20 Feb 2007)
New Revision: 1050

Added:
   developers/werner/splash/
   developers/werner/splash/README
   developers/werner/splash/splash.sh
   developers/werner/splash/splashu.sh
   trunk/src/target/u-boot/patches/uboot-s3c2410-splash.patch
Modified:
   trunk/src/target/u-boot/patches/series
Log:
Experimental splash screen support.



Added: developers/werner/splash/README
===================================================================
--- developers/werner/splash/README	2007-02-20 00:35:47 UTC (rev 1049)
+++ developers/werner/splash/README	2007-02-20 05:08:48 UTC (rev 1050)
@@ -0,0 +1,49 @@
+Splash screen toolkit
+=====================
+
+This is preliminary and experimental. The second splash screen design isn't
+even official.
+
+- You need u-boot with uboot-s3c2410-splash.patch applied
+
+- You need a reasonably recent version of Netpbm
+
+- Download the official startup screen:
+  wget http://wiki.openmoko.org/images/c/c2/System_boot.png
+
+- Make sure that /usr/src/linux points to a valid Linux kernel source tree
+
+- Generate the first splash screen (in splash.bmp.gz):
+  ./splash.sh
+
+- Generate the update for the second splash screen (in splashu.bmp.gz):
+  ./splashu.sh
+
+- Boot into u-boot, halt the boot process
+
+- With openocd, load the images into memory
+  halt
+  load_binary wherever/splash.bmp.gz 0x32000000
+  load_binary wherever/splashu.bmp.gz 0x32005000
+  resume
+
+- Commit them to NAND flash, from the u-boot prompt
+  nand erase splash
+  nand write.e 0x32000000 splash 0x7000
+
+- Update your environment
+  setenv splashimage nand read.e 0x32000000 splash 7000\; bmp display 0x32000000
+  setenv bootcmd bmp display 0x32005000 185 475\; ${bootcmd}
+  saveenv
+
+- Power down, then up
+
+Note: if changing the images, they may grow larger than assumed here (0x5000
+bytes for the first image, 0x2000 for the second), in which case you have to
+adjust sizes and the address of the second image.
+
+Known bug: if you scribble over the 0x3200xxxx area while in u-boot, the
+second image won't display. However, I like this better than either 1)
+always loading the first image twice, or 2) manually calculating offsets
+into the "splash" partition. (Which is complicated by the possibility of
+having to skip bad blocks.)

Added: developers/werner/splash/splash.sh
===================================================================
--- developers/werner/splash/splash.sh	2007-02-20 00:35:47 UTC (rev 1049)
+++ developers/werner/splash/splash.sh	2007-02-20 05:08:48 UTC (rev 1050)
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# -meanpixel yields slightly better dithering but over-emphasizes the halos
+
+pngtopnm "${1:-System_boot.png}" |
+  pnmquant -fs 256 |
+  ppmtobmp -bpp=8 |
+  gzip -9 >"${2:-splash.bmp.gz}"


Property changes on: developers/werner/splash/splash.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: developers/werner/splash/splashu.sh
===================================================================
--- developers/werner/splash/splashu.sh	2007-02-20 00:35:47 UTC (rev 1049)
+++ developers/werner/splash/splashu.sh	2007-02-20 05:08:48 UTC (rev 1050)
@@ -0,0 +1,15 @@
+#!/bin/sh
+TUX=/usr/src/linux/Documentation/logo.gif
+
+trap "rm -f tux.pnm tux-tmp.alpha tux.alpha" 0
+
+giftopnm "${2:-$TUX}" --alphaout=tux-tmp.alpha |
+  pnmscale -height 120 >tux.pnm
+pnmscale -height 120 tux-tmp.alpha >tux.alpha
+pngtopnm "${1:-System_boot.png}" |
+  pamcomp -align=center -valign=middle -yoff=225 -alpha=tux.alpha \
+    tux.pnm - |
+  pamcut -left 185 -width 110 -bottom 605 -height 130 |
+  pnmquant -fs 256 |
+  ppmtobmp -bpp=8 |
+  gzip -9 >"${3:-splashu.bmp.gz}"


Property changes on: developers/werner/splash/splashu.sh
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/src/target/u-boot/patches/series
===================================================================
--- trunk/src/target/u-boot/patches/series	2007-02-20 00:35:47 UTC (rev 1049)
+++ trunk/src/target/u-boot/patches/series	2007-02-20 05:08:48 UTC (rev 1050)
@@ -34,3 +34,4 @@
 
 # those have to be implemented fully
 uboot-dfu.patch
+uboot-s3c2410-splash.patch

Added: trunk/src/target/u-boot/patches/uboot-s3c2410-splash.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-s3c2410-splash.patch	2007-02-20 00:35:47 UTC (rev 1049)
+++ trunk/src/target/u-boot/patches/uboot-s3c2410-splash.patch	2007-02-20 05:08:48 UTC (rev 1050)
@@ -0,0 +1,137 @@
+Note: most of the changes in here are pretty generic and should go to a
+separate patch. Also, some just increase u-boot's limits, and aren't
+specific to splash images per se. I'll keep them all in here for
+convenience until the code it stable.
+
+drivers/cfb_console.c: include asm/byteorder.h for le32_to_cpu and friends
+  [ shouldn't someone else have found this long ago ? ]
+drivers/cfb_console.c: set SHORTSWAP to swap nibbles
+  [ clean this up when and if HWSWP is confirmed ]
+drivers/cfb_console.c (video_logo): if "splashimage" doesn't contain an
+  address, use its content as a command
+drivers/s3c2410_fb.c (video_hw_init): set HWSWP in LCDCON5
+drivers/s3c2410_fb.c (video_hw_init): use memset instead of open-coded
+   equivalent
+include/configs/neo1973.h: increase heap from 128 kB to 400 kB, for BMP image
+  decompression
+  [ note: increasing it to 512 kB trips over something. note sure what.
+    find out. ]
+include/configs/neo1973.h (CONFIG_COMMANDS): add CFG_CMD_BMP
+include/configs/neo1973.h: raise number of command line arguments from 16 to 64
+include/configs/neo1973.h: enable splash screen and BMP support
+
+- Werner Almesberger <werner at openmoko.org>
+
+Index: u-boot/drivers/cfb_console.c
+===================================================================
+--- u-boot.orig/drivers/cfb_console.c
++++ u-boot/drivers/cfb_console.c
+@@ -191,6 +191,7 @@ CONFIG_VIDEO_HW_CURSOR:	     - Uses the 
+ #if (CONFIG_COMMANDS & CFG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
+ #include <watchdog.h>
+ #include <bmp_layout.h>
++#include <asm/byteorder.h>
+ #endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) || CONFIG_SPLASH_SCREEN */
+ 
+ /*****************************************************************************/
+@@ -315,6 +316,11 @@ void	console_cursor (int state);
+ #define SHORTSWAP32(x)	 (x)
+ #endif
+ 
++#ifdef CONFIG_VIDEO_S3C2410
++#undef SHORTSWAP32
++#define	SHORTSWAP32(x)	((((x) & 0xffff) << 16) | (((x) >> 16) & 0xffff))
++#endif
++
+ #if defined(DEBUG) || defined(DEBUG_CFB_CONSOLE)
+ #define PRINTD(x)	  printf(x)
+ #else
+@@ -1116,7 +1122,13 @@ static void *video_logo (void)
+ 	ulong addr;
+ 
+ 	if ((s = getenv ("splashimage")) != NULL) {
+-		addr = simple_strtoul (s, NULL, 16);
++		char *end;
++
++		addr = simple_strtoul (s, &end, 16);
++		if (*end) {
++			run_command(s, 0);
++			return (void *) video_fb_address;
++		}
+ 
+ 		if (video_display_bitmap (addr, 0, 0) == 0) {
+ 			return ((void *) (video_fb_address));
+Index: u-boot/drivers/s3c2410_fb.c
+===================================================================
+--- u-boot.orig/drivers/s3c2410_fb.c
++++ u-boot/drivers/s3c2410_fb.c
+@@ -47,7 +47,6 @@ void *video_hw_init (void)
+ 	struct ctfb_res_modes *res_mode;
+ 	struct ctfb_res_modes var_mode;
+ 	unsigned char videoout;
+-	unsigned int *vm;
+ 
+ 	/* Search for video chip */
+ 	printf("Video: ");
+@@ -148,7 +147,7 @@ void *video_hw_init (void)
+ 	lcd->LCDCON2 = 0x019fc3c1;
+ 	lcd->LCDCON3 = 0x0039df67;
+ 	lcd->LCDCON4 = 0x00000007;
+-	lcd->LCDCON5 = 0x0001cb08;
++	lcd->LCDCON5 = 0x0001cb09;
+ 	lcd->LPCSEL  = 0x00000000;
+ 
+ 	lcd->LCDSADDR1 = LCD_VIDEO_ADDR >> 1;
+@@ -164,10 +163,7 @@ void *video_hw_init (void)
+ 	}
+ 
+ 	/* Clear video memory */
+-	i = pGD->memSize/4;
+-	vm = (unsigned int *)pGD->frameAdrs;
+-	while(i--)
+-		*vm++ = 0;
++	memset(pGD->frameAdrs, 0, pGD->memSize);
+ 
+ 	/* Enable  Display  */
+ 	lcd->LCDCON1 |= 0x01;	/* ENVID = 1 */
+Index: u-boot/include/configs/neo1973.h
+===================================================================
+--- u-boot.orig/include/configs/neo1973.h
++++ u-boot/include/configs/neo1973.h
+@@ -54,7 +54,8 @@
+ /*
+  * Size of malloc() pool
+  */
+-#define CFG_MALLOC_LEN		(CFG_ENV_SIZE + 128*1024)
++#define CFG_MALLOC_LEN		(CFG_ENV_SIZE + 400*1024)
++					/* >> CFG_VIDEO_LOGO_MAX_SIZE */
+ #define CFG_GBL_DATA_SIZE	128	/* size in bytes reserved for initial data */
+ 
+ /*
+@@ -90,6 +91,7 @@
+ 			/* CFG_CMD_IRQ	 | */  \
+ 			CFG_CMD_BOOTD	 | \
+ 			CFG_CMD_CONSOLE	 | \
++			CFG_CMD_BMP	 | \
+ 			CFG_CMD_ASKENV	 | \
+ 			CFG_CMD_RUN	 | \
+ 			CFG_CMD_ECHO	 | \
+@@ -142,7 +144,7 @@
+ #endif
+ #define	CFG_CBSIZE		256		/* Console I/O Buffer Size	*/
+ #define	CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
+-#define	CFG_MAXARGS		16		/* max number of command args	*/
++#define	CFG_MAXARGS		64		/* max number of command args	*/
+ #define CFG_BARGSIZE		CFG_CBSIZE	/* Boot Argument Buffer Size	*/
+ 
+ #define CFG_MEMTEST_START	0x30000000	/* memtest works on	*/
+@@ -253,6 +255,9 @@
+ #define CONFIG_VIDEO_S3C2410
+ #define CONFIG_CFB_CONSOLE
+ #define CONFIG_VIDEO_LOGO
++#define CONFIG_SPLASH_SCREEN
++#define CFG_VIDEO_LOGO_MAX_SIZE	(640*480+1024+100) /* 100 = slack */
++#define CONFIG_VIDEO_BMP_GZIP
+ #define CONFIG_VGA_AS_SINGLE_DEVICE
+ 
+ #define VIDEO_KBD_INIT_FCT	0





More information about the commitlog mailing list