|
|
|
@ -121,8 +121,7 @@ static inline void console_back (void) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
lcd_putc_xy(console_col * VIDEO_FONT_WIDTH, |
|
|
|
|
console_row * VIDEO_FONT_HEIGHT, |
|
|
|
|
' '); |
|
|
|
|
console_row * VIDEO_FONT_HEIGHT, ' '); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------*/ |
|
|
|
@ -146,37 +145,37 @@ void lcd_putc (const char c) |
|
|
|
|
{ |
|
|
|
|
if (!lcd_is_enabled) { |
|
|
|
|
serial_putc(c); |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
switch (c) { |
|
|
|
|
case '\r': console_col = 0; |
|
|
|
|
return; |
|
|
|
|
case '\r': |
|
|
|
|
console_col = 0; |
|
|
|
|
|
|
|
|
|
case '\n': console_newline(); |
|
|
|
|
return; |
|
|
|
|
case '\n': |
|
|
|
|
console_newline(); |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
case '\t': /* Tab (8 chars alignment) */ |
|
|
|
|
console_col += 8; |
|
|
|
|
console_col &= ~7; |
|
|
|
|
|
|
|
|
|
if (console_col >= CONSOLE_COLS) { |
|
|
|
|
if (console_col >= CONSOLE_COLS) |
|
|
|
|
console_newline(); |
|
|
|
|
} |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
case '\b': console_back(); |
|
|
|
|
return; |
|
|
|
|
case '\b': |
|
|
|
|
console_back(); |
|
|
|
|
|
|
|
|
|
default: lcd_putc_xy (console_col * VIDEO_FONT_WIDTH, |
|
|
|
|
console_row * VIDEO_FONT_HEIGHT, |
|
|
|
|
c); |
|
|
|
|
if (++console_col >= CONSOLE_COLS) { |
|
|
|
|
console_newline(); |
|
|
|
|
} |
|
|
|
|
return; |
|
|
|
|
default: |
|
|
|
|
lcd_putc_xy(console_col * VIDEO_FONT_WIDTH, |
|
|
|
|
console_row * VIDEO_FONT_HEIGHT, c); |
|
|
|
|
if (++console_col >= CONSOLE_COLS) |
|
|
|
|
console_newline(); |
|
|
|
|
} |
|
|
|
|
/* NOTREACHED */ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------*/ |
|
|
|
@ -185,6 +184,7 @@ void lcd_puts (const char *s) |
|
|
|
|
{ |
|
|
|
|
if (!lcd_is_enabled) { |
|
|
|
|
serial_puts(s); |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -447,8 +447,8 @@ ulong lcd_setmem (ulong addr) |
|
|
|
|
ulong size; |
|
|
|
|
int line_length = (panel_info.vl_col * NBITS(panel_info.vl_bpix)) / 8; |
|
|
|
|
|
|
|
|
|
debug ("LCD panel info: %d x %d, %d bit/pix\n", |
|
|
|
|
panel_info.vl_col, panel_info.vl_row, NBITS (panel_info.vl_bpix) ); |
|
|
|
|
debug("LCD panel info: %d x %d, %d bit/pix\n", panel_info.vl_col, |
|
|
|
|
panel_info.vl_row, NBITS(panel_info.vl_bpix)); |
|
|
|
|
|
|
|
|
|
size = line_length * panel_info.vl_row; |
|
|
|
|
|
|
|
|
@ -460,7 +460,7 @@ ulong lcd_setmem (ulong addr) |
|
|
|
|
|
|
|
|
|
debug("Reserving %ldk for LCD Framebuffer at: %08lx\n", size>>10, addr); |
|
|
|
|
|
|
|
|
|
return (addr); |
|
|
|
|
return addr; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------*/ |
|
|
|
@ -633,6 +633,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) |
|
|
|
|
if (!((bmp->header.signature[0] == 'B') && |
|
|
|
|
(bmp->header.signature[1] == 'M'))) { |
|
|
|
|
printf("Error: no valid bmp image at %lx\n", bmp_image); |
|
|
|
|
|
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -646,6 +647,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) |
|
|
|
|
if ((bpix != 1) && (bpix != 8) && (bpix != 16) && (bpix != 32)) { |
|
|
|
|
printf ("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n", |
|
|
|
|
bpix, bmp_bpix); |
|
|
|
|
|
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -654,6 +656,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) |
|
|
|
|
printf ("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n", |
|
|
|
|
bpix, |
|
|
|
|
le16_to_cpu(bmp->header.bit_count)); |
|
|
|
|
|
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -709,8 +712,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) |
|
|
|
|
* specific. |
|
|
|
|
*/ |
|
|
|
|
#if defined(CONFIG_MCC200) |
|
|
|
|
if (bpix==1) |
|
|
|
|
{ |
|
|
|
|
if (bpix == 1) { |
|
|
|
|
width = ((width + 7) & ~7) >> 3; |
|
|
|
|
x = ((x + 7) & ~7) >> 3; |
|
|
|
|
pwidth= ((pwidth + 7) & ~7) >> 3; |
|
|
|
@ -806,7 +808,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) |
|
|
|
|
break; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
return (0); |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
@ -823,13 +825,15 @@ static void *lcd_logo (void) |
|
|
|
|
|
|
|
|
|
addr = simple_strtoul (s, NULL, 16); |
|
|
|
|
#ifdef CONFIG_SPLASH_SCREEN_ALIGN |
|
|
|
|
if ((s = getenv ("splashpos")) != NULL) { |
|
|
|
|
s = getenv("splashpos"); |
|
|
|
|
if (s != NULL) { |
|
|
|
|
if (s[0] == 'm') |
|
|
|
|
x = BMP_ALIGN_CENTER; |
|
|
|
|
else |
|
|
|
|
x = simple_strtol(s, NULL, 0); |
|
|
|
|
|
|
|
|
|
if ((s = strchr (s + 1, ',')) != NULL) { |
|
|
|
|
s = strchr(s + 1, ','); |
|
|
|
|
if (s != NULL) { |
|
|
|
|
if (s[1] == 'm') |
|
|
|
|
y = BMP_ALIGN_CENTER; |
|
|
|
|
else |
|
|
|
@ -848,9 +852,8 @@ static void *lcd_logo (void) |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
if (lcd_display_bitmap (addr, x, y) == 0) { |
|
|
|
|
return ((void *)lcd_base); |
|
|
|
|
} |
|
|
|
|
if (lcd_display_bitmap(addr, x, y) == 0) |
|
|
|
|
return (void *)lcd_base; |
|
|
|
|
} |
|
|
|
|
#endif /* CONFIG_SPLASH_SCREEN */ |
|
|
|
|
|
|
|
|
@ -863,9 +866,9 @@ static void *lcd_logo (void) |
|
|
|
|
#endif /* CONFIG_LCD_INFO */ |
|
|
|
|
|
|
|
|
|
#if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO) |
|
|
|
|
return ((void *)((ulong)lcd_base + BMP_LOGO_HEIGHT * lcd_line_length)); |
|
|
|
|
return (void *)((ulong)lcd_base + BMP_LOGO_HEIGHT * lcd_line_length); |
|
|
|
|
#else |
|
|
|
|
return ((void *)lcd_base); |
|
|
|
|
return (void *)lcd_base; |
|
|
|
|
#endif /* CONFIG_LCD_LOGO && !CONFIG_LCD_INFO_BELOW_LOGO */ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|