X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=blobdiff_plain;f=include%2Flcd.h;h=062e0246d6a7833a943e7fc6605e63332d658c74;hp=b688583828b1c82f90c9ea4a0a670d0eb7fb03a5;hb=c619a0dd89c609e2d7b0468f7da0728621524473;hpb=83dc830b1693252d996bda920cd5f3161d7c64a9 diff --git a/include/lcd.h b/include/lcd.h index b688583828..062e0246d6 100644 --- a/include/lcd.h +++ b/include/lcd.h @@ -1,4 +1,6 @@ /* + * Copyright (C) 2004-2010 Freescale Semiconductor, Inc. + * * MPC823 and PXA LCD Controller * * Modeled after video interface by Paolo Scaffardi @@ -43,6 +45,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,8 +89,6 @@ typedef struct vidinfo { u_char vl_wbf; /* Wait between frames */ } vidinfo_t; -extern vidinfo_t panel_info; - #elif defined CONFIG_PXA250 /* * PXA LCD DMA descriptor @@ -146,16 +158,106 @@ 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 */ + + /* 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 */ + + /* 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; + +#elif defined(CONFIG_MXC2_LCD) + +typedef struct vidinfo { + u_long vl_refresh; /* Refresh Rate Hz */ + u_long vl_row; /* resolution in x */ + u_long vl_col; /* resolution in y */ + u_long vl_pixclock; /* pixel clock in picoseconds */ + u_long vl_left_margin; /* Horizontal back porch */ + u_long vl_right_margin; /* Horizontal front porch */ + u_long vl_upper_margin; /* Vertical back porch */ + u_long vl_lower_margin; /* Vertical front porch */ + u_long vl_hsync; /* Horizontal sync pulse length */ + u_long vl_vsync; /* Vertical sync pulse length */ + u_long vl_sync; /* Polarity on data enable */ + u_long vl_mode; /* Video Mode */ + u_long vl_flag; + u_char vl_bpix; + ushort *cmap; +} vidinfo_t; + +#elif defined(CONFIG_MXC_EPDC) + +struct waveform_modes { + int mode_init; + int mode_du; + int mode_gc4; + int mode_gc8; + int mode_gc16; + int mode_gc32; +}; + +struct epdc_data_struct { + /* EPDC buffer pointers */ + u_long working_buf_addr; + u_long waveform_buf_addr; + + /* Waveform mode definitions */ + struct waveform_modes wv_modes; +}; + +typedef struct vidinfo { + u_long vl_refresh; /* Refresh Rate Hz */ + u_long vl_row; /* resolution in x */ + u_long vl_col; /* resolution in y */ + u_long vl_pixclock; /* pixel clock in picoseconds */ + u_long vl_left_margin; /* Horizontal back porch */ + u_long vl_right_margin; /* Horizontal front porch */ + u_long vl_upper_margin; /* Vertical back porch */ + u_long vl_lower_margin; /* Vertical front porch */ + u_long vl_hsync; /* Horizontal sync pulse length */ + u_long vl_vsync; /* Vertical sync pulse length */ + u_long vl_sync; /* Polarity on data enable */ + u_long vl_mode; /* Video Mode */ + u_long vl_flag; + u_char vl_bpix; + ushort *cmap; + struct epdc_data_struct epdc_data; +} vidinfo_t; + +#else -#elif defined(CONFIG_MCC200) 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 */ + +#endif /* CONFIG_MPC823, CONFIG_PXA250 or CONFIG_MCC200 or CONFIG_ATMEL_LCD */ + +extern vidinfo_t panel_info; /* Video functions */ @@ -169,22 +271,24 @@ 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 */ +#endif /* * Information about displays we are using. This is for configuring * 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 @@ -279,7 +383,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.