X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Flcd.h;h=0e098d925ecb053e875cc5340aebe2b07d70765e;hb=b038db852b5b7120f1ff825d8e2a5c2cd14c2f0f;hp=06feab335df74fe2041492e52e3ecb9c70a217fc;hpb=8655b6f8603f12099e534a10f7840630b3e93026;p=u-boot diff --git a/include/lcd.h b/include/lcd.h index 06feab335d..0e098d925e 100644 --- a/include/lcd.h +++ b/include/lcd.h @@ -43,6 +43,18 @@ extern void *lcd_console_address; /* Start of console buffer */ extern short console_col; extern short console_row; +extern struct vidinfo panel_info; + +extern void lcd_ctrl_init (void *lcdbase); +extern void lcd_enable (void); + +/* setcolreg used in 8bpp/16bpp; initcolregs used in monochrome */ +extern void lcd_setcolreg (ushort regno, + ushort red, ushort green, ushort blue); +extern void lcd_initcolregs (void); + +/* gunzip_bmp used if CONFIG_VIDEO_BMP_GZIP */ +extern struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp); #if defined CONFIG_MPC823 /* @@ -75,9 +87,7 @@ typedef struct vidinfo { u_char vl_wbf; /* Wait between frames */ } vidinfo_t; -extern vidinfo_t panel_info; - -#elif defined CONFIG_PXA250 +#elif defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined CONFIG_CPU_MONAHANS /* * PXA LCD DMA descriptor */ @@ -146,9 +156,48 @@ typedef struct vidinfo { struct pxafb_info pxa; } vidinfo_t; -extern vidinfo_t panel_info; +#elif defined(CONFIG_ATMEL_LCD) + +typedef struct vidinfo { + u_long vl_col; /* Number of columns (i.e. 640) */ + u_long vl_row; /* Number of rows (i.e. 480) */ + u_long vl_clk; /* pixel clock in ps */ -#endif /* CONFIG_MPC823 or CONFIG_PXA250 */ + /* LCD configuration register */ + u_long vl_sync; /* Horizontal / vertical sync */ + u_long vl_bpix; /* Bits per pixel, 0 = 1, 1 = 2, 2 = 4, 3 = 8, 4 = 16 */ + u_long vl_tft; /* 0 = passive, 1 = TFT */ + u_long vl_cont_pol_low; /* contrast polarity is low */ + + /* Horizontal control register. */ + u_long vl_hsync_len; /* Length of horizontal sync */ + u_long vl_left_margin; /* Time from sync to picture */ + u_long vl_right_margin; /* Time from picture to sync */ + + /* Vertical control register. */ + u_long vl_vsync_len; /* Length of vertical sync */ + u_long vl_upper_margin; /* Time from sync to picture */ + u_long vl_lower_margin; /* Time from picture to sync */ + + u_long mmio; /* Memory mapped registers */ +} vidinfo_t; + +#else + +typedef struct vidinfo { + ushort vl_col; /* Number of columns (i.e. 160) */ + ushort vl_row; /* Number of rows (i.e. 100) */ + + u_char vl_bpix; /* Bits per pixel, 0 = 1 */ + + ushort *cmap; /* Pointer to the colormap */ + + void *priv; /* Pointer to driver-specific data */ +} vidinfo_t; + +#endif /* CONFIG_MPC823, CONFIG_PXA250 or CONFIG_MCC200 or CONFIG_ATMEL_LCD */ + +extern vidinfo_t panel_info; /* Video functions */ @@ -162,20 +211,15 @@ void lcd_putc (const char c); void lcd_puts (const char *s); void lcd_printf (const char *fmt, ...); +/* Allow boards to customize the information displayed */ +void lcd_show_board_info(void); /************************************************************************/ /* ** BITMAP DISPLAY SUPPORT */ /************************************************************************/ -#if (CONFIG_COMMANDS & CFG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN) +#if defined(CONFIG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN) # include # include -#endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) || CONFIG_SPLASH_SCREEN */ - -/************************************************************************/ -/* ** LOGO DATA */ -/************************************************************************/ -#ifdef CONFIG_LCD_LOGO -# include /* Get logo data, width and height */ #endif /* @@ -183,8 +227,8 @@ void lcd_printf (const char *fmt, ...); * the LCD controller and memory allocation. Someone has to know what * is connected, as we can't autodetect anything. */ -#define CFG_HIGH 0 /* Pins are active high */ -#define CFG_LOW 1 /* Pins are active low */ +#define CONFIG_SYS_HIGH 0 /* Pins are active high */ +#define CONFIG_SYS_LOW 1 /* Pins are active low */ #define LCD_MONOCHROME 0 #define LCD_COLOR2 1 @@ -193,7 +237,7 @@ void lcd_printf (const char *fmt, ...); #define LCD_COLOR16 4 /*----------------------------------------------------------------------*/ -#if defined(LCD_INFO_BELOW_LOGO) +#if defined(CONFIG_LCD_INFO_BELOW_LOGO) # define LCD_INFO_X 0 # define LCD_INFO_Y (BMP_LOGO_HEIGHT + VIDEO_FONT_HEIGHT) #elif defined(CONFIG_LCD_LOGO) @@ -252,10 +296,6 @@ void lcd_printf (const char *fmt, ...); #endif /* color definitions */ -#if defined(CONFIG_LCD_LOGO) && (CONSOLE_COLOR_WHITE >= BMP_LOGO_OFFSET) -# error Default Color Map overlaps with Logo Color Map -#endif - /************************************************************************/ #ifndef PAGE_SIZE # define PAGE_SIZE 4096 @@ -264,7 +304,7 @@ void lcd_printf (const char *fmt, ...); /************************************************************************/ /* ** CONSOLE DEFINITIONS & FUNCTIONS */ /************************************************************************/ -#if defined(CONFIG_LCD_LOGO) && !defined(LCD_INFO_BELOW_LOGO) +#if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO) # define CONSOLE_ROWS ((panel_info.vl_row-BMP_LOGO_HEIGHT) \ / VIDEO_FONT_HEIGHT) #else @@ -283,7 +323,7 @@ void lcd_printf (const char *fmt, ...); #if LCD_BPP == LCD_MONOCHROME # define COLOR_MASK(c) ((c) | (c) << 1 | (c) << 2 | (c) << 3 | \ (c) << 4 | (c) << 5 | (c) << 6 | (c) << 7) -#elif LCD_BPP == LCD_COLOR8 +#elif (LCD_BPP == LCD_COLOR8) || (LCD_BPP == LCD_COLOR16) # define COLOR_MASK(c) (c) #else # error Unsupported LCD BPP.