diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug index 7c765cf..52e15a7 100644 --- a/arch/mips/Kconfig.debug +++ b/arch/mips/Kconfig.debug @@ -41,6 +41,18 @@ config EARLY_PRINTK_8250 If you say Y here, it will be possible to use a 8250/16550 serial port as the boot console. +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 66aac55..ae9fe2f 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -51,6 +51,10 @@ EXPORT_SYMBOL(cpu_data); struct screen_info screen_info; #endif +#if defined(CONFIG_EARLY_ODYSSEY_PRINTK) + extern void setup_early_odyssey_printk(void); +#endif + /* * Despite it's name this variable is even if we don't have PCI */ @@ -786,8 +790,12 @@ void __init setup_arch(char **cmdline_p) setup_early_fdc_console(); #ifdef CONFIG_EARLY_PRINTK +#if defined(CONFIG_EARLY_ODYSSEY_PRINTK) + setup_early_odyssey_printk(); +#else setup_early_printk(); #endif +#endif cpu_report(); check_bugs_early(); diff --git a/arch/mips/sgi-common/Makefile b/arch/mips/sgi-common/Makefile index bb8e588..8b1096f 100644 --- a/arch/mips/sgi-common/Makefile +++ b/arch/mips/sgi-common/Makefile @@ -1,3 +1,6 @@ # # Makefile for common bits shared by various SGI systems # + +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 0000000..392d19d --- /dev/null +++ b/arch/mips/sgi-common/odyssey-earlycon.c @@ -0,0 +1,43 @@ +/* + * 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(unsigned char c, unsigned f); +extern struct console *early_console; + +static void early_odyssey_write(struct console *co, const char *s, + unsigned 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 bda964b..59c4ee3 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -809,6 +809,10 @@ config FB_GBE_MEM This is the amount of memory reserved for the framebuffer, which can be any value between 1MB and 8MB. +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 d626628e..ba097c9 100644 --- a/drivers/video/fbdev/Makefile +++ b/drivers/video/fbdev/Makefile @@ -133,6 +133,7 @@ obj-$(CONFIG_FB_HYPERV) += hyperv_fb.o obj-$(CONFIG_FB_OPENCORES) += ocfb.o obj-$(CONFIG_FB_SM712) += sm712fb.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 0000000..e465180 --- /dev/null +++ b/drivers/video/fbdev/odyssey_early.c @@ -0,0 +1,398 @@ +/* + * 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