From: "Steven J. Hill" <sjhill@xxxxxxxx> Add SEAD-3 support for early serial printk and the address for the small LCD display. The actual framebuffer support is contained in another patch. Signed-off-by: Douglas Leung <douglas@xxxxxxxx> Signed-off-by: Chris Dearman <chris@xxxxxxxx> Signed-off-by: Steven J. Hill <sjhill@xxxxxxxx> --- arch/mips/include/asm/mips-boards/generic.h | 1 + arch/mips/kernel/early_printk.c | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/arch/mips/include/asm/mips-boards/generic.h b/arch/mips/include/asm/mips-boards/generic.h index 46c0856..a857264 100644 --- a/arch/mips/include/asm/mips-boards/generic.h +++ b/arch/mips/include/asm/mips-boards/generic.h @@ -29,6 +29,7 @@ */ #define ASCII_DISPLAY_WORD_BASE 0x1f000410 #define ASCII_DISPLAY_POS_BASE 0x1f000418 +#define LCD_DISPLAY_POS_BASE 0x1f000400 /* SEAD-3 */ /* diff --git a/arch/mips/kernel/early_printk.c b/arch/mips/kernel/early_printk.c index 9ae813e..e078cae 100644 --- a/arch/mips/kernel/early_printk.c +++ b/arch/mips/kernel/early_printk.c @@ -12,6 +12,23 @@ #include <asm/setup.h> +#ifdef CONFIG_MIPS_SEAD3 +#include <linux/string.h> +#include <asm/mips-boards/prom.h> + +extern void prom_putchar(char, char); + +static void __init +early_console_write(struct console *con, const char *s, unsigned n) +{ + while (n-- && *s) { + if (*s == '\n') + prom_putchar('\r', con->index); + prom_putchar(*s, con->index); + s++; + } +} +#else extern void prom_putchar(char); static void __init @@ -24,6 +41,7 @@ early_console_write(struct console *con, const char *s, unsigned n) s++; } } +#endif static struct console early_console __initdata = { .name = "early", @@ -40,5 +58,12 @@ void __init setup_early_printk(void) return; early_console_initialized = 1; +#ifdef CONFIG_MIPS_SEAD3 + if ((strstr(prom_getcmdline(), "console=ttyS0")) != NULL) + early_console.index = 0; + else if ((strstr(prom_getcmdline(), "console=ttyS1")) != NULL) + early_console.index = 1; +#endif + register_console(&early_console); } -- 1.7.9.6