diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug index 058f8cd628fd..08fb173ef865 100644 --- a/arch/mips/Kconfig.debug +++ b/arch/mips/Kconfig.debug @@ -53,6 +53,19 @@ config EARLY_IMPACT_PRINTK for debugging purposes. It is fixed at 1280x1024 resolution and overwrites top-to-bottom. A solid red line indicates the last line of text written. + +config EARLY_ODYSSEY_PRINTK + bool "Early Odyssey printk" if EXPERT + depends on (SGI_IP30 || SGI_IP35) && EARLY_PRINTK + select FB_ODYSSEY_EARLY + select FONT_SUPPORT + select FONT_8x16 + help + This options enables utilizing the Odyssey as an early boot console + for debugging purposes. It is fixed at 1280x1024 resolution and + overwrites top-to-bottom. A solid red line indicates the last line + of text written. + endchoice config USE_GENERIC_EARLY_PRINTK_8250 diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index d5b6c6816af5..d59bfab970a6 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -57,6 +57,10 @@ struct screen_info screen_info; extern void setup_early_impact_printk(void); #endif +#if defined(CONFIG_EARLY_ODYSSEY_PRINTK) + extern void setup_early_odyssey_printk(void); +#endif + /* * Setup information * @@ -1017,6 +1021,8 @@ void __init setup_arch(char **cmdline_p) #ifdef CONFIG_EARLY_PRINTK #if defined(CONFIG_EARLY_IMPACT_PRINTK) setup_early_impact_printk(); +#elif defined(CONFIG_EARLY_ODYSSEY_PRINTK) + setup_early_odyssey_printk(); #else setup_early_printk(); #endif diff --git a/arch/mips/sgi-common/Makefile b/arch/mips/sgi-common/Makefile index ff862b0c7abd..70499ee1c2ec 100644 --- a/arch/mips/sgi-common/Makefile +++ b/arch/mips/sgi-common/Makefile @@ -3,3 +3,4 @@ # obj-$(CONFIG_EARLY_IMPACT_PRINTK) += impact-earlycon.o +obj-$(CONFIG_EARLY_ODYSSEY_PRINTK) += odyssey-earlycon.o diff --git a/arch/mips/sgi-common/odyssey-earlycon.c b/arch/mips/sgi-common/odyssey-earlycon.c new file mode 100644 index 000000000000..1267b430da97 --- /dev/null +++ b/arch/mips/sgi-common/odyssey-earlycon.c @@ -0,0 +1,45 @@ +/* + * Wrapper for an early console using the using the Odyssey Graphics Card + * as a debugging/early boot console. + * + * Copyright (c) 2004-2007 Stanislaw Skowronek + * Copyright (c) 2014 Joshua Kinard + */ +#include +#include +#include +#include + +#include + +extern void odyssey_earlyinit(void); +extern void odyssey_earlychar(u8 c, u32 f); +extern struct console *early_console; + +static void +early_odyssey_write(struct console *co, const char *s, u32 count) +{ + /* Do each character */ + while (count--) + odyssey_earlychar(*s++, 0xa0a0a0); +} + +static struct console +early_odyssey_cons = { + .name = "early_odyssey", + .write = early_odyssey_write, + .flags = CON_PRINTBUFFER | CON_BOOT, + .index = -1, +}; + +void __init +setup_early_odyssey_printk(void) +{ + if (early_console) + return; + + odyssey_earlyinit(); + early_console = &early_odyssey_cons; + + register_console(&early_odyssey_cons); +} diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index 7430a82492dc..34b155053e06 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -731,6 +731,10 @@ config FB_IMPACT help SGI Impact (MardiGras/MGRAS) graphics card support. +config FB_ODYSSEY_EARLY + bool + depends on (SGI_IP30 || SGI_IP35) + config FB_ODYSSEY tristate "SGI Odyssey graphics support" depends on FB && (SGI_IP30 || SGI_IP35) diff --git a/drivers/video/fbdev/Makefile b/drivers/video/fbdev/Makefile index 67fe1e90b9a3..0e09eb73b1a6 100644 --- a/drivers/video/fbdev/Makefile +++ b/drivers/video/fbdev/Makefile @@ -128,6 +128,7 @@ obj-$(CONFIG_FB_SM712) += sm712fb.o obj-$(CONFIG_FB_IMPACT) += impact.o obj-$(CONFIG_FB_IMPACT_EARLY) += impact_early.o obj-$(CONFIG_FB_ODYSSEY) += odyssey.o +obj-$(CONFIG_FB_ODYSSEY_EARLY) += odyssey_early.o # Platform or fallback drivers go here obj-$(CONFIG_FB_UVESA) += uvesafb.o diff --git a/drivers/video/fbdev/odyssey_early.c b/drivers/video/fbdev/odyssey_early.c new file mode 100644 index 000000000000..a209f2b0149a --- /dev/null +++ b/drivers/video/fbdev/odyssey_early.c @@ -0,0 +1,409 @@ +/* + * linux/drivers/video/odyssey_early.c + * -- SGI Octane Odyssey (VPro) graphics + * + * Copyright (c) 2004 by Stanislaw Skowronek + * Copyright (c) 2011-14 by Joshua Kinard (Fixes, Maintenance) + * + * Separated from linux/drivers/video/fbdev/odyssey.c + * + * This driver provides direct access to the Odyssey hardware for + * early_console support. It can typically be initialized after the + * CPU(s) have been setup, but before anything else, like IRQs. Handy for + * debugging core startup code on a machine as difficult as Octane. + * + * When running, the driver will draw a solid red line across the screen + * to denote the current output line. It will scroll from top to the bottom + * of the screen and then begin overwriting from the top again. + */ + +#include +#include +#include +#include +#include +#include + +#include