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