aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/Kconfig31
-rw-r--r--arch/mips/arc/console.c32
-rw-r--r--arch/mips/arc/init.c9
-rw-r--r--arch/mips/arc/memory.c6
-rw-r--r--arch/mips/arc/tree.c10
-rw-r--r--arch/mips/cobalt/console.c26
-rw-r--r--arch/mips/cobalt/setup.c4
-rw-r--r--arch/mips/dec/prom/console.c38
-rw-r--r--arch/mips/gt64120/ev64120/promcon.c5
-rw-r--r--arch/mips/kernel/Makefile1
-rw-r--r--arch/mips/kernel/early_printk.c40
-rw-r--r--arch/mips/kernel/setup.c8
-rw-r--r--arch/mips/lasat/lasat_board.c13
-rw-r--r--arch/mips/lasat/prom.c47
-rw-r--r--arch/mips/lasat/prom.h1
-rw-r--r--arch/mips/lasat/setup.c2
-rw-r--r--arch/mips/lib/Makefile4
-rw-r--r--arch/mips/lib/promlib.c24
-rw-r--r--arch/mips/mips-boards/generic/Makefile4
-rw-r--r--arch/mips/mips-boards/generic/console.c (renamed from arch/mips/mips-boards/generic/printf.c)12
-rw-r--r--arch/mips/mips-boards/generic/init.c9
-rw-r--r--arch/mips/mips-boards/generic/memory.c11
-rw-r--r--arch/mips/mips-boards/sim/Makefile6
-rw-r--r--arch/mips/mips-boards/sim/sim_console.c (renamed from arch/mips/mips-boards/sim/sim_printf.c)44
-rw-r--r--arch/mips/mips-boards/sim/sim_mem.c2
-rw-r--r--arch/mips/mips-boards/sim/sim_setup.c6
-rw-r--r--arch/mips/mm/cerr-sb1.c124
-rw-r--r--arch/mips/momentum/jaguar_atx/ja-console.c5
-rw-r--r--arch/mips/philips/pnx8550/common/prom.c2
-rw-r--r--arch/mips/philips/pnx8550/common/setup.c9
-rw-r--r--arch/mips/pmc-sierra/yosemite/py-console.c5
-rw-r--r--arch/mips/sgi-ip27/ip27-console.c35
-rw-r--r--arch/mips/sibyte/Kconfig2
-rw-r--r--arch/mips/sibyte/bcm1480/irq.c2
-rw-r--r--arch/mips/sibyte/bcm1480/setup.c10
-rw-r--r--arch/mips/sibyte/cfe/setup.c8
-rw-r--r--arch/mips/sibyte/sb1250/setup.c24
-rw-r--r--arch/mips/sni/sniprom.c51
38 files changed, 254 insertions, 418 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index e7e880b87456..4ec2dd5455f3 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -176,7 +176,7 @@ config MACH_DECSTATION
176 bool "DECstations" 176 bool "DECstations"
177 select BOOT_ELF32 177 select BOOT_ELF32
178 select DMA_NONCOHERENT 178 select DMA_NONCOHERENT
179 select EARLY_PRINTK 179 select SYS_HAS_EARLY_PRINTK
180 select IRQ_CPU 180 select IRQ_CPU
181 select SYS_HAS_CPU_R3000 181 select SYS_HAS_CPU_R3000
182 select SYS_HAS_CPU_R4X00 182 select SYS_HAS_CPU_R4X00
@@ -242,6 +242,7 @@ config MACH_JAZZ
242config LASAT 242config LASAT
243 bool "LASAT Networks platforms" 243 bool "LASAT Networks platforms"
244 select DMA_NONCOHERENT 244 select DMA_NONCOHERENT
245 select SYS_HAS_EARLY_PRINTK
245 select HW_HAS_PCI 246 select HW_HAS_PCI
246 select MIPS_GT64120 247 select MIPS_GT64120
247 select MIPS_NILE4 248 select MIPS_NILE4
@@ -256,6 +257,7 @@ config MIPS_ATLAS
256 bool "MIPS Atlas board" 257 bool "MIPS Atlas board"
257 select BOOT_ELF32 258 select BOOT_ELF32
258 select DMA_NONCOHERENT 259 select DMA_NONCOHERENT
260 select SYS_HAS_EARLY_PRINTK
259 select IRQ_CPU 261 select IRQ_CPU
260 select HW_HAS_PCI 262 select HW_HAS_PCI
261 select MIPS_BOARDS_GEN 263 select MIPS_BOARDS_GEN
@@ -301,6 +303,7 @@ config MIPS_MALTA
301 select SYS_HAS_CPU_MIPS64_R1 303 select SYS_HAS_CPU_MIPS64_R1
302 select SYS_HAS_CPU_NEVADA 304 select SYS_HAS_CPU_NEVADA
303 select SYS_HAS_CPU_RM7000 305 select SYS_HAS_CPU_RM7000
306 select SYS_HAS_EARLY_PRINTK
304 select SYS_SUPPORTS_32BIT_KERNEL 307 select SYS_SUPPORTS_32BIT_KERNEL
305 select SYS_SUPPORTS_64BIT_KERNEL 308 select SYS_SUPPORTS_64BIT_KERNEL
306 select SYS_SUPPORTS_BIG_ENDIAN 309 select SYS_SUPPORTS_BIG_ENDIAN
@@ -316,6 +319,7 @@ config MIPS_SEAD
316 depends on EXPERIMENTAL 319 depends on EXPERIMENTAL
317 select IRQ_CPU 320 select IRQ_CPU
318 select DMA_NONCOHERENT 321 select DMA_NONCOHERENT
322 select SYS_HAS_EARLY_PRINTK
319 select MIPS_BOARDS_GEN 323 select MIPS_BOARDS_GEN
320 select SYS_HAS_CPU_MIPS32_R1 324 select SYS_HAS_CPU_MIPS32_R1
321 select SYS_HAS_CPU_MIPS32_R2 325 select SYS_HAS_CPU_MIPS32_R2
@@ -353,9 +357,11 @@ config WR_PPMC
353config MIPS_SIM 357config MIPS_SIM
354 bool 'MIPS simulator (MIPSsim)' 358 bool 'MIPS simulator (MIPSsim)'
355 select DMA_NONCOHERENT 359 select DMA_NONCOHERENT
360 select SYS_HAS_EARLY_PRINTK
356 select IRQ_CPU 361 select IRQ_CPU
357 select SYS_HAS_CPU_MIPS32_R1 362 select SYS_HAS_CPU_MIPS32_R1
358 select SYS_HAS_CPU_MIPS32_R2 363 select SYS_HAS_CPU_MIPS32_R2
364 select SYS_HAS_EARLY_PRINTK
359 select SYS_SUPPORTS_32BIT_KERNEL 365 select SYS_SUPPORTS_32BIT_KERNEL
360 select SYS_SUPPORTS_BIG_ENDIAN 366 select SYS_SUPPORTS_BIG_ENDIAN
361 select SYS_SUPPORTS_LITTLE_ENDIAN 367 select SYS_SUPPORTS_LITTLE_ENDIAN
@@ -376,6 +382,7 @@ config MOMENCO_JAGUAR_ATX
376 select RM7000_CPU_SCACHE 382 select RM7000_CPU_SCACHE
377 select SWAP_IO_SPACE 383 select SWAP_IO_SPACE
378 select SYS_HAS_CPU_RM9000 384 select SYS_HAS_CPU_RM9000
385 select SYS_HAS_EARLY_PRINTK
379 select SYS_SUPPORTS_32BIT_KERNEL 386 select SYS_SUPPORTS_32BIT_KERNEL
380 select SYS_SUPPORTS_64BIT_KERNEL 387 select SYS_SUPPORTS_64BIT_KERNEL
381 select SYS_SUPPORTS_BIG_ENDIAN 388 select SYS_SUPPORTS_BIG_ENDIAN
@@ -513,6 +520,7 @@ config PMC_YOSEMITE
513 select IRQ_CPU_RM9K 520 select IRQ_CPU_RM9K
514 select SWAP_IO_SPACE 521 select SWAP_IO_SPACE
515 select SYS_HAS_CPU_RM9000 522 select SYS_HAS_CPU_RM9000
523 select SYS_HAS_EARLY_PRINTK
516 select SYS_SUPPORTS_32BIT_KERNEL 524 select SYS_SUPPORTS_32BIT_KERNEL
517 select SYS_SUPPORTS_64BIT_KERNEL 525 select SYS_SUPPORTS_64BIT_KERNEL
518 select SYS_SUPPORTS_BIG_ENDIAN 526 select SYS_SUPPORTS_BIG_ENDIAN
@@ -573,6 +581,7 @@ config SGI_IP22
573 select SWAP_IO_SPACE 581 select SWAP_IO_SPACE
574 select SYS_HAS_CPU_R4X00 582 select SYS_HAS_CPU_R4X00
575 select SYS_HAS_CPU_R5000 583 select SYS_HAS_CPU_R5000
584 select SYS_HAS_EARLY_PRINTK
576 select SYS_SUPPORTS_32BIT_KERNEL 585 select SYS_SUPPORTS_32BIT_KERNEL
577 select SYS_SUPPORTS_64BIT_KERNEL 586 select SYS_SUPPORTS_64BIT_KERNEL
578 select SYS_SUPPORTS_BIG_ENDIAN 587 select SYS_SUPPORTS_BIG_ENDIAN
@@ -587,7 +596,7 @@ config SGI_IP27
587 select ARC64 596 select ARC64
588 select BOOT_ELF64 597 select BOOT_ELF64
589 select DMA_IP27 598 select DMA_IP27
590 select EARLY_PRINTK 599 select SYS_HAS_EARLY_PRINTK
591 select HW_HAS_PCI 600 select HW_HAS_PCI
592 select NR_CPUS_DEFAULT_64 601 select NR_CPUS_DEFAULT_64
593 select PCI_DOMAINS 602 select PCI_DOMAINS
@@ -749,6 +758,7 @@ config SNI_RM
749 select SYS_HAS_CPU_R5000 758 select SYS_HAS_CPU_R5000
750 select SYS_HAS_CPU_R10000 759 select SYS_HAS_CPU_R10000
751 select R5000_CPU_SCACHE 760 select R5000_CPU_SCACHE
761 select SYS_HAS_EARLY_PRINTK
752 select SYS_SUPPORTS_32BIT_KERNEL 762 select SYS_SUPPORTS_32BIT_KERNEL
753 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL 763 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
754 select SYS_SUPPORTS_BIG_ENDIAN 764 select SYS_SUPPORTS_BIG_ENDIAN
@@ -897,6 +907,20 @@ config DMA_NEED_PCI_MAP_STATE
897 bool 907 bool
898 908
899config EARLY_PRINTK 909config EARLY_PRINTK
910 bool "Early printk" if EMBEDDED && DEBUG_KERNEL
911 depends on SYS_HAS_EARLY_PRINTK
912 default y
913 help
914 This option enables special console drivers which allow the kernel
915 to print messages very early in the bootup process.
916
917 This is useful for kernel debugging when your machine crashes very
918 early before the console code is initialized. For normal operation
919 it is not recommended because it looks on some machines ugly and
920 oesn't cooperate with an X server. You should normally N here,
921 unless you want to debug such a crash.
922
923config SYS_HAS_EARLY_PRINTK
900 bool 924 bool
901 925
902config GENERIC_ISA_DMA 926config GENERIC_ISA_DMA
@@ -1033,6 +1057,7 @@ config SOC_PNX8550
1033 select DMA_NONCOHERENT 1057 select DMA_NONCOHERENT
1034 select HW_HAS_PCI 1058 select HW_HAS_PCI
1035 select SYS_HAS_CPU_MIPS32_R1 1059 select SYS_HAS_CPU_MIPS32_R1
1060 select SYS_HAS_EARLY_PRINTK
1036 select SYS_SUPPORTS_32BIT_KERNEL 1061 select SYS_SUPPORTS_32BIT_KERNEL
1037 select GENERIC_HARDIRQS_NO__DO_IRQ 1062 select GENERIC_HARDIRQS_NO__DO_IRQ
1038 select SYS_SUPPORTS_KGDB 1063 select SYS_SUPPORTS_KGDB
@@ -1093,7 +1118,7 @@ config HAVE_STD_PC_SERIAL_PORT
1093 1118
1094config ARC_CONSOLE 1119config ARC_CONSOLE
1095 bool "ARC console support" 1120 bool "ARC console support"
1096 depends on SGI_IP22 || SNI_RM 1121 depends on SGI_IP22 || (SNI_RM && CPU_LITTLE_ENDIAN)
1097 1122
1098config ARC_MEMORY 1123config ARC_MEMORY
1099 bool 1124 bool
diff --git a/arch/mips/arc/console.c b/arch/mips/arc/console.c
index 6a9d144512c0..0fe6032999cb 100644
--- a/arch/mips/arc/console.c
+++ b/arch/mips/arc/console.c
@@ -29,35 +29,3 @@ void prom_putchar(char c)
29 ArcWrite(1, &it, 1, &cnt); 29 ArcWrite(1, &it, 1, &cnt);
30 bc_enable(); 30 bc_enable();
31} 31}
32
33char prom_getchar(void)
34{
35 ULONG cnt;
36 CHAR c;
37
38 bc_disable();
39 ArcRead(0, &c, 1, &cnt);
40 bc_enable();
41
42 return c;
43}
44
45void prom_printf(char *fmt, ...)
46{
47 va_list args;
48 char ppbuf[1024];
49 char *bptr;
50
51 va_start(args, fmt);
52 vsprintf(ppbuf, fmt, args);
53
54 bptr = ppbuf;
55
56 while (*bptr != 0) {
57 if (*bptr == '\n')
58 prom_putchar('\r');
59
60 prom_putchar(*bptr++);
61 }
62 va_end(args);
63}
diff --git a/arch/mips/arc/init.c b/arch/mips/arc/init.c
index 76ab505ca693..0ac8f42d3752 100644
--- a/arch/mips/arc/init.c
+++ b/arch/mips/arc/init.c
@@ -24,12 +24,15 @@ void __init prom_init(void)
24{ 24{
25 PSYSTEM_PARAMETER_BLOCK pb = PROMBLOCK; 25 PSYSTEM_PARAMETER_BLOCK pb = PROMBLOCK;
26 romvec = ROMVECTOR; 26 romvec = ROMVECTOR;
27 ULONG cnt;
28 CHAR c;
29
27 prom_argc = fw_arg0; 30 prom_argc = fw_arg0;
28 _prom_argv = (LONG *) fw_arg1; 31 _prom_argv = (LONG *) fw_arg1;
29 _prom_envp = (LONG *) fw_arg2; 32 _prom_envp = (LONG *) fw_arg2;
30 33
31 if (pb->magic != 0x53435241) { 34 if (pb->magic != 0x53435241) {
32 prom_printf("Aieee, bad prom vector magic %08lx\n", pb->magic); 35 printk(KERN_CRIT "Aieee, bad prom vector magic %08lx\n", pb->magic);
33 while(1) 36 while(1)
34 ; 37 ;
35 } 38 }
@@ -41,8 +44,8 @@ void __init prom_init(void)
41 prom_meminit(); 44 prom_meminit();
42 45
43#ifdef DEBUG_PROM_INIT 46#ifdef DEBUG_PROM_INIT
44 prom_printf("Press a key to reboot\n"); 47 pr_info("Press a key to reboot\n");
45 prom_getchar(); 48 ArcRead(0, &c, 1, &cnt);
46 ArcEnterInteractiveMode(); 49 ArcEnterInteractiveMode();
47#endif 50#endif
48} 51}
diff --git a/arch/mips/arc/memory.c b/arch/mips/arc/memory.c
index 456cb81a32d9..83d15791ef6a 100644
--- a/arch/mips/arc/memory.c
+++ b/arch/mips/arc/memory.c
@@ -118,11 +118,11 @@ void __init prom_meminit(void)
118#ifdef DEBUG 118#ifdef DEBUG
119 int i = 0; 119 int i = 0;
120 120
121 prom_printf("ARCS MEMORY DESCRIPTOR dump:\n"); 121 printk("ARCS MEMORY DESCRIPTOR dump:\n");
122 p = ArcGetMemoryDescriptor(PROM_NULL_MDESC); 122 p = ArcGetMemoryDescriptor(PROM_NULL_MDESC);
123 while(p) { 123 while(p) {
124 prom_printf("[%d,%p]: base<%08lx> pages<%08lx> type<%s>\n", 124 printk("[%d,%p]: base<%08lx> pages<%08lx> type<%s>\n",
125 i, p, p->base, p->pages, mtypes(p->type)); 125 i, p, p->base, p->pages, mtypes(p->type));
126 p = ArcGetMemoryDescriptor(p); 126 p = ArcGetMemoryDescriptor(p);
127 i++; 127 i++;
128 } 128 }
diff --git a/arch/mips/arc/tree.c b/arch/mips/arc/tree.c
index 2aedd4f52839..abd1786ea09b 100644
--- a/arch/mips/arc/tree.c
+++ b/arch/mips/arc/tree.c
@@ -93,11 +93,11 @@ static char *iflags[] = {
93static void __init 93static void __init
94dump_component(pcomponent *p) 94dump_component(pcomponent *p)
95{ 95{
96 prom_printf("[%p]:class<%s>type<%s>flags<%s>ver<%d>rev<%d>", 96 printk("[%p]:class<%s>type<%s>flags<%s>ver<%d>rev<%d>",
97 p, classes[p->class], types[p->type], 97 p, classes[p->class], types[p->type],
98 iflags[p->iflags], p->vers, p->rev); 98 iflags[p->iflags], p->vers, p->rev);
99 prom_printf("key<%08lx>\n\tamask<%08lx>cdsize<%d>ilen<%d>iname<%s>\n", 99 printk("key<%08lx>\n\tamask<%08lx>cdsize<%d>ilen<%d>iname<%s>\n",
100 p->key, p->amask, (int)p->cdsize, (int)p->ilen, p->iname); 100 p->key, p->amask, (int)p->cdsize, (int)p->ilen, p->iname);
101} 101}
102 102
103static void __init 103static void __init
diff --git a/arch/mips/cobalt/console.c b/arch/mips/cobalt/console.c
index 46c23b66bc17..fff20d28114f 100644
--- a/arch/mips/cobalt/console.c
+++ b/arch/mips/cobalt/console.c
@@ -19,29 +19,3 @@ static void putchar(int c)
19 19
20 COBALT_UART[UART_TX] = c; 20 COBALT_UART[UART_TX] = c;
21} 21}
22
23static void cons_write(struct console *c, const char *s, unsigned n)
24{
25 while(n-- && *s)
26 putchar(*s++);
27}
28
29static struct console cons_info =
30{
31 .name = "uart",
32 .write = cons_write,
33 .flags = CON_PRINTBUFFER | CON_BOOT,
34 .index = -1,
35};
36
37void __init cobalt_early_console(void)
38{
39 register_console(&cons_info);
40
41 printk("Cobalt: early console registered\n");
42}
43
44void __init disable_early_printk(void)
45{
46 unregister_console(&cons_info);
47}
diff --git a/arch/mips/cobalt/setup.c b/arch/mips/cobalt/setup.c
index 415ff8710b55..d2340587671c 100644
--- a/arch/mips/cobalt/setup.c
+++ b/arch/mips/cobalt/setup.c
@@ -150,10 +150,6 @@ void __init plat_mem_setup(void)
150#endif 150#endif
151 151
152 if (cobalt_board_id > COBALT_BRD_ID_RAQ1) { 152 if (cobalt_board_id > COBALT_BRD_ID_RAQ1) {
153#ifdef CONFIG_EARLY_PRINTK
154 cobalt_early_console();
155#endif
156
157#ifdef CONFIG_SERIAL_8250 153#ifdef CONFIG_SERIAL_8250
158 uart.line = 0; 154 uart.line = 0;
159 uart.type = PORT_UNKNOWN; 155 uart.type = PORT_UNKNOWN;
diff --git a/arch/mips/dec/prom/console.c b/arch/mips/dec/prom/console.c
index cade16ec7e5a..65419bf32441 100644
--- a/arch/mips/dec/prom/console.c
+++ b/arch/mips/dec/prom/console.c
@@ -16,40 +16,12 @@
16 16
17#include <asm/dec/prom.h> 17#include <asm/dec/prom.h>
18 18
19static void __init prom_console_write(struct console *con, const char *s, 19void prom_putchar(char c)
20 unsigned int c)
21{ 20{
22 static char sfmt[] __initdata = "%%%us"; 21 char s[2];
23 char fmt[13];
24 22
25 snprintf(fmt, sizeof(fmt), sfmt, c); 23 s[0] = c;
26 prom_printf(fmt, s); 24 s[1] = '\0';
27}
28
29static struct console promcons __initdata = {
30 .name = "prom",
31 .write = prom_console_write,
32 .flags = CON_PRINTBUFFER,
33 .index = -1,
34};
35
36static int promcons_output __initdata = 0;
37
38void __init register_prom_console(void)
39{
40 if (!promcons_output) {
41 promcons_output = 1;
42 register_console(&promcons);
43 }
44}
45 25
46void __init unregister_prom_console(void) 26 prom_printf( s);
47{
48 if (promcons_output) {
49 unregister_console(&promcons);
50 promcons_output = 0;
51 }
52} 27}
53
54void disable_early_printk(void)
55 __attribute__((alias("unregister_prom_console")));
diff --git a/arch/mips/gt64120/ev64120/promcon.c b/arch/mips/gt64120/ev64120/promcon.c
index b5937c4ba7db..6e0ecfed9640 100644
--- a/arch/mips/gt64120/ev64120/promcon.c
+++ b/arch/mips/gt64120/ev64120/promcon.c
@@ -24,11 +24,6 @@ static void prom_console_write(struct console *co, const char *s,
24 } 24 }
25} 25}
26 26
27int prom_getchar(void)
28{
29 return 0;
30}
31
32static struct console sercons = { 27static struct console sercons = {
33 .name = "ttyS", 28 .name = "ttyS",
34 .write = prom_console_write, 29 .write = prom_console_write,
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index a3dad394acb7..49246264cc7c 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -65,5 +65,6 @@ obj-$(CONFIG_64BIT) += cpu-bugs64.o
65obj-$(CONFIG_I8253) += i8253.o 65obj-$(CONFIG_I8253) += i8253.o
66 66
67obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o 67obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
68obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
68 69
69CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi) 70CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
diff --git a/arch/mips/kernel/early_printk.c b/arch/mips/kernel/early_printk.c
new file mode 100644
index 000000000000..304efdc5682f
--- /dev/null
+++ b/arch/mips/kernel/early_printk.c
@@ -0,0 +1,40 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2003, 06, 07 Ralf Baechle (ralf@linux-mips.org)
7 * Copyright (C) 2007 MIPS Technologies, Inc.
8 * written by Ralf Baechle (ralf@linux-mips.org)
9 */
10#include <linux/console.h>
11#include <linux/init.h>
12
13extern void prom_putchar(char);
14
15static void early_console_write(struct console *con, const char *s, unsigned n)
16{
17 while (n-- && *s) {
18 if (*s == '\n')
19 prom_putchar('\r');
20 prom_putchar(*s);
21 s++;
22 }
23}
24
25static struct console early_console = {
26 .name = "early",
27 .write = early_console_write,
28 .flags = CON_PRINTBUFFER | CON_BOOT,
29 .index = -1
30};
31
32void __init setup_early_printk(void)
33{
34 register_console(&early_console);
35}
36
37void __init disable_early_printk(void)
38{
39 unregister_console(&early_console);
40}
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 11ab222a2e97..4975da0bfb63 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -525,6 +525,14 @@ void __init setup_arch(char **cmdline_p)
525{ 525{
526 cpu_probe(); 526 cpu_probe();
527 prom_init(); 527 prom_init();
528
529#ifdef CONFIG_EARLY_PRINTK
530 {
531 extern void setup_early_printk(void);
532
533 setup_early_printk();
534 }
535#endif
528 cpu_report(); 536 cpu_report();
529 537
530#if defined(CONFIG_VT) 538#if defined(CONFIG_VT)
diff --git a/arch/mips/lasat/lasat_board.c b/arch/mips/lasat/lasat_board.c
index d425120b0282..fbe9a87bd0ad 100644
--- a/arch/mips/lasat/lasat_board.c
+++ b/arch/mips/lasat/lasat_board.c
@@ -110,12 +110,13 @@ int lasat_init_board_info(void)
110 sizeof(struct lasat_eeprom_struct) - 4); 110 sizeof(struct lasat_eeprom_struct) - 4);
111 111
112 if (crc != lasat_board_info.li_eeprom_info.crc32) { 112 if (crc != lasat_board_info.li_eeprom_info.crc32) {
113 prom_printf("WARNING...\nWARNING...\nEEPROM CRC does not match calculated, attempting to soldier on...\n"); 113 printk(KERN_WARNING "WARNING...\nWARNING...\nEEPROM CRC does "
114 "not match calculated, attempting to soldier on...\n");
114 } 115 }
115 116
116 if (lasat_board_info.li_eeprom_info.version != LASAT_EEPROM_VERSION) 117 if (lasat_board_info.li_eeprom_info.version != LASAT_EEPROM_VERSION) {
117 { 118 printk(KERN_WARNING "WARNING...\nWARNING...\nEEPROM version "
118 prom_printf("WARNING...\nWARNING...\nEEPROM version %d, wanted version %d, attempting to soldier on...\n", 119 "%d, wanted version %d, attempting to soldier on...\n",
119 (unsigned int)lasat_board_info.li_eeprom_info.version, 120 (unsigned int)lasat_board_info.li_eeprom_info.version,
120 LASAT_EEPROM_VERSION); 121 LASAT_EEPROM_VERSION);
121 } 122 }
@@ -124,7 +125,9 @@ int lasat_init_board_info(void)
124 cfg1 = lasat_board_info.li_eeprom_info.cfg[1]; 125 cfg1 = lasat_board_info.li_eeprom_info.cfg[1];
125 126
126 if ( LASAT_W0_DSCTYPE(cfg0) != 1) { 127 if ( LASAT_W0_DSCTYPE(cfg0) != 1) {
127 prom_printf("WARNING...\nWARNING...\nInvalid configuration read from EEPROM, attempting to soldier on..."); 128 printk(KERN_WARNING "WARNING...\nWARNING...\n"
129 "Invalid configuration read from EEPROM, attempting to "
130 "soldier on...");
128 } 131 }
129 /* We have a valid configuration */ 132 /* We have a valid configuration */
130 133
diff --git a/arch/mips/lasat/prom.c b/arch/mips/lasat/prom.c
index d47692f73a26..812c6ac366be 100644
--- a/arch/mips/lasat/prom.c
+++ b/arch/mips/lasat/prom.c
@@ -23,10 +23,6 @@
23#define PROM_PUTC_ADDR PROM_JUMP_TABLE_ENTRY(1) 23#define PROM_PUTC_ADDR PROM_JUMP_TABLE_ENTRY(1)
24#define PROM_MONITOR_ADDR PROM_JUMP_TABLE_ENTRY(2) 24#define PROM_MONITOR_ADDR PROM_JUMP_TABLE_ENTRY(2)
25 25
26static void null_prom_printf(const char * fmt, ...)
27{
28}
29
30static void null_prom_display(const char *string, int pos, int clear) 26static void null_prom_display(const char *string, int pos, int clear)
31{ 27{
32} 28}
@@ -40,50 +36,29 @@ static void null_prom_putc(char c)
40} 36}
41 37
42/* these are functions provided by the bootloader */ 38/* these are functions provided by the bootloader */
43static void (* prom_putc)(char c) = null_prom_putc; 39static void (* __prom_putc)(char c) = null_prom_putc;
44void (* prom_printf)(const char * fmt, ...) = null_prom_printf; 40
41void prom_putchar(char c)
42{
43 __prom_putc(c);
44}
45
45void (* prom_display)(const char *string, int pos, int clear) = 46void (* prom_display)(const char *string, int pos, int clear) =
46 null_prom_display; 47 null_prom_display;
47void (* prom_monitor)(void) = null_prom_monitor; 48void (* prom_monitor)(void) = null_prom_monitor;
48 49
49unsigned int lasat_ndelay_divider; 50unsigned int lasat_ndelay_divider;
50 51
51#define PROM_PRINTFBUF_SIZE 256
52static char prom_printfbuf[PROM_PRINTFBUF_SIZE];
53
54static void real_prom_printf(const char * fmt, ...)
55{
56 va_list ap;
57 int len;
58 char *c = prom_printfbuf;
59 int i;
60
61 va_start(ap, fmt);
62 len = vsnprintf(prom_printfbuf, PROM_PRINTFBUF_SIZE, fmt, ap);
63 va_end(ap);
64
65 /* output overflowed the buffer */
66 if (len < 0 || len > PROM_PRINTFBUF_SIZE)
67 len = PROM_PRINTFBUF_SIZE;
68
69 for (i=0; i < len; i++) {
70 if (*c == '\n')
71 prom_putc('\r');
72 prom_putc(*c++);
73 }
74}
75
76static void setup_prom_vectors(void) 52static void setup_prom_vectors(void)
77{ 53{
78 u32 version = *(u32 *)(RESET_VECTOR + 0x90); 54 u32 version = *(u32 *)(RESET_VECTOR + 0x90);
79 55
80 if (version >= 307) { 56 if (version >= 307) {
81 prom_display = (void *)PROM_DISPLAY_ADDR; 57 prom_display = (void *)PROM_DISPLAY_ADDR;
82 prom_putc = (void *)PROM_PUTC_ADDR; 58 __prom_putc = (void *)PROM_PUTC_ADDR;
83 prom_printf = real_prom_printf;
84 prom_monitor = (void *)PROM_MONITOR_ADDR; 59 prom_monitor = (void *)PROM_MONITOR_ADDR;
85 } 60 }
86 prom_printf("prom vectors set up\n"); 61 printk("prom vectors set up\n");
87} 62}
88 63
89static struct at93c_defs at93c_defs[N_MACHTYPES] = { 64static struct at93c_defs at93c_defs[N_MACHTYPES] = {
@@ -101,11 +76,11 @@ void __init prom_init(void)
101 setup_prom_vectors(); 76 setup_prom_vectors();
102 77
103 if (current_cpu_data.cputype == CPU_R5000) { 78 if (current_cpu_data.cputype == CPU_R5000) {
104 prom_printf("LASAT 200 board\n"); 79 printk("LASAT 200 board\n");
105 mips_machtype = MACH_LASAT_200; 80 mips_machtype = MACH_LASAT_200;
106 lasat_ndelay_divider = LASAT_200_DIVIDER; 81 lasat_ndelay_divider = LASAT_200_DIVIDER;
107 } else { 82 } else {
108 prom_printf("LASAT 100 board\n"); 83 printk("LASAT 100 board\n");
109 mips_machtype = MACH_LASAT_100; 84 mips_machtype = MACH_LASAT_100;
110 lasat_ndelay_divider = LASAT_100_DIVIDER; 85 lasat_ndelay_divider = LASAT_100_DIVIDER;
111 } 86 }
diff --git a/arch/mips/lasat/prom.h b/arch/mips/lasat/prom.h
index 07be7bf1e4a3..019d45fbd268 100644
--- a/arch/mips/lasat/prom.h
+++ b/arch/mips/lasat/prom.h
@@ -2,5 +2,4 @@
2#define PROM_H 2#define PROM_H
3extern void (* prom_display)(const char *string, int pos, int clear); 3extern void (* prom_display)(const char *string, int pos, int clear);
4extern void (* prom_monitor)(void); 4extern void (* prom_monitor)(void);
5extern void (* prom_printf)(const char * fmt, ...);
6#endif 5#endif
diff --git a/arch/mips/lasat/setup.c b/arch/mips/lasat/setup.c
index b27b47cd6fb2..488007f13988 100644
--- a/arch/mips/lasat/setup.c
+++ b/arch/mips/lasat/setup.c
@@ -178,5 +178,5 @@ void __init plat_mem_setup(void)
178 /* Switch from prom exception handler to normal mode */ 178 /* Switch from prom exception handler to normal mode */
179 change_c0_status(ST0_BEV,0); 179 change_c0_status(ST0_BEV,0);
180 180
181 prom_printf("Lasat specific initialization complete\n"); 181 pr_info("Lasat specific initialization complete\n");
182} 182}
diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile
index 52e0ec8bcb15..d7d3b14dcfb2 100644
--- a/arch/mips/lib/Makefile
+++ b/arch/mips/lib/Makefile
@@ -2,8 +2,8 @@
2# Makefile for MIPS-specific library files.. 2# Makefile for MIPS-specific library files..
3# 3#
4 4
5lib-y += csum_partial.o memcpy.o memcpy-inatomic.o memset.o promlib.o \ 5lib-y += csum_partial.o memcpy.o memcpy-inatomic.o memset.o strlen_user.o \
6 strlen_user.o strncpy_user.o strnlen_user.o uncached.o 6 strncpy_user.o strnlen_user.o uncached.o
7 7
8obj-y += iomap.o 8obj-y += iomap.o
9obj-$(CONFIG_PCI) += iomap-pci.o 9obj-$(CONFIG_PCI) += iomap-pci.o
diff --git a/arch/mips/lib/promlib.c b/arch/mips/lib/promlib.c
deleted file mode 100644
index dddfe98b4ded..000000000000
--- a/arch/mips/lib/promlib.c
+++ /dev/null
@@ -1,24 +0,0 @@
1#include <stdarg.h>
2#include <linux/kernel.h>
3
4extern void prom_putchar(char);
5
6void prom_printf(char *fmt, ...)
7{
8 va_list args;
9 char ppbuf[1024];
10 char *bptr;
11
12 va_start(args, fmt);
13 vsprintf(ppbuf, fmt, args);
14
15 bptr = ppbuf;
16
17 while (*bptr != 0) {
18 if (*bptr == '\n')
19 prom_putchar('\r');
20
21 prom_putchar(*bptr++);
22 }
23 va_end(args);
24}
diff --git a/arch/mips/mips-boards/generic/Makefile b/arch/mips/mips-boards/generic/Makefile
index 0a30f5dc9b72..aade36d78787 100644
--- a/arch/mips/mips-boards/generic/Makefile
+++ b/arch/mips/mips-boards/generic/Makefile
@@ -18,7 +18,9 @@
18# Makefile for the MIPS boards generic routines under Linux. 18# Makefile for the MIPS boards generic routines under Linux.
19# 19#
20 20
21obj-y := reset.o display.o init.o memory.o printf.o \ 21obj-y := reset.o display.o init.o memory.o \
22 cmdline.o time.o 22 cmdline.o time.o
23
24obj-$(CONFIG_EARLY_PRINTK) += console.o
23obj-$(CONFIG_PCI) += pci.o 25obj-$(CONFIG_PCI) += pci.o
24obj-$(CONFIG_KGDB) += gdb_hook.o 26obj-$(CONFIG_KGDB) += gdb_hook.o
diff --git a/arch/mips/mips-boards/generic/printf.c b/arch/mips/mips-boards/generic/console.c
index 1a711bd79b51..4d8ab99e4155 100644
--- a/arch/mips/mips-boards/generic/printf.c
+++ b/arch/mips/mips-boards/generic/console.c
@@ -17,10 +17,9 @@
17 * 17 *
18 * Putting things on the screen/serial line using YAMONs facilities. 18 * Putting things on the screen/serial line using YAMONs facilities.
19 */ 19 */
20#include <linux/console.h>
20#include <linux/init.h> 21#include <linux/init.h>
21#include <linux/kernel.h>
22#include <linux/serial_reg.h> 22#include <linux/serial_reg.h>
23#include <linux/spinlock.h>
24#include <asm/io.h> 23#include <asm/io.h>
25 24
26#ifdef CONFIG_MIPS_ATLAS 25#ifdef CONFIG_MIPS_ATLAS
@@ -67,12 +66,3 @@ int prom_putchar(char c)
67 66
68 return 1; 67 return 1;
69} 68}
70
71char prom_getchar(void)
72{
73 while (!(serial_in(UART_LSR) & UART_LSR_DR))
74 ;
75
76 return serial_in(UART_RX);
77}
78
diff --git a/arch/mips/mips-boards/generic/init.c b/arch/mips/mips-boards/generic/init.c
index 58a0fe883591..b11337600129 100644
--- a/arch/mips/mips-boards/generic/init.c
+++ b/arch/mips/mips-boards/generic/init.c
@@ -167,7 +167,7 @@ static void __init console_config(void)
167 flow = 'r'; 167 flow = 'r';
168 sprintf (console_string, " console=ttyS0,%d%c%c%c", baud, parity, bits, flow); 168 sprintf (console_string, " console=ttyS0,%d%c%c%c", baud, parity, bits, flow);
169 strcat (prom_getcmdline(), console_string); 169 strcat (prom_getcmdline(), console_string);
170 prom_printf("Config serial console:%s\n", console_string); 170 pr_info("Config serial console:%s\n", console_string);
171 } 171 }
172} 172}
173#endif 173#endif
@@ -210,8 +210,9 @@ void __init kgdb_config (void)
210 generic_getDebugChar = rs_getDebugChar; 210 generic_getDebugChar = rs_getDebugChar;
211 } 211 }
212 212
213 prom_printf("KGDB: Using serial line /dev/ttyS%d at %d for session, " 213 pr_info("KGDB: Using serial line /dev/ttyS%d at %d for "
214 "please connect your debugger\n", line ? 1 : 0, speed); 214 "session, please connect your debugger\n",
215 line ? 1 : 0, speed);
215 216
216 { 217 {
217 char *s; 218 char *s;
@@ -382,7 +383,7 @@ void __init prom_init(void)
382 board_nmi_handler_setup = mips_nmi_setup; 383 board_nmi_handler_setup = mips_nmi_setup;
383 board_ejtag_handler_setup = mips_ejtag_setup; 384 board_ejtag_handler_setup = mips_ejtag_setup;
384 385
385 prom_printf("\nLINUX started...\n"); 386 pr_info("\nLINUX started...\n");
386 prom_init_cmdline(); 387 prom_init_cmdline();
387 prom_meminit(); 388 prom_meminit();
388#ifdef CONFIG_SERIAL_8250_CONSOLE 389#ifdef CONFIG_SERIAL_8250_CONSOLE
diff --git a/arch/mips/mips-boards/generic/memory.c b/arch/mips/mips-boards/generic/memory.c
index ebf0e16c5a0d..ae39953da2c4 100644
--- a/arch/mips/mips-boards/generic/memory.c
+++ b/arch/mips/mips-boards/generic/memory.c
@@ -59,11 +59,12 @@ struct prom_pmemblock * __init prom_getmdesc(void)
59 /* otherwise look in the environment */ 59 /* otherwise look in the environment */
60 memsize_str = prom_getenv("memsize"); 60 memsize_str = prom_getenv("memsize");
61 if (!memsize_str) { 61 if (!memsize_str) {
62 prom_printf("memsize not set in boot prom, set to default (32Mb)\n"); 62 printk(KERN_WARNING
63 "memsize not set in boot prom, set to default (32Mb)\n");
63 physical_memsize = 0x02000000; 64 physical_memsize = 0x02000000;
64 } else { 65 } else {
65#ifdef DEBUG 66#ifdef DEBUG
66 prom_printf("prom_memsize = %s\n", memsize_str); 67 pr_debug("prom_memsize = %s\n", memsize_str);
67#endif 68#endif
68 physical_memsize = simple_strtol(memsize_str, NULL, 0); 69 physical_memsize = simple_strtol(memsize_str, NULL, 0);
69 } 70 }
@@ -141,12 +142,12 @@ void __init prom_meminit(void)
141 struct prom_pmemblock *p; 142 struct prom_pmemblock *p;
142 143
143#ifdef DEBUG 144#ifdef DEBUG
144 prom_printf("YAMON MEMORY DESCRIPTOR dump:\n"); 145 pr_debug("YAMON MEMORY DESCRIPTOR dump:\n");
145 p = prom_getmdesc(); 146 p = prom_getmdesc();
146 while (p->size) { 147 while (p->size) {
147 int i = 0; 148 int i = 0;
148 prom_printf("[%d,%p]: base<%08lx> size<%08lx> type<%s>\n", 149 pr_debug("[%d,%p]: base<%08lx> size<%08lx> type<%s>\n",
149 i, p, p->base, p->size, mtypes[p->type]); 150 i, p, p->base, p->size, mtypes[p->type]);
150 p++; 151 p++;
151 i++; 152 i++;
152 } 153 }
diff --git a/arch/mips/mips-boards/sim/Makefile b/arch/mips/mips-boards/sim/Makefile
index a12e32aafde0..6aeebc9122f2 100644
--- a/arch/mips/mips-boards/sim/Makefile
+++ b/arch/mips/mips-boards/sim/Makefile
@@ -1,5 +1,7 @@
1# 1#
2# Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved. 2# Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.
3# Copyright (C) 2007 MIPS Technologies, Inc.
4# written by Ralf Baechle (ralf@linux-mips.org)
3# 5#
4# This program is free software; you can distribute it and/or modify it 6# This program is free software; you can distribute it and/or modify it
5# under the terms of the GNU General Public License (Version 2) as 7# under the terms of the GNU General Public License (Version 2) as
@@ -15,5 +17,7 @@
15# 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 17# 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16# 18#
17 19
18obj-y := sim_setup.o sim_mem.o sim_time.o sim_printf.o sim_int.o sim_cmdline.o 20obj-y := sim_setup.o sim_mem.o sim_time.o sim_int.o sim_cmdline.o
21
22obj-$(CONFIG_EARLY_PRINTK) += sim_console.o
19obj-$(CONFIG_SMP) += sim_smp.o 23obj-$(CONFIG_SMP) += sim_smp.o
diff --git a/arch/mips/mips-boards/sim/sim_printf.c b/arch/mips/mips-boards/sim/sim_console.c
index 3ee5a0b501a6..de595a9ccb27 100644
--- a/arch/mips/mips-boards/sim/sim_printf.c
+++ b/arch/mips/mips-boards/sim/sim_console.c
@@ -1,7 +1,4 @@
1/* 1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
4 *
5 * This program is free software; you can distribute it and/or modify it 2 * This program is free software; you can distribute it and/or modify it
6 * under the terms of the GNU General Public License (Version 2) as 3 * under the terms of the GNU General Public License (Version 2) as
7 * published by the Free Software Foundation. 4 * published by the Free Software Foundation.
@@ -15,14 +12,14 @@
15 * with this program; if not, write to the Free Software Foundation, Inc., 12 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 13 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
17 * 14 *
18 * Putting things on the screen/serial line using YAMONs facilities. 15 * Carsten Langgaard, carstenl@mips.com
16 * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
17 * Copyright (C) 2007 MIPS Technologies, Inc.
18 * written by Ralf Baechle
19 */ 19 */
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/kernel.h>
22#include <linux/serial_reg.h> 21#include <linux/serial_reg.h>
23#include <linux/spinlock.h>
24#include <asm/io.h> 22#include <asm/io.h>
25#include <asm/system.h>
26 23
27static inline unsigned int serial_in(int offset) 24static inline unsigned int serial_in(int offset)
28{ 25{
@@ -34,41 +31,10 @@ static inline void serial_out(int offset, int value)
34 outb(value, 0x3f8 + offset); 31 outb(value, 0x3f8 + offset);
35} 32}
36 33
37int putPromChar(char c) 34void __init prom_putchar(char c)
38{ 35{
39 while ((serial_in(UART_LSR) & UART_LSR_THRE) == 0) 36 while ((serial_in(UART_LSR) & UART_LSR_THRE) == 0)
40 ; 37 ;
41 38
42 serial_out(UART_TX, c); 39 serial_out(UART_TX, c);
43
44 return 1;
45}
46
47char getPromChar(void)
48{
49 while (!(serial_in(UART_LSR) & 1))
50 ;
51
52 return serial_in(UART_RX);
53}
54
55void prom_printf(char *fmt, ...)
56{
57 va_list args;
58 int l;
59 char *p, *buf_end;
60 char buf[1024];
61
62 va_start(args, fmt);
63 l = vsprintf(buf, fmt, args); /* hopefully i < sizeof(buf) */
64 va_end(args);
65
66 buf_end = buf + l;
67
68 for (p = buf; p < buf_end; p++) {
69 /* Crude cr/nl handling is better than none */
70 if (*p == '\n')
71 putPromChar('\r');
72 putPromChar(*p);
73 }
74} 40}
diff --git a/arch/mips/mips-boards/sim/sim_mem.c b/arch/mips/mips-boards/sim/sim_mem.c
index 46bc16f8b15d..e408ef0bcd6e 100644
--- a/arch/mips/mips-boards/sim/sim_mem.c
+++ b/arch/mips/mips-boards/sim/sim_mem.c
@@ -46,7 +46,7 @@ struct prom_pmemblock * __init prom_getmdesc(void)
46 unsigned int memsize; 46 unsigned int memsize;
47 47
48 memsize = 0x02000000; 48 memsize = 0x02000000;
49 prom_printf("Setting default memory size 0x%08x\n", memsize); 49 pr_info("Setting default memory size 0x%08x\n", memsize);
50 50
51 memset(mdesc, 0, sizeof(mdesc)); 51 memset(mdesc, 0, sizeof(mdesc));
52 52
diff --git a/arch/mips/mips-boards/sim/sim_setup.c b/arch/mips/mips-boards/sim/sim_setup.c
index ea2066c3a1f7..b705f09e57c3 100644
--- a/arch/mips/mips-boards/sim/sim_setup.c
+++ b/arch/mips/mips-boards/sim/sim_setup.c
@@ -55,7 +55,7 @@ void __init plat_mem_setup(void)
55 serial_init(); 55 serial_init();
56 56
57 board_time_init = sim_time_init; 57 board_time_init = sim_time_init;
58 prom_printf("Linux started...\n"); 58 pr_info("Linux started...\n");
59 59
60#ifdef CONFIG_MIPS_MT_SMP 60#ifdef CONFIG_MIPS_MT_SMP
61 sanitize_tlb_entries(); 61 sanitize_tlb_entries();
@@ -66,7 +66,7 @@ void prom_init(void)
66{ 66{
67 set_io_port_base(0xbfd00000); 67 set_io_port_base(0xbfd00000);
68 68
69 prom_printf("\nLINUX started...\n"); 69 pr_info("\nLINUX started...\n");
70 prom_init_cmdline(); 70 prom_init_cmdline();
71 prom_meminit(); 71 prom_meminit();
72} 72}
@@ -91,7 +91,7 @@ static void __init serial_init(void)
91 s.timeout = 4; 91 s.timeout = 4;
92 92
93 if (early_serial_setup(&s) != 0) { 93 if (early_serial_setup(&s) != 0) {
94 prom_printf(KERN_ERR "Serial setup failed!\n"); 94 printk(KERN_ERR "Serial setup failed!\n");
95 } 95 }
96 96
97#endif 97#endif
diff --git a/arch/mips/mm/cerr-sb1.c b/arch/mips/mm/cerr-sb1.c
index e19fbb9ee47f..11a916629d3b 100644
--- a/arch/mips/mm/cerr-sb1.c
+++ b/arch/mips/mm/cerr-sb1.c
@@ -77,66 +77,66 @@ static uint32_t extract_dc(unsigned short addr, int data);
77static inline void breakout_errctl(unsigned int val) 77static inline void breakout_errctl(unsigned int val)
78{ 78{
79 if (val & CP0_ERRCTL_RECOVERABLE) 79 if (val & CP0_ERRCTL_RECOVERABLE)
80 prom_printf(" recoverable"); 80 printk(" recoverable");
81 if (val & CP0_ERRCTL_DCACHE) 81 if (val & CP0_ERRCTL_DCACHE)
82 prom_printf(" dcache"); 82 printk(" dcache");
83 if (val & CP0_ERRCTL_ICACHE) 83 if (val & CP0_ERRCTL_ICACHE)
84 prom_printf(" icache"); 84 printk(" icache");
85 if (val & CP0_ERRCTL_MULTIBUS) 85 if (val & CP0_ERRCTL_MULTIBUS)
86 prom_printf(" multiple-buserr"); 86 printk(" multiple-buserr");
87 prom_printf("\n"); 87 printk("\n");
88} 88}
89 89
90static inline void breakout_cerri(unsigned int val) 90static inline void breakout_cerri(unsigned int val)
91{ 91{
92 if (val & CP0_CERRI_TAG_PARITY) 92 if (val & CP0_CERRI_TAG_PARITY)
93 prom_printf(" tag-parity"); 93 printk(" tag-parity");
94 if (val & CP0_CERRI_DATA_PARITY) 94 if (val & CP0_CERRI_DATA_PARITY)
95 prom_printf(" data-parity"); 95 printk(" data-parity");
96 if (val & CP0_CERRI_EXTERNAL) 96 if (val & CP0_CERRI_EXTERNAL)
97 prom_printf(" external"); 97 printk(" external");
98 prom_printf("\n"); 98 printk("\n");
99} 99}
100 100
101static inline void breakout_cerrd(unsigned int val) 101static inline void breakout_cerrd(unsigned int val)
102{ 102{
103 switch (val & CP0_CERRD_CAUSES) { 103 switch (val & CP0_CERRD_CAUSES) {
104 case CP0_CERRD_LOAD: 104 case CP0_CERRD_LOAD:
105 prom_printf(" load,"); 105 printk(" load,");
106 break; 106 break;
107 case CP0_CERRD_STORE: 107 case CP0_CERRD_STORE:
108 prom_printf(" store,"); 108 printk(" store,");
109 break; 109 break;
110 case CP0_CERRD_FILLWB: 110 case CP0_CERRD_FILLWB:
111 prom_printf(" fill/wb,"); 111 printk(" fill/wb,");
112 break; 112 break;
113 case CP0_CERRD_COHERENCY: 113 case CP0_CERRD_COHERENCY:
114 prom_printf(" coherency,"); 114 printk(" coherency,");
115 break; 115 break;
116 case CP0_CERRD_DUPTAG: 116 case CP0_CERRD_DUPTAG:
117 prom_printf(" duptags,"); 117 printk(" duptags,");
118 break; 118 break;
119 default: 119 default:
120 prom_printf(" NO CAUSE,"); 120 printk(" NO CAUSE,");
121 break; 121 break;
122 } 122 }
123 if (!(val & CP0_CERRD_TYPES)) 123 if (!(val & CP0_CERRD_TYPES))
124 prom_printf(" NO TYPE"); 124 printk(" NO TYPE");
125 else { 125 else {
126 if (val & CP0_CERRD_MULTIPLE) 126 if (val & CP0_CERRD_MULTIPLE)
127 prom_printf(" multi-err"); 127 printk(" multi-err");
128 if (val & CP0_CERRD_TAG_STATE) 128 if (val & CP0_CERRD_TAG_STATE)
129 prom_printf(" tag-state"); 129 printk(" tag-state");
130 if (val & CP0_CERRD_TAG_ADDRESS) 130 if (val & CP0_CERRD_TAG_ADDRESS)
131 prom_printf(" tag-address"); 131 printk(" tag-address");
132 if (val & CP0_CERRD_DATA_SBE) 132 if (val & CP0_CERRD_DATA_SBE)
133 prom_printf(" data-SBE"); 133 printk(" data-SBE");
134 if (val & CP0_CERRD_DATA_DBE) 134 if (val & CP0_CERRD_DATA_DBE)
135 prom_printf(" data-DBE"); 135 printk(" data-DBE");
136 if (val & CP0_CERRD_EXTERNAL) 136 if (val & CP0_CERRD_EXTERNAL)
137 prom_printf(" external"); 137 printk(" external");
138 } 138 }
139 prom_printf("\n"); 139 printk("\n");
140} 140}
141 141
142#ifndef CONFIG_SIBYTE_BUS_WATCHER 142#ifndef CONFIG_SIBYTE_BUS_WATCHER
@@ -157,18 +157,18 @@ static void check_bus_watcher(void)
157 l2_tag = in64(IO_SPACE_BASE | A_L2_ECC_TAG); 157 l2_tag = in64(IO_SPACE_BASE | A_L2_ECC_TAG);
158#endif 158#endif
159 memio_err = csr_in32(IOADDR(A_BUS_MEM_IO_ERRORS)); 159 memio_err = csr_in32(IOADDR(A_BUS_MEM_IO_ERRORS));
160 prom_printf("Bus watcher error counters: %08x %08x\n", l2_err, memio_err); 160 printk("Bus watcher error counters: %08x %08x\n", l2_err, memio_err);
161 prom_printf("\nLast recorded signature:\n"); 161 printk("\nLast recorded signature:\n");
162 prom_printf("Request %02x from %d, answered by %d with Dcode %d\n", 162 printk("Request %02x from %d, answered by %d with Dcode %d\n",
163 (unsigned int)(G_SCD_BERR_TID(status) & 0x3f), 163 (unsigned int)(G_SCD_BERR_TID(status) & 0x3f),
164 (int)(G_SCD_BERR_TID(status) >> 6), 164 (int)(G_SCD_BERR_TID(status) >> 6),
165 (int)G_SCD_BERR_RID(status), 165 (int)G_SCD_BERR_RID(status),
166 (int)G_SCD_BERR_DCODE(status)); 166 (int)G_SCD_BERR_DCODE(status));
167#ifdef DUMP_L2_ECC_TAG_ON_ERROR 167#ifdef DUMP_L2_ECC_TAG_ON_ERROR
168 prom_printf("Last L2 tag w/ bad ECC: %016llx\n", l2_tag); 168 printk("Last L2 tag w/ bad ECC: %016llx\n", l2_tag);
169#endif 169#endif
170 } else { 170 } else {
171 prom_printf("Bus watcher indicates no error\n"); 171 printk("Bus watcher indicates no error\n");
172 } 172 }
173} 173}
174#else 174#else
@@ -187,11 +187,11 @@ asmlinkage void sb1_cache_error(void)
187#else 187#else
188 csr_out32(M_SCD_TRACE_CFG_FREEZE, IO_SPACE_BASE | A_SCD_TRACE_CFG); 188 csr_out32(M_SCD_TRACE_CFG_FREEZE, IO_SPACE_BASE | A_SCD_TRACE_CFG);
189#endif 189#endif
190 prom_printf("Trace buffer frozen\n"); 190 printk("Trace buffer frozen\n");
191#endif 191#endif
192 192
193 prom_printf("Cache error exception on CPU %x:\n", 193 printk("Cache error exception on CPU %x:\n",
194 (read_c0_prid() >> 25) & 0x7); 194 (read_c0_prid() >> 25) & 0x7);
195 195
196 __asm__ __volatile__ ( 196 __asm__ __volatile__ (
197 " .set push\n\t" 197 " .set push\n\t"
@@ -209,43 +209,43 @@ asmlinkage void sb1_cache_error(void)
209 "=r" (dpahi), "=r" (dpalo), "=r" (eepc)); 209 "=r" (dpahi), "=r" (dpalo), "=r" (eepc));
210 210
211 cerr_dpa = (((uint64_t)dpahi) << 32) | dpalo; 211 cerr_dpa = (((uint64_t)dpahi) << 32) | dpalo;
212 prom_printf(" c0_errorepc == %08x\n", eepc); 212 printk(" c0_errorepc == %08x\n", eepc);
213 prom_printf(" c0_errctl == %08x", errctl); 213 printk(" c0_errctl == %08x", errctl);
214 breakout_errctl(errctl); 214 breakout_errctl(errctl);
215 if (errctl & CP0_ERRCTL_ICACHE) { 215 if (errctl & CP0_ERRCTL_ICACHE) {
216 prom_printf(" c0_cerr_i == %08x", cerr_i); 216 printk(" c0_cerr_i == %08x", cerr_i);
217 breakout_cerri(cerr_i); 217 breakout_cerri(cerr_i);
218 if (CP0_CERRI_IDX_VALID(cerr_i)) { 218 if (CP0_CERRI_IDX_VALID(cerr_i)) {
219 /* Check index of EPC, allowing for delay slot */ 219 /* Check index of EPC, allowing for delay slot */
220 if (((eepc & SB1_CACHE_INDEX_MASK) != (cerr_i & SB1_CACHE_INDEX_MASK)) && 220 if (((eepc & SB1_CACHE_INDEX_MASK) != (cerr_i & SB1_CACHE_INDEX_MASK)) &&
221 ((eepc & SB1_CACHE_INDEX_MASK) != ((cerr_i & SB1_CACHE_INDEX_MASK) - 4))) 221 ((eepc & SB1_CACHE_INDEX_MASK) != ((cerr_i & SB1_CACHE_INDEX_MASK) - 4)))
222 prom_printf(" cerr_i idx doesn't match eepc\n"); 222 printk(" cerr_i idx doesn't match eepc\n");
223 else { 223 else {
224 res = extract_ic(cerr_i & SB1_CACHE_INDEX_MASK, 224 res = extract_ic(cerr_i & SB1_CACHE_INDEX_MASK,
225 (cerr_i & CP0_CERRI_DATA) != 0); 225 (cerr_i & CP0_CERRI_DATA) != 0);
226 if (!(res & cerr_i)) 226 if (!(res & cerr_i))
227 prom_printf("...didn't see indicated icache problem\n"); 227 printk("...didn't see indicated icache problem\n");
228 } 228 }
229 } 229 }
230 } 230 }
231 if (errctl & CP0_ERRCTL_DCACHE) { 231 if (errctl & CP0_ERRCTL_DCACHE) {
232 prom_printf(" c0_cerr_d == %08x", cerr_d); 232 printk(" c0_cerr_d == %08x", cerr_d);
233 breakout_cerrd(cerr_d); 233 breakout_cerrd(cerr_d);
234 if (CP0_CERRD_DPA_VALID(cerr_d)) { 234 if (CP0_CERRD_DPA_VALID(cerr_d)) {
235 prom_printf(" c0_cerr_dpa == %010llx\n", cerr_dpa); 235 printk(" c0_cerr_dpa == %010llx\n", cerr_dpa);
236 if (!CP0_CERRD_IDX_VALID(cerr_d)) { 236 if (!CP0_CERRD_IDX_VALID(cerr_d)) {
237 res = extract_dc(cerr_dpa & SB1_CACHE_INDEX_MASK, 237 res = extract_dc(cerr_dpa & SB1_CACHE_INDEX_MASK,
238 (cerr_d & CP0_CERRD_DATA) != 0); 238 (cerr_d & CP0_CERRD_DATA) != 0);
239 if (!(res & cerr_d)) 239 if (!(res & cerr_d))
240 prom_printf("...didn't see indicated dcache problem\n"); 240 printk("...didn't see indicated dcache problem\n");
241 } else { 241 } else {
242 if ((cerr_dpa & SB1_CACHE_INDEX_MASK) != (cerr_d & SB1_CACHE_INDEX_MASK)) 242 if ((cerr_dpa & SB1_CACHE_INDEX_MASK) != (cerr_d & SB1_CACHE_INDEX_MASK))
243 prom_printf(" cerr_d idx doesn't match cerr_dpa\n"); 243 printk(" cerr_d idx doesn't match cerr_dpa\n");
244 else { 244 else {
245 res = extract_dc(cerr_d & SB1_CACHE_INDEX_MASK, 245 res = extract_dc(cerr_d & SB1_CACHE_INDEX_MASK,
246 (cerr_d & CP0_CERRD_DATA) != 0); 246 (cerr_d & CP0_CERRD_DATA) != 0);
247 if (!(res & cerr_d)) 247 if (!(res & cerr_d))
248 prom_printf("...didn't see indicated problem\n"); 248 printk("...didn't see indicated problem\n");
249 } 249 }
250 } 250 }
251 } 251 }
@@ -334,7 +334,7 @@ static uint32_t extract_ic(unsigned short addr, int data)
334 uint8_t lru; 334 uint8_t lru;
335 int res = 0; 335 int res = 0;
336 336
337 prom_printf("Icache index 0x%04x ", addr); 337 printk("Icache index 0x%04x ", addr);
338 for (way = 0; way < 4; way++) { 338 for (way = 0; way < 4; way++) {
339 /* Index-load-tag-I */ 339 /* Index-load-tag-I */
340 __asm__ __volatile__ ( 340 __asm__ __volatile__ (
@@ -354,7 +354,7 @@ static uint32_t extract_ic(unsigned short addr, int data)
354 taglo = ((unsigned long long)taglohi << 32) | taglolo; 354 taglo = ((unsigned long long)taglohi << 32) | taglolo;
355 if (way == 0) { 355 if (way == 0) {
356 lru = (taghi >> 14) & 0xff; 356 lru = (taghi >> 14) & 0xff;
357 prom_printf("[Bank %d Set 0x%02x] LRU > %d %d %d %d > MRU\n", 357 printk("[Bank %d Set 0x%02x] LRU > %d %d %d %d > MRU\n",
358 ((addr >> 5) & 0x3), /* bank */ 358 ((addr >> 5) & 0x3), /* bank */
359 ((addr >> 7) & 0x3f), /* index */ 359 ((addr >> 7) & 0x3f), /* index */
360 (lru & 0x3), 360 (lru & 0x3),
@@ -369,19 +369,19 @@ static uint32_t extract_ic(unsigned short addr, int data)
369 if (valid) { 369 if (valid) {
370 tlo_tmp = taglo & 0xfff3ff; 370 tlo_tmp = taglo & 0xfff3ff;
371 if (((taglo >> 10) & 1) ^ range_parity(tlo_tmp, 23, 0)) { 371 if (((taglo >> 10) & 1) ^ range_parity(tlo_tmp, 23, 0)) {
372 prom_printf(" ** bad parity in VTag0/G/ASID\n"); 372 printk(" ** bad parity in VTag0/G/ASID\n");
373 res |= CP0_CERRI_TAG_PARITY; 373 res |= CP0_CERRI_TAG_PARITY;
374 } 374 }
375 if (((taglo >> 11) & 1) ^ range_parity(taglo, 63, 24)) { 375 if (((taglo >> 11) & 1) ^ range_parity(taglo, 63, 24)) {
376 prom_printf(" ** bad parity in R/VTag1\n"); 376 printk(" ** bad parity in R/VTag1\n");
377 res |= CP0_CERRI_TAG_PARITY; 377 res |= CP0_CERRI_TAG_PARITY;
378 } 378 }
379 } 379 }
380 if (valid ^ ((taghi >> 27) & 1)) { 380 if (valid ^ ((taghi >> 27) & 1)) {
381 prom_printf(" ** bad parity for valid bit\n"); 381 printk(" ** bad parity for valid bit\n");
382 res |= CP0_CERRI_TAG_PARITY; 382 res |= CP0_CERRI_TAG_PARITY;
383 } 383 }
384 prom_printf(" %d [VA %016llx] [Vld? %d] raw tags: %08X-%016llX\n", 384 printk(" %d [VA %016llx] [Vld? %d] raw tags: %08X-%016llX\n",
385 way, va, valid, taghi, taglo); 385 way, va, valid, taghi, taglo);
386 386
387 if (data) { 387 if (data) {
@@ -407,21 +407,21 @@ static uint32_t extract_ic(unsigned short addr, int data)
407 : "r" ((way << 13) | addr | (offset << 3))); 407 : "r" ((way << 13) | addr | (offset << 3)));
408 predecode = (datahi >> 8) & 0xff; 408 predecode = (datahi >> 8) & 0xff;
409 if (((datahi >> 16) & 1) != (uint32_t)range_parity(predecode, 7, 0)) { 409 if (((datahi >> 16) & 1) != (uint32_t)range_parity(predecode, 7, 0)) {
410 prom_printf(" ** bad parity in predecode\n"); 410 printk(" ** bad parity in predecode\n");
411 res |= CP0_CERRI_DATA_PARITY; 411 res |= CP0_CERRI_DATA_PARITY;
412 } 412 }
413 /* XXXKW should/could check predecode bits themselves */ 413 /* XXXKW should/could check predecode bits themselves */
414 if (((datahi >> 4) & 0xf) ^ inst_parity(insta)) { 414 if (((datahi >> 4) & 0xf) ^ inst_parity(insta)) {
415 prom_printf(" ** bad parity in instruction a\n"); 415 printk(" ** bad parity in instruction a\n");
416 res |= CP0_CERRI_DATA_PARITY; 416 res |= CP0_CERRI_DATA_PARITY;
417 } 417 }
418 if ((datahi & 0xf) ^ inst_parity(instb)) { 418 if ((datahi & 0xf) ^ inst_parity(instb)) {
419 prom_printf(" ** bad parity in instruction b\n"); 419 printk(" ** bad parity in instruction b\n");
420 res |= CP0_CERRI_DATA_PARITY; 420 res |= CP0_CERRI_DATA_PARITY;
421 } 421 }
422 prom_printf(" %05X-%08X%08X", datahi, insta, instb); 422 printk(" %05X-%08X%08X", datahi, insta, instb);
423 } 423 }
424 prom_printf("\n"); 424 printk("\n");
425 } 425 }
426 } 426 }
427 return res; 427 return res;
@@ -489,7 +489,7 @@ static uint32_t extract_dc(unsigned short addr, int data)
489 uint8_t ecc, lru; 489 uint8_t ecc, lru;
490 int res = 0; 490 int res = 0;
491 491
492 prom_printf("Dcache index 0x%04x ", addr); 492 printk("Dcache index 0x%04x ", addr);
493 for (way = 0; way < 4; way++) { 493 for (way = 0; way < 4; way++) {
494 __asm__ __volatile__ ( 494 __asm__ __volatile__ (
495 " .set push\n\t" 495 " .set push\n\t"
@@ -509,7 +509,7 @@ static uint32_t extract_dc(unsigned short addr, int data)
509 pa = (taglo & 0xFFFFFFE000ULL) | addr; 509 pa = (taglo & 0xFFFFFFE000ULL) | addr;
510 if (way == 0) { 510 if (way == 0) {
511 lru = (taghi >> 14) & 0xff; 511 lru = (taghi >> 14) & 0xff;
512 prom_printf("[Bank %d Set 0x%02x] LRU > %d %d %d %d > MRU\n", 512 printk("[Bank %d Set 0x%02x] LRU > %d %d %d %d > MRU\n",
513 ((addr >> 11) & 0x2) | ((addr >> 5) & 1), /* bank */ 513 ((addr >> 11) & 0x2) | ((addr >> 5) & 1), /* bank */
514 ((addr >> 6) & 0x3f), /* index */ 514 ((addr >> 6) & 0x3f), /* index */
515 (lru & 0x3), 515 (lru & 0x3),
@@ -519,15 +519,15 @@ static uint32_t extract_dc(unsigned short addr, int data)
519 } 519 }
520 state = (taghi >> 25) & 0x1f; 520 state = (taghi >> 25) & 0x1f;
521 valid = DC_TAG_VALID(state); 521 valid = DC_TAG_VALID(state);
522 prom_printf(" %d [PA %010llx] [state %s (%02x)] raw tags: %08X-%016llX\n", 522 printk(" %d [PA %010llx] [state %s (%02x)] raw tags: %08X-%016llX\n",
523 way, pa, dc_state_str(state), state, taghi, taglo); 523 way, pa, dc_state_str(state), state, taghi, taglo);
524 if (valid) { 524 if (valid) {
525 if (((taglo >> 11) & 1) ^ range_parity(taglo, 39, 26)) { 525 if (((taglo >> 11) & 1) ^ range_parity(taglo, 39, 26)) {
526 prom_printf(" ** bad parity in PTag1\n"); 526 printk(" ** bad parity in PTag1\n");
527 res |= CP0_CERRD_TAG_ADDRESS; 527 res |= CP0_CERRD_TAG_ADDRESS;
528 } 528 }
529 if (((taglo >> 10) & 1) ^ range_parity(taglo, 25, 13)) { 529 if (((taglo >> 10) & 1) ^ range_parity(taglo, 25, 13)) {
530 prom_printf(" ** bad parity in PTag0\n"); 530 printk(" ** bad parity in PTag0\n");
531 res |= CP0_CERRD_TAG_ADDRESS; 531 res |= CP0_CERRD_TAG_ADDRESS;
532 } 532 }
533 } else { 533 } else {
@@ -567,13 +567,13 @@ static uint32_t extract_dc(unsigned short addr, int data)
567 } 567 }
568 res |= (bits == 1) ? CP0_CERRD_DATA_SBE : CP0_CERRD_DATA_DBE; 568 res |= (bits == 1) ? CP0_CERRD_DATA_SBE : CP0_CERRD_DATA_DBE;
569 } 569 }
570 prom_printf(" %02X-%016llX", datahi, datalo); 570 printk(" %02X-%016llX", datahi, datalo);
571 } 571 }
572 prom_printf("\n"); 572 printk("\n");
573 if (bad_ecc) 573 if (bad_ecc)
574 prom_printf(" dwords w/ bad ECC: %d %d %d %d\n", 574 printk(" dwords w/ bad ECC: %d %d %d %d\n",
575 !!(bad_ecc & 8), !!(bad_ecc & 4), 575 !!(bad_ecc & 8), !!(bad_ecc & 4),
576 !!(bad_ecc & 2), !!(bad_ecc & 1)); 576 !!(bad_ecc & 2), !!(bad_ecc & 1));
577 } 577 }
578 } 578 }
579 return res; 579 return res;
diff --git a/arch/mips/momentum/jaguar_atx/ja-console.c b/arch/mips/momentum/jaguar_atx/ja-console.c
index 2292d0ec47fc..2c30b4f56245 100644
--- a/arch/mips/momentum/jaguar_atx/ja-console.c
+++ b/arch/mips/momentum/jaguar_atx/ja-console.c
@@ -74,11 +74,6 @@ void prom_putchar(char c)
74 uart->iu_thr = c; 74 uart->iu_thr = c;
75} 75}
76 76
77char __init prom_getchar(void)
78{
79 return 0;
80}
81
82static void inline ja_console_probe(void) 77static void inline ja_console_probe(void)
83{ 78{
84 struct uart_port up; 79 struct uart_port up;
diff --git a/arch/mips/philips/pnx8550/common/prom.c b/arch/mips/philips/pnx8550/common/prom.c
index 8aeed6c2b8c3..2f567452e7ac 100644
--- a/arch/mips/philips/pnx8550/common/prom.c
+++ b/arch/mips/philips/pnx8550/common/prom.c
@@ -112,7 +112,7 @@ void __init prom_free_prom_memory(void)
112 112
113extern int pnx8550_console_port; 113extern int pnx8550_console_port;
114 114
115/* used by prom_printf */ 115/* used by early printk */
116void prom_putchar(char c) 116void prom_putchar(char c)
117{ 117{
118 if (pnx8550_console_port != -1) { 118 if (pnx8550_console_port != -1) {
diff --git a/arch/mips/philips/pnx8550/common/setup.c b/arch/mips/philips/pnx8550/common/setup.c
index e62123ca9b64..5bd737477685 100644
--- a/arch/mips/philips/pnx8550/common/setup.c
+++ b/arch/mips/philips/pnx8550/common/setup.c
@@ -41,8 +41,6 @@
41#include <uart.h> 41#include <uart.h>
42#include <nand.h> 42#include <nand.h>
43 43
44extern void prom_printf(char *fmt, ...);
45
46extern void __init board_setup(void); 44extern void __init board_setup(void);
47extern void pnx8550_machine_restart(char *); 45extern void pnx8550_machine_restart(char *);
48extern void pnx8550_machine_halt(void); 46extern void pnx8550_machine_halt(void);
@@ -51,7 +49,6 @@ extern struct resource ioport_resource;
51extern struct resource iomem_resource; 49extern struct resource iomem_resource;
52extern void pnx8550_time_init(void); 50extern void pnx8550_time_init(void);
53extern void rs_kgdb_hook(int tty_no); 51extern void rs_kgdb_hook(int tty_no);
54extern void prom_printf(char *fmt, ...);
55extern char *prom_getcmdline(void); 52extern char *prom_getcmdline(void);
56 53
57struct resource standard_io_resources[] = { 54struct resource standard_io_resources[] = {
@@ -141,7 +138,7 @@ void __init plat_mem_setup(void)
141 argptr += strlen("console=ttyS"); 138 argptr += strlen("console=ttyS");
142 pnx8550_console_port = *argptr == '0' ? 0 : 1; 139 pnx8550_console_port = *argptr == '0' ? 0 : 1;
143 140
144 /* We must initialize the UART (console) before prom_printf */ 141 /* We must initialize the UART (console) before early printk */
145 /* Set LCR to 8-bit and BAUD to 38400 (no 5) */ 142 /* Set LCR to 8-bit and BAUD to 38400 (no 5) */
146 ip3106_lcr(UART_BASE, pnx8550_console_port) = 143 ip3106_lcr(UART_BASE, pnx8550_console_port) =
147 PNX8XXX_UART_LCR_8BIT; 144 PNX8XXX_UART_LCR_8BIT;
@@ -155,8 +152,8 @@ void __init plat_mem_setup(void)
155 argptr += strlen("kgdb=ttyS"); 152 argptr += strlen("kgdb=ttyS");
156 line = *argptr == '0' ? 0 : 1; 153 line = *argptr == '0' ? 0 : 1;
157 rs_kgdb_hook(line); 154 rs_kgdb_hook(line);
158 prom_printf("KGDB: Using ttyS%i for session, " 155 pr_info("KGDB: Using ttyS%i for session, "
159 "please connect your debugger\n", line ? 1 : 0); 156 "please connect your debugger\n", line ? 1 : 0);
160 } 157 }
161#endif 158#endif
162 return; 159 return;
diff --git a/arch/mips/pmc-sierra/yosemite/py-console.c b/arch/mips/pmc-sierra/yosemite/py-console.c
index 757e605693ff..b7f1d9c4a8a3 100644
--- a/arch/mips/pmc-sierra/yosemite/py-console.c
+++ b/arch/mips/pmc-sierra/yosemite/py-console.c
@@ -107,8 +107,3 @@ void prom_putchar(char c)
107 while ((readb_outer_space(lsr) & 0x20) == 0); 107 while ((readb_outer_space(lsr) & 0x20) == 0);
108 writeb_outer_space(thr, c); 108 writeb_outer_space(thr, c);
109} 109}
110
111char __init prom_getchar(void)
112{
113 return 0;
114}
diff --git a/arch/mips/sgi-ip27/ip27-console.c b/arch/mips/sgi-ip27/ip27-console.c
index 14211e382374..3ba830651c58 100644
--- a/arch/mips/sgi-ip27/ip27-console.c
+++ b/arch/mips/sgi-ip27/ip27-console.c
@@ -6,12 +6,6 @@
6 * Copyright (C) 2001, 2002 Ralf Baechle 6 * Copyright (C) 2001, 2002 Ralf Baechle
7 */ 7 */
8#include <linux/init.h> 8#include <linux/init.h>
9#include <linux/console.h>
10#include <linux/kdev_t.h>
11#include <linux/major.h>
12#include <linux/termios.h>
13#include <linux/sched.h>
14#include <linux/tty.h>
15 9
16#include <asm/page.h> 10#include <asm/page.h>
17#include <asm/semaphore.h> 11#include <asm/semaphore.h>
@@ -38,37 +32,10 @@ static inline struct ioc3_uartregs *console_uart(void)
38 return &ioc3->sregs.uarta; 32 return &ioc3->sregs.uarta;
39} 33}
40 34
41void prom_putchar(char c) 35void __init prom_putchar(char c)
42{ 36{
43 struct ioc3_uartregs *uart = console_uart(); 37 struct ioc3_uartregs *uart = console_uart();
44 38
45 while ((uart->iu_lsr & 0x20) == 0); 39 while ((uart->iu_lsr & 0x20) == 0);
46 uart->iu_thr = c; 40 uart->iu_thr = c;
47} 41}
48
49static void ioc3_console_write(struct console *con, const char *s, unsigned n)
50{
51 while (n-- && *s) {
52 if (*s == '\n')
53 prom_putchar('\r');
54 prom_putchar(*s);
55 s++;
56 }
57}
58
59static struct console ioc3_console = {
60 .name = "ioc3",
61 .write = ioc3_console_write,
62 .flags = CON_PRINTBUFFER | CON_BOOT,
63 .index = -1
64};
65
66__init void ip27_setup_console(void)
67{
68 register_console(&ioc3_console);
69}
70
71void __init disable_early_printk(void)
72{
73 unregister_console(&ioc3_console);
74}
diff --git a/arch/mips/sibyte/Kconfig b/arch/mips/sibyte/Kconfig
index ec7a2cffacf0..67dac6204b6d 100644
--- a/arch/mips/sibyte/Kconfig
+++ b/arch/mips/sibyte/Kconfig
@@ -116,6 +116,7 @@ config SB1_CERR_STALL
116config SIBYTE_CFE 116config SIBYTE_CFE
117 bool "Booting from CFE" 117 bool "Booting from CFE"
118 depends on SIBYTE_SB1xxx_SOC 118 depends on SIBYTE_SB1xxx_SOC
119 select SYS_HAS_EARLY_PRINTK
119 help 120 help
120 Make use of the CFE API for enumerating available memory, 121 Make use of the CFE API for enumerating available memory,
121 controlling secondary CPUs, and possibly console output. 122 controlling secondary CPUs, and possibly console output.
@@ -131,6 +132,7 @@ config SIBYTE_CFE_CONSOLE
131config SIBYTE_STANDALONE 132config SIBYTE_STANDALONE
132 bool 133 bool
133 depends on SIBYTE_SB1xxx_SOC && !SIBYTE_CFE 134 depends on SIBYTE_SB1xxx_SOC && !SIBYTE_CFE
135 select SYS_HAS_EARLY_PRINTK
134 default y 136 default y
135 137
136config SIBYTE_STANDALONE_RAM_SIZE 138config SIBYTE_STANDALONE_RAM_SIZE
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c
index 1dc5d05d8962..20af0f1bb7bf 100644
--- a/arch/mips/sibyte/bcm1480/irq.c
+++ b/arch/mips/sibyte/bcm1480/irq.c
@@ -420,7 +420,7 @@ void __init arch_init_irq(void)
420#ifdef CONFIG_GDB_CONSOLE 420#ifdef CONFIG_GDB_CONSOLE
421 register_gdb_console(); 421 register_gdb_console();
422#endif 422#endif
423 prom_printf("Waiting for GDB on UART port %d\n", kgdb_port); 423 printk("Waiting for GDB on UART port %d\n", kgdb_port);
424 set_debug_traps(); 424 set_debug_traps();
425 breakpoint(); 425 breakpoint();
426 } 426 }
diff --git a/arch/mips/sibyte/bcm1480/setup.c b/arch/mips/sibyte/bcm1480/setup.c
index 8236d0c48542..bdaac34ae708 100644
--- a/arch/mips/sibyte/bcm1480/setup.c
+++ b/arch/mips/sibyte/bcm1480/setup.c
@@ -69,7 +69,7 @@ static inline int sys_rev_decode(void)
69 break; 69 break;
70 70
71 default: 71 default:
72 prom_printf("Unknown part type %x\n", part_type); 72 printk("Unknown part type %x\n", part_type);
73 ret = 1; 73 ret = 1;
74 break; 74 break;
75 } 75 }
@@ -102,7 +102,7 @@ static inline int setup_bcm1x80_bcm1x55(void)
102 pass_str = "B0 (pass2)"; 102 pass_str = "B0 (pass2)";
103 break; 103 break;
104 default: 104 default:
105 prom_printf("Unknown %s rev %x\n", soc_str, soc_pass); 105 printk("Unknown %s rev %x\n", soc_str, soc_pass);
106 periph_rev = 1; 106 periph_rev = 1;
107 pass_str = "Unknown Revision"; 107 pass_str = "Unknown Revision";
108 break; 108 break;
@@ -122,14 +122,14 @@ void bcm1480_setup(void)
122 soc_pass = G_SYS_REVISION(sys_rev); 122 soc_pass = G_SYS_REVISION(sys_rev);
123 123
124 if (sys_rev_decode()) { 124 if (sys_rev_decode()) {
125 prom_printf("Restart after failure to identify SiByte chip\n"); 125 printk("Restart after failure to identify SiByte chip\n");
126 machine_restart(NULL); 126 machine_restart(NULL);
127 } 127 }
128 128
129 plldiv = G_BCM1480_SYS_PLL_DIV(__raw_readq(IOADDR(A_SCD_SYSTEM_CFG))); 129 plldiv = G_BCM1480_SYS_PLL_DIV(__raw_readq(IOADDR(A_SCD_SYSTEM_CFG)));
130 zbbus_mhz = ((plldiv >> 1) * 50) + ((plldiv & 1) * 25); 130 zbbus_mhz = ((plldiv >> 1) * 50) + ((plldiv & 1) * 25);
131 131
132 prom_printf("Broadcom SiByte %s %s @ %d MHz (SB-1A rev %d)\n", 132 printk("Broadcom SiByte %s %s @ %d MHz (SB-1A rev %d)\n",
133 soc_str, pass_str, zbbus_mhz * 2, sb1_pass); 133 soc_str, pass_str, zbbus_mhz * 2, sb1_pass);
134 prom_printf("Board type: %s\n", get_system_type()); 134 printk("Board type: %s\n", get_system_type());
135} 135}
diff --git a/arch/mips/sibyte/cfe/setup.c b/arch/mips/sibyte/cfe/setup.c
index 9e6099e69622..ae4a92c3e529 100644
--- a/arch/mips/sibyte/cfe/setup.c
+++ b/arch/mips/sibyte/cfe/setup.c
@@ -221,10 +221,10 @@ static int __init initrd_setup(char *str)
221 goto fail; 221 goto fail;
222 } 222 }
223 initrd_end = initrd_start + initrd_size; 223 initrd_end = initrd_start + initrd_size;
224 prom_printf("Found initrd of %lx@%lx\n", initrd_size, initrd_start); 224 printk("Found initrd of %lx@%lx\n", initrd_size, initrd_start);
225 return 1; 225 return 1;
226 fail: 226 fail:
227 prom_printf("Bad initrd argument. Disabling initrd\n"); 227 printk("Bad initrd argument. Disabling initrd\n");
228 initrd_start = 0; 228 initrd_start = 0;
229 initrd_end = 0; 229 initrd_end = 0;
230 return 1; 230 return 1;
@@ -281,7 +281,7 @@ void __init prom_init(void)
281 } 281 }
282 if (cfe_eptseal != CFE_EPTSEAL) { 282 if (cfe_eptseal != CFE_EPTSEAL) {
283 /* too early for panic to do any good */ 283 /* too early for panic to do any good */
284 prom_printf("CFE's entrypoint seal doesn't match. Spinning."); 284 printk("CFE's entrypoint seal doesn't match. Spinning.");
285 while (1) ; 285 while (1) ;
286 } 286 }
287 cfe_init(cfe_handle, cfe_ept); 287 cfe_init(cfe_handle, cfe_ept);
@@ -303,7 +303,7 @@ void __init prom_init(void)
303 } else { 303 } else {
304 /* The loader should have set the command line */ 304 /* The loader should have set the command line */
305 /* too early for panic to do any good */ 305 /* too early for panic to do any good */
306 prom_printf("LINUX_CMDLINE not defined in cfe."); 306 printk("LINUX_CMDLINE not defined in cfe.");
307 while (1) ; 307 while (1) ;
308 } 308 }
309 } 309 }
diff --git a/arch/mips/sibyte/sb1250/setup.c b/arch/mips/sibyte/sb1250/setup.c
index d0ee1d5b8223..1cb042eab720 100644
--- a/arch/mips/sibyte/sb1250/setup.c
+++ b/arch/mips/sibyte/sb1250/setup.c
@@ -67,7 +67,7 @@ static int __init sys_rev_decode(void)
67 ret = setup_bcm112x(); 67 ret = setup_bcm112x();
68 break; 68 break;
69 default: 69 default:
70 prom_printf("Unknown SOC type %x\n", soc_type); 70 printk("Unknown SOC type %x\n", soc_type);
71 ret = 1; 71 ret = 1;
72 break; 72 break;
73 } 73 }
@@ -112,7 +112,7 @@ static int __init setup_bcm1250(void)
112 pass_str = "A0-A6"; 112 pass_str = "A0-A6";
113 war_pass = K_SYS_REVISION_BCM1250_PASS2; 113 war_pass = K_SYS_REVISION_BCM1250_PASS2;
114 } else { 114 } else {
115 prom_printf("Unknown BCM1250 rev %x\n", soc_pass); 115 printk("Unknown BCM1250 rev %x\n", soc_pass);
116 ret = 1; 116 ret = 1;
117 } 117 }
118 break; 118 break;
@@ -140,7 +140,7 @@ static int __init setup_bcm112x(void)
140 pass_str = "A2"; 140 pass_str = "A2";
141 break; 141 break;
142 default: 142 default:
143 prom_printf("Unknown %s rev %x\n", soc_str, soc_pass); 143 printk("Unknown %s rev %x\n", soc_str, soc_pass);
144 ret = 1; 144 ret = 1;
145 } 145 }
146 return ret; 146 return ret;
@@ -158,21 +158,21 @@ void __init sb1250_setup(void)
158 soc_pass = G_SYS_REVISION(sys_rev); 158 soc_pass = G_SYS_REVISION(sys_rev);
159 159
160 if (sys_rev_decode()) { 160 if (sys_rev_decode()) {
161 prom_printf("Restart after failure to identify SiByte chip\n"); 161 printk("Restart after failure to identify SiByte chip\n");
162 machine_restart(NULL); 162 machine_restart(NULL);
163 } 163 }
164 164
165 plldiv = G_SYS_PLL_DIV(__raw_readq(IOADDR(A_SCD_SYSTEM_CFG))); 165 plldiv = G_SYS_PLL_DIV(__raw_readq(IOADDR(A_SCD_SYSTEM_CFG)));
166 zbbus_mhz = ((plldiv >> 1) * 50) + ((plldiv & 1) * 25); 166 zbbus_mhz = ((plldiv >> 1) * 50) + ((plldiv & 1) * 25);
167 167
168 prom_printf("Broadcom SiByte %s %s @ %d MHz (SB1 rev %d)\n", 168 printk("Broadcom SiByte %s %s @ %d MHz (SB1 rev %d)\n",
169 soc_str, pass_str, zbbus_mhz * 2, sb1_pass); 169 soc_str, pass_str, zbbus_mhz * 2, sb1_pass);
170 prom_printf("Board type: %s\n", get_system_type()); 170 printk("Board type: %s\n", get_system_type());
171 171
172 switch (war_pass) { 172 switch (war_pass) {
173 case K_SYS_REVISION_BCM1250_PASS1: 173 case K_SYS_REVISION_BCM1250_PASS1:
174#ifndef CONFIG_SB1_PASS_1_WORKAROUNDS 174#ifndef CONFIG_SB1_PASS_1_WORKAROUNDS
175 prom_printf("@@@@ This is a BCM1250 A0-A2 (Pass 1) board, " 175 printk("@@@@ This is a BCM1250 A0-A2 (Pass 1) board, "
176 "and the kernel doesn't have the proper " 176 "and the kernel doesn't have the proper "
177 "workarounds compiled in. @@@@\n"); 177 "workarounds compiled in. @@@@\n");
178 bad_config = 1; 178 bad_config = 1;
@@ -182,27 +182,27 @@ void __init sb1250_setup(void)
182 /* Pass 2 - easiest as default for now - so many numbers */ 182 /* Pass 2 - easiest as default for now - so many numbers */
183#if !defined(CONFIG_SB1_PASS_2_WORKAROUNDS) || \ 183#if !defined(CONFIG_SB1_PASS_2_WORKAROUNDS) || \
184 !defined(CONFIG_SB1_PASS_2_1_WORKAROUNDS) 184 !defined(CONFIG_SB1_PASS_2_1_WORKAROUNDS)
185 prom_printf("@@@@ This is a BCM1250 A3-A10 board, and the " 185 printk("@@@@ This is a BCM1250 A3-A10 board, and the "
186 "kernel doesn't have the proper workarounds " 186 "kernel doesn't have the proper workarounds "
187 "compiled in. @@@@\n"); 187 "compiled in. @@@@\n");
188 bad_config = 1; 188 bad_config = 1;
189#endif 189#endif
190#ifdef CONFIG_CPU_HAS_PREFETCH 190#ifdef CONFIG_CPU_HAS_PREFETCH
191 prom_printf("@@@@ Prefetches may be enabled in this kernel, " 191 printk("@@@@ Prefetches may be enabled in this kernel, "
192 "but are buggy on this board. @@@@\n"); 192 "but are buggy on this board. @@@@\n");
193 bad_config = 1; 193 bad_config = 1;
194#endif 194#endif
195 break; 195 break;
196 case K_SYS_REVISION_BCM1250_PASS2_2: 196 case K_SYS_REVISION_BCM1250_PASS2_2:
197#ifndef CONFIG_SB1_PASS_2_WORKAROUNDS 197#ifndef CONFIG_SB1_PASS_2_WORKAROUNDS
198 prom_printf("@@@@ This is a BCM1250 B1/B2. board, and the " 198 printk("@@@@ This is a BCM1250 B1/B2. board, and the "
199 "kernel doesn't have the proper workarounds " 199 "kernel doesn't have the proper workarounds "
200 "compiled in. @@@@\n"); 200 "compiled in. @@@@\n");
201 bad_config = 1; 201 bad_config = 1;
202#endif 202#endif
203#if defined(CONFIG_SB1_PASS_2_1_WORKAROUNDS) || \ 203#if defined(CONFIG_SB1_PASS_2_1_WORKAROUNDS) || \
204 !defined(CONFIG_CPU_HAS_PREFETCH) 204 !defined(CONFIG_CPU_HAS_PREFETCH)
205 prom_printf("@@@@ This is a BCM1250 B1/B2, but the kernel is " 205 printk("@@@@ This is a BCM1250 B1/B2, but the kernel is "
206 "conservatively configured for an 'A' stepping. " 206 "conservatively configured for an 'A' stepping. "
207 "@@@@\n"); 207 "@@@@\n");
208#endif 208#endif
@@ -211,7 +211,7 @@ void __init sb1250_setup(void)
211 break; 211 break;
212 } 212 }
213 if (bad_config) { 213 if (bad_config) {
214 prom_printf("Invalid configuration for this chip.\n"); 214 printk("Invalid configuration for this chip.\n");
215 machine_restart(NULL); 215 machine_restart(NULL);
216 } 216 }
217} 217}
diff --git a/arch/mips/sni/sniprom.c b/arch/mips/sni/sniprom.c
index 6a44bbf0b732..643366eb854a 100644
--- a/arch/mips/sni/sniprom.c
+++ b/arch/mips/sni/sniprom.c
@@ -9,6 +9,8 @@
9 * Copyright (C) 2005-2006 Thomas Bogendoerfer (tsbogend@alpha.franken.de) 9 * Copyright (C) 2005-2006 Thomas Bogendoerfer (tsbogend@alpha.franken.de)
10 */ 10 */
11 11
12#define DEBUG
13
12#include <linux/kernel.h> 14#include <linux/kernel.h>
13#include <linux/init.h> 15#include <linux/init.h>
14#include <linux/string.h> 16#include <linux/string.h>
@@ -32,14 +34,13 @@
32#define PROM_ENTRY(x) (PROM_VEC + (x)) 34#define PROM_ENTRY(x) (PROM_VEC + (x))
33 35
34 36
35#define DEBUG
36#ifdef DEBUG
37#define DBG_PRINTF(x...) prom_printf(x)
38#else
39#define DBG_PRINTF(x...)
40#endif
41
42static int *(*__prom_putchar)(int) = (int *(*)(int))PROM_ENTRY(PROM_PUTCHAR); 37static int *(*__prom_putchar)(int) = (int *(*)(int))PROM_ENTRY(PROM_PUTCHAR);
38
39void prom_putchar(char c)
40{
41 __prom_putchar(c);
42}
43
43static char *(*__prom_getenv)(char *) = (char *(*)(char *))PROM_ENTRY(PROM_GETENV); 44static char *(*__prom_getenv)(char *) = (char *(*)(char *))PROM_ENTRY(PROM_GETENV);
44static void (*__prom_get_memconf)(void *) = (void (*)(void *))PROM_ENTRY(PROM_GET_MEMCONF); 45static void (*__prom_get_memconf)(void *) = (void (*)(void *))PROM_ENTRY(PROM_GET_MEMCONF);
45 46
@@ -48,26 +49,6 @@ char *prom_getenv (char *s)
48 return __prom_getenv(s); 49 return __prom_getenv(s);
49} 50}
50 51
51void prom_printf(char *fmt, ...)
52{
53 va_list args;
54 char ppbuf[1024];
55 char *bptr;
56
57 va_start(args, fmt);
58 vsprintf(ppbuf, fmt, args);
59
60 bptr = ppbuf;
61
62 while (*bptr != 0) {
63 if (*bptr == '\n')
64 __prom_putchar('\r');
65
66 __prom_putchar(*bptr++);
67 }
68 va_end(args);
69}
70
71void __init prom_free_prom_memory(void) 52void __init prom_free_prom_memory(void)
72{ 53{
73} 54}
@@ -94,15 +75,15 @@ static void sni_idprom_dump(void)
94{ 75{
95 int i; 76 int i;
96 77
97 prom_printf("SNI IDProm dump:\n"); 78 pr_debug("SNI IDProm dump:\n");
98 for (i = 0; i < 256; i++) { 79 for (i = 0; i < 256; i++) {
99 if (i%16 == 0) 80 if (i%16 == 0)
100 prom_printf("%04x ", i); 81 pr_debug("%04x ", i);
101 82
102 prom_printf("%02x ", *(unsigned char *) (SNI_IDPROM_BASE + i)); 83 printk("%02x ", *(unsigned char *) (SNI_IDPROM_BASE + i));
103 84
104 if (i % 16 == 15) 85 if (i % 16 == 15)
105 prom_printf("\n"); 86 printk("\n");
106 } 87 }
107} 88}
108#endif 89#endif
@@ -121,12 +102,12 @@ static void sni_mem_init(void )
121 /* MemSIZE from prom in 16MByte chunks */ 102 /* MemSIZE from prom in 16MByte chunks */
122 memsize = *((unsigned char *) SNI_IDPROM_MEMSIZE) * 16; 103 memsize = *((unsigned char *) SNI_IDPROM_MEMSIZE) * 16;
123 104
124 DBG_PRINTF("IDProm memsize: %lu MByte\n", memsize); 105 pr_debug("IDProm memsize: %lu MByte\n", memsize);
125 106
126 /* get memory bank layout from prom */ 107 /* get memory bank layout from prom */
127 __prom_get_memconf(&memconf); 108 __prom_get_memconf(&memconf);
128 109
129 DBG_PRINTF("prom_get_mem_conf memory configuration:\n"); 110 pr_debug("prom_get_mem_conf memory configuration:\n");
130 for (i = 0;i < 8 && memconf[i].size; i++) { 111 for (i = 0;i < 8 && memconf[i].size; i++) {
131 if (sni_brd_type == SNI_BRD_PCI_TOWER || 112 if (sni_brd_type == SNI_BRD_PCI_TOWER ||
132 sni_brd_type == SNI_BRD_PCI_TOWER_CPLUS) { 113 sni_brd_type == SNI_BRD_PCI_TOWER_CPLUS) {
@@ -135,7 +116,7 @@ static void sni_mem_init(void )
135 memconf[i].base -= 0x20000000; 116 memconf[i].base -= 0x20000000;
136 } 117 }
137 } 118 }
138 DBG_PRINTF("Bank%d: %08x @ %08x\n", i, 119 pr_debug("Bank%d: %08x @ %08x\n", i,
139 memconf[i].size, memconf[i].base); 120 memconf[i].size, memconf[i].base);
140 add_memory_region(memconf[i].base, memconf[i].size, BOOT_MEM_RAM); 121 add_memory_region(memconf[i].base, memconf[i].size, BOOT_MEM_RAM);
141 } 122 }
@@ -248,7 +229,7 @@ void __init prom_init(void)
248 systype = "RM300-Exx"; 229 systype = "RM300-Exx";
249 break; 230 break;
250 } 231 }
251 DBG_PRINTF("Found SNI brdtype %02x name %s\n", sni_brd_type,systype); 232 pr_debug("Found SNI brdtype %02x name %s\n", sni_brd_type,systype);
252 233
253#ifdef DEBUG 234#ifdef DEBUG
254 sni_idprom_dump(); 235 sni_idprom_dump();