]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Add a tag for preferring the STI console.
authorPaul Mundt <paul.mundt@nokia.com>
Wed, 8 Feb 2006 17:21:34 +0000 (19:21 +0200)
committerPaul Mundt <paul.mundt@nokia.com>
Wed, 8 Feb 2006 17:21:34 +0000 (19:21 +0200)
Presently we have OMAP_TAG_SERIAL_CONSOLE that wraps in to
add_preferred_console() for the serial console, this does the same
thing with OMAP_TAG_STI_CONSOLE so it's selectable who gets tty
control.

Signed-off-by: Paul Mundt <paul.mundt@nokia.com>
arch/arm/plat-omap/sti/sti-console.c
include/asm-arm/arch-omap/board.h

index 46f878cae799809948a191fbda9c4ba0d9b94eea..2a2554fbad612f846bf9223ad0f1acd076d465f7 100644 (file)
 #include <linux/tty.h>
 #include <linux/tty_driver.h>
 #include <asm/arch/sti.h>
+#include <asm/arch/board.h>
 
 #define DRV_NAME "sticon"
 
 static struct tty_driver *tty_driver;
 static DEFINE_SPINLOCK(sti_console_lock);
-static unsigned int sti_console_channel = 32;
+static unsigned int sti_console_channel;
 static int sti_line_done = -1;
 
 /*
@@ -132,6 +133,16 @@ static struct console sti_console = {
 
 static int __init sti_console_init(void)
 {
+       const struct omap_sti_console_config *info;
+
+       info = omap_get_config(OMAP_TAG_STI_CONSOLE,
+                              struct omap_sti_console_config);
+       if (info && info->enable) {
+               add_preferred_console(DRV_NAME, 0, NULL);
+
+               sti_console_channel = info->channel;
+       }
+
        register_console(&sti_console);
        return 0;
 }
index 93f37a9ceb1912d35bba00a89657f376b5d42ef5..684e871050e15c1e31cec12e9ba4d5d8e302349a 100644 (file)
@@ -21,6 +21,7 @@
 #define OMAP_TAG_LCD           0x4f05
 #define OMAP_TAG_GPIO_SWITCH   0x4f06
 #define OMAP_TAG_UART          0x4f07
+#define OMAP_TAG_STI_CONSOLE   0x4f09
 
 #define OMAP_TAG_BOOT_REASON    0x4f80
 #define OMAP_TAG_FLASH_PART    0x4f81
@@ -55,6 +56,11 @@ struct omap_serial_console_config {
        u32 console_speed;
 };
 
+struct omap_sti_console_config {
+       unsigned enable:1;
+       u8 channel;
+};
+
 struct omap_usb_config {
        /* Configure drivers according to the connectors on your board:
         *  - "A" connector (rectagular)