-#ifdef LCD_TEST_PATTERN
-
-#define N_BLK_VERT 2
-#define N_BLK_HOR 3
-
-static int test_colors[N_BLK_HOR*N_BLK_VERT] = {
- CONSOLE_COLOR_RED, CONSOLE_COLOR_GREEN, CONSOLE_COLOR_YELLOW,
- CONSOLE_COLOR_BLUE, CONSOLE_COLOR_MAGENTA, CONSOLE_COLOR_CYAN,
-};
-
-static void test_pattern (void)
-{
- ushort v_max = panel_info.vl_row;
- ushort h_max = panel_info.vl_col;
- ushort v_step = (v_max + N_BLK_VERT - 1) / N_BLK_VERT;
- ushort h_step = (h_max + N_BLK_HOR - 1) / N_BLK_HOR;
- ushort v, h;
- uchar *pix = (uchar *)lcd_base;
-
- 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) {
- uchar iy = v / v_step;
- for (h=0; h<h_max; ++h) {
- uchar ix = N_BLK_HOR * iy + (h/h_step);
- *pix++ = test_colors[ix];
- }
- }
-}
-#endif /* LCD_TEST_PATTERN */
-
-
-/************************************************************************/
-/* ** GENERIC Initialization Routines */
-/************************************************************************/
-
-int drv_lcd_init (void)
-{
- DECLARE_GLOBAL_DATA_PTR;
-
- device_t lcddev;
- int rc;
-
- lcd_base = (void *)(gd->fb_base);
-
- lcd_line_length = (panel_info.vl_col * NBITS (panel_info.vl_bpix)) / 8;
-
- lcd_init (lcd_base); /* LCD initialization */
-
- /* Device initialization */
- memset (&lcddev, 0, sizeof (lcddev));
-
- strcpy (lcddev.name, "lcd");
- lcddev.ext = 0; /* No extensions */
- lcddev.flags = DEV_FLAGS_OUTPUT; /* Output only */
- lcddev.putc = lcd_putc; /* 'putc' function */
- lcddev.puts = lcd_puts; /* 'puts' function */
-
- rc = device_register (&lcddev);
-
- return (rc == 0) ? 1 : rc;
-}
-
-/*----------------------------------------------------------------------*/
-
-static int lcd_init (void *lcdbase)
-{
- /* Initialize the lcd controller */
- debug ("[LCD] Initializing LCD frambuffer at %p\n", lcdbase);
-
- lcd_ctrl_init (lcdbase);
-
-#if LCD_BPP == LCD_MONOCHROME
- /* Setting the palette */
- lcd_initcolregs();
-
-#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);
-#endif
-
-#ifndef CFG_WHITE_ON_BLACK
- lcd_setfgcolor (CONSOLE_COLOR_BLACK);
- lcd_setbgcolor (CONSOLE_COLOR_WHITE);
-#else
- lcd_setfgcolor (CONSOLE_COLOR_WHITE);
- lcd_setbgcolor (CONSOLE_COLOR_BLACK);
-#endif /* CFG_WHITE_ON_BLACK */
-
-#ifdef LCD_TEST_PATTERN
- test_pattern();
-#else
- /* set framebuffer to background color */
- memset ((char *)lcd_base,
- COLOR_MASK(lcd_getbgcolor()),
- lcd_line_length*panel_info.vl_row);
-#endif
-
- lcd_enable ();
-
- /* Paint the logo and retrieve LCD base address */
- debug ("[LCD] Drawing the logo...\n");
- lcd_console_address = lcd_logo ();
-
- /* Initialize the console */
- console_col = 0;
-#ifdef LCD_INFO_BELOW_LOGO
- console_row = 7 + BMP_LOGO_HEIGHT / VIDEO_FONT_HEIGHT;
-#else
- console_row = 1; /* leave 1 blank line below logo */
-#endif
- lcd_is_enabled = 1;
-
- return 0;
-}
-
-
-/************************************************************************/
-/* ** ROM capable initialization part - needed to reserve FB memory */