summaryrefslogtreecommitdiff
path: root/drivers/video/cfb_console.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2009-06-14 22:05:42 +0200
committerWolfgang Denk <wd@denx.de>2009-06-14 22:05:42 +0200
commit92afd368bba7d98b2b7bfb51082c3639bb2119b3 (patch)
tree74ffc8a3f4980f7c6bad6bf80bb41d3974eff685 /drivers/video/cfb_console.c
parent6b1f78ae6ad037382ad430b07064105c88f7ac02 (diff)
parent388517e4b745b00256c2fa201ce7bccb67b4f245 (diff)
downloadu-boot-imx-92afd368bba7d98b2b7bfb51082c3639bb2119b3.zip
u-boot-imx-92afd368bba7d98b2b7bfb51082c3639bb2119b3.tar.gz
u-boot-imx-92afd368bba7d98b2b7bfb51082c3639bb2119b3.tar.bz2
Merge branch 'next' of ../master
Diffstat (limited to 'drivers/video/cfb_console.c')
-rw-r--r--drivers/video/cfb_console.c82
1 files changed, 43 insertions, 39 deletions
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 5ee2314..bcafb27 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -1330,53 +1330,57 @@ static int video_init (void)
/*****************************************************************************/
+/*
+ * Implement a weak default function for boards that optionally
+ * need to skip the video initialization.
+ */
+int __board_video_skip(void)
+{
+ /* As default, don't skip test */
+ return 0;
+}
+int board_video_skip(void) __attribute__((weak, alias("__board_video_skip")));
+
int drv_video_init (void)
{
int skip_dev_init;
device_t console_dev;
- skip_dev_init = 0;
+ /* Check if video initialization should be skipped */
+ if (board_video_skip())
+ return 0;
/* Init video chip - returns with framebuffer cleared */
- if (video_init () == -1)
- skip_dev_init = 1;
+ skip_dev_init = (video_init () == -1);
-#ifdef CONFIG_VGA_AS_SINGLE_DEVICE
- /* Devices VGA and Keyboard will be assigned seperately */
- /* Init vga device */
- if (!skip_dev_init) {
- memset (&console_dev, 0, sizeof (console_dev));
- strcpy (console_dev.name, "vga");
- console_dev.ext = DEV_EXT_VIDEO; /* Video extensions */
- console_dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_SYSTEM;
- console_dev.putc = video_putc; /* 'putc' function */
- console_dev.puts = video_puts; /* 'puts' function */
- console_dev.tstc = NULL; /* 'tstc' function */
- console_dev.getc = NULL; /* 'getc' function */
-
- if (device_register (&console_dev) == 0)
- return 1;
- }
-#else
+#if !defined(CONFIG_VGA_AS_SINGLE_DEVICE)
PRINTD ("KBD: Keyboard init ...\n");
- if (VIDEO_KBD_INIT_FCT == -1)
- skip_dev_init = 1;
-
- /* Init console device */
- if (!skip_dev_init) {
- memset (&console_dev, 0, sizeof (console_dev));
- strcpy (console_dev.name, "vga");
- console_dev.ext = DEV_EXT_VIDEO; /* Video extensions */
- console_dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
- console_dev.putc = video_putc; /* 'putc' function */
- console_dev.puts = video_puts; /* 'puts' function */
- console_dev.tstc = VIDEO_TSTC_FCT; /* 'tstc' function */
- console_dev.getc = VIDEO_GETC_FCT; /* 'getc' function */
-
- if (device_register (&console_dev) == 0)
- return 1;
- }
+ skip_dev_init |= (VIDEO_KBD_INIT_FCT == -1);
+#endif
+
+ if (skip_dev_init)
+ return 0;
+
+ /* Init vga device */
+ memset (&console_dev, 0, sizeof (console_dev));
+ strcpy (console_dev.name, "vga");
+ console_dev.ext = DEV_EXT_VIDEO; /* Video extensions */
+ console_dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_SYSTEM;
+ console_dev.putc = video_putc; /* 'putc' function */
+ console_dev.puts = video_puts; /* 'puts' function */
+ console_dev.tstc = NULL; /* 'tstc' function */
+ console_dev.getc = NULL; /* 'getc' function */
+
+#if !defined(CONFIG_VGA_AS_SINGLE_DEVICE)
+ /* Also init console device */
+ console_dev.flags |= DEV_FLAGS_INPUT;
+ console_dev.tstc = VIDEO_TSTC_FCT; /* 'tstc' function */
+ console_dev.getc = VIDEO_GETC_FCT; /* 'getc' function */
#endif /* CONFIG_VGA_AS_SINGLE_DEVICE */
- /* No console dev available */
- return 0;
+
+ if (device_register (&console_dev) != 0)
+ return 0;
+
+ /* Return success */
+ return 1;
}