From: Paul Mundt Date: Wed, 8 Feb 2006 17:21:34 +0000 (+0200) Subject: ARM: OMAP: Add a tag for preferring the STI console. X-Git-Tag: v2.6.16-omap1~90 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ab7ad9fe425f03c9f83379509c44f98d155e1424;p=linux-2.6-omap-h63xx.git ARM: OMAP: Add a tag for preferring the STI console. 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 --- diff --git a/arch/arm/plat-omap/sti/sti-console.c b/arch/arm/plat-omap/sti/sti-console.c index 46f878cae79..2a2554fbad6 100644 --- a/arch/arm/plat-omap/sti/sti-console.c +++ b/arch/arm/plat-omap/sti/sti-console.c @@ -15,12 +15,13 @@ #include #include #include +#include #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; } diff --git a/include/asm-arm/arch-omap/board.h b/include/asm-arm/arch-omap/board.h index 93f37a9ceb1..684e871050e 100644 --- a/include/asm-arm/arch-omap/board.h +++ b/include/asm-arm/arch-omap/board.h @@ -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)