From: wdenk Date: Mon, 21 Oct 2002 20:48:29 +0000 (+0000) Subject: Fix byteorder problem with autoscript command. X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=287e754feaf34d60bd630efc32dd425f3e4e278c;p=users%2Frw%2Fppcboot.git Fix byteorder problem with autoscript command. Work on video support for RRvision board. --- diff --git a/CHANGELOG b/CHANGELOG index 5f0581f..14fab2d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,8 @@ Modifications since 1.2.0: ====================================================================== +* Fix endianess problems in autoscript command + * Add VFD support for TRAB * Add support for RedRock Vision V1.0 Board diff --git a/board/trab/vfd.c b/board/trab/vfd.c index c0e8f1a..b550a69 100644 --- a/board/trab/vfd.c +++ b/board/trab/vfd.c @@ -348,7 +348,7 @@ int drv_vfd_init(void) DECLARE_GLOBAL_DATA_PTR; - vfdbase = gd->vfd_base; + vfdbase = gd->fb_base; create_vfd_table(); init_grid_ctrl(); diff --git a/common/cmd_autoscript.c b/common/cmd_autoscript.c index 42979c3..49bd463 100644 --- a/common/cmd_autoscript.c +++ b/common/cmd_autoscript.c @@ -33,10 +33,13 @@ * copying the new image, and rebooting the machine. */ +/* #define DEBUG */ + #include #include #include #include +#include #include #include #if defined(CONFIG_8xx) @@ -58,15 +61,20 @@ autoscript (ulong addr) ulong *len_ptr; char *cmd; int rcode = 0; + int verify; + + cmd = getenv ("verify"); + verify = (cmd && (*cmd == 'n')) ? 0 : 1; - memcpy (hdr, (char *)addr, sizeof(image_header_t)); - if (hdr->ih_magic != IH_MAGIC) { + memmove (hdr, (char *)addr, sizeof(image_header_t)); + + if (ntohl(hdr->ih_magic) != IH_MAGIC) { printf ("Bad magic number\n"); return 1; } - crc = hdr->ih_hcrc; + crc = ntohl(hdr->ih_hcrc); hdr->ih_hcrc = 0; len = sizeof (image_header_t); data = (ulong)hdr; @@ -76,10 +84,13 @@ autoscript (ulong addr) } data = addr + sizeof(image_header_t); - len = hdr->ih_size; - if (crc32(0, (char *)data, len) != hdr->ih_dcrc) { - printf ("Bad data crc\n"); - return 1; + len = ntohl(hdr->ih_size); + + if (verify) { + if (crc32(0, (char *)data, len) != ntohl(hdr->ih_dcrc)) { + printf ("Bad data crc\n"); + return 1; + } } if (hdr->ih_type != IH_TYPE_SCRIPT) { @@ -90,11 +101,13 @@ autoscript (ulong addr) /* get length of script */ len_ptr = (ulong *)data; - if ((len = *len_ptr) == 0) { + if ((len = ntohl(*len_ptr)) == 0) { printf ("Empty Script\n"); return 1; } + debug ("** Script length: %d\n", len); + if ((cmd = malloc (len + 1)) == NULL) { return 1; } @@ -102,7 +115,7 @@ autoscript (ulong addr) while (*len_ptr++); /* make sure cmd is null terminated */ - memcpy (cmd, (char *)len_ptr, len); + memmove (cmd, (char *)len_ptr, len); *(cmd + len) = 0; #ifdef CFG_HUSH_PARSER @@ -122,6 +135,8 @@ autoscript (ulong addr) *next = '\0'; /* run only non-empty commands */ if ((next - line) > 1) { + debug ("** exec: \"%s\"\n", + line); if (run_command (line, 0) < 0) { rcode = 1; break; diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 78671a7..8c4699c 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -465,7 +465,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, * Now check if we have a multifile image */ } else if ((hdr->ih_type==IH_TYPE_MULTI) && (len_ptr[1])) { - u_long tail = len_ptr[0] % 4; + u_long tail = ntohl(len_ptr[0]) % 4; int i; SHOW_BOOT_PROGRESS (13); @@ -476,12 +476,12 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, for (i=1; len_ptr[i]; ++i) data += 4; /* add kernel length, and align */ - data += len_ptr[0]; + data += ntohl(len_ptr[0]); if (tail) { data += 4 - tail; } - len = len_ptr[1]; + len = ntohl(len_ptr[1]); } else { /* diff --git a/common/cmd_vfd.c b/common/cmd_vfd.c index 47eb429..4a538f9 100644 --- a/common/cmd_vfd.c +++ b/common/cmd_vfd.c @@ -23,9 +23,11 @@ /* * Command to load a splash screen to the VFDs. - * NOTE that htis will be controlled by a key combination when + * NOTE that this will be controlled by a key combination when * the keyboard stuff works. For now the user has to enter a - * bitmap number (only VFDT_TEST_LOGO is supported now - 16.10.2002). + * bitmap number (only VFD_TEST_LOGO is supported now - 16.10.2002). + * Added VFD_REMOTE_LOGO (same as VFD_TEST_LOGO but a different color) + * on 20.10.2002. * * This rather crudely requires that each bitmap be included as a * header file. @@ -37,6 +39,7 @@ #ifdef VFD_TEST_LOGO #include #define VFD_TEST_LOGO_BMPNR 0 +#define VFD_REMOTE_LOGO_BMPNR 1 #endif extern void transfer_pic(unsigned char, unsigned char *, int, int); @@ -59,6 +62,10 @@ int do_vfd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) transfer_pic(1, &vfd_test_logo_bitmap[0], VFD_TEST_LOGO_HEIGHT, VFD_TEST_LOGO_WIDTH); break; + case VFD_REMOTE_LOGO_BMPNR: + transfer_pic(1, &vfd_remote_logo_bitmap[0], + VFD_TEST_LOGO_HEIGHT, VFD_TEST_LOGO_WIDTH); + break; #endif default: printf("Unknown bitmap %ld\n", bitmap); diff --git a/cpu/mpc8xx/lcd.c b/cpu/mpc8xx/lcd.c index 2414f34..d63d9b5 100644 --- a/cpu/mpc8xx/lcd.c +++ b/cpu/mpc8xx/lcd.c @@ -635,7 +635,7 @@ int drv_lcd_init (void) device_t lcddev; int rc; - lcd_base = (void *)(gd->lcd_base); + lcd_base = (void *)(gd->fb_base); lcd_line_length = (panel_info.vl_col * NBITS (panel_info.vl_bpix)) / 8; diff --git a/cpu/mpc8xx/video.c b/cpu/mpc8xx/video.c index b88a655..6b359a7 100644 --- a/cpu/mpc8xx/video.c +++ b/cpu/mpc8xx/video.c @@ -1,6 +1,8 @@ /* * (C) Copyright 2000 * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it + * (C) Copyright 2002 + * Wolfgang Denk, wd@denx.de * * See file CREDITS for list of people who contributed to this * project. @@ -21,6 +23,8 @@ * MA 02111-1307 USA */ +#define DEBUG + /************************************************************************/ /* ** HEADER FILES */ /************************************************************************/ @@ -39,10 +43,7 @@ /* ** DEBUG SETTINGS */ /************************************************************************/ -#define VIDEO_DEBUG_STEP 0 -#define PRINTD(x) if (VIDEO_DEBUG_STEP) printf(x); - -#if 0 +#if 1 #define VIDEO_DEBUG_COLORBARS /* Force colorbars output */ #endif @@ -51,14 +52,17 @@ /************************************************************************/ #if 0 -#define VIDEO_MODE_EXTENDED /* Allow screen size bigger than visible area */ +#define VIDEO_MODE_EXTENDED /* Allow screen size bigger than visible area */ #define VIDEO_MODE_NTSC #endif + #define VIDEO_MODE_PAL + #if 0 -#define VIDEO_BLINK /* This enables cursor blinking (under construction) */ +#define VIDEO_BLINK /* This enables cursor blinking (under construction) */ #endif -#define VIDEO_INFO /* Show PPCBOOT informations */ + +#define VIDEO_INFO /* Show PPCBoot information */ #define VIDEO_INFO_X VIDEO_LOGO_WIDTH+8 #define VIDEO_INFO_Y 16 @@ -71,10 +75,7 @@ #include /* Sets encoder data, mode, and visible and active area */ #define VIDEO_I2C 1 -#define VIDEO_I2C_RATE (VIDEO_ENCODER_I2C_RATE >> 1) #define VIDEO_I2C_ADDR CONFIG_VIDEO_ENCODER_AD7176_ADDR -#define VIDEO_I2C_DATA_ADDR video_encoder_data -#define VIDEO_I2C_DATA_SIZE sizeof(video_encoder_data) #endif #ifdef CONFIG_VIDEO_ENCODER_AD7177 @@ -82,10 +83,7 @@ #include /* Sets encoder data, mode, and visible and active area */ #define VIDEO_I2C 1 -#define VIDEO_I2C_RATE (VIDEO_ENCODER_I2C_RATE >> 1) #define VIDEO_I2C_ADDR CONFIG_VIDEO_ENCODER_AD7177_ADDR -#define VIDEO_I2C_DATA_ADDR video_encoder_data -#define VIDEO_I2C_DATA_SIZE sizeof(video_encoder_data) #endif /************************************************************************/ @@ -101,9 +99,9 @@ #endif #define VIDEO_PIXEL_SIZE (VIDEO_MODE_BPP/8) -#define VIDEO_SIZE (VIDEO_ROWS*VIDEO_COLS*VIDEO_PIXEL_SIZE)/* Total size of buffer */ -#define VIDEO_PIX_BLOCKS (VIDEO_SIZE >> 2) /* Number of ints */ -#define VIDEO_LINE_LEN (VIDEO_COLS*VIDEO_PIXEL_SIZE) /* Number of bytes per line */ +#define VIDEO_SIZE (VIDEO_ROWS*VIDEO_COLS*VIDEO_PIXEL_SIZE) /* Total size of buffer */ +#define VIDEO_PIX_BLOCKS (VIDEO_SIZE >> 2) /* Number of ints */ +#define VIDEO_LINE_LEN (VIDEO_COLS*VIDEO_PIXEL_SIZE) /* Number of bytes per line */ #define VIDEO_BURST_LEN (VIDEO_COLS/8) #ifdef VIDEO_MODE_YUYV @@ -116,10 +114,10 @@ /* ** FONT AND LOGO DATA */ /************************************************************************/ -#include /* Get font data, width and height */ +#include /* Get font data, width and height */ #ifdef CONFIG_VIDEO_LOGO -#include /* Get logo data, width and height */ +#include /* Get logo data, width and height */ #define VIDEO_LOGO_WIDTH DEF_PPCBOOT_LOGO_WIDTH #define VIDEO_LOGO_HEIGHT DEF_PPCBOOT_LOGO_HEIGHT @@ -132,24 +130,24 @@ /* VCCR - VIDEO CONTROLLER CONFIGURATION REGISTER */ -#define VIDEO_VCCR_VON 0 /* Video controller ON */ -#define VIDEO_VCCR_CSRC 1 /* Clock source */ -#define VIDEO_VCCR_PDF 13 /* Pixel display format */ -#define VIDEO_VCCR_IEN 11 /* Interrupt enable */ +#define VIDEO_VCCR_VON 0 /* Video controller ON */ +#define VIDEO_VCCR_CSRC 1 /* Clock source */ +#define VIDEO_VCCR_PDF 13 /* Pixel display format */ +#define VIDEO_VCCR_IEN 11 /* Interrupt enable */ /* VSR - VIDEO STATUS REGISTER */ -#define VIDEO_VSR_CAS 6 /* Active set */ -#define VIDEO_VSR_EOF 0 /* End of frame */ +#define VIDEO_VSR_CAS 6 /* Active set */ +#define VIDEO_VSR_EOF 0 /* End of frame */ /* VCMR - VIDEO COMMAND REGISTER */ -#define VIDEO_VCMR_BD 0 /* Blank display */ -#define VIDEO_VCMR_ASEL 1 /* Active set selection */ +#define VIDEO_VCMR_BD 0 /* Blank display */ +#define VIDEO_VCMR_ASEL 1 /* Active set selection */ /* VBCB - VIDEO BACKGROUND COLOR BUFFER REGISTER */ -#define VIDEO_BCSR4_RESET_BIT 21 /* BCSR4 - Extern video encoder reset */ +#define VIDEO_BCSR4_RESET_BIT 21 /* BCSR4 - Extern video encoder reset */ #define VIDEO_BCSR4_EXTCLK_BIT 22 /* BCSR4 - Extern clock enable */ #define VIDEO_BCSR4_VIDLED_BIT 23 /* BCSR4 - Video led disable */ @@ -200,26 +198,22 @@ /************************************************************************/ typedef struct { - unsigned char V, - Y1, - U, - Y2; -} tYUYV ; + unsigned char V, Y1, U, Y2; +} tYUYV; /* This structure is based on the Video Ram in the MPC823. */ -typedef struct VRAM -{ - unsigned hx:2, /* Horizontal sync */ - vx:2, /* Vertical sync */ - fx:2, /* Frame */ - bx:2, /* Blank */ - res1:6, /* Reserved */ - vds:2, /* Video Data Select */ - inter:1, /* Interrupt */ - res2:2, /* Reserved */ - lcyc:11, /* Loop/video cycles */ - lp:1, /* Loop start/end */ - lst:1; /* Last entry */ +typedef struct VRAM { + unsigned hx:2, /* Horizontal sync */ + vx:2, /* Vertical sync */ + fx:2, /* Frame */ + bx:2, /* Blank */ + res1:6, /* Reserved */ + vds:2, /* Video Data Select */ + inter:1, /* Interrupt */ + res2:2, /* Reserved */ + lcyc:11, /* Loop/video cycles */ + lp:1, /* Loop start/end */ + lst:1; /* Last entry */ } VRAM; /************************************************************************/ @@ -227,31 +221,27 @@ typedef struct VRAM /************************************************************************/ static int - video_panning_range_x = 0, /* Video mode invisible pixels x range */ - video_panning_range_y = 0, /* Video mode invisible pixels y range */ - video_panning_value_x = 0, /* Video mode x panning value (absolute) */ - video_panning_value_y = 0, /* Video mode y panning value (absolute) */ - video_panning_factor_x = 0, /* Video mode x panning value (-127 +127) */ - video_panning_factor_y = 0, /* Video mode y panning value (-127 +127) */ - - console_col = 0, /* Cursor col */ - console_row = 0, /* Cursor row */ - - video_palette[16]; /* Our palette */ - -static const int - video_font_draw_table[] = {0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff} ; + video_panning_range_x = 0, /* Video mode invisible pixels x range */ + video_panning_range_y = 0, /* Video mode invisible pixels y range */ + video_panning_value_x = 0, /* Video mode x panning value (absolute) */ + video_panning_value_y = 0, /* Video mode y panning value (absolute) */ + video_panning_factor_x = 0, /* Video mode x panning value (-127 +127) */ + video_panning_factor_y = 0, /* Video mode y panning value (-127 +127) */ + console_col = 0, /* Cursor col */ + console_row = 0, /* Cursor row */ + video_palette[16]; /* Our palette */ + +static const int video_font_draw_table[] = + { 0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff }; static char - - video_color_fg = 0, /* Current fg color index (0-15) */ - video_color_bg = 0, /* Current bg color index (0-15) */ - - video_enable = 0 ; /* Video has been initialized? */ + video_color_fg = 0, /* Current fg color index (0-15) */ + video_color_bg = 0, /* Current bg color index (0-15) */ + video_enable = 0; /* Video has been initialized? */ static void - *video_fb_address, /* Frame buffer address */ - *video_console_address ; /* Console frame buffer start address */ + *video_fb_address, /* Frame buffer address */ + *video_console_address; /* Console frame buffer start address */ /************************************************************************/ /* ** MEMORY FUNCTIONS (32bit) */ @@ -259,74 +249,74 @@ static void static void memsetl (int *p, int c, int v) { - while (c--) - *(p++) = v ; + while (c--) + *(p++) = v; } static void memcpyl (int *d, int *s, int c) { - while (c--) - *(d++) = *(s++) ; + while (c--) + *(d++) = *(s++); } /************************************************************************/ /* ** VIDEO DRAWING AND COLOR FUNCTIONS */ /************************************************************************/ -static int video_maprgb (int r, int g, int b) +static int video_maprgb (int r, int g, int b) { #ifdef VIDEO_MODE_YUYV - unsigned int pR, pG, pB ; - tYUYV YUYV ; - unsigned int *ret = (unsigned int*) &YUYV ; + unsigned int pR, pG, pB; + tYUYV YUYV; + unsigned int *ret = (unsigned int *) &YUYV; - /* Transform (0-255) components to (0-100) */ + /* Transform (0-255) components to (0-100) */ - pR = r * 100 / 255 ; - pG = g * 100 / 255 ; - pB = b * 100 / 255 ; + pR = r * 100 / 255; + pG = g * 100 / 255; + pB = b * 100 / 255; - /* Calculate YUV values (0-255) from RGB beetween 0-100 */ + /* Calculate YUV values (0-255) from RGB beetween 0-100 */ - YUYV.Y1 = YUYV.Y2 = 209 * (pR + pG + pB) / 300 + 16 ; - YUYV.U = pR - (pG*3/4) - (pB/4) + 128 ; - YUYV.V = pB - (pR/4) - (pG*3/4) + 128 ; - return *ret ; + YUYV.Y1 = YUYV.Y2 = 209 * (pR + pG + pB) / 300 + 16; + YUYV.U = pR - (pG * 3 / 4) - (pB / 4) + 128; + YUYV.V = pB - (pR / 4) - (pG * 3 / 4) + 128; + return *ret; #endif #ifdef VIDEO_MODE_RGB - return ((r >> 3) << 11) | ((g > 2) << 6) | (b >> 3) ; + return ((r >> 3) << 11) | ((g > 2) << 6) | (b >> 3); #endif } static void video_setpalette (int color, int r, int g, int b) { - color &= 0xf ; + color &= 0xf; - video_palette[color] = video_maprgb(r,g,b); + video_palette[color] = video_maprgb (r, g, b); - /* Swap values if our panning offset is odd */ - if (video_panning_value_x & 1) - video_palette[color] = SWAPINT (video_palette[color]); + /* Swap values if our panning offset is odd */ + if (video_panning_value_x & 1) + video_palette[color] = SWAPINT (video_palette[color]); } -static void video_fill(int color) +static void video_fill (int color) { - memsetl (video_fb_address, VIDEO_PIX_BLOCKS, color); + memsetl (video_fb_address, VIDEO_PIX_BLOCKS, color); } -static void video_setfgcolor(int i) +static void video_setfgcolor (int i) { - video_color_fg = i & 0xf; + video_color_fg = i & 0xf; } -static void video_setbgcolor(int i) +static void video_setbgcolor (int i) { - video_color_bg = i & 0xf; + video_color_bg = i & 0xf; } -static int video_pickcolor(int i) +static int video_pickcolor (int i) { - return video_palette[i & 0xf]; + return video_palette[i & 0xf]; } /* Absolute console plotting functions */ @@ -334,200 +324,216 @@ static int video_pickcolor(int i) #ifdef VIDEO_BLINK static void video_revchar (int xx, int yy) { - int rows; - u8 *dest ; - dest = video_fb_address + yy * VIDEO_LINE_LEN + xx * 2; - - for (rows = VIDEO_FONT_HEIGHT; rows--; dest += VIDEO_LINE_LEN) { - switch (VIDEO_FONT_WIDTH) { - case 16: - ((u32 *)dest)[6] ^= 0xffffffff; ((u32 *)dest)[7] ^= 0xffffffff; - /* FALL THROUGH */ - case 12: - ((u32 *)dest)[4] ^= 0xffffffff; ((u32 *)dest)[5] ^= 0xffffffff; - /* FALL THROUGH */ - case 8: - ((u32 *)dest)[2] ^= 0xffffffff; ((u32 *)dest)[3] ^= 0xffffffff; - /* FALL THROUGH */ - case 4: - ((u32 *)dest)[0] ^= 0xffffffff; ((u32 *)dest)[1] ^= 0xffffffff; + int rows; + u8 *dest; + + dest = video_fb_address + yy * VIDEO_LINE_LEN + xx * 2; + + for (rows = VIDEO_FONT_HEIGHT; rows--; dest += VIDEO_LINE_LEN) { + switch (VIDEO_FONT_WIDTH) { + case 16: + ((u32 *) dest)[6] ^= 0xffffffff; + ((u32 *) dest)[7] ^= 0xffffffff; + /* FALL THROUGH */ + case 12: + ((u32 *) dest)[4] ^= 0xffffffff; + ((u32 *) dest)[5] ^= 0xffffffff; + /* FALL THROUGH */ + case 8: + ((u32 *) dest)[2] ^= 0xffffffff; + ((u32 *) dest)[3] ^= 0xffffffff; + /* FALL THROUGH */ + case 4: + ((u32 *) dest)[0] ^= 0xffffffff; + ((u32 *) dest)[1] ^= 0xffffffff; + } } - } } #endif -static void video_drawchars(int xx, int yy, unsigned char *s, int count) +static void video_drawchars (int xx, int yy, unsigned char *s, int count) { - u8 *cdat, *dest, *dest0; - int rows, offset, c; - u32 eorx, fgx, bgx; + u8 *cdat, *dest, *dest0; + int rows, offset, c; + u32 eorx, fgx, bgx; - offset = yy * VIDEO_LINE_LEN + xx * 2; - dest0 = video_fb_address + offset ; + offset = yy * VIDEO_LINE_LEN + xx * 2; + dest0 = video_fb_address + offset; - fgx = video_pickcolor (video_color_fg) ; - bgx = video_pickcolor (video_color_bg) ; + fgx = video_pickcolor (video_color_fg); + bgx = video_pickcolor (video_color_bg); - if (xx & 1) - { - fgx = SWAPINT(fgx); - bgx = SWAPINT(bgx); - } + if (xx & 1) { + fgx = SWAPINT (fgx); + bgx = SWAPINT (bgx); + } - eorx = fgx ^ bgx; + eorx = fgx ^ bgx; - switch (VIDEO_FONT_WIDTH) { - case 4: - case 8: - while (count--) - { - c = *s ; - cdat = video_fontdata + c * VIDEO_FONT_HEIGHT; - for (rows = VIDEO_FONT_HEIGHT, dest = dest0; rows--; dest += VIDEO_LINE_LEN) { - u8 bits = *cdat++; - ((u32 *)dest)[0] = (video_font_draw_table[bits >> 6] & eorx) ^ bgx; - ((u32 *)dest)[1] = (video_font_draw_table[bits >> 4 & 3] & eorx) ^ bgx; - if (VIDEO_FONT_WIDTH == 8) { - ((u32 *)dest)[2] = (video_font_draw_table[bits >> 2 & 3] & eorx) ^ bgx; - ((u32 *)dest)[3] = (video_font_draw_table[bits & 3] & eorx) ^ bgx; + switch (VIDEO_FONT_WIDTH) { + case 4: + case 8: + while (count--) { + c = *s; + cdat = video_fontdata + c * VIDEO_FONT_HEIGHT; + for (rows = VIDEO_FONT_HEIGHT, dest = dest0; + rows--; + dest += VIDEO_LINE_LEN) { + u8 bits = *cdat++; + + ((u32 *) dest)[0] = + (video_font_draw_table[bits >> 6] & eorx) ^ bgx; + ((u32 *) dest)[1] = + (video_font_draw_table[bits >> 4 & 3] & eorx) ^ bgx; + if (VIDEO_FONT_WIDTH == 8) { + ((u32 *) dest)[2] = + (video_font_draw_table[bits >> 2 & 3] & eorx) ^ bgx; + ((u32 *) dest)[3] = + (video_font_draw_table[bits & 3] & eorx) ^ bgx; + } + } + dest0 += VIDEO_FONT_WIDTH * 2; + s++; } - } - dest0 += VIDEO_FONT_WIDTH*2; - s++ ; - } - break; - case 12: - case 16: - while (count--) { - cdat = video_fontdata + (*s) * (VIDEO_FONT_HEIGHT << 1); - for (rows = VIDEO_FONT_HEIGHT, dest = dest0; rows--; dest += VIDEO_LINE_LEN) { - u8 bits = *cdat++; - ((u32 *)dest)[0] = (video_font_draw_table[bits >> 6] & eorx) ^ bgx; - ((u32 *)dest)[1] = (video_font_draw_table[bits >> 4 & 3] & eorx) ^ bgx; - ((u32 *)dest)[2] = (video_font_draw_table[bits >> 2 & 3] & eorx) ^ bgx; - ((u32 *)dest)[3] = (video_font_draw_table[bits & 3] & eorx) ^ bgx; - bits = *cdat++; - ((u32 *)dest)[4] = (video_font_draw_table[bits >> 6] & eorx) ^ bgx; - ((u32 *)dest)[5] = (video_font_draw_table[bits >> 4 & 3] & eorx) ^ bgx; - if (VIDEO_FONT_WIDTH == 16) { - ((u32 *)dest)[6] = (video_font_draw_table[bits >> 2 & 3] & eorx) ^ bgx; - ((u32 *)dest)[7] = (video_font_draw_table[bits & 3] & eorx) ^ bgx; + break; + case 12: + case 16: + while (count--) { + cdat = video_fontdata + (*s) * (VIDEO_FONT_HEIGHT << 1); + for (rows = VIDEO_FONT_HEIGHT, dest = dest0; rows--; + dest += VIDEO_LINE_LEN) { + u8 bits = *cdat++; + + ((u32 *) dest)[0] = + (video_font_draw_table[bits >> 6] & eorx) ^ bgx; + ((u32 *) dest)[1] = + (video_font_draw_table[bits >> 4 & 3] & eorx) ^ bgx; + ((u32 *) dest)[2] = + (video_font_draw_table[bits >> 2 & 3] & eorx) ^ bgx; + ((u32 *) dest)[3] = + (video_font_draw_table[bits & 3] & eorx) ^ bgx; + bits = *cdat++; + ((u32 *) dest)[4] = + (video_font_draw_table[bits >> 6] & eorx) ^ bgx; + ((u32 *) dest)[5] = + (video_font_draw_table[bits >> 4 & 3] & eorx) ^ bgx; + if (VIDEO_FONT_WIDTH == 16) { + ((u32 *) dest)[6] = + (video_font_draw_table[bits >> 2 & 3] & eorx) ^ bgx; + ((u32 *) dest)[7] = + (video_font_draw_table[bits & 3] & eorx) ^ bgx; + } + } + s++; + dest0 += VIDEO_FONT_WIDTH * 2; } - } - s++ ; - dest0 += VIDEO_FONT_WIDTH*2; + break; } - break; - } } -static inline void video_drawstring(int xx, int yy, unsigned char *s) +static inline void video_drawstring (int xx, int yy, unsigned char *s) { - video_drawchars (xx, yy, s, strlen(s)) ; + video_drawchars (xx, yy, s, strlen (s)); } /* Relative to console plotting functions */ -static void video_putchars(int xx, int yy, unsigned char *s, int count) +static void video_putchars (int xx, int yy, unsigned char *s, int count) { #ifdef CONFIG_VIDEO_LOGO - video_drawchars (xx, yy + VIDEO_LOGO_HEIGHT, s, count) ; + video_drawchars (xx, yy + VIDEO_LOGO_HEIGHT, s, count); #else - video_drawchars (xx, yy, s, count) ; + video_drawchars (xx, yy, s, count); #endif } -static void video_putchar(int xx, int yy, unsigned char c) +static void video_putchar (int xx, int yy, unsigned char c) { #ifdef CONFIG_VIDEO_LOGO - video_drawchars (xx, yy + VIDEO_LOGO_HEIGHT, &c, 1) ; + video_drawchars (xx, yy + VIDEO_LOGO_HEIGHT, &c, 1); #else - video_drawchars (xx, yy, &c, 1) ; + video_drawchars (xx, yy, &c, 1); #endif } -static inline void video_putstring(int xx, int yy, unsigned char *s) +static inline void video_putstring (int xx, int yy, unsigned char *s) { - video_putchars (xx, yy, s, strlen(s)) ; + video_putchars (xx, yy, s, strlen (s)); } /************************************************************************/ /* ** VIDEO CONTROLLER LOW-LEVEL FUNCTIONS */ /************************************************************************/ -static void video_mode_dupefield(VRAM *source, VRAM *dest, int entries) +static void video_mode_dupefield (VRAM * source, VRAM * dest, int entries) { - int i ; + int i; - for(i=0; ihx = Hx ; - vr->vx = Vx ; - vr->fx = Fx ; - vr->bx = Bx ; - vr->vds = VDS ; - vr->inter = INT ; - vr->lcyc = LCYC ; - vr->lp = LP ; - vr->lst = LST ; + vr->hx = Hx; + vr->vx = Vx; + vr->fx = Fx; + vr->bx = Bx; + vr->vds = VDS; + vr->inter = INT; + vr->lcyc = LCYC; + vr->lp = LP; + vr->lst = LST; } #define ADDENTRY(a,b,c,d,e,f,g,h,i) video_mode_addentry(&vr[entry++],a,b,c,d,e,f,g,h,i) static int video_mode_generate (void) { - immap_t *immap = (immap_t *)CFG_IMMR; - VRAM *vr = (VRAM *)(((void *)immap) + 0xb00); /* Pointer to the VRAM table */ - int DX, X1, X2, DY, Y1, Y2, entry=0, fifo ; + immap_t *immap = (immap_t *) CFG_IMMR; + VRAM *vr = (VRAM *) (((void *) immap) + 0xb00); /* Pointer to the VRAM table */ + int DX, X1, X2, DY, Y1, Y2, entry = 0, fifo; - /* CHECKING PARAMETERS */ + /* CHECKING PARAMETERS */ - if (video_panning_factor_y < -128) - video_panning_factor_y = -128; + if (video_panning_factor_y < -128) + video_panning_factor_y = -128; - if (video_panning_factor_y > 128) - video_panning_factor_y = 128; + if (video_panning_factor_y > 128) + video_panning_factor_y = 128; - if (video_panning_factor_x < -128) - video_panning_factor_x = -128; + if (video_panning_factor_x < -128) + video_panning_factor_x = -128; - if (video_panning_factor_x > 128) - video_panning_factor_x = 128; + if (video_panning_factor_x > 128) + video_panning_factor_x = 128; - /* Setting panning */ + /* Setting panning */ - DX = video_panning_range_x = (VIDEO_ACTIVE_COLS - VIDEO_COLS) * 2 ; - DY = video_panning_range_y = (VIDEO_ACTIVE_ROWS - VIDEO_ROWS) / 2 ; + DX = video_panning_range_x = (VIDEO_ACTIVE_COLS - VIDEO_COLS) * 2; + DY = video_panning_range_y = (VIDEO_ACTIVE_ROWS - VIDEO_ROWS) / 2; - video_panning_value_x = (video_panning_factor_x + 128) * DX / 256; - video_panning_value_y = (video_panning_factor_y + 128) * DY / 256; + video_panning_value_x = (video_panning_factor_x + 128) * DX / 256; + video_panning_value_y = (video_panning_factor_y + 128) * DY / 256; - /* We assume these are burst units (multiplied by 2, we need it pari) */ - X1 = video_panning_value_x & 0xfffe; - X2 = DX - X1; + /* We assume these are burst units (multiplied by 2, we need it pari) */ + X1 = video_panning_value_x & 0xfffe; + X2 = DX - X1; - /* We assume these are field line units (divided by 2, we need it pari) */ - Y1 = video_panning_value_y & 0xfffe; - Y2 = DY - Y1; + /* We assume these are field line units (divided by 2, we need it pari) */ + Y1 = video_panning_value_y & 0xfffe; + Y2 = DY - Y1; #ifdef VIDEO_MODE_NTSC /* @@ -535,103 +541,99 @@ static int video_mode_generate (void) * * Retrace blanking */ - ADDENTRY( 0, 0, 3, 0, 1, 0, 3, 1, 0 ); - ADDENTRY( 3, 0, 3, 0, 1, 0, 243, 0, 0 ); - ADDENTRY( 3, 0, 3, 0, 1, 0,1440, 0, 0 ); - ADDENTRY( 3, 0, 3, 0, 1, 0, 32, 1, 0 ); + ADDENTRY (0, 0, 3, 0, 1, 0, 3, 1, 0); + ADDENTRY (3, 0, 3, 0, 1, 0, 243, 0, 0); + ADDENTRY (3, 0, 3, 0, 1, 0, 1440, 0, 0); + ADDENTRY (3, 0, 3, 0, 1, 0, 32, 1, 0); /* * Vertical blanking */ - ADDENTRY( 0, 0, 0, 0, 1, 0, 18, 1, 0 ); - ADDENTRY( 3, 0, 0, 0, 1, 0, 243, 0, 0 ); - ADDENTRY( 3, 0, 0, 0, 1, 0,1440, 0, 0 ); - ADDENTRY( 3, 0, 0, 0, 1, 0, 32, 1, 0 ); + ADDENTRY (0, 0, 0, 0, 1, 0, 18, 1, 0); + ADDENTRY (3, 0, 0, 0, 1, 0, 243, 0, 0); + ADDENTRY (3, 0, 0, 0, 1, 0, 1440, 0, 0); + ADDENTRY (3, 0, 0, 0, 1, 0, 32, 1, 0); /* * Odd field active area (TOP) */ - if (Y1 > 0) - { - ADDENTRY( 0, 0, 0, 0, 1, 0, Y1, 1, 0 ); - ADDENTRY( 3, 0, 0, 0, 1, 0, 235, 0, 0 ); - ADDENTRY( 3, 0, 0, 3, 1, 0,1448, 0, 0 ); - ADDENTRY( 3, 0, 0, 0, 1, 0, 32, 1, 0 ); - } + if (Y1 > 0) { + ADDENTRY (0, 0, 0, 0, 1, 0, Y1, 1, 0); + ADDENTRY (3, 0, 0, 0, 1, 0, 235, 0, 0); + ADDENTRY (3, 0, 0, 3, 1, 0, 1448, 0, 0); + ADDENTRY (3, 0, 0, 0, 1, 0, 32, 1, 0); + } /* * Odd field active area */ - ADDENTRY( 0, 0, 0, 0, 1, 0, 240 - DY, 1, 0 ); - ADDENTRY( 3, 0, 0, 0, 1, 0, 235, 0, 0 ); - ADDENTRY( 3, 0, 0, 3, 1, 0, 8+X1, 0, 0 ); - ADDENTRY( 3, 0, 0, 3, 0, 0,VIDEO_COLS * 2, 0, 0 ); + ADDENTRY (0, 0, 0, 0, 1, 0, 240 - DY, 1, 0); + ADDENTRY (3, 0, 0, 0, 1, 0, 235, 0, 0); + ADDENTRY (3, 0, 0, 3, 1, 0, 8 + X1, 0, 0); + ADDENTRY (3, 0, 0, 3, 0, 0, VIDEO_COLS * 2, 0, 0); - if (X2 > 0) - ADDENTRY( 3, 0, 0, 3, 1, 0, X2, 0, 0 ); + if (X2 > 0) + ADDENTRY (3, 0, 0, 3, 1, 0, X2, 0, 0); - ADDENTRY( 3, 0, 0, 0, 1, 0, 32, 1, 0 ); + ADDENTRY (3, 0, 0, 0, 1, 0, 32, 1, 0); /* * Odd field active area (BOTTOM) */ - if (Y1 > 0) - { - ADDENTRY( 0, 0, 0, 0, 1, 0, Y2, 1, 0 ); - ADDENTRY( 3, 0, 0, 0, 1, 0, 235, 0, 0 ); - ADDENTRY( 3, 0, 0, 3, 1, 0,1448, 0, 0 ); - ADDENTRY( 3, 0, 0, 0, 1, 0, 32, 1, 0 ); - } + if (Y1 > 0) { + ADDENTRY (0, 0, 0, 0, 1, 0, Y2, 1, 0); + ADDENTRY (3, 0, 0, 0, 1, 0, 235, 0, 0); + ADDENTRY (3, 0, 0, 3, 1, 0, 1448, 0, 0); + ADDENTRY (3, 0, 0, 0, 1, 0, 32, 1, 0); + } /* * Vertical blanking */ - ADDENTRY( 0, 0, 0, 0, 1, 0, 4, 1, 0 ); - ADDENTRY( 3, 0, 0, 0, 1, 0, 243, 0, 0 ); - ADDENTRY( 3, 0, 0, 0, 1, 0,1440, 0, 0 ); - ADDENTRY( 3, 0, 0, 0, 1, 0, 32, 1, 0 ); + ADDENTRY (0, 0, 0, 0, 1, 0, 4, 1, 0); + ADDENTRY (3, 0, 0, 0, 1, 0, 243, 0, 0); + ADDENTRY (3, 0, 0, 0, 1, 0, 1440, 0, 0); + ADDENTRY (3, 0, 0, 0, 1, 0, 32, 1, 0); /* * Vertical blanking */ - ADDENTRY( 0, 0, 3, 0, 1, 0, 19, 1, 0 ); - ADDENTRY( 3, 0, 3, 0, 1, 0, 243, 0, 0 ); - ADDENTRY( 3, 0, 3, 0, 1, 0,1440, 0, 0 ); - ADDENTRY( 3, 0, 3, 0, 1, 0, 32, 1, 0 ); + ADDENTRY (0, 0, 3, 0, 1, 0, 19, 1, 0); + ADDENTRY (3, 0, 3, 0, 1, 0, 243, 0, 0); + ADDENTRY (3, 0, 3, 0, 1, 0, 1440, 0, 0); + ADDENTRY (3, 0, 3, 0, 1, 0, 32, 1, 0); /* * Even field active area (TOP) */ - if (Y1 > 0) - { - ADDENTRY( 0, 0, 3, 0, 1, 0, Y1, 1, 0 ); - ADDENTRY( 3, 0, 3, 0, 1, 0, 235, 0, 0 ); - ADDENTRY( 3, 0, 3, 3, 1, 0,1448, 0, 0 ); - ADDENTRY( 3, 0, 3, 0, 1, 0, 32, 1, 0 ); - } + if (Y1 > 0) { + ADDENTRY (0, 0, 3, 0, 1, 0, Y1, 1, 0); + ADDENTRY (3, 0, 3, 0, 1, 0, 235, 0, 0); + ADDENTRY (3, 0, 3, 3, 1, 0, 1448, 0, 0); + ADDENTRY (3, 0, 3, 0, 1, 0, 32, 1, 0); + } /* * Even field active area (CENTER) */ - ADDENTRY( 0, 0, 3, 0, 1, 0, 240 - DY, 1, 0 ); - ADDENTRY( 3, 0, 3, 0, 1, 0, 235, 0, 0 ); - ADDENTRY( 3, 0, 3, 3, 1, 0, 8+X1, 0, 0 ); - ADDENTRY( 3, 0, 3, 3, 0, 0,VIDEO_COLS * 2, 0, 0 ); + ADDENTRY (0, 0, 3, 0, 1, 0, 240 - DY, 1, 0); + ADDENTRY (3, 0, 3, 0, 1, 0, 235, 0, 0); + ADDENTRY (3, 0, 3, 3, 1, 0, 8 + X1, 0, 0); + ADDENTRY (3, 0, 3, 3, 0, 0, VIDEO_COLS * 2, 0, 0); - if (X2 > 0) - ADDENTRY( 3, 0, 3, 3, 1, 0, X2, 0, 0 ); + if (X2 > 0) + ADDENTRY (3, 0, 3, 3, 1, 0, X2, 0, 0); - ADDENTRY( 3, 0, 3, 0, 1, 0, 32, 1, 0 ); + ADDENTRY (3, 0, 3, 0, 1, 0, 32, 1, 0); /* * Even field active area (BOTTOM) */ - if (Y1 > 0) - { - ADDENTRY( 0, 0, 3, 0, 1, 0, Y2, 1, 0 ); - ADDENTRY( 3, 0, 3, 0, 1, 0, 235, 0, 0 ); - ADDENTRY( 3, 0, 3, 3, 1, 0,1448, 0, 0 ); - ADDENTRY( 3, 0, 3, 0, 1, 0, 32, 1, 0 ); - } + if (Y1 > 0) { + ADDENTRY (0, 0, 3, 0, 1, 0, Y2, 1, 0); + ADDENTRY (3, 0, 3, 0, 1, 0, 235, 0, 0); + ADDENTRY (3, 0, 3, 3, 1, 0, 1448, 0, 0); + ADDENTRY (3, 0, 3, 0, 1, 0, 32, 1, 0); + } /* * Vertical blanking */ - ADDENTRY( 0, 0, 3, 0, 1, 0, 1, 1, 0 ); - ADDENTRY( 3, 0, 3, 0, 1, 0, 243, 0, 0 ); - ADDENTRY( 3, 0, 3, 0, 1, 0,1440, 0, 0 ); - ADDENTRY( 3, 0, 3, 0, 1, 1, 32, 1, 1 ); + ADDENTRY (0, 0, 3, 0, 1, 0, 1, 1, 0); + ADDENTRY (3, 0, 3, 0, 1, 0, 243, 0, 0); + ADDENTRY (3, 0, 3, 0, 1, 0, 1440, 0, 0); + ADDENTRY (3, 0, 3, 0, 1, 1, 32, 1, 1); #endif #ifdef VIDEO_MODE_PAL @@ -640,292 +642,304 @@ static int video_mode_generate (void) * * vertical; blanking */ - ADDENTRY( 0, 0, 0, 0, 1, 0, 22, 1, 0 ); - ADDENTRY( 3, 0, 0, 0, 1, 0, 263, 0, 0 ); - ADDENTRY( 3, 0, 0, 0, 1, 0,1440, 0, 0 ); - ADDENTRY( 3, 0, 0, 0, 1, 0, 24, 1, 0 ); + ADDENTRY (0, 0, 0, 0, 1, 0, 22, 1, 0); + ADDENTRY (3, 0, 0, 0, 1, 0, 263, 0, 0); + ADDENTRY (3, 0, 0, 0, 1, 0, 1440, 0, 0); + ADDENTRY (3, 0, 0, 0, 1, 0, 24, 1, 0); /* * active area (TOP) */ - if (Y1 > 0) - { - ADDENTRY( 0, 0, 0, 0, 1, 0, Y1, 1, 0 ); /* 11? */ - ADDENTRY( 3, 0, 0, 0, 1, 0, 255, 0, 0 ); - ADDENTRY( 3, 0, 0, 3, 1, 0,1448, 0, 0 ); - ADDENTRY( 3, 0, 0, 0, 1, 0, 24, 1, 0 ); - } + if (Y1 > 0) { + ADDENTRY (0, 0, 0, 0, 1, 0, Y1, 1, 0); /* 11? */ + ADDENTRY (3, 0, 0, 0, 1, 0, 255, 0, 0); + ADDENTRY (3, 0, 0, 3, 1, 0, 1448, 0, 0); + ADDENTRY (3, 0, 0, 0, 1, 0, 24, 1, 0); + } /* * field active area (CENTER) */ - ADDENTRY( 0, 0, 0, 0, 1, 0, 288-DY, 1, 0 ); /* 265? */ - ADDENTRY( 3, 0, 0, 0, 1, 0, 255, 0, 0 ); - ADDENTRY( 3, 0, 0, 3, 1, 0, 8 + X1, 0, 0 ); - ADDENTRY( 3, 0, 0, 3, 0, 0, VIDEO_COLS * 2, 0, 0 ); + ADDENTRY (0, 0, 0, 0, 1, 0, 288 - DY, 1, 0); /* 265? */ + ADDENTRY (3, 0, 0, 0, 1, 0, 255, 0, 0); + ADDENTRY (3, 0, 0, 3, 1, 0, 8 + X1, 0, 0); + ADDENTRY (3, 0, 0, 3, 0, 0, VIDEO_COLS * 2, 0, 0); - if (X2 > 0) - ADDENTRY( 3, 0, 0, 1, 1, 0, X2, 0, 0 ); + if (X2 > 0) + ADDENTRY (3, 0, 0, 1, 1, 0, X2, 0, 0); - ADDENTRY( 3, 0, 0, 0, 1, 0, 24, 1, 0 ); + ADDENTRY (3, 0, 0, 0, 1, 0, 24, 1, 0); /* * field active area (BOTTOM) */ - if (Y2 > 0) - { - ADDENTRY( 0, 0, 0, 0, 1, 0, Y2, 1, 0 ); /* 12? */ - ADDENTRY( 3, 0, 0, 0, 1, 0, 255, 0, 0 ); - ADDENTRY( 3, 0, 0, 3, 1, 0,1448, 0, 0 ); - ADDENTRY( 3, 0, 0, 0, 1, 0, 24, 1, 0 ); - } + if (Y2 > 0) { + ADDENTRY (0, 0, 0, 0, 1, 0, Y2, 1, 0); /* 12? */ + ADDENTRY (3, 0, 0, 0, 1, 0, 255, 0, 0); + ADDENTRY (3, 0, 0, 3, 1, 0, 1448, 0, 0); + ADDENTRY (3, 0, 0, 0, 1, 0, 24, 1, 0); + } /* * field vertical; blanking */ - ADDENTRY( 0, 0, 0, 0, 1, 0, 2, 1, 0 ); - ADDENTRY( 3, 0, 0, 0, 1, 0, 263, 0, 0 ); - ADDENTRY( 3, 0, 0, 0, 1, 0,1440, 0, 0 ); - ADDENTRY( 3, 0, 0, 0, 1, 0, 24, 1, 0 ); + ADDENTRY (0, 0, 0, 0, 1, 0, 2, 1, 0); + ADDENTRY (3, 0, 0, 0, 1, 0, 263, 0, 0); + ADDENTRY (3, 0, 0, 0, 1, 0, 1440, 0, 0); + ADDENTRY (3, 0, 0, 0, 1, 0, 24, 1, 0); /* * Create the other field (like this, but whit other field selected, * one more cycle loop and a last identifier) */ - video_mode_dupefield (vr, &vr[entry], entry); + video_mode_dupefield (vr, &vr[entry], entry); #endif - /* See what FIFO are we using */ - fifo = GETBIT(immap->im_vid.vid_vsr, VIDEO_VSR_CAS); + /* See what FIFO are we using */ + fifo = GETBIT (immap->im_vid.vid_vsr, VIDEO_VSR_CAS); - /* Set number of lines and burst (only one frame for now) */ - if (fifo) - immap->im_vid.vid_vfcr0 = VIDEO_BURST_LEN | - (VIDEO_BURST_LEN << 8) | - ((VIDEO_ROWS / 2) << 19) ; - else - immap->im_vid.vid_vfcr1 = VIDEO_BURST_LEN | - (VIDEO_BURST_LEN << 8) | - ((VIDEO_ROWS / 2) << 19) ; + /* Set number of lines and burst (only one frame for now) */ + if (fifo) { + immap->im_vid.vid_vfcr0 = VIDEO_BURST_LEN | + (VIDEO_BURST_LEN << 8) | ((VIDEO_ROWS / 2) << 19); + } else { + immap->im_vid.vid_vfcr1 = VIDEO_BURST_LEN | + (VIDEO_BURST_LEN << 8) | ((VIDEO_ROWS / 2) << 19); + } - SETBIT(immap->im_vid.vid_vcmr, VIDEO_VCMR_ASEL, !fifo); + SETBIT (immap->im_vid.vid_vcmr, VIDEO_VCMR_ASEL, !fifo); /* * Wait until changes are applied (not done) * while (GETBIT(immap->im_vid.vid_vsr, VIDEO_VSR_CAS) == fifo) ; */ - /* Return number of VRAM entries */ - return entry * 2 ; + /* Return number of VRAM entries */ + return entry * 2; } static void video_encoder_init (void) { #ifdef VIDEO_I2C - int rc; + int rc; - /* Initialize the I2C */ - PRINTD("\n[VIDEO ENCODER] Initializing I2C bus..."); - i2c_init(CFG_I2C_SPEED, CFG_I2C_SLAVE); + /* Initialize the I2C */ + debug ("[VIDEO ENCODER] Initializing I2C bus...\n"); + i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE); #ifdef CONFIG_FADS - /* Reset ADV7176 chip */ - PRINTD("\n[VIDEO ENCODER] Resetting encoder..."); - (*(int *)BCSR4) &= ~(1 << 21); + /* Reset ADV7176 chip */ + debug ("[VIDEO ENCODER] Resetting encoder...\n"); + (*(int *) BCSR4) &= ~(1 << 21); - /* Wait for 5 ms inside the reset */ - PRINTD("\n[VIDEO ENCODER] Waiting for encoder reset..."); - udelay(5000); + /* Wait for 5 ms inside the reset */ + debug ("[VIDEO ENCODER] Waiting for encoder reset...\n"); + udelay (5000); - /* Take ADV7176 out of reset */ - (*(int *)BCSR4) |= 1 << 21; + /* Take ADV7176 out of reset */ + (*(int *) BCSR4) |= 1 << 21; - /* Wait for 5 ms after the reset */ - udelay(5000); -#endif + /* Wait for 5 ms after the reset */ + udelay (5000); +#endif /* CONFIG_FADS */ - /* Send configuration */ - PRINTD("\n[VIDEO ENCODER] Configuring the encoder..."); -#if (VIDEO_DEBUG_STEP == 1) - printf("Sending %d bytes (%08x) to I2C 0x%x\n", - VIDEO_I2C_DATA_SIZE, VIDEO_I2C_DATA_ADDR, VIDEO_I2C_ADDR); -#endif - if ((rc = i2c_write(VIDEO_I2C_ADDR, 0, 1, - VIDEO_I2C_DATA_ADDR, VIDEO_I2C_DATA_SIZE)) != 0) { - printf ("i2c_send error: rc=%d\n", rc); + /* Send configuration */ +#ifdef DEBUG + { + int i; + + puts ("[VIDEO ENCODER] Configuring the encoder...\n"); + + printf ("Sending %d bytes (@ %08lX) to I2C 0x%X:\n ", + sizeof(video_encoder_data), + (ulong)video_encoder_data, + VIDEO_I2C_ADDR); + for (i=0; iim_vid.vid_vbcb = VIDEO_BG_COL; + /* Set black background */ + debug ("[VIDEO CTRL] Setting background color...\n"); + immap->im_vid.vid_vbcb = VIDEO_BG_COL; - /* Show the background */ - PRINTD("\n[VIDEO CTRL] Forcing background..."); - SETBIT(immap->im_vid.vid_vcmr, VIDEO_VCMR_BD, 1); + /* Show the background */ + debug ("[VIDEO CTRL] Forcing background...\n"); + SETBIT (immap->im_vid.vid_vcmr, VIDEO_VCMR_BD, 1); - /* Turn off video controller */ - PRINTD("\n[VIDEO CTRL] Turning off video controller..."); - SETBIT(immap->im_vid.vid_vccr, VIDEO_VCCR_VON, 0) ; + /* Turn off video controller */ + debug ("[VIDEO CTRL] Turning off video controller...\n"); + SETBIT (immap->im_vid.vid_vccr, VIDEO_VCCR_VON, 0); #ifdef CONFIG_FADS - /* Turn on Video Port LED */ - PRINTD("\n[VIDEO CTRL] Turning off video port led..."); - SETBIT(*(int *)BCSR4, VIDEO_BCSR4_VIDLED_BIT, 1); + /* Turn on Video Port LED */ + debug ("[VIDEO CTRL] Turning off video port led...\n"); + SETBIT (*(int *) BCSR4, VIDEO_BCSR4_VIDLED_BIT, 1); - /* Disable internal clock */ - PRINTD("\n[VIDEO CTRL] Disabling internal clock..."); - SETBIT(*(int *)BCSR4, VIDEO_BCSR4_EXTCLK_BIT, 0); + /* Disable internal clock */ + debug ("[VIDEO CTRL] Disabling internal clock...\n"); + SETBIT (*(int *) BCSR4, VIDEO_BCSR4_EXTCLK_BIT, 0); #endif - /* Generate and make active a new video mode */ - PRINTD("\n[VIDEO CTRL] Generating video mode..."); - video_mode_generate (); + /* Generate and make active a new video mode */ + debug ("[VIDEO CTRL] Generating video mode...\n"); + video_mode_generate (); - /* Start of frame buffer (even and odd frame, to make it working with */ - /* any selected active set) */ - PRINTD("\n[VIDEO CTRL] Setting frame address..."); - immap->im_vid.vid_vfaa1 = - immap->im_vid.vid_vfaa0 = (u32) video_fb_address ; - immap->im_vid.vid_vfba1 = - immap->im_vid.vid_vfba0 = (u32) video_fb_address + VIDEO_LINE_LEN ; + /* Start of frame buffer (even and odd frame, to make it working with */ + /* any selected active set) */ + debug ("[VIDEO CTRL] Setting frame address...\n"); + immap->im_vid.vid_vfaa1 = + immap->im_vid.vid_vfaa0 = (u32) video_fb_address; + immap->im_vid.vid_vfba1 = + immap->im_vid.vid_vfba0 = + (u32) video_fb_address + VIDEO_LINE_LEN; - /* YUV, Big endian, SHIFT/CLK/CLK input (BEFORE ENABLING 27MHZ EXT CLOCK) */ - PRINTD("\n[VIDEO CTRL] Setting pixel mode and clocks..."); - immap->im_vid.vid_vccr = 0x2042; + /* YUV, Big endian, SHIFT/CLK/CLK input (BEFORE ENABLING 27MHZ EXT CLOCK) */ + debug ("[VIDEO CTRL] Setting pixel mode and clocks...\n"); + immap->im_vid.vid_vccr = 0x2042; - /* Configure port pins */ - PRINTD("\n[VIDEO CTRL] Configuring input/ouput pins..."); - immap->im_ioport.iop_pdpar = 0x1fff; - immap->im_ioport.iop_pddir = 0x0000; + /* Configure port pins */ + debug ("[VIDEO CTRL] Configuring input/ouput pins...\n"); + immap->im_ioport.iop_pdpar = 0x1fff; + immap->im_ioport.iop_pddir = 0x0000; #ifdef CONFIG_FADS - /* Turn on Video Port Clock - ONLY AFTER SET VCCR TO ENABLE EXTERNAL CLOCK */ - PRINTD("\n[VIDEO CTRL] Turning on video clock..."); - SETBIT(*(int *)BCSR4, VIDEO_BCSR4_EXTCLK_BIT, 1); + /* Turn on Video Port Clock - ONLY AFTER SET VCCR TO ENABLE EXTERNAL CLOCK */ + debug ("[VIDEO CTRL] Turning on video clock...\n"); + SETBIT (*(int *) BCSR4, VIDEO_BCSR4_EXTCLK_BIT, 1); - /* Turn on Video Port LED */ - PRINTD("\n[VIDEO CTRL] Turning on video port led..."); - SETBIT(*(int *)BCSR4, VIDEO_BCSR4_VIDLED_BIT, 0); + /* Turn on Video Port LED */ + debug ("[VIDEO CTRL] Turning on video port led...\n"); + SETBIT (*(int *) BCSR4, VIDEO_BCSR4_VIDLED_BIT, 0); #endif - /* Blanking the screen. */ - PRINTD("\n[VIDEO CTRL] Blanking the screen..."); - video_fill(VIDEO_BG_COL); - - /* Turns on Aggressive Mode. Normally, turning on the caches will cause */ - /* the screen to flicker when the caches try to fill. This gives the */ - /* FIFO's for the Video Controller higher priority and prevents flickering */ - /* because of underrun. This may still be an issue when using FLASH, since */ - /* accessing data from Flash is so slow. */ - PRINTD("\n[VIDEO CTRL] Turning on aggressive mode..."); - immap->im_siu_conf.sc_sdcr = 0x40; - - /* Turn on video controller */ - PRINTD("\n[VIDEO CTRL] Turning on video controller..."); - SETBIT(immap->im_vid.vid_vccr, VIDEO_VCCR_VON, 1) ; - - /* Show the display */ - PRINTD("\n[VIDEO CTRL] Enabling the video..."); - SETBIT(immap->im_vid.vid_vcmr, VIDEO_VCMR_BD, 0); + /* Blanking the screen. */ + debug ("[VIDEO CTRL] Blanking the screen...\n"); + video_fill (VIDEO_BG_COL); + + /* + * Turns on Aggressive Mode. Normally, turning on the caches + * will cause the screen to flicker when the caches try to + * fill. This gives the FIFO's for the Video Controller + * higher priority and prevents flickering because of + * underrun. This may still be an issue when using FLASH, + * since accessing data from Flash is so slow. + */ + debug ("[VIDEO CTRL] Turning on aggressive mode...\n"); + immap->im_siu_conf.sc_sdcr = 0x40; + + /* Turn on video controller */ + debug ("[VIDEO CTRL] Turning on video controller...\n"); + SETBIT (immap->im_vid.vid_vccr, VIDEO_VCCR_VON, 1); + + /* Show the display */ + debug ("[VIDEO CTRL] Enabling the video...\n"); + SETBIT (immap->im_vid.vid_vcmr, VIDEO_VCMR_BD, 0); } /************************************************************************/ /* ** CONSOLE FUNCTIONS */ /************************************************************************/ -static void console_scrollup(void) +static void console_scrollup (void) { - /* Copy up rows ignoring the first one */ - memcpyl (CONSOLE_ROW_FIRST, CONSOLE_ROW_SECOND, CONSOLE_SCROLL_SIZE >> 2); + /* Copy up rows ignoring the first one */ + memcpyl (CONSOLE_ROW_FIRST, CONSOLE_ROW_SECOND, CONSOLE_SCROLL_SIZE >> 2); - /* Clear the last one */ - memsetl (CONSOLE_ROW_LAST, CONSOLE_ROW_SIZE >> 2, VIDEO_BG_COL); + /* Clear the last one */ + memsetl (CONSOLE_ROW_LAST, CONSOLE_ROW_SIZE >> 2, VIDEO_BG_COL); } static inline void console_back (void) { - console_col -- ; + console_col--; - if (console_col < 0) - { - console_col = CONSOLE_COLS-1 ; - console_row -- ; - if (console_row < 0) - console_row = 0; - } + if (console_col < 0) { + console_col = CONSOLE_COLS - 1; + console_row--; + if (console_row < 0) + console_row = 0; + } - video_putchar (console_col * VIDEO_FONT_WIDTH, console_row * VIDEO_FONT_HEIGHT, ' '); + video_putchar ( console_col * VIDEO_FONT_WIDTH, + console_row * VIDEO_FONT_HEIGHT, ' '); } static inline void console_newline (void) { - console_row ++ ; - console_col = 0 ; - - /* Check if we need to scroll the terminal */ - if (console_row >= CONSOLE_ROWS) - { - /* Scroll everything up */ - console_scrollup () ; - - /* Decrement row number */ - console_row -- ; - } + console_row++; + console_col = 0; + + /* Check if we need to scroll the terminal */ + if (console_row >= CONSOLE_ROWS) { + /* Scroll everything up */ + console_scrollup (); + + /* Decrement row number */ + console_row--; + } } -void video_putc(const char c) +void video_putc (const char c) { - if (!video_enable) - { - serial_putc(c); - return ; - } - - switch (c){ - case 13: /* Simply ignore this */ - break; - - case '\n': /* Next line, please */ - console_newline(); - break; - - case 9: /* Tab (8 chars alignment) */ - console_col |= 0x0008 ; /* Next 8 chars boundary */ - console_col &= ~0x0007 ; /* Set this bit to zero */ - - if (console_col >= CONSOLE_COLS) - console_newline(); - break; - - case 8: /* Eat last character */ - console_back(); - break; - - default: /* Add to the console */ - video_putchar (console_col * VIDEO_FONT_WIDTH, - console_row * VIDEO_FONT_HEIGHT, c); - console_col++ ; - /* Check if we need to go to next row */ - if (console_col >= CONSOLE_COLS) - console_newline(); - } + if (!video_enable) { + serial_putc (c); + return; + } + + switch (c) { + case 13: /* Simply ignore this */ + break; + + case '\n': /* Next line, please */ + console_newline (); + break; + + case 9: /* Tab (8 chars alignment) */ + console_col |= 0x0008; /* Next 8 chars boundary */ + console_col &= ~0x0007; /* Set this bit to zero */ + + if (console_col >= CONSOLE_COLS) + console_newline (); + break; + + case 8: /* Eat last character */ + console_back (); + break; + + default: /* Add to the console */ + video_putchar ( console_col * VIDEO_FONT_WIDTH, + console_row * VIDEO_FONT_HEIGHT, c); + console_col++; + /* Check if we need to go to next row */ + if (console_col >= CONSOLE_COLS) + console_newline (); + } } void video_puts (const char *s) { - int count = strlen(s); - - if (!video_enable) - while(count--) - serial_putc(*s++); - else - while(count--) - video_putc(*s++); + int count = strlen (s); + + if (!video_enable) + while (count--) + serial_putc (*s++); + else + while (count--) + video_putc (*s++); } /************************************************************************/ @@ -937,38 +951,38 @@ void video_puts (const char *s) #define BLINK_TIMER_ID 0 #define BLINK_TIMER_HZ 2 -static unsigned char blink_enabled = 0; -static timer_t blink_timer ; +static unsigned char blink_enabled = 0; +static timer_t blink_timer; static void blink_update (void) { - static int blink_row = -1, blink_col = -1, blink_old = 0; - -/* Check if we have a new position to invert */ - if ((console_row != blink_row) || (console_col != blink_col)) - { - /* Check if we need to reverse last character */ - if (blink_old) - video_revchar (blink_col * VIDEO_FONT_WIDTH, - (blink_row + static int blink_row = -1, blink_col = -1, blink_old = 0; + + /* Check if we have a new position to invert */ + if ((console_row != blink_row) || (console_col != blink_col)) { + /* Check if we need to reverse last character */ + if (blink_old) + video_revchar ( blink_col * VIDEO_FONT_WIDTH, + (blink_row #ifdef CONFIG_VIDEO_LOGO - + VIDEO_LOGO_HEIGHT + + VIDEO_LOGO_HEIGHT #endif - )* VIDEO_FONT_HEIGHT); + ) * VIDEO_FONT_HEIGHT); - /* Update values */ - blink_row = console_row ; - blink_col = console_col ; - blink_old = 0 ; - } + /* Update values */ + blink_row = console_row; + blink_col = console_col; + blink_old = 0; + } /* Reverse this character */ - blink_old = !blink_old ; - video_revchar (console_col * VIDEO_FONT_WIDTH, (console_row + blink_old = !blink_old; + video_revchar ( console_col * VIDEO_FONT_WIDTH, + (console_row #ifdef CONFIG_VIDEO_LOGO - +VIDEO_LOGO_HEIGHT + + VIDEO_LOGO_HEIGHT #endif - ) * VIDEO_FONT_HEIGHT); + ) * VIDEO_FONT_HEIGHT); } @@ -978,33 +992,35 @@ static void blink_update (void) static void blink_handler (void *arg) { /* Blink */ - blink_update(); + blink_update (); /* Ack the timer */ - timer_ack (&blink_timer); + timer_ack (&blink_timer); } int blink_set (int blink) { - int ret = blink_enabled ; + int ret = blink_enabled; - if (blink) - timer_enable (&blink_timer); - else - timer_disable (&blink_timer); + if (blink) + timer_enable (&blink_timer); + else + timer_disable (&blink_timer); - blink_enabled = blink ; + blink_enabled = blink; - return ret ; + return ret; } static inline void blink_close (void) { - timer_close (&blink_timer); + timer_close (&blink_timer); } static inline void blink_init (void) { - timer_init (&blink_timer, BLINK_TIMER_ID, BLINK_TIMER_HZ, blink_handler); + timer_init (&blink_timer, + BLINK_TIMER_ID, BLINK_TIMER_HZ, + blink_handler); } #endif @@ -1013,60 +1029,59 @@ static inline void blink_init (void) /************************************************************************/ #ifdef CONFIG_VIDEO_LOGO -void easylogo_plot (fastimage_t *image, void *screen, int width, int x, int y) +void easylogo_plot (fastimage_t * image, void *screen, int width, int x, + int y) { - int skip = width - image->width, - xcount, - ycount = image->height; + int skip = width - image->width, xcount, ycount = image->height; #ifdef VIDEO_MODE_YUYV - unsigned short + unsigned short *source = (unsigned short *) image->data, - *dest = (unsigned short *) screen + y * width + x; - - while (ycount--) - { - xcount = image->width ; - while (xcount--) - *dest++ = *source++; - dest += skip ; - } + *dest = (unsigned short *) screen + y * width + x; + + while (ycount--) { + xcount = image->width; + while (xcount--) + *dest++ = *source++; + dest += skip; + } #endif #ifdef VIDEO_MODE_RGB - unsigned char + unsigned char *source = (unsigned short *) image->data, - *dest = (unsigned short *) screen + ((y * width) + x)*3; - - while (ycount--) - { - xcount = image->width * 3 ; - memcpy(dest, source, xcount); - source += xcount ; - dest += ycount ; - } + *dest = (unsigned short *) screen + ((y * width) + x) * 3; + + while (ycount--) { + xcount = image->width * 3; + memcpy (dest, source, xcount); + source += xcount; + dest += ycount; + } #endif } static void *video_logo (void) { - u16 *screen = video_fb_address, width = VIDEO_COLS ; - char info[80]; + u16 *screen = video_fb_address, width = VIDEO_COLS; + char info[80]; - easylogo_plot (VIDEO_LOGO_ADDR, screen, width, 0, 0); + easylogo_plot (VIDEO_LOGO_ADDR, screen, width, 0, 0); #ifdef VIDEO_INFO - sprintf(info, "%s (%s - %s) ",PPCBOOT_VERSION,__DATE__,__TIME__); - video_drawstring(VIDEO_INFO_X, VIDEO_INFO_Y, info); + sprintf (info, "%s (%s - %s) ", PPCBOOT_VERSION, __DATE__, __TIME__); + video_drawstring (VIDEO_INFO_X, VIDEO_INFO_Y, info); #ifdef CONFIG_FADS - sprintf(info, "MPC823 CPU at 50 Mhz on FADS823 board"); - video_drawstring(VIDEO_INFO_X, VIDEO_INFO_Y + VIDEO_FONT_HEIGHT, info); + sprintf (info, "MPC823 CPU at 50 MHz on FADS823 board"); + video_drawstring (VIDEO_INFO_X, VIDEO_INFO_Y + VIDEO_FONT_HEIGHT, + info); - sprintf(info, "2Mb FLASH - 8Mb DRAM - 4Mb SRAM"); - video_drawstring(VIDEO_INFO_X, VIDEO_INFO_Y + VIDEO_FONT_HEIGHT*2, info); + sprintf (info, "2MB FLASH - 8MB DRAM - 4MB SRAM"); + video_drawstring (VIDEO_INFO_X, VIDEO_INFO_Y + VIDEO_FONT_HEIGHT * 2, + info); #endif #endif - return video_fb_address + VIDEO_LOGO_HEIGHT * VIDEO_LINE_LEN ; + return video_fb_address + VIDEO_LOGO_HEIGHT * VIDEO_LINE_LEN; } #endif @@ -1074,91 +1089,109 @@ static void *video_logo (void) /* ** VIDEO HIGH-LEVEL FUNCTIONS */ /************************************************************************/ -static int video_init(void *videobase) +static int video_init (void *videobase) { - /* Initialize the encoder */ - PRINTD("\n[VIDEO] Initializing video encoder..."); - video_encoder_init(); - - /* Initialize the video controller */ -#if VIDEO_DEBUG_STEP == 1 - printf("\n[VIDEO] Initializing video controller at %08x...", (int)videobase); -#endif - video_ctrl_init(videobase); - - /* Setting the palette */ - video_setpalette (CONSOLE_COLOR_BLACK , 0, 0, 0) ; - video_setpalette (CONSOLE_COLOR_WHITE , 0xff, 0xff, 0xff) ; - video_setpalette (CONSOLE_COLOR_GRAY , 0xaa, 0xaa, 0xaa) ; - video_setbgcolor (CONSOLE_COLOR_BLACK ) ; - video_setfgcolor (CONSOLE_COLOR_GRAY ) ; + /* Initialize the encoder */ + debug ("[VIDEO] Initializing video encoder...\n"); + video_encoder_init (); + + /* Initialize the video controller */ + debug ("[VIDEO] Initializing video controller at %08x...\n", + (int) videobase); + video_ctrl_init (videobase); + + /* Setting the palette */ + video_setpalette (CONSOLE_COLOR_BLACK, 0, 0, 0); + video_setpalette (CONSOLE_COLOR_WHITE, 0xff, 0xff, 0xff); + video_setpalette (CONSOLE_COLOR_GRAY, 0xaa, 0xaa, 0xaa); + video_setbgcolor (CONSOLE_COLOR_BLACK); + video_setfgcolor (CONSOLE_COLOR_GRAY); #ifdef CONFIG_VIDEO_LOGO - /* Paint the logo and retrieve tv base address */ - PRINTD("\n[VIDEO] Drawing the logo..."); - video_console_address = video_logo(); + /* Paint the logo and retrieve tv base address */ + debug ("[VIDEO] Drawing the logo...\n"); + video_console_address = video_logo (); #else - video_console_address = video_fb_address; + video_console_address = video_fb_address; #endif #ifdef VIDEO_BLINK - /* Enable the blinking (under construction) */ - blink_init (); - blink_set (0); /* To Fix! */ + /* Enable the blinking (under construction) */ + blink_init (); + blink_set (0); /* To Fix! */ #endif - /* Initialize the console */ - console_col = 0; - console_row = 0; - video_enable = 1 ; + /* Initialize the console */ + console_col = 0; + console_row = 0; + video_enable = 1; -#if 0 - /* Showing some information */ - printf("%s %dx%dx%d (%s) on %s - console %dx%d\n", #ifdef VIDEO_MODE_PAL - "PAL", +# define VIDEO_MODE_TMP1 "PAL" #endif #ifdef VIDEO_MODE_NTSC - "NTSC", +# define VIDEO_MODE_TMP1 "NTSC" #endif - VIDEO_COLS, VIDEO_ROWS, VIDEO_MODE_BPP, #ifdef VIDEO_MODE_YUYV - "YCbYCr", +# define VIDEO_MODE_TMP2 "YCbYCr" #endif #ifdef VIDEO_MODE_RGB - "RGB", -#endif - VIDEO_ENCODER_NAME, - CONSOLE_COLS, - CONSOLE_ROWS - ); +# define VIDEO_MODE_TMP2 "RGB" #endif - return 0 ; + debug ( VIDEO_MODE_TMP1 + " %dx%dx%d (" VIDEO_MODE_TMP2 ") on %s - console %dx%d\n", + VIDEO_COLS, VIDEO_ROWS, VIDEO_MODE_BPP, + VIDEO_ENCODER_NAME, CONSOLE_COLS, CONSOLE_ROWS); + return 0; } int drv_video_init (void) { - DECLARE_GLOBAL_DATA_PTR; /* needed for CONFIG_VIDEO_ADDR */ + DECLARE_GLOBAL_DATA_PTR; - int error, devices = 1 ; + int error, devices = 1; - device_t videodev ; + device_t videodev; - video_init((void *)CONFIG_VIDEO_ADDR); /* Video initialization */ + video_init ((void *)(gd->fb_base)); /* Video initialization */ /* Device initialization */ - memset (&videodev, 0, sizeof(videodev)); + memset (&videodev, 0, sizeof (videodev)); + + strcpy (videodev.name, "video"); + videodev.ext = DEV_EXT_VIDEO; /* Video extensions */ + videodev.flags = DEV_FLAGS_OUTPUT; /* Output only */ + videodev.putc = video_putc; /* 'putc' function */ + videodev.puts = video_puts; /* 'puts' function */ + + error = device_register (&videodev); + + return (error == 0) ? devices : error; +} + +/************************************************************************/ +/* ** ROM capable initialization part - needed to reserve FB memory */ +/************************************************************************/ - strcpy(videodev.name, "video"); - videodev.ext = DEV_EXT_VIDEO ; /* Video extensions */ - videodev.flags = DEV_FLAGS_OUTPUT; /* Output only */ - videodev.putc = video_putc ; /* 'putc' function */ - videodev.puts = video_puts ; /* 'puts' function */ +/* + * This is called early in the system initialization to grab memory + * for the video controller. + * Returns new address for monitor, after reserving video buffer memory + * + * Note that this is running from ROM, so no write access to global data. + */ +ulong video_setmem (ulong addr) +{ + /* Allocate pages for the frame buffer. */ + addr -= VIDEO_SIZE; - error = device_register (&videodev); + debug ("Reserving %dk for Video Framebuffer at: %08lx\n", + VIDEO_SIZE>>10, addr); - return (error == 0) ? devices : error ; + return (addr); } + + #endif diff --git a/include/asm-arm/global_data.h b/include/asm-arm/global_data.h index bf4e126..bf26d0b 100644 --- a/include/asm-arm/global_data.h +++ b/include/asm-arm/global_data.h @@ -42,7 +42,7 @@ typedef struct global_data { unsigned long env_addr; /* Address of Environment struct */ unsigned long env_valid; /* Checksum of Environment valid? */ #ifdef CONFIG_VFD - unsigned long vfd_base; /* base address of VFD frame buffer */ + unsigned long fb_base; /* base address of frame buffer */ #endif #if 0 unsigned long cpu_clk; /* CPU clock in Hz! */ diff --git a/include/asm-ppc/global_data.h b/include/asm-ppc/global_data.h index 5ab8edb..7cf234d 100644 --- a/include/asm-ppc/global_data.h +++ b/include/asm-ppc/global_data.h @@ -62,8 +62,8 @@ typedef struct global_data { #if defined(CONFIG_SANDPOINT) || defined(CONFIG_MUSENKI) void * console_addr; #endif -#ifdef CONFIG_LCD - unsigned long lcd_base; /* Base address of LCD frambuffer mem */ +#if defined(CONFIG_LCD) || defined(CONFIG_VIDEO) + unsigned long fb_base; /* Base address of framebuffer memory */ #endif #ifdef CONFIG_BOARD_TYPES unsigned long board_type; diff --git a/include/common.h b/include/common.h index 77226a5..16cd321 100644 --- a/include/common.h +++ b/include/common.h @@ -335,14 +335,13 @@ ulong post_word_load (void); void mii_init (void); /* $(CPU)/.../lcd.c */ -#ifdef CONFIG_LCD ulong lcd_setmem (ulong); -#endif /* CONFIG_LCD */ /* $(CPU)/.../vfd.c */ -#ifdef CONFIG_VFD ulong vfd_setmem (ulong); -#endif /* CONFIG_VFD */ + +/* $(CPU)/.../video.c */ +ulong video_setmem (ulong); /* ppc/cache.c */ void flush_cache (unsigned long, unsigned long); diff --git a/include/configs/FADS823.h b/include/configs/FADS823.h index 6002188..6bc01e8 100644 --- a/include/configs/FADS823.h +++ b/include/configs/FADS823.h @@ -54,7 +54,7 @@ #define CONFIG_VIDEO_ENCODER_AD7176 1 /* Enable this encoder */ #define CONFIG_VIDEO_ENCODER_AD7176_ADDR 0x54 /* Default on fads */ #define CONFIG_VIDEO_SIZE (2*1024*1024) -#define CONFIG_VIDEO_ADDR (gd->bd->bi_memsize - CONFIG_VIDEO_SIZE) /* Frame buffer address */ +/* #define CONFIG_VIDEO_ADDR (gd->bd->bi_memsize - CONFIG_VIDEO_SIZE) Frame buffer address */ /* Wireless 56Khz 4PPM keyboard on SMCx */ diff --git a/include/configs/RRvision.h b/include/configs/RRvision.h index 283b4ec..6557aa3 100644 --- a/include/configs/RRvision.h +++ b/include/configs/RRvision.h @@ -100,19 +100,45 @@ #define CONFIG_RTC_MPC8xx /* use internal RTC of MPC8xx */ -#if 0 +#if 1 #define CONFIG_VIDEO 1 /* To enable the video initialization */ -/*#define CONFIG_VIDEO_ADDR 0x00200000 */ /* Video related */ #define CONFIG_VIDEO_LOGO 1 /* Show the logo */ -#define CONFIG_VIDEO_ENCODER_AD7177 1 /* Enable this encoder */ -#define CONFIG_VIDEO_ENCODER_AD7177_ADDR 0xF4 /* ALSB to ground */ +#define CONFIG_VIDEO_ENCODER_AD7176 1 /* Enable this encoder */ +#define CONFIG_VIDEO_ENCODER_AD7176_ADDR 0x51 /* ALSB to ground */ #endif +/* enable I2C and select the hardware/software driver */ +#undef CONFIG_HARD_I2C /* I2C with hardware support */ +#define CONFIG_SOFT_I2C /* I2C bit-banged */ + +# define CFG_I2C_SPEED 50000 /* 50 kHz is supposed to work */ +# define CFG_I2C_SLAVE 0xFE + +#ifdef CONFIG_SOFT_I2C +/* + * Software (bit-bang) I2C driver configuration + */ +#define PB_SCL 0x00000020 /* PB 26 */ +#define PB_SDA 0x00000010 /* PB 27 */ + +#define I2C_INIT (immr->im_cpm.cp_pbdir |= PB_SCL) +#define I2C_ACTIVE (immr->im_cpm.cp_pbdir |= PB_SDA) +#define I2C_TRISTATE (immr->im_cpm.cp_pbdir &= ~PB_SDA) +#define I2C_READ ((immr->im_cpm.cp_pbdat & PB_SDA) != 0) +#define I2C_SDA(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SDA; \ + else immr->im_cpm.cp_pbdat &= ~PB_SDA +#define I2C_SCL(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \ + else immr->im_cpm.cp_pbdat &= ~PB_SCL +#define I2C_DELAY udelay(1) /* 1/4 I2C clock duration */ +#endif /* CONFIG_SOFT_I2C */ + + #define CONFIG_COMMANDS ( ( CONFIG_CMD_DFL | \ CFG_CMD_DHCP | \ + CFG_CMD_I2C | \ CFG_CMD_IDE | \ CFG_CMD_DATE ) & \ ~( CFG_CMD_PCMCIA | \ diff --git a/include/configs/trab.h b/include/configs/trab.h index a642e31..1cc9008 100644 --- a/include/configs/trab.h +++ b/include/configs/trab.h @@ -69,7 +69,7 @@ #define CONFIG_HWFLOW /* include RTS/CTS flow control support */ -#define CONFIG_MODEM_SUPPORT /* enable modem initialization stuff */ +#undef CONFIG_MODEM_SUPPORT /* enable modem initialization stuff */ #define CONFIG_MODEM_KEY_MAGIC "23" /* hold down these keys to enable modem */ diff --git a/include/vfd_logo.h b/include/vfd_logo.h index a636401..af13280 100644 --- a/include/vfd_logo.h +++ b/include/vfd_logo.h @@ -522,4 +522,517 @@ unsigned char vfd_test_logo_bitmap[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDD, 0xDD, 0xDD, }; +#define VFD_REMOTE_LOGO_WIDTH 112 +#define VFD_REMOTE_LOGO_HEIGHT 72 +#define VFD_REMOTE_LOGO_COLORS 0 +#define VFD_REMOTE_LOGO_OFFSET 0 + + +unsigned char vfd_remote_logo_bitmap[] = { + 0x99, 0x99, 0x99, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFD, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0xDF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0x99, 0x99, 0x99, + 0x99, 0x99, 0x99, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x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F, 0xFF, 0xFF, 0xFD, 0xDF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x99, 0x99, 0xDF, 0xFD, 0x99, 0xDF, 0xFD, + 0x99, 0x99, 0x99, 0x99, 0xDF, 0x99, 0x99, 0x99, + 0x99, 0x99, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, + 0x99, 0xFF, 0xFF, 0xFF, 0xFD, 0x99, 0x99, 0xFF, + 0x99, 0x99, 0xFF, 0x99, 0x99, 0x99, 0x99, 0x99, + 0xFD, 0x99, 0x99, 0x99, 0x99, 0x99, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x99, 0x99, 0xFF, 0xFF, 0xFF, + 0xFD, 0x99, 0x99, 0xFF, 0xFD, 0x99, 0x99, 0xFD, + 0x99, 0x99, 0x99, 0x99, 0xDF, 0x99, 0x99, 0x99, + 0x99, 0x99, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x99, + 0x99, 0xDF, 0xFF, 0xFF, 0x99, 0x99, 0xDF, 0xFF, + 0x99, 0x99, 0xDF, 0x99, 0x99, 0x99, 0x99, 0x99, + 0xFD, 0x99, 0x99, 0x99, 0x99, 0xDF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFD, 0x99, 0x99, 0xDF, 0xFF, 0xFF, + 0xFD, 0x99, 0x99, 0xFF, 0xFD, 0x99, 0x99, 0xFD, + 0x99, 0x99, 0x99, 0x99, 0xDF, 0x99, 0x99, 0x99, + 0x99, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0x99, + 0x99, 0x99, 0xFF, 0xFF, 0x99, 0x99, 0xDF, 0xFF, + 0x99, 0x99, 0xDF, 0x99, 0x99, 0x99, 0x99, 0x99, + 0xFD, 0x99, 0x99, 0x99, 0x99, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0x99, 0x99, 0x99, 0x99, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF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, 0x99, 0x99, 0x99, 0x99, 0xDF, + 0xFD, 0x99, 0xDF, 0xFF, 0xFD, 0x99, 0xDF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x99, 0x99, 0xDF, 0x99, 0x99, 0xDF, 0xFD, + 0x99, 0xDF, 0xFF, 0xFF, 0xFF, 0x99, 0x99, 0xFF, + 0xFD, 0x99, 0x99, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xDF, 0xFF, 0xFF, 0xFF, 0xFD, 0x99, 0x99, 0xFD, + 0x99, 0x99, 0xFF, 0x99, 0x99, 0xFF, 0xFF, 0xFF, + 0xFD, 0x99, 0xDF, 0xFF, 0x99, 0x99, 0xDF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFD, 0xDF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x99, 0x99, 0xDF, 0xFD, 0x99, 0xDF, 0xFD, + 0x99, 0x99, 0x99, 0x99, 0xDF, 0x99, 0x99, 0x99, + 0x99, 0x99, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, + 0x99, 0xFF, 0xFF, 0xFF, 0xFD, 0x99, 0x99, 0xFF, + 0x99, 0x99, 0xFF, 0x99, 0x99, 0x99, 0x99, 0x99, + 0xFD, 0x99, 0x99, 0x99, 0x99, 0x99, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x99, 0x99, 0xFF, 0xFF, 0xFF, + 0xFD, 0x99, 0x99, 0xFF, 0xFD, 0x99, 0x99, 0xFD, + 0x99, 0x99, 0x99, 0x99, 0xDF, 0x99, 0x99, 0x99, + 0x99, 0x99, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x99, + 0x99, 0xDF, 0xFF, 0xFF, 0x99, 0x99, 0xDF, 0xFF, + 0x99, 0x99, 0xDF, 0x99, 0x99, 0x99, 0x99, 0x99, + 0xFD, 0x99, 0x99, 0x99, 0x99, 0xDF, 0xFF, 0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0x99, 0x99, 0xFF, 0x99, 0x99, 0xFF, 0xFF, 0xFF, + 0xFD, 0x99, 0xDF, 0xFF, 0x99, 0x99, 0xDF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFD, 0xDF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x99, 0x99, 0xDF, 0xFD, 0x99, 0xDF, 0xFD, + 0x99, 0x99, 0x99, 0x99, 0xDF, 0x99, 0x99, 0x99, + 0x99, 0x99, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, + 0x99, 0xFF, 0xFF, 0xFF, 0xFD, 0x99, 0x99, 0xFF, + 0x99, 0x99, 0xFF, 0x99, 0x99, 0x99, 0x99, 0x99, + 0xFD, 0x99, 0x99, 0x99, 0x99, 0x99, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x99, 0x99, 0xFF, 0xFF, 0xFF, + 0xFD, 0x99, 0x99, 0xFF, 0xFD, 0x99, 0x99, 0xFD, + 0x99, 0x99, 0x99, 0x99, 0xDF, 0x99, 0x99, 0x99, + 0x99, 0x99, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x99, + 0x99, 0xDF, 0xFF, 0xFF, 0x99, 0x99, 0xDF, 0xFF, + 0x99, 0x99, 0xDF, 0x99, 0x99, 0x99, 0x99, 0x99, + 0xFD, 0x99, 0x99, 0x99, 0x99, 0xDF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFD, 0x99, 0x99, 0xDF, 0xFF, 0xFF, + 0xFD, 0x99, 0x99, 0xFF, 0xFD, 0x99, 0x99, 0xFD, + 0x99, 0x99, 0x99, 0x99, 0xDF, 0x99, 0x99, 0x99, + 0x99, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0x99, + 0x99, 0x99, 0xFF, 0xFF, 0x99, 0x99, 0xDF, 0xFF, + 0x99, 0x99, 0xDF, 0x99, 0x99, 0x99, 0x99, 0x99, + 0xFD, 0x99, 0x99, 0x99, 0x99, 0xFF, 0xFF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 0x99, 0x99, 0x99, 0x99, 0xDF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0x99, 0x99, 0x99, +}; + #endif /* __VFD_TEST_LOGO_H__ */ diff --git a/include/video_ad7176.h b/include/video_ad7176.h index 4ada315..88007ce 100644 --- a/include/video_ad7176.h +++ b/include/video_ad7176.h @@ -26,10 +26,10 @@ #define VIDEO_ENCODER_NAME "Analog Devices AD7176" -#define VIDEO_ENCODER_I2C_RATE 100000 // Max rate is 100Khz -#define VIDEO_ENCODER_CB_Y_CR_Y // Use CB Y CR Y format... +#define VIDEO_ENCODER_I2C_RATE 100000 /* Max rate is 100Khz */ +#define VIDEO_ENCODER_CB_Y_CR_Y /* Use CB Y CR Y format... */ -#define VIDEO_MODE_YUYV // The only mode supported by this encoder +#define VIDEO_MODE_YUYV /* The only mode supported by this encoder */ #undef VIDEO_MODE_RGB #define VIDEO_MODE_BPP 16 @@ -47,60 +47,59 @@ #define VIDEO_VISIBLE_ROWS 400 #endif -static unsigned char - video_encoder_data[] = { +static unsigned char video_encoder_data[] = { #ifdef VIDEO_MODE_NTSC - 0x04, // Mode Register 0 + 0x04, /* Mode Register 0 */ #ifdef VIDEO_DEBUG_COLORBARS 0x82, #else - 0x02, // Mode Register 1 + 0x02, /* Mode Register 1 */ #endif - 0x16, // Subcarrier Freq 0 - 0x7c, // Subcarrier Freq 1 - 0xf0, // Subcarrier Freq 2 - 0x21, // Subcarrier Freq 3 - 0x00, // Subcarrier phase - 0x02, // Timing Register 0 - 0x00, // Extended Captioning 0 - 0x00, // Extended Captioning 1 - 0x00, // Closed Captioning 0 - 0x00, // Closed Captioning 1 - 0x00, // Timing Register 1 - 0x08, // Mode Register 2 - 0x00, // Pedestal Register 0 - 0x00, // Pedestal Register 1 - 0x00, // Pedestal Register 2 - 0x00, // Pedestal Register 3 - 0x00 // Mode Register 3 + 0x16, /* Subcarrier Freq 0 */ + 0x7c, /* Subcarrier Freq 1 */ + 0xf0, /* Subcarrier Freq 2 */ + 0x21, /* Subcarrier Freq 3 */ + 0x00, /* Subcarrier phase */ + 0x02, /* Timing Register 0 */ + 0x00, /* Extended Captioning 0 */ + 0x00, /* Extended Captioning 1 */ + 0x00, /* Closed Captioning 0 */ + 0x00, /* Closed Captioning 1 */ + 0x00, /* Timing Register 1 */ + 0x08, /* Mode Register 2 */ + 0x00, /* Pedestal Register 0 */ + 0x00, /* Pedestal Register 1 */ + 0x00, /* Pedestal Register 2 */ + 0x00, /* Pedestal Register 3 */ + 0x00 /* Mode Register 3 */ -#endif +#endif /* VIDEO_MODE_NTSC */ #ifdef VIDEO_MODE_PAL - 0x05, // Mode Register 0 + 0x05, /* Mode Register 0 */ #ifdef VIDEO_DEBUG_COLORBARS 0x82, #else - 0x02, // Mode Register 1 (2) -#endif - 0xcb, // Subcarrier Freq 0 - 0x8a, // Subcarrier Freq 1 - 0x09, // Subcarrier Freq 2 - 0x2a, // Subcarrier Freq 3 - 0x00, // Subcarrier phase - 0x0a, // Timing Register 0 (a) - 0x00, // Extended Captioning 0 - 0x00, // Extended Captioning 1 - 0x00, // Closed Captioning 0 - 0x00, // Closed Captioning 1 - 0x00, // Timing Register 1 - 0x08, // Mode Register 2 (8) - 0x00, // Pedestal Register 0 - 0x00, // Pedestal Register 1 - 0x00, // Pedestal Register 2 - 0x00, // Pedestal Register 3 - 0x00 // Mode Register 3 + 0x02, /* Mode Register 1 (2) */ #endif - } ; + 0xcb, /* Subcarrier Freq 0 */ + 0x8a, /* Subcarrier Freq 1 */ + 0x09, /* Subcarrier Freq 2 */ + 0x2a, /* Subcarrier Freq 3 */ + 0x00, /* Subcarrier phase */ + 0x0a, /* Timing Register 0 (a) */ + 0x00, /* Extended Captioning 0 */ + 0x00, /* Extended Captioning 1 */ + 0x00, /* Closed Captioning 0 */ + 0x00, /* Closed Captioning 1 */ + 0x00, /* Timing Register 1 */ + 0x08, /* Mode Register 2 (8) */ + 0x00, /* Pedestal Register 0 */ + 0x00, /* Pedestal Register 1 */ + 0x00, /* Pedestal Register 2 */ + 0x00, /* Pedestal Register 3 */ + 0x00 /* Mode Register 3 */ +#endif /* VIDEO_MODE_PAL */ +} ; -#endif +#endif /* _VIDEO_AD7176_H_ */ diff --git a/lib_arm/board.c b/lib_arm/board.c index 0120ded..7da0b1d 100644 --- a/lib_arm/board.c +++ b/lib_arm/board.c @@ -211,7 +211,7 @@ void start_armboot (void) /* armboot_real_end is defined in the board-specific linker script */ addr = (_armboot_real_end + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1); size = vfd_setmem (addr); - gd->vfd_base = addr; + gd->fb_base = addr; /* round to the next page boundary */ addr += size; addr = (addr + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1); diff --git a/lib_ppc/board.c b/lib_ppc/board.c index 007de0b..6051715 100644 --- a/lib_ppc/board.c +++ b/lib_ppc/board.c @@ -395,13 +395,17 @@ void board_init_f (ulong bootflag) #endif #ifdef CONFIG_LCD - /* - * reserve memory for LCD display (always full pages) - */ + /* reserve memory for LCD display (always full pages) */ addr = lcd_setmem (addr); - gd->lcd_base = addr; + gd->fb_base = addr; #endif /* CONFIG_LCD */ +#ifdef CONFIG_VIDEO + /* reserve memory for video display (always full pages) */ + addr = video_setmem (addr); + gd->fb_base = addr; +#endif /* CONFIG_VIDEO */ + /* * reserve memory for PPCBoot code, data & bss * round down to next 4 kB limit