2 * Common LCD routines for supported CPUs
4 * (C) Copyright 2001-2002
5 * Wolfgang Denk, DENX Software Engineering -- wd@denx.de
7 * See file CREDITS for list of people who contributed to this
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 /************************************************************************/
28 /************************************************************************/
36 #include <linux/types.h>
38 #if defined(CONFIG_POST)
44 #if defined(CONFIG_PXA250)
45 #include <asm/byteorder.h>
48 #if defined(CONFIG_MPC823)
54 /************************************************************************/
56 /************************************************************************/
57 #include <video_font.h> /* Get font data, width and height */
59 /************************************************************************/
61 /************************************************************************/
62 #ifdef CONFIG_LCD_LOGO
63 # include <bmp_logo.h> /* Get logo data, width and height */
64 # if (CONSOLE_COLOR_WHITE >= BMP_LOGO_OFFSET)
65 //# error Default Color Map overlaps with Logo Color Map
69 DECLARE_GLOBAL_DATA_PTR
;
71 ulong
lcd_setmem (ulong addr
);
73 static void lcd_drawchars (ushort x
, ushort y
, uchar
*str
, int count
);
74 static inline void lcd_puts_xy (ushort x
, ushort y
, uchar
*s
);
75 static inline void lcd_putc_xy (ushort x
, ushort y
, uchar c
);
77 static int lcd_init (void *lcdbase
);
79 static int lcd_clear (cmd_tbl_t
* cmdtp
, int flag
, int argc
, char *argv
[]);
80 extern void lcd_ctrl_init (void *lcdbase
);
81 extern void lcd_enable (void);
82 static void *lcd_logo (void);
84 #ifdef CONFIG_JzRISC /* JzRISC core */
85 extern int flush_cache_all(void);
86 extern void jz_slcd_update(void);
87 extern void write_frame();
90 #if LCD_BPP == LCD_COLOR8
91 extern void lcd_setcolreg (ushort regno
,
92 ushort red
, ushort green
, ushort blue
);
94 #if LCD_BPP == LCD_MONOCHROME
95 extern void lcd_initcolregs (void);
98 static int lcd_getbgcolor (void);
99 static void lcd_setfgcolor (int color
);
100 static void lcd_setbgcolor (int color
);
102 char lcd_is_enabled
= 0;
103 extern vidinfo_t panel_info
;
105 #ifdef NOT_USED_SO_FAR
106 static void lcd_getcolreg (ushort regno
,
107 ushort
*red
, ushort
*green
, ushort
*blue
);
108 static int lcd_getfgcolor (void);
109 #endif /* NOT_USED_SO_FAR */
111 /************************************************************************/
113 /*----------------------------------------------------------------------*/
115 static void console_scrollup (void)
118 /* Copy up rows ignoring the first one */
119 memcpy (CONSOLE_ROW_FIRST
, CONSOLE_ROW_SECOND
, CONSOLE_SCROLL_SIZE
);
121 /* Clear the last one */
122 memset (CONSOLE_ROW_LAST
, COLOR_MASK(lcd_color_bg
), CONSOLE_ROW_SIZE
);
125 * Poor attempt to optimize speed by moving "long"s.
126 * But the code is ugly, and not a bit faster :-(
128 ulong
*t
= (ulong
*)CONSOLE_ROW_FIRST
;
129 ulong
*s
= (ulong
*)CONSOLE_ROW_SECOND
;
130 ulong l
= CONSOLE_SCROLL_SIZE
/ sizeof(ulong
);
131 uchar c
= lcd_color_bg
& 0xFF;
132 ulong val
= (c
<<24) | (c
<<16) | (c
<<8) | c
;
137 t
= (ulong
*)CONSOLE_ROW_LAST
;
138 l
= CONSOLE_ROW_SIZE
/ sizeof(ulong
);
145 /*----------------------------------------------------------------------*/
147 static inline void console_back (void)
149 if (--console_col
< 0) {
150 console_col
= CONSOLE_COLS
-1 ;
151 if (--console_row
< 0) {
156 lcd_putc_xy (console_col
* VIDEO_FONT_WIDTH
,
157 console_row
* VIDEO_FONT_HEIGHT
,
161 /*----------------------------------------------------------------------*/
163 static inline void console_newline (void)
168 /* Check if we need to scroll the terminal */
169 if (console_row
>= CONSOLE_ROWS
) {
170 /* Scroll everything up */
171 console_scrollup () ;
176 /*----------------------------------------------------------------------*/
177 #ifndef CFG_LCD_LOGOONLY_NOINFO
178 void lcd_putc (const char c
)
182 if (!lcd_is_enabled
) {
186 if ( BMP_LOGO_HEIGHT
> (panel_info
.vl_row
- 2*VIDEO_FONT_HEIGHT
))
190 case '\r': console_col
= 0;
193 case '\n': console_newline();
196 case '\t': /* Tab (8 chars alignment) */
200 if (console_col
>= CONSOLE_COLS
) {
205 case '\b': console_back();
208 default: lcd_putc_xy (console_col
* VIDEO_FONT_WIDTH
,
209 console_row
* VIDEO_FONT_HEIGHT
,
211 if (++console_col
>= CONSOLE_COLS
) {
218 #else /* CFG_LCD_LOGOONLY_NOINFO, no info printed */
219 void lcd_putc (const char c
)
223 #endif /* CFG_LCD_LOGOONLY_NOINFO */
224 /*----------------------------------------------------------------------*/
226 void lcd_puts (const char *s
)
228 if (!lcd_is_enabled
) {
238 /************************************************************************/
239 /* ** Low-Level Graphics Routines */
240 /************************************************************************/
242 static void lcd_drawchars (ushort x
, ushort y
, uchar
*str
, int count
)
248 dest
= (uchar
*)(lcd_base
+ y
* lcd_line_length
+ x
* (1 << LCD_BPP
) / 8);
249 off
= x
* (1 << LCD_BPP
) % 8;
251 for (row
=0; row
< VIDEO_FONT_HEIGHT
; ++row
, dest
+= lcd_line_length
) {
256 #if LCD_BPP == LCD_MONOCHROME
257 uchar rest
= *d
& -(1 << (8-off
));
260 for (i
=0; i
<count
; ++i
) {
264 bits
= video_fontdata
[c
* VIDEO_FONT_HEIGHT
+ row
];
266 #if LCD_BPP == LCD_MONOCHROME
267 sym
= (COLOR_MASK(lcd_color_fg
) & bits
) |
268 (COLOR_MASK(lcd_color_bg
) & ~bits
);
270 *d
++ = rest
| (sym
>> off
);
271 rest
= sym
<< (8-off
);
272 #elif LCD_BPP == LCD_COLOR8
273 for (c
=0; c
<8; ++c
) {
274 *d
++ = (bits
& 0x80) ?
275 lcd_color_fg
: lcd_color_bg
;
278 #elif LCD_BPP == LCD_COLOR16
279 ushort
*m
= (ushort
*)d
;
280 for (c
=0; c
< 8; ++c
) {
281 *m
++ = (bits
& 0x80) ?
282 lcd_color_fg
: lcd_color_bg
;
286 #elif LCD_BPP == LCD_COLOR18
288 for (c
=0; c
< 8 ; ++c
) {
289 *m
++ = (bits
& 0x80) ?
290 lcd_color_fg
: lcd_color_bg
;
296 #if LCD_BPP == LCD_MONOCHROME
297 *d
= rest
| (*d
& ((1 << (8-off
)) - 1));
302 //lcd_set_target(100,100,panel_info.vl_col,panel_info.vl_row);
307 #ifdef CONFIG_JzRISC /* JzRISC core */
312 /*----------------------------------------------------------------------*/
314 static inline void lcd_puts_xy (ushort x
, ushort y
, uchar
*s
)
316 #if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
317 lcd_drawchars (x
, y
+BMP_LOGO_HEIGHT
, s
, strlen ((char *)s
));
319 lcd_drawchars (x
, y
, s
, strlen ((char *)s
));
323 /*----------------------------------------------------------------------*/
325 static inline void lcd_putc_xy (ushort x
, ushort y
, uchar c
)
327 #if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
328 lcd_drawchars (x
, y
+BMP_LOGO_HEIGHT
, &c
, 1);
330 lcd_drawchars (x
, y
, &c
, 1);
334 /************************************************************************/
335 /** Small utility to check that you got the colours right */
336 /************************************************************************/
337 #ifdef LCD_TEST_PATTERN
342 static int test_colors
[N_BLK_HOR
*N_BLK_VERT
] = {
343 CONSOLE_COLOR_RED
, CONSOLE_COLOR_GREEN
, CONSOLE_COLOR_YELLOW
,
344 CONSOLE_COLOR_BLUE
, CONSOLE_COLOR_MAGENTA
, CONSOLE_COLOR_CYAN
,
347 static void test_pattern (void)
349 ushort v_max
= panel_info
.vl_row
;
350 ushort h_max
= panel_info
.vl_col
;
351 ushort v_step
= (v_max
+ N_BLK_VERT
- 1) / N_BLK_VERT
;
352 ushort h_step
= (h_max
+ N_BLK_HOR
- 1) / N_BLK_HOR
;
354 uchar
*pix
= (uchar
*)lcd_base
;
356 printf ("[LCD] Test Pattern: %d x %d [%d x %d]\n",
357 h_max
, v_max
, h_step
, v_step
);
359 /* WARNING: Code silently assumes 8bit/pixel */
360 for (v
=0; v
<v_max
; ++v
) {
361 uchar iy
= v
/ v_step
;
362 for (h
=0; h
<h_max
; ++h
) {
363 uchar ix
= N_BLK_HOR
* iy
+ (h
/h_step
);
364 *pix
++ = test_colors
[ix
];
368 #endif /* LCD_TEST_PATTERN */
371 /************************************************************************/
372 /* ** GENERIC Initialization Routines */
373 /************************************************************************/
375 int drv_lcd_init (void)
380 lcd_base
= (void *)(gd
->fb_base
);
382 lcd_line_length
= (panel_info
.vl_col
* NBITS (panel_info
.vl_bpix
)) / 8;
384 lcd_init (lcd_base
); /* LCD initialization */
386 /* Device initialization */
387 memset (&lcddev
, 0, sizeof (lcddev
));
389 strcpy (lcddev
.name
, "lcd");
390 lcddev
.ext
= 0; /* No extensions */
391 lcddev
.flags
= DEV_FLAGS_OUTPUT
; /* Output only */
392 lcddev
.putc
= lcd_putc
; /* 'putc' function */
393 lcddev
.puts
= lcd_puts
; /* 'puts' function */
395 rc
= device_register (&lcddev
);
397 return (rc
== 0) ? 1 : rc
;
400 /*----------------------------------------------------------------------*/
401 static int lcd_clear (cmd_tbl_t
* cmdtp
, int flag
, int argc
, char *argv
[])
403 #if LCD_BPP == LCD_MONOCHROME
404 /* Setting the palette */
407 #elif LCD_BPP == LCD_COLOR8
408 /* Setting the palette */
409 lcd_setcolreg (CONSOLE_COLOR_BLACK
, 0, 0, 0);
410 lcd_setcolreg (CONSOLE_COLOR_RED
, 0xFF, 0, 0);
411 lcd_setcolreg (CONSOLE_COLOR_GREEN
, 0, 0xFF, 0);
412 lcd_setcolreg (CONSOLE_COLOR_YELLOW
, 0xFF, 0xFF, 0);
413 lcd_setcolreg (CONSOLE_COLOR_BLUE
, 0, 0, 0xFF);
414 lcd_setcolreg (CONSOLE_COLOR_MAGENTA
, 0xFF, 0, 0xFF);
415 lcd_setcolreg (CONSOLE_COLOR_CYAN
, 0, 0xFF, 0xFF);
416 lcd_setcolreg (CONSOLE_COLOR_GREY
, 0xAA, 0xAA, 0xAA);
417 lcd_setcolreg (CONSOLE_COLOR_WHITE
, 0xFF, 0xFF, 0xFF);
420 #ifndef CFG_WHITE_ON_BLACK
421 lcd_setfgcolor (CONSOLE_COLOR_BLACK
);
422 lcd_setbgcolor (CONSOLE_COLOR_WHITE
);
424 lcd_setfgcolor (CONSOLE_COLOR_WHITE
);
425 lcd_setbgcolor (CONSOLE_COLOR_BLACK
);
426 #endif /* CFG_WHITE_ON_BLACK */
428 #ifdef LCD_TEST_PATTERN
431 /* set framebuffer to background color */
432 #if LCD_BPP == LCD_COLOR16
434 short *lcdbase_p
= (short *)lcd_base
;
435 for(i
=0;i
<lcd_line_length
*panel_info
.vl_row
/2;i
++)
436 *lcdbase_p
++ = COLOR_MASK(lcd_getbgcolor());
438 #elif LCD_BPP == LCD_COLOR18
440 int *lcdbase_p
= (int *)lcd_base
;
441 for(i
=0;i
<lcd_line_length
*panel_info
.vl_row
/4;i
++)
442 *lcdbase_p
++ = COLOR_MASK(lcd_getbgcolor());
444 memset ((char *)lcd_base
,
445 COLOR_MASK(lcd_getbgcolor()),
446 lcd_line_length
*panel_info
.vl_row
);
450 /* Paint the logo and retrieve LCD base address */
451 debug ("[LCD] Drawing the logo...\n");
452 lcd_console_address
= lcd_logo ();
461 cls
, 1, 1, lcd_clear
,
462 "cls - clear screen\n",
466 /*----------------------------------------------------------------------*/
468 static int lcd_init (void *lcdbase
)
470 /* Initialize the lcd controller */
471 debug ("[LCD] Initializing LCD frambuffer at %p\n", lcdbase
);
473 lcd_ctrl_init (lcdbase
);
474 lcd_clear (NULL
, 1, 1, NULL
); /* dummy args */
477 /* Initialize the console */
479 #ifdef CONFIG_LCD_INFO_BELOW_LOGO
480 console_row
= 7 + BMP_LOGO_HEIGHT
/ VIDEO_FONT_HEIGHT
;
482 console_row
= 1; /* leave 1 blank line below logo */
490 /************************************************************************/
491 /* ** ROM capable initialization part - needed to reserve FB memory */
492 /************************************************************************/
494 * This is called early in the system initialization to grab memory
495 * for the LCD controller.
496 * Returns new address for monitor, after reserving LCD buffer memory
498 * Note that this is running from ROM, so no write access to global data.
500 ulong
lcd_setmem (ulong addr
)
503 int line_length
= (panel_info
.vl_col
* NBITS (panel_info
.vl_bpix
)) / 8;
505 debug ("LCD panel info: %d x %d, %d bit/pix\n",
506 panel_info
.vl_col
, panel_info
.vl_row
, NBITS (panel_info
.vl_bpix
) );
508 size
= line_length
* panel_info
.vl_row
;
510 /* Round up to nearest full page */
511 size
= (size
+ (PAGE_SIZE
- 1)) & ~(PAGE_SIZE
- 1);
513 /* Allocate pages for the frame buffer. */
516 debug ("Reserving %ldk for LCD Framebuffer at: %08lx\n", size
>>10, addr
);
521 /*----------------------------------------------------------------------*/
523 static void lcd_setfgcolor (int color
)
525 #if LCD_BPP == LCD_COLOR16
526 lcd_color_fg
= color
& 0xFFFF;
528 #elif LCD_BPP == LCD_COLOR18
529 lcd_color_fg
= color
& 0xFFFFFFFF;
531 lcd_color_fg
= color
& 0xF;
535 /*----------------------------------------------------------------------*/
537 static void lcd_setbgcolor (int color
)
539 #if LCD_BPP == LCD_COLOR16
540 lcd_color_bg
= color
& 0xFFFF;
542 #elif LCD_BPP == LCD_COLOR18
543 lcd_color_bg
= color
& 0xFFFFFFFF;
545 lcd_color_bg
= color
& 0xF;
549 /*----------------------------------------------------------------------*/
551 #ifdef NOT_USED_SO_FAR
552 static int lcd_getfgcolor (void)
557 #endif /* NOT_USED_SO_FAR */
559 /*----------------------------------------------------------------------*/
561 static int lcd_getbgcolor (void)
566 /*----------------------------------------------------------------------*/
568 /************************************************************************/
569 /* ** Chipset depending Bitmap / Logo stuff... */
570 /************************************************************************/
571 #ifdef CONFIG_LCD_LOGO
572 void bitmap_plot (int x
, int y
)
580 #if defined(CONFIG_PXA250)
581 struct pxafb_info
*fbi
= &panel_info
.pxa
;
582 #elif defined(CONFIG_MPC823)
583 volatile immap_t
*immr
= (immap_t
*) CFG_IMMR
;
584 volatile cpm8xx_t
*cp
= &(immr
->im_cpm
);
586 debug ("Logo: width %d height %d colors %d cmap %d\n",
587 BMP_LOGO_WIDTH
, BMP_LOGO_HEIGHT
, BMP_LOGO_COLORS
,
588 sizeof(bmp_logo_palette
)/(sizeof(ushort
)));
590 bmap
= &bmp_logo_bitmap
[0];
591 fb
= (uchar
*)(lcd_base
+ y
* lcd_line_length
+ x
);
593 if (NBITS(panel_info
.vl_bpix
) < 12) {
594 /* Leave room for default color map */
595 #if defined(CONFIG_PXA250)
596 cmap
= (ushort
*)fbi
->palette
;
597 #elif defined(CONFIG_MPC823)
598 cmap
= (ushort
*)&(cp
->lcd_cmap
[BMP_LOGO_OFFSET
*sizeof(ushort
)]);
605 for (i
=0; i
<(sizeof(bmp_logo_palette
)/(sizeof(ushort
))); ++i
) {
606 ushort colreg
= bmp_logo_palette
[i
];
607 #ifdef CFG_INVERT_COLORS
608 *cmap
++ = 0xffff - colreg
;
616 for (i
=0; i
<BMP_LOGO_HEIGHT
; ++i
) {
617 memcpy (fb
, bmap
, BMP_LOGO_WIDTH
);
618 bmap
+= BMP_LOGO_WIDTH
;
619 fb
+= panel_info
.vl_col
;
622 else{ /* true color mode */
623 if(NBITS(panel_info
.vl_bpix
) == 16){
624 fb16
= (ushort
*)(lcd_base
+ y
* lcd_line_length
+ x
);
625 for (i
=0; i
<BMP_LOGO_HEIGHT
; ++i
) {
626 for (j
=0; j
<BMP_LOGO_WIDTH
; j
++) {
627 fb16
[j
] = bmp_logo_palette
[(bmap
[j
])];
629 bmap
+= BMP_LOGO_WIDTH
;
630 fb16
+= panel_info
.vl_col
;
634 fb32
= (uint
*)(lcd_base
+ y
* lcd_line_length
+ x
);
635 for (i
=0; i
<BMP_LOGO_HEIGHT
; ++i
) {
636 for (j
=0; j
<BMP_LOGO_WIDTH
; j
++) {
637 fb32
[j
] = bmp_logo_palette
[(bmap
[j
])];
639 bmap
+= BMP_LOGO_WIDTH
;
640 fb32
+= panel_info
.vl_col
;
648 #endif /* CONFIG_LCD_LOGO */
650 /*----------------------------------------------------------------------*/
651 #if (CONFIG_COMMANDS & CFG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
653 * Display the BMP file located at address bmp_image.
656 int lcd_display_bitmap(ulong bmp_image
, int x
, int y
)
658 #if !defined(CONFIG_MCC200)
663 bmp_image_t
*bmp
=(bmp_image_t
*)bmp_image
;
666 unsigned long width
, height
;
667 unsigned long pwidth
= panel_info
.vl_col
;
668 unsigned colors
,bpix
;
669 unsigned long compression
;
670 #if defined(CONFIG_PXA250)
671 struct pxafb_info
*fbi
= &panel_info
.pxa
;
672 #elif defined(CONFIG_MPC823)
673 volatile immap_t
*immr
= (immap_t
*) CFG_IMMR
;
674 volatile cpm8xx_t
*cp
= &(immr
->im_cpm
);
677 if (!((bmp
->header
.signature
[0]=='B') &&
678 (bmp
->header
.signature
[1]=='M'))) {
679 printf ("Error: no valid bmp image at %lx\n", bmp_image
);
683 width
= le32_to_cpu (bmp
->header
.width
);
684 height
= le32_to_cpu (bmp
->header
.height
);
685 colors
= 1<<le16_to_cpu (bmp
->header
.bit_count
);
686 compression
= le32_to_cpu (bmp
->header
.compression
);
688 bpix
= NBITS(panel_info
.vl_bpix
);
690 if ((bpix
!= 1) && (bpix
!= 8)) {
691 printf ("Error: %d bit/pixel mode not supported by U-Boot\n",
696 if (bpix
!= le16_to_cpu(bmp
->header
.bit_count
)) {
697 printf ("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n",
699 le16_to_cpu(bmp
->header
.bit_count
));
703 debug ("Display-bmp: %d x %d with %d colors\n",
704 (int)width
, (int)height
, (int)colors
);
706 #if !defined(CONFIG_MCC200)
707 /* MCC200 LCD doesn't need CMAP, supports 1bpp b&w only */
709 #if defined(CONFIG_PXA250)
710 cmap
= (ushort
*)fbi
->palette
;
711 #elif defined(CONFIG_MPC823)
712 cmap
= (ushort
*)&(cp
->lcd_cmap
[255*sizeof(ushort
)]);
714 # error "Don't know location of color map"
718 for (i
=0; i
<colors
; ++i
) {
719 bmp_color_table_entry_t cte
= bmp
->color_table
[i
];
721 ( ((cte
.red
) << 8) & 0xf800) |
722 ( ((cte
.green
) << 3) & 0x07e0) |
723 ( ((cte
.blue
) >> 3) & 0x001f) ;
724 #ifdef CFG_INVERT_COLORS
725 *cmap
= 0xffff - colreg
;
729 #if defined(CONFIG_PXA250)
731 #elif defined(CONFIG_MPC823)
739 * BMP format for Monochrome assumes that the state of a
740 * pixel is described on a per Bit basis, not per Byte.
741 * So, in case of Monochrome BMP we should align widths
742 * on a byte boundary and convert them from Bit to Byte
744 * Probably, PXA250 and MPC823 process 1bpp BMP images in
745 * their own ways, so make the converting to be MCC200
748 #if defined(CONFIG_MCC200)
751 width
= ((width
+ 7) & ~7) >> 3;
752 x
= ((x
+ 7) & ~7) >> 3;
753 pwidth
= ((pwidth
+ 7) & ~7) >> 3;
757 padded_line
= (width
&0x3) ? ((width
&~0x3)+4) : (width
);
758 if ((x
+ width
)>pwidth
)
760 if ((y
+ height
)>panel_info
.vl_row
)
761 height
= panel_info
.vl_row
- y
;
763 bmap
= (uchar
*)bmp
+ le32_to_cpu (bmp
->header
.data_offset
);
764 fb
= (uchar
*) (lcd_base
+
765 (y
+ height
- 1) * lcd_line_length
+ x
);
766 for (i
= 0; i
< height
; ++i
) {
768 for (j
= 0; j
< width
; j
++)
769 #if defined(CONFIG_PXA250)
771 #elif defined(CONFIG_MPC823) || defined(CONFIG_MCC200)
772 *(fb
++)=255-*(bmap
++);
774 bmap
+= (width
- padded_line
);
775 fb
-= (width
+ lcd_line_length
);
780 #endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) || CONFIG_SPLASH_SCREEN */
783 static void *lcd_logo (void)
785 #ifdef CONFIG_LCD_INFO
788 #endif /* CONFIG_LCD_INFO */
790 #ifdef CONFIG_SPLASH_SCREEN
793 static int do_splash
= 1;
795 if (do_splash
&& (s
= getenv("splashimage")) != NULL
) {
796 addr
= simple_strtoul(s
, NULL
, 16);
799 if (lcd_display_bitmap (addr
, 0, 0) == 0) {
800 return ((void *)lcd_base
);
803 #endif /* CONFIG_SPLASH_SCREEN */
805 #ifdef CONFIG_LCD_LOGO
808 #endif /* CONFIG_LCD_LOGO */
811 # ifdef CONFIG_LCD_INFO
812 sprintf (info
, "%s (%s - %s) ", U_BOOT_VERSION
, __DATE__
, __TIME__
);
813 lcd_drawchars (LCD_INFO_X
, LCD_INFO_Y
, (uchar
*)info
, strlen(info
));
815 sprintf (info
, "(C) 2004 DENX Software Engineering");
816 lcd_drawchars (LCD_INFO_X
, LCD_INFO_Y
+ VIDEO_FONT_HEIGHT
,
817 (uchar
*)info
, strlen(info
));
819 sprintf (info
, " Wolfgang DENK, wd@denx.de");
820 lcd_drawchars (LCD_INFO_X
, LCD_INFO_Y
+ VIDEO_FONT_HEIGHT
* 2,
821 (uchar
*)info
, strlen(info
));
822 # ifdef CONFIG_LCD_INFO_BELOW_LOGO
823 sprintf (info
, "MPC823 CPU at %s MHz",
824 strmhz(temp
, gd
->cpu_clk
));
825 lcd_drawchars (LCD_INFO_X
, LCD_INFO_Y
+ VIDEO_FONT_HEIGHT
* 3,
827 sprintf (info
, " %ld MB RAM, %ld MB Flash",
829 gd
->bd
->bi_flashsize
>> 20 );
830 lcd_drawchars (LCD_INFO_X
, LCD_INFO_Y
+ VIDEO_FONT_HEIGHT
* 4,
833 /* leave one blank line */
835 sprintf (info
, "MPC823 CPU at %s MHz, %ld MB RAM, %ld MB Flash",
836 strmhz(temp
, gd
->cpu_clk
),
838 gd
->bd
->bi_flashsize
>> 20 );
839 lcd_drawchars (LCD_INFO_X
, LCD_INFO_Y
+ VIDEO_FONT_HEIGHT
* 4,
840 (uchar
*)info
, strlen(info
));
842 # endif /* CONFIG_LCD_INFO_BELOW_LOGO */
843 # endif /* CONFIG_LCD_INFO */
844 #endif /* CONFIG_MPC823 */
846 #if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
847 return ((void *)((ulong
)lcd_base
+ BMP_LOGO_HEIGHT
* lcd_line_length
));
849 return ((void *)lcd_base
);
850 #endif /* CONFIG_LCD_LOGO && !CONFIG_LCD_INFO_BELOW_LOGO */
853 /************************************************************************/
854 /************************************************************************/
856 #endif /* CONFIG_LCD */