forked from analogdevicesinc/linux
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIPS] Add early console for Cobalt.
Signed-off-by: Peter Horton <[email protected]> Signed-off-by: Ralf Baechle <[email protected]>
- Loading branch information
1 parent
c4a1745
commit e87ddde
Showing
6 changed files
with
60 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
config EARLY_PRINTK | ||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,6 @@ | |
|
||
obj-y := irq.o int-handler.o reset.o setup.o | ||
|
||
obj-$(CONFIG_EARLY_PRINTK) += console.o | ||
|
||
EXTRA_AFLAGS := $(CFLAGS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* (C) P. Horton 2006 | ||
*/ | ||
|
||
#include <linux/config.h> | ||
#include <linux/init.h> | ||
#include <linux/kernel.h> | ||
#include <linux/console.h> | ||
#include <linux/serial_reg.h> | ||
#include <asm/addrspace.h> | ||
#include <asm/mach-cobalt/cobalt.h> | ||
|
||
static void putchar(int c) | ||
{ | ||
if(c == '\n') | ||
putchar('\r'); | ||
|
||
while(!(COBALT_UART[UART_LSR] & UART_LSR_THRE)) | ||
; | ||
|
||
COBALT_UART[UART_TX] = c; | ||
} | ||
|
||
static void cons_write(struct console *c, const char *s, unsigned n) | ||
{ | ||
while(n-- && *s) | ||
putchar(*s++); | ||
} | ||
|
||
static struct console cons_info = | ||
{ | ||
.name = "uart", | ||
.write = cons_write, | ||
.flags = CON_PRINTBUFFER | CON_BOOT, | ||
.index = -1, | ||
}; | ||
|
||
void __init cobalt_early_console(void) | ||
{ | ||
register_console(&cons_info); | ||
|
||
printk("Cobalt: early console registered\n"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters