[MIPS] Fix and cleanup the mess that a dozen prom_printf variants are.

early_printk is a so much saner thing.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

+255 -428
+28 -3
arch/mips/Kconfig
··· 176 176 bool "DECstations" 177 177 select BOOT_ELF32 178 178 select DMA_NONCOHERENT 179 - select EARLY_PRINTK 179 + select SYS_HAS_EARLY_PRINTK 180 180 select IRQ_CPU 181 181 select SYS_HAS_CPU_R3000 182 182 select SYS_HAS_CPU_R4X00 ··· 242 242 config LASAT 243 243 bool "LASAT Networks platforms" 244 244 select DMA_NONCOHERENT 245 + select SYS_HAS_EARLY_PRINTK 245 246 select HW_HAS_PCI 246 247 select MIPS_GT64120 247 248 select MIPS_NILE4 ··· 257 256 bool "MIPS Atlas board" 258 257 select BOOT_ELF32 259 258 select DMA_NONCOHERENT 259 + select SYS_HAS_EARLY_PRINTK 260 260 select IRQ_CPU 261 261 select HW_HAS_PCI 262 262 select MIPS_BOARDS_GEN ··· 303 301 select SYS_HAS_CPU_MIPS64_R1 304 302 select SYS_HAS_CPU_NEVADA 305 303 select SYS_HAS_CPU_RM7000 304 + select SYS_HAS_EARLY_PRINTK 306 305 select SYS_SUPPORTS_32BIT_KERNEL 307 306 select SYS_SUPPORTS_64BIT_KERNEL 308 307 select SYS_SUPPORTS_BIG_ENDIAN ··· 319 316 depends on EXPERIMENTAL 320 317 select IRQ_CPU 321 318 select DMA_NONCOHERENT 319 + select SYS_HAS_EARLY_PRINTK 322 320 select MIPS_BOARDS_GEN 323 321 select SYS_HAS_CPU_MIPS32_R1 324 322 select SYS_HAS_CPU_MIPS32_R2 ··· 357 353 config MIPS_SIM 358 354 bool 'MIPS simulator (MIPSsim)' 359 355 select DMA_NONCOHERENT 356 + select SYS_HAS_EARLY_PRINTK 360 357 select IRQ_CPU 361 358 select SYS_HAS_CPU_MIPS32_R1 362 359 select SYS_HAS_CPU_MIPS32_R2 360 + select SYS_HAS_EARLY_PRINTK 363 361 select SYS_SUPPORTS_32BIT_KERNEL 364 362 select SYS_SUPPORTS_BIG_ENDIAN 365 363 select SYS_SUPPORTS_LITTLE_ENDIAN ··· 382 376 select RM7000_CPU_SCACHE 383 377 select SWAP_IO_SPACE 384 378 select SYS_HAS_CPU_RM9000 379 + select SYS_HAS_EARLY_PRINTK 385 380 select SYS_SUPPORTS_32BIT_KERNEL 386 381 select SYS_SUPPORTS_64BIT_KERNEL 387 382 select SYS_SUPPORTS_BIG_ENDIAN ··· 520 513 select IRQ_CPU_RM9K 521 514 select SWAP_IO_SPACE 522 515 select SYS_HAS_CPU_RM9000 516 + select SYS_HAS_EARLY_PRINTK 523 517 select SYS_SUPPORTS_32BIT_KERNEL 524 518 select SYS_SUPPORTS_64BIT_KERNEL 525 519 select SYS_SUPPORTS_BIG_ENDIAN ··· 581 573 select SWAP_IO_SPACE 582 574 select SYS_HAS_CPU_R4X00 583 575 select SYS_HAS_CPU_R5000 576 + select SYS_HAS_EARLY_PRINTK 584 577 select SYS_SUPPORTS_32BIT_KERNEL 585 578 select SYS_SUPPORTS_64BIT_KERNEL 586 579 select SYS_SUPPORTS_BIG_ENDIAN ··· 596 587 select ARC64 597 588 select BOOT_ELF64 598 589 select DMA_IP27 599 - select EARLY_PRINTK 590 + select SYS_HAS_EARLY_PRINTK 600 591 select HW_HAS_PCI 601 592 select NR_CPUS_DEFAULT_64 602 593 select PCI_DOMAINS ··· 758 749 select SYS_HAS_CPU_R5000 759 750 select SYS_HAS_CPU_R10000 760 751 select R5000_CPU_SCACHE 752 + select SYS_HAS_EARLY_PRINTK 761 753 select SYS_SUPPORTS_32BIT_KERNEL 762 754 select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL 763 755 select SYS_SUPPORTS_BIG_ENDIAN ··· 907 897 bool 908 898 909 899 config EARLY_PRINTK 900 + bool "Early printk" if EMBEDDED && DEBUG_KERNEL 901 + depends on SYS_HAS_EARLY_PRINTK 902 + default y 903 + help 904 + This option enables special console drivers which allow the kernel 905 + to print messages very early in the bootup process. 906 + 907 + This is useful for kernel debugging when your machine crashes very 908 + early before the console code is initialized. For normal operation 909 + it is not recommended because it looks on some machines ugly and 910 + oesn't cooperate with an X server. You should normally N here, 911 + unless you want to debug such a crash. 912 + 913 + config SYS_HAS_EARLY_PRINTK 910 914 bool 911 915 912 916 config GENERIC_ISA_DMA ··· 1057 1033 select DMA_NONCOHERENT 1058 1034 select HW_HAS_PCI 1059 1035 select SYS_HAS_CPU_MIPS32_R1 1036 + select SYS_HAS_EARLY_PRINTK 1060 1037 select SYS_SUPPORTS_32BIT_KERNEL 1061 1038 select GENERIC_HARDIRQS_NO__DO_IRQ 1062 1039 select SYS_SUPPORTS_KGDB ··· 1118 1093 1119 1094 config ARC_CONSOLE 1120 1095 bool "ARC console support" 1121 - depends on SGI_IP22 || SNI_RM 1096 + depends on SGI_IP22 || (SNI_RM && CPU_LITTLE_ENDIAN) 1122 1097 1123 1098 config ARC_MEMORY 1124 1099 bool
-32
arch/mips/arc/console.c
··· 29 29 ArcWrite(1, &it, 1, &cnt); 30 30 bc_enable(); 31 31 } 32 - 33 - char 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 - 45 - void 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 - }
+6 -3
arch/mips/arc/init.c
··· 24 24 { 25 25 PSYSTEM_PARAMETER_BLOCK pb = PROMBLOCK; 26 26 romvec = ROMVECTOR; 27 + ULONG cnt; 28 + CHAR c; 29 + 27 30 prom_argc = fw_arg0; 28 31 _prom_argv = (LONG *) fw_arg1; 29 32 _prom_envp = (LONG *) fw_arg2; 30 33 31 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 36 while(1) 34 37 ; 35 38 } ··· 44 41 prom_meminit(); 45 42 46 43 #ifdef DEBUG_PROM_INIT 47 - prom_printf("Press a key to reboot\n"); 48 - prom_getchar(); 44 + pr_info("Press a key to reboot\n"); 45 + ArcRead(0, &c, 1, &cnt); 49 46 ArcEnterInteractiveMode(); 50 47 #endif 51 48 }
+3 -3
arch/mips/arc/memory.c
··· 118 118 #ifdef DEBUG 119 119 int i = 0; 120 120 121 - prom_printf("ARCS MEMORY DESCRIPTOR dump:\n"); 121 + printk("ARCS MEMORY DESCRIPTOR dump:\n"); 122 122 p = ArcGetMemoryDescriptor(PROM_NULL_MDESC); 123 123 while(p) { 124 - prom_printf("[%d,%p]: base<%08lx> pages<%08lx> type<%s>\n", 125 - i, p, p->base, p->pages, mtypes(p->type)); 124 + printk("[%d,%p]: base<%08lx> pages<%08lx> type<%s>\n", 125 + i, p, p->base, p->pages, mtypes(p->type)); 126 126 p = ArcGetMemoryDescriptor(p); 127 127 i++; 128 128 }
+5 -5
arch/mips/arc/tree.c
··· 93 93 static void __init 94 94 dump_component(pcomponent *p) 95 95 { 96 - prom_printf("[%p]:class<%s>type<%s>flags<%s>ver<%d>rev<%d>", 97 - p, classes[p->class], types[p->type], 98 - iflags[p->iflags], p->vers, p->rev); 99 - prom_printf("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); 96 + printk("[%p]:class<%s>type<%s>flags<%s>ver<%d>rev<%d>", 97 + p, classes[p->class], types[p->type], 98 + iflags[p->iflags], p->vers, p->rev); 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); 101 101 } 102 102 103 103 static void __init
-26
arch/mips/cobalt/console.c
··· 19 19 20 20 COBALT_UART[UART_TX] = c; 21 21 } 22 - 23 - static void cons_write(struct console *c, const char *s, unsigned n) 24 - { 25 - while(n-- && *s) 26 - putchar(*s++); 27 - } 28 - 29 - static struct console cons_info = 30 - { 31 - .name = "uart", 32 - .write = cons_write, 33 - .flags = CON_PRINTBUFFER | CON_BOOT, 34 - .index = -1, 35 - }; 36 - 37 - void __init cobalt_early_console(void) 38 - { 39 - register_console(&cons_info); 40 - 41 - printk("Cobalt: early console registered\n"); 42 - } 43 - 44 - void __init disable_early_printk(void) 45 - { 46 - unregister_console(&cons_info); 47 - }
-4
arch/mips/cobalt/setup.c
··· 150 150 #endif 151 151 152 152 if (cobalt_board_id > COBALT_BRD_ID_RAQ1) { 153 - #ifdef CONFIG_EARLY_PRINTK 154 - cobalt_early_console(); 155 - #endif 156 - 157 153 #ifdef CONFIG_SERIAL_8250 158 154 uart.line = 0; 159 155 uart.type = PORT_UNKNOWN;
+6 -34
arch/mips/dec/prom/console.c
··· 16 16 17 17 #include <asm/dec/prom.h> 18 18 19 - static void __init prom_console_write(struct console *con, const char *s, 20 - unsigned int c) 19 + void prom_putchar(char c) 21 20 { 22 - static char sfmt[] __initdata = "%%%us"; 23 - char fmt[13]; 21 + char s[2]; 24 22 25 - snprintf(fmt, sizeof(fmt), sfmt, c); 26 - prom_printf(fmt, s); 23 + s[0] = c; 24 + s[1] = '\0'; 25 + 26 + prom_printf( s); 27 27 } 28 - 29 - static struct console promcons __initdata = { 30 - .name = "prom", 31 - .write = prom_console_write, 32 - .flags = CON_PRINTBUFFER, 33 - .index = -1, 34 - }; 35 - 36 - static int promcons_output __initdata = 0; 37 - 38 - void __init register_prom_console(void) 39 - { 40 - if (!promcons_output) { 41 - promcons_output = 1; 42 - register_console(&promcons); 43 - } 44 - } 45 - 46 - void __init unregister_prom_console(void) 47 - { 48 - if (promcons_output) { 49 - unregister_console(&promcons); 50 - promcons_output = 0; 51 - } 52 - } 53 - 54 - void disable_early_printk(void) 55 - __attribute__((alias("unregister_prom_console")));
-5
arch/mips/gt64120/ev64120/promcon.c
··· 24 24 } 25 25 } 26 26 27 - int prom_getchar(void) 28 - { 29 - return 0; 30 - } 31 - 32 27 static struct console sercons = { 33 28 .name = "ttyS", 34 29 .write = prom_console_write,
+1
arch/mips/kernel/Makefile
··· 65 65 obj-$(CONFIG_I8253) += i8253.o 66 66 67 67 obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o 68 + obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 68 69 69 70 CFLAGS_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)
+40
arch/mips/kernel/early_printk.c
··· 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 + 13 + extern void prom_putchar(char); 14 + 15 + static 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 + 25 + static struct console early_console = { 26 + .name = "early", 27 + .write = early_console_write, 28 + .flags = CON_PRINTBUFFER | CON_BOOT, 29 + .index = -1 30 + }; 31 + 32 + void __init setup_early_printk(void) 33 + { 34 + register_console(&early_console); 35 + } 36 + 37 + void __init disable_early_printk(void) 38 + { 39 + unregister_console(&early_console); 40 + }
+8
arch/mips/kernel/setup.c
··· 525 525 { 526 526 cpu_probe(); 527 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 536 cpu_report(); 529 537 530 538 #if defined(CONFIG_VT)
+8 -5
arch/mips/lasat/lasat_board.c
··· 110 110 sizeof(struct lasat_eeprom_struct) - 4); 111 111 112 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 - { 118 - prom_printf("WARNING...\nWARNING...\nEEPROM version %d, wanted version %d, attempting to soldier on...\n", 117 + if (lasat_board_info.li_eeprom_info.version != LASAT_EEPROM_VERSION) { 118 + printk(KERN_WARNING "WARNING...\nWARNING...\nEEPROM version " 119 + "%d, wanted version %d, attempting to soldier on...\n", 119 120 (unsigned int)lasat_board_info.li_eeprom_info.version, 120 121 LASAT_EEPROM_VERSION); 121 122 } ··· 125 124 cfg1 = lasat_board_info.li_eeprom_info.cfg[1]; 126 125 127 126 if ( LASAT_W0_DSCTYPE(cfg0) != 1) { 128 - prom_printf("WARNING...\nWARNING...\nInvalid configuration read from EEPROM, attempting to soldier on..."); 127 + printk(KERN_WARNING "WARNING...\nWARNING...\n" 128 + "Invalid configuration read from EEPROM, attempting to " 129 + "soldier on..."); 129 130 } 130 131 /* We have a valid configuration */ 131 132
+11 -36
arch/mips/lasat/prom.c
··· 23 23 #define PROM_PUTC_ADDR PROM_JUMP_TABLE_ENTRY(1) 24 24 #define PROM_MONITOR_ADDR PROM_JUMP_TABLE_ENTRY(2) 25 25 26 - static void null_prom_printf(const char * fmt, ...) 27 - { 28 - } 29 - 30 26 static void null_prom_display(const char *string, int pos, int clear) 31 27 { 32 28 } ··· 36 40 } 37 41 38 42 /* these are functions provided by the bootloader */ 39 - static void (* prom_putc)(char c) = null_prom_putc; 40 - void (* prom_printf)(const char * fmt, ...) = null_prom_printf; 43 + static void (* __prom_putc)(char c) = null_prom_putc; 44 + 45 + void prom_putchar(char c) 46 + { 47 + __prom_putc(c); 48 + } 49 + 41 50 void (* prom_display)(const char *string, int pos, int clear) = 42 51 null_prom_display; 43 52 void (* prom_monitor)(void) = null_prom_monitor; 44 53 45 54 unsigned int lasat_ndelay_divider; 46 - 47 - #define PROM_PRINTFBUF_SIZE 256 48 - static char prom_printfbuf[PROM_PRINTFBUF_SIZE]; 49 - 50 - static void real_prom_printf(const char * fmt, ...) 51 - { 52 - va_list ap; 53 - int len; 54 - char *c = prom_printfbuf; 55 - int i; 56 - 57 - va_start(ap, fmt); 58 - len = vsnprintf(prom_printfbuf, PROM_PRINTFBUF_SIZE, fmt, ap); 59 - va_end(ap); 60 - 61 - /* output overflowed the buffer */ 62 - if (len < 0 || len > PROM_PRINTFBUF_SIZE) 63 - len = PROM_PRINTFBUF_SIZE; 64 - 65 - for (i=0; i < len; i++) { 66 - if (*c == '\n') 67 - prom_putc('\r'); 68 - prom_putc(*c++); 69 - } 70 - } 71 55 72 56 static void setup_prom_vectors(void) 73 57 { ··· 55 79 56 80 if (version >= 307) { 57 81 prom_display = (void *)PROM_DISPLAY_ADDR; 58 - prom_putc = (void *)PROM_PUTC_ADDR; 59 - prom_printf = real_prom_printf; 82 + __prom_putc = (void *)PROM_PUTC_ADDR; 60 83 prom_monitor = (void *)PROM_MONITOR_ADDR; 61 84 } 62 - prom_printf("prom vectors set up\n"); 85 + printk("prom vectors set up\n"); 63 86 } 64 87 65 88 static struct at93c_defs at93c_defs[N_MACHTYPES] = { ··· 76 101 setup_prom_vectors(); 77 102 78 103 if (current_cpu_data.cputype == CPU_R5000) { 79 - prom_printf("LASAT 200 board\n"); 104 + printk("LASAT 200 board\n"); 80 105 mips_machtype = MACH_LASAT_200; 81 106 lasat_ndelay_divider = LASAT_200_DIVIDER; 82 107 } else { 83 - prom_printf("LASAT 100 board\n"); 108 + printk("LASAT 100 board\n"); 84 109 mips_machtype = MACH_LASAT_100; 85 110 lasat_ndelay_divider = LASAT_100_DIVIDER; 86 111 }
-1
arch/mips/lasat/prom.h
··· 2 2 #define PROM_H 3 3 extern void (* prom_display)(const char *string, int pos, int clear); 4 4 extern void (* prom_monitor)(void); 5 - extern void (* prom_printf)(const char * fmt, ...); 6 5 #endif
+1 -1
arch/mips/lasat/setup.c
··· 178 178 /* Switch from prom exception handler to normal mode */ 179 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 }
+2 -2
arch/mips/lib/Makefile
··· 2 2 # Makefile for MIPS-specific library files.. 3 3 # 4 4 5 - lib-y += csum_partial.o memcpy.o memcpy-inatomic.o memset.o promlib.o \ 6 - strlen_user.o strncpy_user.o strnlen_user.o uncached.o 5 + lib-y += csum_partial.o memcpy.o memcpy-inatomic.o memset.o strlen_user.o \ 6 + strncpy_user.o strnlen_user.o uncached.o 7 7 8 8 obj-y += iomap.o 9 9 obj-$(CONFIG_PCI) += iomap-pci.o
-24
arch/mips/lib/promlib.c
··· 1 - #include <stdarg.h> 2 - #include <linux/kernel.h> 3 - 4 - extern void prom_putchar(char); 5 - 6 - void 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 - }
+3 -1
arch/mips/mips-boards/generic/Makefile
··· 18 18 # Makefile for the MIPS boards generic routines under Linux. 19 19 # 20 20 21 - obj-y := reset.o display.o init.o memory.o printf.o \ 21 + obj-y := reset.o display.o init.o memory.o \ 22 22 cmdline.o time.o 23 + 24 + obj-$(CONFIG_EARLY_PRINTK) += console.o 23 25 obj-$(CONFIG_PCI) += pci.o 24 26 obj-$(CONFIG_KGDB) += gdb_hook.o
+5 -4
arch/mips/mips-boards/generic/init.c
··· 167 167 flow = 'r'; 168 168 sprintf (console_string, " console=ttyS0,%d%c%c%c", baud, parity, bits, flow); 169 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 173 #endif ··· 210 210 generic_getDebugChar = rs_getDebugChar; 211 211 } 212 212 213 - prom_printf("KGDB: Using serial line /dev/ttyS%d at %d for session, " 214 - "please connect your debugger\n", line ? 1 : 0, speed); 213 + pr_info("KGDB: Using serial line /dev/ttyS%d at %d for " 214 + "session, please connect your debugger\n", 215 + line ? 1 : 0, speed); 215 216 216 217 { 217 218 char *s; ··· 383 382 board_nmi_handler_setup = mips_nmi_setup; 384 383 board_ejtag_handler_setup = mips_ejtag_setup; 385 384 386 - prom_printf("\nLINUX started...\n"); 385 + pr_info("\nLINUX started...\n"); 387 386 prom_init_cmdline(); 388 387 prom_meminit(); 389 388 #ifdef CONFIG_SERIAL_8250_CONSOLE
+6 -5
arch/mips/mips-boards/generic/memory.c
··· 59 59 /* otherwise look in the environment */ 60 60 memsize_str = prom_getenv("memsize"); 61 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 64 physical_memsize = 0x02000000; 64 65 } else { 65 66 #ifdef DEBUG 66 - prom_printf("prom_memsize = %s\n", memsize_str); 67 + pr_debug("prom_memsize = %s\n", memsize_str); 67 68 #endif 68 69 physical_memsize = simple_strtol(memsize_str, NULL, 0); 69 70 } ··· 142 141 struct prom_pmemblock *p; 143 142 144 143 #ifdef DEBUG 145 - prom_printf("YAMON MEMORY DESCRIPTOR dump:\n"); 144 + pr_debug("YAMON MEMORY DESCRIPTOR dump:\n"); 146 145 p = prom_getmdesc(); 147 146 while (p->size) { 148 147 int i = 0; 149 - prom_printf("[%d,%p]: base<%08lx> size<%08lx> type<%s>\n", 150 - i, p, p->base, p->size, mtypes[p->type]); 148 + pr_debug("[%d,%p]: base<%08lx> size<%08lx> type<%s>\n", 149 + i, p, p->base, p->size, mtypes[p->type]); 151 150 p++; 152 151 i++; 153 152 }
+1 -11
arch/mips/mips-boards/generic/printf.c arch/mips/mips-boards/generic/console.c
··· 17 17 * 18 18 * Putting things on the screen/serial line using YAMONs facilities. 19 19 */ 20 + #include <linux/console.h> 20 21 #include <linux/init.h> 21 - #include <linux/kernel.h> 22 22 #include <linux/serial_reg.h> 23 - #include <linux/spinlock.h> 24 23 #include <asm/io.h> 25 24 26 25 #ifdef CONFIG_MIPS_ATLAS ··· 66 67 67 68 return 1; 68 69 } 69 - 70 - char prom_getchar(void) 71 - { 72 - while (!(serial_in(UART_LSR) & UART_LSR_DR)) 73 - ; 74 - 75 - return serial_in(UART_RX); 76 - } 77 -
+5 -1
arch/mips/mips-boards/sim/Makefile
··· 1 1 # 2 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 6 # This program is free software; you can distribute it and/or modify it 5 7 # under the terms of the GNU General Public License (Version 2) as ··· 17 15 # 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 18 16 # 19 17 20 - obj-y := sim_setup.o sim_mem.o sim_time.o sim_printf.o sim_int.o sim_cmdline.o 18 + obj-y := sim_setup.o sim_mem.o sim_time.o sim_int.o sim_cmdline.o 19 + 20 + obj-$(CONFIG_EARLY_PRINTK) += sim_console.o 21 21 obj-$(CONFIG_SMP) += sim_smp.o
+1 -1
arch/mips/mips-boards/sim/sim_mem.c
··· 46 46 unsigned int memsize; 47 47 48 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 51 memset(mdesc, 0, sizeof(mdesc)); 52 52
+5 -39
arch/mips/mips-boards/sim/sim_printf.c arch/mips/mips-boards/sim/sim_console.c
··· 1 1 /* 2 - * Carsten Langgaard, carstenl@mips.com 3 - * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved. 4 - * 5 2 * This program is free software; you can distribute it and/or modify it 6 3 * under the terms of the GNU General Public License (Version 2) as 7 4 * published by the Free Software Foundation. ··· 12 15 * with this program; if not, write to the Free Software Foundation, Inc., 13 16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 14 17 * 15 - * Putting things on the screen/serial line using YAMONs facilities. 18 + * Carsten Langgaard, carstenl@mips.com 19 + * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved. 20 + * Copyright (C) 2007 MIPS Technologies, Inc. 21 + * written by Ralf Baechle 16 22 */ 17 23 #include <linux/init.h> 18 - #include <linux/kernel.h> 19 24 #include <linux/serial_reg.h> 20 - #include <linux/spinlock.h> 21 25 #include <asm/io.h> 22 - #include <asm/system.h> 23 26 24 27 static inline unsigned int serial_in(int offset) 25 28 { ··· 31 34 outb(value, 0x3f8 + offset); 32 35 } 33 36 34 - int putPromChar(char c) 37 + void __init prom_putchar(char c) 35 38 { 36 39 while ((serial_in(UART_LSR) & UART_LSR_THRE) == 0) 37 40 ; 38 41 39 42 serial_out(UART_TX, c); 40 - 41 - return 1; 42 - } 43 - 44 - char getPromChar(void) 45 - { 46 - while (!(serial_in(UART_LSR) & 1)) 47 - ; 48 - 49 - return serial_in(UART_RX); 50 - } 51 - 52 - void prom_printf(char *fmt, ...) 53 - { 54 - va_list args; 55 - int l; 56 - char *p, *buf_end; 57 - char buf[1024]; 58 - 59 - va_start(args, fmt); 60 - l = vsprintf(buf, fmt, args); /* hopefully i < sizeof(buf) */ 61 - va_end(args); 62 - 63 - buf_end = buf + l; 64 - 65 - for (p = buf; p < buf_end; p++) { 66 - /* Crude cr/nl handling is better than none */ 67 - if (*p == '\n') 68 - putPromChar('\r'); 69 - putPromChar(*p); 70 - } 71 43 }
+3 -3
arch/mips/mips-boards/sim/sim_setup.c
··· 55 55 serial_init(); 56 56 57 57 board_time_init = sim_time_init; 58 - prom_printf("Linux started...\n"); 58 + pr_info("Linux started...\n"); 59 59 60 60 #ifdef CONFIG_MIPS_MT_SMP 61 61 sanitize_tlb_entries(); ··· 66 66 { 67 67 set_io_port_base(0xbfd00000); 68 68 69 - prom_printf("\nLINUX started...\n"); 69 + pr_info("\nLINUX started...\n"); 70 70 prom_init_cmdline(); 71 71 prom_meminit(); 72 72 } ··· 91 91 s.timeout = 4; 92 92 93 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 97 #endif
+62 -62
arch/mips/mm/cerr-sb1.c
··· 77 77 static inline void breakout_errctl(unsigned int val) 78 78 { 79 79 if (val & CP0_ERRCTL_RECOVERABLE) 80 - prom_printf(" recoverable"); 80 + printk(" recoverable"); 81 81 if (val & CP0_ERRCTL_DCACHE) 82 - prom_printf(" dcache"); 82 + printk(" dcache"); 83 83 if (val & CP0_ERRCTL_ICACHE) 84 - prom_printf(" icache"); 84 + printk(" icache"); 85 85 if (val & CP0_ERRCTL_MULTIBUS) 86 - prom_printf(" multiple-buserr"); 87 - prom_printf("\n"); 86 + printk(" multiple-buserr"); 87 + printk("\n"); 88 88 } 89 89 90 90 static inline void breakout_cerri(unsigned int val) 91 91 { 92 92 if (val & CP0_CERRI_TAG_PARITY) 93 - prom_printf(" tag-parity"); 93 + printk(" tag-parity"); 94 94 if (val & CP0_CERRI_DATA_PARITY) 95 - prom_printf(" data-parity"); 95 + printk(" data-parity"); 96 96 if (val & CP0_CERRI_EXTERNAL) 97 - prom_printf(" external"); 98 - prom_printf("\n"); 97 + printk(" external"); 98 + printk("\n"); 99 99 } 100 100 101 101 static inline void breakout_cerrd(unsigned int val) 102 102 { 103 103 switch (val & CP0_CERRD_CAUSES) { 104 104 case CP0_CERRD_LOAD: 105 - prom_printf(" load,"); 105 + printk(" load,"); 106 106 break; 107 107 case CP0_CERRD_STORE: 108 - prom_printf(" store,"); 108 + printk(" store,"); 109 109 break; 110 110 case CP0_CERRD_FILLWB: 111 - prom_printf(" fill/wb,"); 111 + printk(" fill/wb,"); 112 112 break; 113 113 case CP0_CERRD_COHERENCY: 114 - prom_printf(" coherency,"); 114 + printk(" coherency,"); 115 115 break; 116 116 case CP0_CERRD_DUPTAG: 117 - prom_printf(" duptags,"); 117 + printk(" duptags,"); 118 118 break; 119 119 default: 120 - prom_printf(" NO CAUSE,"); 120 + printk(" NO CAUSE,"); 121 121 break; 122 122 } 123 123 if (!(val & CP0_CERRD_TYPES)) 124 - prom_printf(" NO TYPE"); 124 + printk(" NO TYPE"); 125 125 else { 126 126 if (val & CP0_CERRD_MULTIPLE) 127 - prom_printf(" multi-err"); 127 + printk(" multi-err"); 128 128 if (val & CP0_CERRD_TAG_STATE) 129 - prom_printf(" tag-state"); 129 + printk(" tag-state"); 130 130 if (val & CP0_CERRD_TAG_ADDRESS) 131 - prom_printf(" tag-address"); 131 + printk(" tag-address"); 132 132 if (val & CP0_CERRD_DATA_SBE) 133 - prom_printf(" data-SBE"); 133 + printk(" data-SBE"); 134 134 if (val & CP0_CERRD_DATA_DBE) 135 - prom_printf(" data-DBE"); 135 + printk(" data-DBE"); 136 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 142 #ifndef CONFIG_SIBYTE_BUS_WATCHER ··· 157 157 l2_tag = in64(IO_SPACE_BASE | A_L2_ECC_TAG); 158 158 #endif 159 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); 161 - prom_printf("\nLast recorded signature:\n"); 162 - prom_printf("Request %02x from %d, answered by %d with Dcode %d\n", 160 + printk("Bus watcher error counters: %08x %08x\n", l2_err, memio_err); 161 + printk("\nLast recorded signature:\n"); 162 + printk("Request %02x from %d, answered by %d with Dcode %d\n", 163 163 (unsigned int)(G_SCD_BERR_TID(status) & 0x3f), 164 164 (int)(G_SCD_BERR_TID(status) >> 6), 165 165 (int)G_SCD_BERR_RID(status), 166 166 (int)G_SCD_BERR_DCODE(status)); 167 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 169 #endif 170 170 } else { 171 - prom_printf("Bus watcher indicates no error\n"); 171 + printk("Bus watcher indicates no error\n"); 172 172 } 173 173 } 174 174 #else ··· 187 187 #else 188 188 csr_out32(M_SCD_TRACE_CFG_FREEZE, IO_SPACE_BASE | A_SCD_TRACE_CFG); 189 189 #endif 190 - prom_printf("Trace buffer frozen\n"); 190 + printk("Trace buffer frozen\n"); 191 191 #endif 192 192 193 - prom_printf("Cache error exception on CPU %x:\n", 194 - (read_c0_prid() >> 25) & 0x7); 193 + printk("Cache error exception on CPU %x:\n", 194 + (read_c0_prid() >> 25) & 0x7); 195 195 196 196 __asm__ __volatile__ ( 197 197 " .set push\n\t" ··· 209 209 "=r" (dpahi), "=r" (dpalo), "=r" (eepc)); 210 210 211 211 cerr_dpa = (((uint64_t)dpahi) << 32) | dpalo; 212 - prom_printf(" c0_errorepc == %08x\n", eepc); 213 - prom_printf(" c0_errctl == %08x", errctl); 212 + printk(" c0_errorepc == %08x\n", eepc); 213 + printk(" c0_errctl == %08x", errctl); 214 214 breakout_errctl(errctl); 215 215 if (errctl & CP0_ERRCTL_ICACHE) { 216 - prom_printf(" c0_cerr_i == %08x", cerr_i); 216 + printk(" c0_cerr_i == %08x", cerr_i); 217 217 breakout_cerri(cerr_i); 218 218 if (CP0_CERRI_IDX_VALID(cerr_i)) { 219 219 /* Check index of EPC, allowing for delay slot */ 220 220 if (((eepc & SB1_CACHE_INDEX_MASK) != (cerr_i & SB1_CACHE_INDEX_MASK)) && 221 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 223 else { 224 224 res = extract_ic(cerr_i & SB1_CACHE_INDEX_MASK, 225 225 (cerr_i & CP0_CERRI_DATA) != 0); 226 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 231 if (errctl & CP0_ERRCTL_DCACHE) { 232 - prom_printf(" c0_cerr_d == %08x", cerr_d); 232 + printk(" c0_cerr_d == %08x", cerr_d); 233 233 breakout_cerrd(cerr_d); 234 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 236 if (!CP0_CERRD_IDX_VALID(cerr_d)) { 237 237 res = extract_dc(cerr_dpa & SB1_CACHE_INDEX_MASK, 238 238 (cerr_d & CP0_CERRD_DATA) != 0); 239 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 241 } else { 242 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 244 else { 245 245 res = extract_dc(cerr_d & SB1_CACHE_INDEX_MASK, 246 246 (cerr_d & CP0_CERRD_DATA) != 0); 247 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 334 uint8_t lru; 335 335 int res = 0; 336 336 337 - prom_printf("Icache index 0x%04x ", addr); 337 + printk("Icache index 0x%04x ", addr); 338 338 for (way = 0; way < 4; way++) { 339 339 /* Index-load-tag-I */ 340 340 __asm__ __volatile__ ( ··· 354 354 taglo = ((unsigned long long)taglohi << 32) | taglolo; 355 355 if (way == 0) { 356 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 358 ((addr >> 5) & 0x3), /* bank */ 359 359 ((addr >> 7) & 0x3f), /* index */ 360 360 (lru & 0x3), ··· 369 369 if (valid) { 370 370 tlo_tmp = taglo & 0xfff3ff; 371 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 373 res |= CP0_CERRI_TAG_PARITY; 374 374 } 375 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 377 res |= CP0_CERRI_TAG_PARITY; 378 378 } 379 379 } 380 380 if (valid ^ ((taghi >> 27) & 1)) { 381 - prom_printf(" ** bad parity for valid bit\n"); 381 + printk(" ** bad parity for valid bit\n"); 382 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 385 way, va, valid, taghi, taglo); 386 386 387 387 if (data) { ··· 407 407 : "r" ((way << 13) | addr | (offset << 3))); 408 408 predecode = (datahi >> 8) & 0xff; 409 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 411 res |= CP0_CERRI_DATA_PARITY; 412 412 } 413 413 /* XXXKW should/could check predecode bits themselves */ 414 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 416 res |= CP0_CERRI_DATA_PARITY; 417 417 } 418 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 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 427 return res; ··· 489 489 uint8_t ecc, lru; 490 490 int res = 0; 491 491 492 - prom_printf("Dcache index 0x%04x ", addr); 492 + printk("Dcache index 0x%04x ", addr); 493 493 for (way = 0; way < 4; way++) { 494 494 __asm__ __volatile__ ( 495 495 " .set push\n\t" ··· 509 509 pa = (taglo & 0xFFFFFFE000ULL) | addr; 510 510 if (way == 0) { 511 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 513 ((addr >> 11) & 0x2) | ((addr >> 5) & 1), /* bank */ 514 514 ((addr >> 6) & 0x3f), /* index */ 515 515 (lru & 0x3), ··· 519 519 } 520 520 state = (taghi >> 25) & 0x1f; 521 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 523 way, pa, dc_state_str(state), state, taghi, taglo); 524 524 if (valid) { 525 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 527 res |= CP0_CERRD_TAG_ADDRESS; 528 528 } 529 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 531 res |= CP0_CERRD_TAG_ADDRESS; 532 532 } 533 533 } else { ··· 567 567 } 568 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 573 if (bad_ecc) 574 - prom_printf(" dwords w/ bad ECC: %d %d %d %d\n", 575 - !!(bad_ecc & 8), !!(bad_ecc & 4), 576 - !!(bad_ecc & 2), !!(bad_ecc & 1)); 574 + printk(" dwords w/ bad ECC: %d %d %d %d\n", 575 + !!(bad_ecc & 8), !!(bad_ecc & 4), 576 + !!(bad_ecc & 2), !!(bad_ecc & 1)); 577 577 } 578 578 } 579 579 return res;
-5
arch/mips/momentum/jaguar_atx/ja-console.c
··· 74 74 uart->iu_thr = c; 75 75 } 76 76 77 - char __init prom_getchar(void) 78 - { 79 - return 0; 80 - } 81 - 82 77 static void inline ja_console_probe(void) 83 78 { 84 79 struct uart_port up;
+1 -1
arch/mips/philips/pnx8550/common/prom.c
··· 112 112 113 113 extern int pnx8550_console_port; 114 114 115 - /* used by prom_printf */ 115 + /* used by early printk */ 116 116 void prom_putchar(char c) 117 117 { 118 118 if (pnx8550_console_port != -1) {
+3 -6
arch/mips/philips/pnx8550/common/setup.c
··· 41 41 #include <uart.h> 42 42 #include <nand.h> 43 43 44 - extern void prom_printf(char *fmt, ...); 45 - 46 44 extern void __init board_setup(void); 47 45 extern void pnx8550_machine_restart(char *); 48 46 extern void pnx8550_machine_halt(void); ··· 49 51 extern struct resource iomem_resource; 50 52 extern void pnx8550_time_init(void); 51 53 extern void rs_kgdb_hook(int tty_no); 52 - extern void prom_printf(char *fmt, ...); 53 54 extern char *prom_getcmdline(void); 54 55 55 56 struct resource standard_io_resources[] = { ··· 138 141 argptr += strlen("console=ttyS"); 139 142 pnx8550_console_port = *argptr == '0' ? 0 : 1; 140 143 141 - /* We must initialize the UART (console) before prom_printf */ 144 + /* We must initialize the UART (console) before early printk */ 142 145 /* Set LCR to 8-bit and BAUD to 38400 (no 5) */ 143 146 ip3106_lcr(UART_BASE, pnx8550_console_port) = 144 147 PNX8XXX_UART_LCR_8BIT; ··· 152 155 argptr += strlen("kgdb=ttyS"); 153 156 line = *argptr == '0' ? 0 : 1; 154 157 rs_kgdb_hook(line); 155 - prom_printf("KGDB: Using ttyS%i for session, " 156 - "please connect your debugger\n", line ? 1 : 0); 158 + pr_info("KGDB: Using ttyS%i for session, " 159 + "please connect your debugger\n", line ? 1 : 0); 157 160 } 158 161 #endif 159 162 return;
-5
arch/mips/pmc-sierra/yosemite/py-console.c
··· 107 107 while ((readb_outer_space(lsr) & 0x20) == 0); 108 108 writeb_outer_space(thr, c); 109 109 } 110 - 111 - char __init prom_getchar(void) 112 - { 113 - return 0; 114 - }
+1 -34
arch/mips/sgi-ip27/ip27-console.c
··· 6 6 * Copyright (C) 2001, 2002 Ralf Baechle 7 7 */ 8 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 10 #include <asm/page.h> 17 11 #include <asm/semaphore.h> ··· 32 38 return &ioc3->sregs.uarta; 33 39 } 34 40 35 - void prom_putchar(char c) 41 + void __init prom_putchar(char c) 36 42 { 37 43 struct ioc3_uartregs *uart = console_uart(); 38 44 39 45 while ((uart->iu_lsr & 0x20) == 0); 40 46 uart->iu_thr = c; 41 - } 42 - 43 - static void ioc3_console_write(struct console *con, const char *s, unsigned n) 44 - { 45 - while (n-- && *s) { 46 - if (*s == '\n') 47 - prom_putchar('\r'); 48 - prom_putchar(*s); 49 - s++; 50 - } 51 - } 52 - 53 - static struct console ioc3_console = { 54 - .name = "ioc3", 55 - .write = ioc3_console_write, 56 - .flags = CON_PRINTBUFFER | CON_BOOT, 57 - .index = -1 58 - }; 59 - 60 - __init void ip27_setup_console(void) 61 - { 62 - register_console(&ioc3_console); 63 - } 64 - 65 - void __init disable_early_printk(void) 66 - { 67 - unregister_console(&ioc3_console); 68 47 }
+2
arch/mips/sibyte/Kconfig
··· 116 116 config SIBYTE_CFE 117 117 bool "Booting from CFE" 118 118 depends on SIBYTE_SB1xxx_SOC 119 + select SYS_HAS_EARLY_PRINTK 119 120 help 120 121 Make use of the CFE API for enumerating available memory, 121 122 controlling secondary CPUs, and possibly console output. ··· 132 131 config SIBYTE_STANDALONE 133 132 bool 134 133 depends on SIBYTE_SB1xxx_SOC && !SIBYTE_CFE 134 + select SYS_HAS_EARLY_PRINTK 135 135 default y 136 136 137 137 config SIBYTE_STANDALONE_RAM_SIZE
+1 -1
arch/mips/sibyte/bcm1480/irq.c
··· 420 420 #ifdef CONFIG_GDB_CONSOLE 421 421 register_gdb_console(); 422 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 424 set_debug_traps(); 425 425 breakpoint(); 426 426 }
+5 -5
arch/mips/sibyte/bcm1480/setup.c
··· 69 69 break; 70 70 71 71 default: 72 - prom_printf("Unknown part type %x\n", part_type); 72 + printk("Unknown part type %x\n", part_type); 73 73 ret = 1; 74 74 break; 75 75 } ··· 102 102 pass_str = "B0 (pass2)"; 103 103 break; 104 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 106 periph_rev = 1; 107 107 pass_str = "Unknown Revision"; 108 108 break; ··· 122 122 soc_pass = G_SYS_REVISION(sys_rev); 123 123 124 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 126 machine_restart(NULL); 127 127 } 128 128 129 129 plldiv = G_BCM1480_SYS_PLL_DIV(__raw_readq(IOADDR(A_SCD_SYSTEM_CFG))); 130 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 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 }
+4 -4
arch/mips/sibyte/cfe/setup.c
··· 221 221 goto fail; 222 222 } 223 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 225 return 1; 226 226 fail: 227 - prom_printf("Bad initrd argument. Disabling initrd\n"); 227 + printk("Bad initrd argument. Disabling initrd\n"); 228 228 initrd_start = 0; 229 229 initrd_end = 0; 230 230 return 1; ··· 281 281 } 282 282 if (cfe_eptseal != CFE_EPTSEAL) { 283 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 285 while (1) ; 286 286 } 287 287 cfe_init(cfe_handle, cfe_ept); ··· 303 303 } else { 304 304 /* The loader should have set the command line */ 305 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 307 while (1) ; 308 308 } 309 309 }
+12 -12
arch/mips/sibyte/sb1250/setup.c
··· 67 67 ret = setup_bcm112x(); 68 68 break; 69 69 default: 70 - prom_printf("Unknown SOC type %x\n", soc_type); 70 + printk("Unknown SOC type %x\n", soc_type); 71 71 ret = 1; 72 72 break; 73 73 } ··· 112 112 pass_str = "A0-A6"; 113 113 war_pass = K_SYS_REVISION_BCM1250_PASS2; 114 114 } else { 115 - prom_printf("Unknown BCM1250 rev %x\n", soc_pass); 115 + printk("Unknown BCM1250 rev %x\n", soc_pass); 116 116 ret = 1; 117 117 } 118 118 break; ··· 140 140 pass_str = "A2"; 141 141 break; 142 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 144 ret = 1; 145 145 } 146 146 return ret; ··· 158 158 soc_pass = G_SYS_REVISION(sys_rev); 159 159 160 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 162 machine_restart(NULL); 163 163 } 164 164 165 165 plldiv = G_SYS_PLL_DIV(__raw_readq(IOADDR(A_SCD_SYSTEM_CFG))); 166 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 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 172 switch (war_pass) { 173 173 case K_SYS_REVISION_BCM1250_PASS1: 174 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 176 "and the kernel doesn't have the proper " 177 177 "workarounds compiled in. @@@@\n"); 178 178 bad_config = 1; ··· 182 182 /* Pass 2 - easiest as default for now - so many numbers */ 183 183 #if !defined(CONFIG_SB1_PASS_2_WORKAROUNDS) || \ 184 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 186 "kernel doesn't have the proper workarounds " 187 187 "compiled in. @@@@\n"); 188 188 bad_config = 1; 189 189 #endif 190 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 192 "but are buggy on this board. @@@@\n"); 193 193 bad_config = 1; 194 194 #endif 195 195 break; 196 196 case K_SYS_REVISION_BCM1250_PASS2_2: 197 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 199 "kernel doesn't have the proper workarounds " 200 200 "compiled in. @@@@\n"); 201 201 bad_config = 1; 202 202 #endif 203 203 #if defined(CONFIG_SB1_PASS_2_1_WORKAROUNDS) || \ 204 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 206 "conservatively configured for an 'A' stepping. " 207 207 "@@@@\n"); 208 208 #endif ··· 211 211 break; 212 212 } 213 213 if (bad_config) { 214 - prom_printf("Invalid configuration for this chip.\n"); 214 + printk("Invalid configuration for this chip.\n"); 215 215 machine_restart(NULL); 216 216 } 217 217 }
+16 -35
arch/mips/sni/sniprom.c
··· 9 9 * Copyright (C) 2005-2006 Thomas Bogendoerfer (tsbogend@alpha.franken.de) 10 10 */ 11 11 12 + #define DEBUG 13 + 12 14 #include <linux/kernel.h> 13 15 #include <linux/init.h> 14 16 #include <linux/string.h> ··· 34 32 #define PROM_ENTRY(x) (PROM_VEC + (x)) 35 33 36 34 37 - #define DEBUG 38 - #ifdef DEBUG 39 - #define DBG_PRINTF(x...) prom_printf(x) 40 - #else 41 - #define DBG_PRINTF(x...) 42 - #endif 43 - 44 35 static int *(*__prom_putchar)(int) = (int *(*)(int))PROM_ENTRY(PROM_PUTCHAR); 36 + 37 + void prom_putchar(char c) 38 + { 39 + __prom_putchar(c); 40 + } 41 + 45 42 static char *(*__prom_getenv)(char *) = (char *(*)(char *))PROM_ENTRY(PROM_GETENV); 46 43 static void (*__prom_get_memconf)(void *) = (void (*)(void *))PROM_ENTRY(PROM_GET_MEMCONF); 47 44 48 45 char *prom_getenv (char *s) 49 46 { 50 47 return __prom_getenv(s); 51 - } 52 - 53 - void prom_printf(char *fmt, ...) 54 - { 55 - va_list args; 56 - char ppbuf[1024]; 57 - char *bptr; 58 - 59 - va_start(args, fmt); 60 - vsprintf(ppbuf, fmt, args); 61 - 62 - bptr = ppbuf; 63 - 64 - while (*bptr != 0) { 65 - if (*bptr == '\n') 66 - __prom_putchar('\r'); 67 - 68 - __prom_putchar(*bptr++); 69 - } 70 - va_end(args); 71 48 } 72 49 73 50 void __init prom_free_prom_memory(void) ··· 75 94 { 76 95 int i; 77 96 78 - prom_printf("SNI IDProm dump:\n"); 97 + pr_debug("SNI IDProm dump:\n"); 79 98 for (i = 0; i < 256; i++) { 80 99 if (i%16 == 0) 81 - prom_printf("%04x ", i); 100 + pr_debug("%04x ", i); 82 101 83 - prom_printf("%02x ", *(unsigned char *) (SNI_IDPROM_BASE + i)); 102 + printk("%02x ", *(unsigned char *) (SNI_IDPROM_BASE + i)); 84 103 85 104 if (i % 16 == 15) 86 - prom_printf("\n"); 105 + printk("\n"); 87 106 } 88 107 } 89 108 #endif ··· 102 121 /* MemSIZE from prom in 16MByte chunks */ 103 122 memsize = *((unsigned char *) SNI_IDPROM_MEMSIZE) * 16; 104 123 105 - DBG_PRINTF("IDProm memsize: %lu MByte\n", memsize); 124 + pr_debug("IDProm memsize: %lu MByte\n", memsize); 106 125 107 126 /* get memory bank layout from prom */ 108 127 __prom_get_memconf(&memconf); 109 128 110 - DBG_PRINTF("prom_get_mem_conf memory configuration:\n"); 129 + pr_debug("prom_get_mem_conf memory configuration:\n"); 111 130 for (i = 0;i < 8 && memconf[i].size; i++) { 112 131 if (sni_brd_type == SNI_BRD_PCI_TOWER || 113 132 sni_brd_type == SNI_BRD_PCI_TOWER_CPLUS) { ··· 116 135 memconf[i].base -= 0x20000000; 117 136 } 118 137 } 119 - DBG_PRINTF("Bank%d: %08x @ %08x\n", i, 138 + pr_debug("Bank%d: %08x @ %08x\n", i, 120 139 memconf[i].size, memconf[i].base); 121 140 add_memory_region(memconf[i].base, memconf[i].size, BOOT_MEM_RAM); 122 141 } ··· 229 248 systype = "RM300-Exx"; 230 249 break; 231 250 } 232 - DBG_PRINTF("Found SNI brdtype %02x name %s\n", sni_brd_type,systype); 251 + pr_debug("Found SNI brdtype %02x name %s\n", sni_brd_type,systype); 233 252 234 253 #ifdef DEBUG 235 254 sni_idprom_dump();
-2
include/asm-mips/lasat/lasat.h
··· 237 237 __delay(ns / lasat_ndelay_divider); 238 238 } 239 239 240 - extern void (* prom_printf)(const char *fmt, ...); 241 - 242 240 #endif /* !defined (_LANGUAGE_ASSEMBLY) */ 243 241 244 242 #define LASAT_SERVICEMODE_MAGIC_1 0xdeadbeef
-2
include/asm-mips/mips-boards/prom.h
··· 28 28 29 29 extern char *prom_getcmdline(void); 30 30 extern char *prom_getenv(char *name); 31 - extern void setup_prom_printf(int tty_no); 32 - extern void prom_printf(char *fmt, ...); 33 31 extern void prom_init_cmdline(void); 34 32 extern void prom_meminit(void); 35 33 extern void prom_fixup_mem_map(unsigned long start_mem, unsigned long end_mem);
-3
include/asm-mips/sgialib.h
··· 33 33 extern void prom_putchar(char c); 34 34 extern char prom_getchar(void); 35 35 36 - /* Generic printf() using ARCS console I/O. */ 37 - extern void prom_printf(char *fmt, ...); 38 - 39 36 /* Memory descriptor management. */ 40 37 #define PROM_MAX_PMEMBLOCKS 32 41 38 struct prom_pmemblock {
-2
include/asm-mips/sibyte/sb1250.h
··· 57 57 extern void bcm1480_unmask_irq(int cpu, int irq); 58 58 extern void bcm1480_smp_finish(void); 59 59 60 - extern void prom_printf(char *fmt, ...); 61 - 62 60 #define AT_spin \ 63 61 __asm__ __volatile__ ( \ 64 62 ".set noat\n" \