diff options
author | Wolfgang Denk | 2012-07-18 10:47:03 +0200 |
---|---|---|
committer | Wolfgang Denk | 2012-07-18 10:47:03 +0200 |
commit | 66714b1a6df0a5a9f1656a6d4e6eea3c7ecdf7ae (patch) | |
tree | 946a13465467eb58f68cf8cf5e121017d380fe2a | |
parent | 3a9469b5cbd467b3a7b176b4feb2073a04f294b6 (diff) | |
parent | cf65d478ab4e0bb0247c374e6b0b40ef77eddbe8 (diff) |
Merge branch 'next' of git://git.denx.de/u-boot-video
* 'next' of git://git.denx.de/u-boot-video:
ipu_common: Add ldb_clk for use in parenting the pixel clock
ipu_common: Do not hardcode the ipu_clk frequency
ipu_common: Rename MXC_CCM_BASE
ipu_common: Let clk_ipu_enable/disable only run on MX51 and MX53
ipu_common: Only apply the erratum to MX51
video: Rename CONFIG_VIDEO_MX5
mx6: Allow mx6 to access the IPUv3 registers
common lcd: minor coding style changes
Signed-off-by: Wolfgang Denk <wd@denx.de>
-rw-r--r-- | arch/arm/include/asm/arch-mx5/imx-regs.h | 2 | ||||
-rw-r--r-- | arch/arm/include/asm/arch-mx6/imx-regs.h | 3 | ||||
-rw-r--r-- | common/lcd.c | 245 | ||||
-rw-r--r-- | drivers/video/Makefile | 2 | ||||
-rw-r--r-- | drivers/video/cfb_console.c | 2 | ||||
-rw-r--r-- | drivers/video/ipu_common.c | 23 | ||||
-rw-r--r-- | drivers/video/ipu_disp.c | 3 | ||||
-rw-r--r-- | drivers/video/ipu_regs.h | 12 | ||||
-rw-r--r-- | include/configs/mx51evk.h | 3 | ||||
-rw-r--r-- | include/configs/mx53loco.h | 3 | ||||
-rw-r--r-- | include/configs/vision2.h | 3 |
11 files changed, 166 insertions, 135 deletions
diff --git a/arch/arm/include/asm/arch-mx5/imx-regs.h b/arch/arm/include/asm/arch-mx5/imx-regs.h index 88fb7cb63d1..8117f4f91ae 100644 --- a/arch/arm/include/asm/arch-mx5/imx-regs.h +++ b/arch/arm/include/asm/arch-mx5/imx-regs.h @@ -50,8 +50,6 @@ #error "CPU_TYPE not defined" #endif -#define IPU_CTRL_BASE_ADDR IPU_SOC_BASE_ADDR + IPU_SOC_OFFSET - #define IRAM_SIZE 0x00020000 /* 128 KB */ /* diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h index e165810ddc3..5d77603ebfe 100644 --- a/arch/arm/include/asm/arch-mx6/imx-regs.h +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h @@ -73,6 +73,9 @@ #define MMDC1_ARB_BASE_ADDR 0x80000000 #define MMDC1_ARB_END_ADDR 0xFFFFFFFF +#define IPU_SOC_BASE_ADDR IPU1_ARB_BASE_ADDR +#define IPU_SOC_OFFSET 0x00200000 + /* Defines for Blocks connected via AIPS (SkyBlue) */ #define ATZ1_BASE_ADDR AIPS1_ARB_BASE_ADDR #define ATZ2_BASE_ADDR AIPS2_ARB_BASE_ADDR diff --git a/common/lcd.c b/common/lcd.c index 85c6cf4374f..506a138cdd4 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -76,42 +76,42 @@ DECLARE_GLOBAL_DATA_PTR; ulong lcd_setmem (ulong addr); -static void lcd_drawchars (ushort x, ushort y, uchar *str, int count); -static inline void lcd_puts_xy (ushort x, ushort y, uchar *s); -static inline void lcd_putc_xy (ushort x, ushort y, uchar c); +static void lcd_drawchars(ushort x, ushort y, uchar *str, int count); +static inline void lcd_puts_xy(ushort x, ushort y, uchar *s); +static inline void lcd_putc_xy(ushort x, ushort y, uchar c); -static int lcd_init (void *lcdbase); +static int lcd_init(void *lcdbase); static void *lcd_logo (void); -static int lcd_getbgcolor (void); -static void lcd_setfgcolor (int color); -static void lcd_setbgcolor (int color); +static int lcd_getbgcolor(void); +static void lcd_setfgcolor(int color); +static void lcd_setbgcolor(int color); char lcd_is_enabled = 0; #ifdef NOT_USED_SO_FAR -static void lcd_getcolreg (ushort regno, +static void lcd_getcolreg(ushort regno, ushort *red, ushort *green, ushort *blue); -static int lcd_getfgcolor (void); +static int lcd_getfgcolor(void); #endif /* NOT_USED_SO_FAR */ /************************************************************************/ /*----------------------------------------------------------------------*/ -static void console_scrollup (void) +static void console_scrollup(void) { /* Copy up rows ignoring the first one */ - memcpy (CONSOLE_ROW_FIRST, CONSOLE_ROW_SECOND, CONSOLE_SCROLL_SIZE); + memcpy(CONSOLE_ROW_FIRST, CONSOLE_ROW_SECOND, CONSOLE_SCROLL_SIZE); /* Clear the last one */ - memset (CONSOLE_ROW_LAST, COLOR_MASK(lcd_color_bg), CONSOLE_ROW_SIZE); + memset(CONSOLE_ROW_LAST, COLOR_MASK(lcd_color_bg), CONSOLE_ROW_SIZE); } /*----------------------------------------------------------------------*/ -static inline void console_back (void) +static inline void console_back(void) { if (--console_col < 0) { console_col = CONSOLE_COLS-1 ; @@ -120,14 +120,13 @@ static inline void console_back (void) } } - lcd_putc_xy (console_col * VIDEO_FONT_WIDTH, - console_row * VIDEO_FONT_HEIGHT, - ' '); + lcd_putc_xy(console_col * VIDEO_FONT_WIDTH, + console_row * VIDEO_FONT_HEIGHT, ' '); } /*----------------------------------------------------------------------*/ -static inline void console_newline (void) +static inline void console_newline(void) { ++console_row; console_col = 0; @@ -135,61 +134,62 @@ static inline void console_newline (void) /* Check if we need to scroll the terminal */ if (console_row >= CONSOLE_ROWS) { /* Scroll everything up */ - console_scrollup () ; + console_scrollup(); --console_row; } } /*----------------------------------------------------------------------*/ -void lcd_putc (const char c) +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; + return; + case '\n': + console_newline(); + return; case '\t': /* Tab (8 chars alignment) */ - console_col += 8; - console_col &= ~7; + console_col += 8; + console_col &= ~7; - if (console_col >= CONSOLE_COLS) { - console_newline(); - } - return; + if (console_col >= CONSOLE_COLS) + console_newline(); - case '\b': console_back(); - return; + 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; + return; + default: + lcd_putc_xy(console_col * VIDEO_FONT_WIDTH, + console_row * VIDEO_FONT_HEIGHT, c); + if (++console_col >= CONSOLE_COLS) + console_newline(); } - /* NOTREACHED */ } /*----------------------------------------------------------------------*/ -void lcd_puts (const char *s) +void lcd_puts(const char *s) { if (!lcd_is_enabled) { - serial_puts (s); + serial_puts(s); + return; } while (*s) { - lcd_putc (*s++); + lcd_putc(*s++); } } @@ -211,7 +211,7 @@ void lcd_printf(const char *fmt, ...) /* ** Low-Level Graphics Routines */ /************************************************************************/ -static void lcd_drawchars (ushort x, ushort y, uchar *str, int count) +static void lcd_drawchars(ushort x, ushort y, uchar *str, int count) { uchar *dest; ushort row; @@ -226,7 +226,7 @@ static void lcd_drawchars (ushort x, ushort y, uchar *str, int count) dest = (uchar *)(lcd_base + y * lcd_line_length + x * (1 << LCD_BPP) / 8); - for (row=0; row < VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) { + for (row = 0; row < VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) { uchar *s = str; int i; #if LCD_BPP == LCD_COLOR16 @@ -239,7 +239,7 @@ static void lcd_drawchars (ushort x, ushort y, uchar *str, int count) uchar rest = *d & -(1 << (8-off)); uchar sym; #endif - for (i=0; i<count; ++i) { + for (i = 0; i < count; ++i) { uchar c, bits; c = *s++; @@ -247,18 +247,18 @@ static void lcd_drawchars (ushort x, ushort y, uchar *str, int count) #if LCD_BPP == LCD_MONOCHROME sym = (COLOR_MASK(lcd_color_fg) & bits) | - (COLOR_MASK(lcd_color_bg) & ~bits); + (COLOR_MASK(lcd_color_bg) & ~bits); *d++ = rest | (sym >> off); rest = sym << (8-off); #elif LCD_BPP == LCD_COLOR8 - for (c=0; c<8; ++c) { + for (c = 0; c < 8; ++c) { *d++ = (bits & 0x80) ? lcd_color_fg : lcd_color_bg; bits <<= 1; } #elif LCD_BPP == LCD_COLOR16 - for (c=0; c<8; ++c) { + for (c = 0; c < 8; ++c) { *d++ = (bits & 0x80) ? lcd_color_fg : lcd_color_bg; bits <<= 1; @@ -273,14 +273,14 @@ static void lcd_drawchars (ushort x, ushort y, uchar *str, int count) /*----------------------------------------------------------------------*/ -static inline void lcd_puts_xy (ushort x, ushort y, uchar *s) +static inline void lcd_puts_xy(ushort x, ushort y, uchar *s) { lcd_drawchars(x, y, s, strlen((char *)s)); } /*----------------------------------------------------------------------*/ -static inline void lcd_putc_xy (ushort x, ushort y, uchar c) +static inline void lcd_putc_xy(ushort x, ushort y, uchar c) { lcd_drawchars(x, y, &c, 1); } @@ -298,7 +298,7 @@ static int test_colors[N_BLK_HOR*N_BLK_VERT] = { CONSOLE_COLOR_BLUE, CONSOLE_COLOR_MAGENTA, CONSOLE_COLOR_CYAN, }; -static void test_pattern (void) +static void test_pattern(void) { ushort v_max = panel_info.vl_row; ushort h_max = panel_info.vl_col; @@ -307,13 +307,13 @@ static void test_pattern (void) ushort v, h; uchar *pix = (uchar *)lcd_base; - printf ("[LCD] Test Pattern: %d x %d [%d x %d]\n", + printf("[LCD] Test Pattern: %d x %d [%d x %d]\n", h_max, v_max, h_step, v_step); /* WARNING: Code silently assumes 8bit/pixel */ - for (v=0; v<v_max; ++v) { + for (v = 0; v < v_max; ++v) { uchar iy = v / v_step; - for (h=0; h<h_max; ++h) { + for (h = 0; h < h_max; ++h) { uchar ix = N_BLK_HOR * iy + (h/h_step); *pix++ = test_colors[ix]; } @@ -335,12 +335,12 @@ int drv_lcd_init (void) lcd_line_length = (panel_info.vl_col * NBITS (panel_info.vl_bpix)) / 8; - lcd_init (lcd_base); /* LCD initialization */ + lcd_init(lcd_base); /* LCD initialization */ /* Device initialization */ - memset (&lcddev, 0, sizeof (lcddev)); + memset(&lcddev, 0, sizeof(lcddev)); - strcpy (lcddev.name, "lcd"); + strcpy(lcddev.name, "lcd"); lcddev.ext = 0; /* No extensions */ lcddev.flags = DEV_FLAGS_OUTPUT; /* Output only */ lcddev.putc = lcd_putc; /* 'putc' function */ @@ -367,35 +367,35 @@ void lcd_clear(void) #elif LCD_BPP == LCD_COLOR8 /* Setting the palette */ - lcd_setcolreg (CONSOLE_COLOR_BLACK, 0, 0, 0); - lcd_setcolreg (CONSOLE_COLOR_RED, 0xFF, 0, 0); - lcd_setcolreg (CONSOLE_COLOR_GREEN, 0, 0xFF, 0); - lcd_setcolreg (CONSOLE_COLOR_YELLOW, 0xFF, 0xFF, 0); - lcd_setcolreg (CONSOLE_COLOR_BLUE, 0, 0, 0xFF); - lcd_setcolreg (CONSOLE_COLOR_MAGENTA, 0xFF, 0, 0xFF); - lcd_setcolreg (CONSOLE_COLOR_CYAN, 0, 0xFF, 0xFF); - lcd_setcolreg (CONSOLE_COLOR_GREY, 0xAA, 0xAA, 0xAA); - lcd_setcolreg (CONSOLE_COLOR_WHITE, 0xFF, 0xFF, 0xFF); + lcd_setcolreg(CONSOLE_COLOR_BLACK, 0, 0, 0); + lcd_setcolreg(CONSOLE_COLOR_RED, 0xFF, 0, 0); + lcd_setcolreg(CONSOLE_COLOR_GREEN, 0, 0xFF, 0); + lcd_setcolreg(CONSOLE_COLOR_YELLOW, 0xFF, 0xFF, 0); + lcd_setcolreg(CONSOLE_COLOR_BLUE, 0, 0, 0xFF); + lcd_setcolreg(CONSOLE_COLOR_MAGENTA, 0xFF, 0, 0xFF); + lcd_setcolreg(CONSOLE_COLOR_CYAN, 0, 0xFF, 0xFF); + lcd_setcolreg(CONSOLE_COLOR_GREY, 0xAA, 0xAA, 0xAA); + lcd_setcolreg(CONSOLE_COLOR_WHITE, 0xFF, 0xFF, 0xFF); #endif #ifndef CONFIG_SYS_WHITE_ON_BLACK - lcd_setfgcolor (CONSOLE_COLOR_BLACK); - lcd_setbgcolor (CONSOLE_COLOR_WHITE); + lcd_setfgcolor(CONSOLE_COLOR_BLACK); + lcd_setbgcolor(CONSOLE_COLOR_WHITE); #else - lcd_setfgcolor (CONSOLE_COLOR_WHITE); - lcd_setbgcolor (CONSOLE_COLOR_BLACK); + lcd_setfgcolor(CONSOLE_COLOR_WHITE); + lcd_setbgcolor(CONSOLE_COLOR_BLACK); #endif /* CONFIG_SYS_WHITE_ON_BLACK */ #ifdef LCD_TEST_PATTERN test_pattern(); #else /* set framebuffer to background color */ - memset ((char *)lcd_base, + memset((char *)lcd_base, COLOR_MASK(lcd_getbgcolor()), lcd_line_length*panel_info.vl_row); #endif /* Paint the logo and retrieve LCD base address */ - debug ("[LCD] Drawing the logo...\n"); + debug("[LCD] Drawing the logo...\n"); lcd_console_address = lcd_logo (); console_col = 0; @@ -410,12 +410,12 @@ U_BOOT_CMD( /*----------------------------------------------------------------------*/ -static int lcd_init (void *lcdbase) +static int lcd_init(void *lcdbase) { /* Initialize the lcd controller */ - debug ("[LCD] Initializing LCD frambuffer at %p\n", lcdbase); + debug("[LCD] Initializing LCD frambuffer at %p\n", lcdbase); - lcd_ctrl_init (lcdbase); + lcd_ctrl_init(lcdbase); lcd_is_enabled = 1; lcd_clear(); lcd_enable (); @@ -442,13 +442,13 @@ static int lcd_init (void *lcdbase) * * Note that this is running from ROM, so no write access to global data. */ -ulong lcd_setmem (ulong addr) +ulong lcd_setmem(ulong addr) { ulong size; - int line_length = (panel_info.vl_col * NBITS (panel_info.vl_bpix)) / 8; + 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; @@ -458,21 +458,21 @@ ulong lcd_setmem (ulong addr) /* Allocate pages for the frame buffer. */ addr -= size; - debug ("Reserving %ldk for LCD Framebuffer at: %08lx\n", size>>10, addr); + debug("Reserving %ldk for LCD Framebuffer at: %08lx\n", size>>10, addr); - return (addr); + return addr; } /*----------------------------------------------------------------------*/ -static void lcd_setfgcolor (int color) +static void lcd_setfgcolor(int color) { lcd_color_fg = color; } /*----------------------------------------------------------------------*/ -static void lcd_setbgcolor (int color) +static void lcd_setbgcolor(int color) { lcd_color_bg = color; } @@ -480,7 +480,7 @@ static void lcd_setbgcolor (int color) /*----------------------------------------------------------------------*/ #ifdef NOT_USED_SO_FAR -static int lcd_getfgcolor (void) +static int lcd_getfgcolor(void) { return lcd_color_fg; } @@ -488,7 +488,7 @@ static int lcd_getfgcolor (void) /*----------------------------------------------------------------------*/ -static int lcd_getbgcolor (void) +static int lcd_getbgcolor(void) { return lcd_color_bg; } @@ -499,7 +499,7 @@ static int lcd_getbgcolor (void) /* ** Chipset depending Bitmap / Logo stuff... */ /************************************************************************/ #ifdef CONFIG_LCD_LOGO -void bitmap_plot (int x, int y) +void bitmap_plot(int x, int y) { #ifdef CONFIG_ATMEL_LCD uint *cmap; @@ -517,7 +517,7 @@ void bitmap_plot (int x, int y) volatile cpm8xx_t *cp = &(immr->im_cpm); #endif - debug ("Logo: width %d height %d colors %d cmap %d\n", + debug("Logo: width %d height %d colors %d cmap %d\n", BMP_LOGO_WIDTH, BMP_LOGO_HEIGHT, BMP_LOGO_COLORS, ARRAY_SIZE(bmp_logo_palette)); @@ -527,9 +527,9 @@ void bitmap_plot (int x, int y) if (NBITS(panel_info.vl_bpix) < 12) { /* Leave room for default color map */ #if defined(CONFIG_CPU_PXA) - cmap = (ushort *)fbi->palette; + cmap = (ushort *) fbi->palette; #elif defined(CONFIG_MPC823) - cmap = (ushort *)&(cp->lcd_cmap[BMP_LOGO_OFFSET*sizeof(ushort)]); + cmap = (ushort *) &(cp->lcd_cmap[BMP_LOGO_OFFSET * sizeof(ushort)]); #elif defined(CONFIG_ATMEL_LCD) cmap = (uint *) (panel_info.mmio + ATMEL_LCDC_LUT(0)); #else @@ -550,12 +550,12 @@ void bitmap_plot (int x, int y) uint lut_entry; #ifdef CONFIG_ATMEL_LCD_BGR555 lut_entry = ((colreg & 0x000F) << 11) | - ((colreg & 0x00F0) << 2) | - ((colreg & 0x0F00) >> 7); + ((colreg & 0x00F0) << 2) | + ((colreg & 0x0F00) >> 7); #else /* CONFIG_ATMEL_LCD_RGB565 */ lut_entry = ((colreg & 0x000F) << 1) | - ((colreg & 0x00F0) << 3) | - ((colreg & 0x0F00) << 4); + ((colreg & 0x00F0) << 3) | + ((colreg & 0x0F00) << 4); #endif *(cmap + BMP_LOGO_OFFSET) = lut_entry; cmap++; @@ -570,8 +570,8 @@ void bitmap_plot (int x, int y) WATCHDOG_RESET(); - for (i=0; i<BMP_LOGO_HEIGHT; ++i) { - memcpy (fb, bmap, BMP_LOGO_WIDTH); + for (i = 0; i < BMP_LOGO_HEIGHT; ++i) { + memcpy(fb, bmap, BMP_LOGO_WIDTH); bmap += BMP_LOGO_WIDTH; fb += panel_info.vl_col; } @@ -579,8 +579,8 @@ void bitmap_plot (int x, int y) else { /* true color mode */ u16 col16; fb16 = (ushort *)(lcd_base + y * lcd_line_length + x); - for (i=0; i<BMP_LOGO_HEIGHT; ++i) { - for (j=0; j<BMP_LOGO_WIDTH; j++) { + for (i = 0; i < BMP_LOGO_HEIGHT; ++i) { + for (j = 0; j < BMP_LOGO_WIDTH; j++) { col16 = bmp_logo_palette[(bmap[j]-16)]; fb16[j] = ((col16 & 0x000F) << 1) | @@ -630,14 +630,15 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) volatile cpm8xx_t *cp = &(immr->im_cpm); #endif - if (!((bmp->header.signature[0]=='B') && - (bmp->header.signature[1]=='M'))) { - printf ("Error: no valid bmp image at %lx\n", bmp_image); + if (!((bmp->header.signature[0] == 'B') && + (bmp->header.signature[1] == 'M'))) { + printf("Error: no valid bmp image at %lx\n", bmp_image); + return 1; } - width = le32_to_cpu (bmp->header.width); - height = le32_to_cpu (bmp->header.height); + width = le32_to_cpu(bmp->header.width); + height = le32_to_cpu(bmp->header.height); bmp_bpix = le16_to_cpu(bmp->header.bit_count); colors = 1 << bmp_bpix; @@ -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,10 +656,11 @@ 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; } - debug ("Display-bmp: %d x %d with %d colors\n", + debug("Display-bmp: %d x %d with %d colors\n", (int)width, (int)height, (int)colors); #if !defined(CONFIG_MCC200) @@ -674,7 +677,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) cmap_base = cmap; /* Set color map */ - for (i=0; i<colors; ++i) { + for (i = 0; i < colors; ++i) { bmp_color_table_entry_t cte = bmp->color_table[i]; #if !defined(CONFIG_ATMEL_LCD) ushort colreg = @@ -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; @@ -731,12 +733,12 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) y = max(0, panel_info.vl_row - height + y + 1); #endif /* CONFIG_SPLASH_SCREEN_ALIGN */ - if ((x + width)>pwidth) + if ((x + width) > pwidth) width = pwidth - x; - if ((y + height)>panel_info.vl_row) + if ((y + height) > panel_info.vl_row) height = panel_info.vl_row - y; - bmap = (uchar *)bmp + le32_to_cpu (bmp->header.data_offset); + bmap = (uchar *)bmp + le32_to_cpu(bmp->header.data_offset); fb = (uchar *) (lcd_base + (y + height - 1) * lcd_line_length + x * bpix / 8); @@ -806,11 +808,11 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) break; }; - return (0); + return 0; } #endif -static void *lcd_logo (void) +static void *lcd_logo(void) { #ifdef CONFIG_SPLASH_SCREEN char *s; @@ -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); + 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 @@ -842,15 +846,14 @@ static void *lcd_logo (void) bmp_image_t *bmp = (bmp_image_t *)addr; unsigned long len; - if (!((bmp->header.signature[0]=='B') && - (bmp->header.signature[1]=='M'))) { + if (!((bmp->header.signature[0] == 'B') && + (bmp->header.signature[1] == 'M'))) { addr = (ulong)gunzip_bmp(addr, &len); } #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 */ } diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 44b7feb9875..2f8e2b521af 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -42,7 +42,7 @@ COBJS-$(CONFIG_VIDEO_DA8XX) += da8xx-fb.o videomodes.o COBJS-$(CONFIG_VIDEO_MB862xx) += mb862xx.o videomodes.o COBJS-$(CONFIG_VIDEO_MB86R0xGDC) += mb86r0xgdc.o videomodes.o COBJS-$(CONFIG_VIDEO_MX3) += mx3fb.o videomodes.o -COBJS-$(CONFIG_VIDEO_MX5) += mxc_ipuv3_fb.o ipu_common.o ipu_disp.o +COBJS-$(CONFIG_VIDEO_IPUV3) += mxc_ipuv3_fb.o ipu_common.o ipu_disp.o COBJS-$(CONFIG_VIDEO_OMAP3) += omap3_dss.o COBJS-$(CONFIG_VIDEO_SED13806) += sed13806.o COBJS-$(CONFIG_VIDEO_SM501) += sm501.o diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 92fa77d27f7..19d061f6cbe 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -164,7 +164,7 @@ /* * Defines for the i.MX31 driver (mx3fb.c) */ -#if defined(CONFIG_VIDEO_MX3) || defined(CONFIG_VIDEO_MX5) +#if defined(CONFIG_VIDEO_MX3) || defined(CONFIG_VIDEO_IPUV3) #define VIDEO_FB_16BPP_WORD_SWAP #endif diff --git a/drivers/video/ipu_common.c b/drivers/video/ipu_common.c index 9d20c864bac..2020da98d23 100644 --- a/drivers/video/ipu_common.c +++ b/drivers/video/ipu_common.c @@ -163,6 +163,7 @@ int clk_set_parent(struct clk *clk, struct clk *parent) static int clk_ipu_enable(struct clk *clk) { +#if defined(CONFIG_MX51) || defined(CONFIG_MX53) u32 reg; reg = __raw_readl(clk->enable_reg); @@ -178,12 +179,13 @@ static int clk_ipu_enable(struct clk *clk) reg = __raw_readl(&mxc_ccm->clpcr); reg &= ~MXC_CCM_CLPCR_BYPASS_IPU_LPM_HS; __raw_writel(reg, &mxc_ccm->clpcr); - +#endif return 0; } static void clk_ipu_disable(struct clk *clk) { +#if defined(CONFIG_MX51) || defined(CONFIG_MX53) u32 reg; reg = __raw_readl(clk->enable_reg); @@ -202,13 +204,14 @@ static void clk_ipu_disable(struct clk *clk) reg = __raw_readl(&mxc_ccm->clpcr); reg |= MXC_CCM_CLPCR_BYPASS_IPU_LPM_HS; __raw_writel(reg, &mxc_ccm->clpcr); +#endif } static struct clk ipu_clk = { .name = "ipu_clk", - .rate = 133000000, - .enable_reg = (u32 *)(MXC_CCM_BASE + + .rate = CONFIG_IPUV3_CLK, + .enable_reg = (u32 *)(CCM_BASE_ADDR + offsetof(struct mxc_ccm_reg, CCGR5)), .enable_shift = MXC_CCM_CCGR5_CG5_OFFSET, .enable = clk_ipu_enable, @@ -216,8 +219,15 @@ static struct clk ipu_clk = { .usecount = 0, }; +static struct clk ldb_clk = { + .name = "ldb_clk", + .rate = 65000000, + .usecount = 0, +}; + /* Globals */ struct clk *g_ipu_clk; +struct clk *g_ldb_clk; unsigned char g_ipu_clk_enabled; struct clk *g_di_clk[2]; struct clk *g_pixel_clk[2]; @@ -340,7 +350,7 @@ static int ipu_pixel_clk_set_parent(struct clk *clk, struct clk *parent) if (parent == g_ipu_clk) di_gen &= ~DI_GEN_DI_CLK_EXT; - else if (!IS_ERR(g_di_clk[clk->id]) && parent == g_di_clk[clk->id]) + else if (!IS_ERR(g_di_clk[clk->id]) && parent == g_ldb_clk) di_gen |= DI_GEN_DI_CLK_EXT; else return -EINVAL; @@ -401,6 +411,7 @@ void ipu_reset(void) int ipu_probe(void) { unsigned long ipu_base; +#if defined CONFIG_MX51 u32 temp; u32 *reg_hsc_mcd = (u32 *)MIPI_HSC_BASE_ADDR; @@ -414,6 +425,7 @@ int ipu_probe(void) temp = __raw_readl(reg_hsc_mxt_conf); __raw_writel(temp | 0x10000, reg_hsc_mxt_conf); +#endif ipu_base = IPU_CTRL_BASE_ADDR; ipu_cpmem_base = (u32 *)(ipu_base + IPU_CPMEM_REG_BASE); @@ -424,7 +436,8 @@ int ipu_probe(void) g_ipu_clk = &ipu_clk; debug("ipu_clk = %u\n", clk_get_rate(g_ipu_clk)); - + g_ldb_clk = &ldb_clk; + debug("ldb_clk = %u\n", clk_get_rate(g_ldb_clk)); ipu_reset(); clk_set_parent(g_pixel_clk[0], g_ipu_clk); diff --git a/drivers/video/ipu_disp.c b/drivers/video/ipu_disp.c index fa8fb2c3577..b4116df8ca1 100644 --- a/drivers/video/ipu_disp.c +++ b/drivers/video/ipu_disp.c @@ -64,6 +64,7 @@ static int dmfc_size_28, dmfc_size_29, dmfc_size_24, dmfc_size_27, dmfc_size_23; int g_di1_tvout; extern struct clk *g_ipu_clk; +extern struct clk *g_ldb_clk; extern struct clk *g_di_clk[2]; extern struct clk *g_pixel_clk[2]; @@ -941,7 +942,7 @@ int32_t ipu_init_sync_panel(int disp, uint32_t pixel_clk, udelay(10000); } } - clk_set_parent(g_pixel_clk[disp], g_di_clk[disp]); + clk_set_parent(g_pixel_clk[disp], g_ldb_clk); } else { if (clk_get_usecount(g_pixel_clk[disp]) != 0) clk_set_parent(g_pixel_clk[disp], g_ipu_clk); diff --git a/drivers/video/ipu_regs.h b/drivers/video/ipu_regs.h index 93b195f2ce1..a43aa03735b 100644 --- a/drivers/video/ipu_regs.h +++ b/drivers/video/ipu_regs.h @@ -47,14 +47,24 @@ #define IPU_SMFC_REG_BASE 0x00050000 #define IPU_DC_REG_BASE 0x00058000 #define IPU_DMFC_REG_BASE 0x00060000 +#define IPU_VDI_REG_BASE 0x00680000 +#if defined(CONFIG_MX51) || defined(CONFIG_MX53) #define IPU_CPMEM_REG_BASE 0x01000000 #define IPU_LUT_REG_BASE 0x01020000 #define IPU_SRM_REG_BASE 0x01040000 #define IPU_TPM_REG_BASE 0x01060000 #define IPU_DC_TMPL_REG_BASE 0x01080000 #define IPU_ISP_TBPR_REG_BASE 0x010C0000 -#define IPU_VDI_REG_BASE 0x00680000 +#elif defined(CONFIG_MX6Q) +#define IPU_CPMEM_REG_BASE 0x00100000 +#define IPU_LUT_REG_BASE 0x00120000 +#define IPU_SRM_REG_BASE 0x00140000 +#define IPU_TPM_REG_BASE 0x00160000 +#define IPU_DC_TMPL_REG_BASE 0x00180000 +#define IPU_ISP_TBPR_REG_BASE 0x001C0000 +#endif +#define IPU_CTRL_BASE_ADDR (IPU_SOC_BASE_ADDR + IPU_SOC_OFFSET) extern u32 *ipu_dc_tmpl_reg; diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h index bd04c027899..6af5ed7fe4b 100644 --- a/include/configs/mx51evk.h +++ b/include/configs/mx51evk.h @@ -126,13 +126,14 @@ /* Framebuffer and LCD */ #define CONFIG_PREBOOT #define CONFIG_VIDEO -#define CONFIG_VIDEO_MX5 +#define CONFIG_VIDEO_IPUV3 #define CONFIG_CFB_CONSOLE #define CONFIG_VGA_AS_SINGLE_DEVICE #define CONFIG_VIDEO_BMP_RLE8 #define CONFIG_SPLASH_SCREEN #define CONFIG_BMP_16BPP #define CONFIG_VIDEO_LOGO +#define CONFIG_IPUV3_CLK 133000000 /* allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h index 61ecd02e4cd..0a25c7d079e 100644 --- a/include/configs/mx53loco.h +++ b/include/configs/mx53loco.h @@ -219,12 +219,13 @@ /* Framebuffer and LCD */ #define CONFIG_PREBOOT #define CONFIG_VIDEO -#define CONFIG_VIDEO_MX5 +#define CONFIG_VIDEO_IPUV3 #define CONFIG_CFB_CONSOLE #define CONFIG_VGA_AS_SINGLE_DEVICE #define CONFIG_VIDEO_BMP_RLE8 #define CONFIG_SPLASH_SCREEN #define CONFIG_BMP_16BPP #define CONFIG_VIDEO_LOGO +#define CONFIG_IPUV3_CLK 133000000 #endif /* __CONFIG_H */ diff --git a/include/configs/vision2.h b/include/configs/vision2.h index 24905a0129b..0ed53d2e046 100644 --- a/include/configs/vision2.h +++ b/include/configs/vision2.h @@ -212,12 +212,13 @@ */ #define CONFIG_PREBOOT #define CONFIG_VIDEO -#define CONFIG_VIDEO_MX5 +#define CONFIG_VIDEO_IPUV3 #define CONFIG_CFB_CONSOLE #define CONFIG_VGA_AS_SINGLE_DEVICE #define CONFIG_VIDEO_BMP_RLE8 #define CONFIG_SPLASH_SCREEN #define CONFIG_CMD_BMP #define CONFIG_BMP_16BPP +#define CONFIG_IPUV3_CLK 133000000 #endif /* __CONFIG_H */ |