Skip to contentSkip to conversation

Early console for Cobalt

PATCH In review Peter Horton 4 participants 6 messages Feb 12, 2006 – Feb 13, 2006 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Early console for Cobalt

Adds early console support for Cobalts.

P.

arch/mips/cobalt/setup.c +5 -8
Index: linux.git/arch/mips/cobalt/setup.c
===================================================================
@@ -31,6 +31,7 @@
 extern void cobalt_machine_restart(char *command);
 extern void cobalt_machine_halt(void);
 extern void cobalt_machine_power_off(void);
+extern void cobalt_early_console(void);
 
 int cobalt_board_id;
 
@@ -109,14 +110,6 @@
 	/* I/O port resource must include UART and LCD/buttons */
 	ioport_resource.end = 0x0fffffff;
 
-	/*
-	 * This is a prom style console. We just poke at the
-	 *  UART to make it talk.
-	 * Only use this console if you really screw up and can't
-	 *  get to the stage of setting up a real serial console.
-	 */
-	/*ns16550_setup_console();*/
-
 	/* request I/O space for devices used on all i[345]86 PCs */
 	for (i = 0; i < COBALT_IO_RESOURCES; i++)
 		request_resource(&ioport_resource, cobalt_io_resources + i);
@@ -136,6 +129,10 @@
 #ifdef CONFIG_SERIAL_8250
 	if (cobalt_board_id > COBALT_BRD_ID_RAQ1) {
 
+#ifdef CONFIG_COBALT_EARLY_CONSOLE
+		cobalt_early_console();
+#endif
+
 		uart.line	= 0;
 		uart.type	= PORT_UNKNOWN;
 		uart.uartclk	= 18432000;
arch/mips/cobalt/Makefile +2 -0
Index: linux.git/arch/mips/cobalt/Makefile
===================================================================
@@ -4,4 +4,6 @@
 
 obj-y	 := irq.o int-handler.o reset.o setup.o
 
+obj-$(CONFIG_COBALT_EARLY_CONSOLE)	+= console.o
+
 EXTRA_AFLAGS := $(CFLAGS)
arch/mips/cobalt/console.c new file +60 -0

60 lines not on this page · raw message

include/asm/mach-cobalt/cobalt.h +2 -0
Index: linux.git/include/asm/mach-cobalt/cobalt.h
===================================================================
@@ -113,4 +113,6 @@
 # define COBALT_KEY_SELECT	(1 << 7)
 # define COBALT_KEY_MASK	0xfe
 
+#define COBALT_UART		((volatile unsigned char *) CKSEG1ADDR(0x1c800000))
+
 #endif /* __ASM_COBALT_H */
arch/mips/Kconfig +1 -0
Index: linux.git/arch/mips/Kconfig
===================================================================
@@ -787,6 +787,7 @@
 source "arch/mips/tx4938/Kconfig"
 source "arch/mips/vr41xx/Kconfig"
 source "arch/mips/philips/pnx8550/common/Kconfig"
+source "arch/mips/cobalt/Kconfig"
 
 endmenu
 
arch/mips/cobalt/Kconfig new file +7 -0
Index: linux.git/arch/mips/cobalt/Kconfig
===================================================================
@@ -0,0 +1,7 @@
+config COBALT_EARLY_CONSOLE
+	bool "Early console support"
+	depends on MIPS_COBALT
+	help
+	  Provide early console support by direct access to the
+	  on board UART. The UART must have been previously
+	  initialised by the boot loader.
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Peter Horton

pdh> Adds early console support for Cobalts.

We already have EARLY_PRINTK. How about using it? (like dec does)

---
Atsushi Nemoto

#2 lore raw
Quoted 4 lines · Atsushi Nemoto
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Peter Horton

pdh> Adds early console support for Cobalts.

We already have EARLY_PRINTK. How about using it? (like dec does)

I already tried getting early printk to work....Either it wasn't initializing early enough for my needs, I was enabling it incorrectly, or it just doesn't work on Cobalt. This does work, however, and already pointed out one obvious flaw I have in a patch I've been using on Cobalt (setting cpu_scache_line_size to > 0 when cobalt lacks an scache).

For systems where the serial device can be difficult to use until initialized late in the boot cycle (Octane comes to mind), early_printk won't function either.

Maybe some kind of framework is needed for defining the kinds of early console various systems can support?

--Kumba

Signature · 4 lines
Gentoo/MIPS Team Lead
Gentoo Foundation Board of Trustees

"Such is oft the course of deeds that move the wheels of the world: small hands do them because they must, while the eyes of the great are elsewhere."  --Elrond
#3 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Kumba

kumba> I already tried getting early printk to work....Either it kumba> wasn't initializing early enough for my needs, I was enabling kumba> it incorrectly, or it just doesn't work on Cobalt. This does kumba> work, however, and already pointed out one obvious flaw I have kumba> in a patch I've been using on Cobalt (setting kumba> cpu_scache_line_size to > 0 when cobalt lacks an scache).

Well, I do not have any objection to cobalt/console.c itself. I just mean let's use CONFIG_EARLY_PRINTK symbol instead of CONFIG_COBALT_EARLY_CONSOLE (and add some other tweaks such as implementing disable_early_printk()).

---
Atsushi Nemoto

#4 lore raw
In reply to Atsushi Nemoto
Quoted 4 lines · Atsushi Nemoto
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Peter Horton

pdh> Adds early console support for Cobalts.

We already have EARLY_PRINTK. How about using it? (like dec does)

Indeed, done.

Ralf

#5 lore raw
In reply to Peter Horton
Quoted 3 lines · Peter Horton

Adds early console support for Cobalts.

Queued for 2.6.17.

Please never include pathnames using the asm symlink like linux.git/include/asm/mach-cobalt/cobalt.h in patches. They do cause rejects and are generally a PITA. I also sent the #if 0'ed code in console.c to /dev/hell.

Ralf