···11+/*22+ * This file is subject to the terms and conditions of the GNU General Public33+ * License. See the file "COPYING" in the main directory of this archive44+ * for more details.55+ *66+ * Copyright (C) 2002, 2003, 06, 07 Ralf Baechle (ralf@linux-mips.org)77+ * Copyright (C) 2007 MIPS Technologies, Inc.88+ * written by Ralf Baechle (ralf@linux-mips.org)99+ */1010+#include <linux/console.h>1111+#include <linux/init.h>1212+1313+extern void prom_putchar(char);1414+1515+static void early_console_write(struct console *con, const char *s, unsigned n)1616+{1717+ while (n-- && *s) {1818+ if (*s == '\n')1919+ prom_putchar('\r');2020+ prom_putchar(*s);2121+ s++;2222+ }2323+}2424+2525+static struct console early_console = {2626+ .name = "early",2727+ .write = early_console_write,2828+ .flags = CON_PRINTBUFFER | CON_BOOT,2929+ .index = -13030+};3131+3232+void __init setup_early_printk(void)3333+{3434+ register_console(&early_console);3535+}3636+3737+void __init disable_early_printk(void)3838+{3939+ unregister_console(&early_console);4040+}
···110110 sizeof(struct lasat_eeprom_struct) - 4);111111112112 if (crc != lasat_board_info.li_eeprom_info.crc32) {113113- prom_printf("WARNING...\nWARNING...\nEEPROM CRC does not match calculated, attempting to soldier on...\n");113113+ printk(KERN_WARNING "WARNING...\nWARNING...\nEEPROM CRC does "114114+ "not match calculated, attempting to soldier on...\n");114115 }115116116116- if (lasat_board_info.li_eeprom_info.version != LASAT_EEPROM_VERSION)117117- {118118- prom_printf("WARNING...\nWARNING...\nEEPROM version %d, wanted version %d, attempting to soldier on...\n",117117+ if (lasat_board_info.li_eeprom_info.version != LASAT_EEPROM_VERSION) {118118+ printk(KERN_WARNING "WARNING...\nWARNING...\nEEPROM version "119119+ "%d, wanted version %d, attempting to soldier on...\n",119120 (unsigned int)lasat_board_info.li_eeprom_info.version,120121 LASAT_EEPROM_VERSION);121122 }···125124 cfg1 = lasat_board_info.li_eeprom_info.cfg[1];126125127126 if ( LASAT_W0_DSCTYPE(cfg0) != 1) {128128- prom_printf("WARNING...\nWARNING...\nInvalid configuration read from EEPROM, attempting to soldier on...");127127+ printk(KERN_WARNING "WARNING...\nWARNING...\n"128128+ "Invalid configuration read from EEPROM, attempting to "129129+ "soldier on...");129130 }130131 /* We have a valid configuration */131132
+11-36
arch/mips/lasat/prom.c
···2323#define PROM_PUTC_ADDR PROM_JUMP_TABLE_ENTRY(1)2424#define PROM_MONITOR_ADDR PROM_JUMP_TABLE_ENTRY(2)25252626-static void null_prom_printf(const char * fmt, ...)2727-{2828-}2929-3026static void null_prom_display(const char *string, int pos, int clear)3127{3228}···3640}37413842/* these are functions provided by the bootloader */3939-static void (* prom_putc)(char c) = null_prom_putc;4040-void (* prom_printf)(const char * fmt, ...) = null_prom_printf;4343+static void (* __prom_putc)(char c) = null_prom_putc;4444+4545+void prom_putchar(char c)4646+{4747+ __prom_putc(c);4848+}4949+4150void (* prom_display)(const char *string, int pos, int clear) =4251 null_prom_display;4352void (* prom_monitor)(void) = null_prom_monitor;44534554unsigned int lasat_ndelay_divider;4646-4747-#define PROM_PRINTFBUF_SIZE 2564848-static char prom_printfbuf[PROM_PRINTFBUF_SIZE];4949-5050-static void real_prom_printf(const char * fmt, ...)5151-{5252- va_list ap;5353- int len;5454- char *c = prom_printfbuf;5555- int i;5656-5757- va_start(ap, fmt);5858- len = vsnprintf(prom_printfbuf, PROM_PRINTFBUF_SIZE, fmt, ap);5959- va_end(ap);6060-6161- /* output overflowed the buffer */6262- if (len < 0 || len > PROM_PRINTFBUF_SIZE)6363- len = PROM_PRINTFBUF_SIZE;6464-6565- for (i=0; i < len; i++) {6666- if (*c == '\n')6767- prom_putc('\r');6868- prom_putc(*c++);6969- }7070-}71557256static void setup_prom_vectors(void)7357{···55795680 if (version >= 307) {5781 prom_display = (void *)PROM_DISPLAY_ADDR;5858- prom_putc = (void *)PROM_PUTC_ADDR;5959- prom_printf = real_prom_printf;8282+ __prom_putc = (void *)PROM_PUTC_ADDR;6083 prom_monitor = (void *)PROM_MONITOR_ADDR;6184 }6262- prom_printf("prom vectors set up\n");8585+ printk("prom vectors set up\n");6386}64876588static struct at93c_defs at93c_defs[N_MACHTYPES] = {···76101 setup_prom_vectors();7710278103 if (current_cpu_data.cputype == CPU_R5000) {7979- prom_printf("LASAT 200 board\n");104104+ printk("LASAT 200 board\n");80105 mips_machtype = MACH_LASAT_200;81106 lasat_ndelay_divider = LASAT_200_DIVIDER;82107 } else {8383- prom_printf("LASAT 100 board\n");108108+ printk("LASAT 100 board\n");84109 mips_machtype = MACH_LASAT_100;85110 lasat_ndelay_divider = LASAT_100_DIVIDER;86111 }
···178178 /* Switch from prom exception handler to normal mode */179179 change_c0_status(ST0_BEV,0);180180181181- prom_printf("Lasat specific initialization complete\n");181181+ pr_info("Lasat specific initialization complete\n");182182}
···1717 *1818 * Putting things on the screen/serial line using YAMONs facilities.1919 */2020+#include <linux/console.h>2021#include <linux/init.h>2121-#include <linux/kernel.h>2222#include <linux/serial_reg.h>2323-#include <linux/spinlock.h>2423#include <asm/io.h>25242625#ifdef CONFIG_MIPS_ATLAS···66676768 return 1;6869}6969-7070-char prom_getchar(void)7171-{7272- while (!(serial_in(UART_LSR) & UART_LSR_DR))7373- ;7474-7575- return serial_in(UART_RX);7676-}7777-
+5-1
arch/mips/mips-boards/sim/Makefile
···11#22# Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.33+# Copyright (C) 2007 MIPS Technologies, Inc.44+# written by Ralf Baechle (ralf@linux-mips.org)35#46# This program is free software; you can distribute it and/or modify it57# under the terms of the GNU General Public License (Version 2) as···1715# 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.1816#19172020-obj-y := sim_setup.o sim_mem.o sim_time.o sim_printf.o sim_int.o sim_cmdline.o1818+obj-y := sim_setup.o sim_mem.o sim_time.o sim_int.o sim_cmdline.o1919+2020+obj-$(CONFIG_EARLY_PRINTK) += sim_console.o2121obj-$(CONFIG_SMP) += sim_smp.o
···11/*22- * Carsten Langgaard, carstenl@mips.com33- * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.44- *52 * This program is free software; you can distribute it and/or modify it63 * under the terms of the GNU General Public License (Version 2) as74 * published by the Free Software Foundation.···1215 * with this program; if not, write to the Free Software Foundation, Inc.,1316 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.1417 *1515- * Putting things on the screen/serial line using YAMONs facilities.1818+ * Carsten Langgaard, carstenl@mips.com1919+ * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.2020+ * Copyright (C) 2007 MIPS Technologies, Inc.2121+ * written by Ralf Baechle1622 */1723#include <linux/init.h>1818-#include <linux/kernel.h>1924#include <linux/serial_reg.h>2020-#include <linux/spinlock.h>2125#include <asm/io.h>2222-#include <asm/system.h>23262427static inline unsigned int serial_in(int offset)2528{···3134 outb(value, 0x3f8 + offset);3235}33363434-int putPromChar(char c)3737+void __init prom_putchar(char c)3538{3639 while ((serial_in(UART_LSR) & UART_LSR_THRE) == 0)3740 ;38413942 serial_out(UART_TX, c);4040-4141- return 1;4242-}4343-4444-char getPromChar(void)4545-{4646- while (!(serial_in(UART_LSR) & 1))4747- ;4848-4949- return serial_in(UART_RX);5050-}5151-5252-void prom_printf(char *fmt, ...)5353-{5454- va_list args;5555- int l;5656- char *p, *buf_end;5757- char buf[1024];5858-5959- va_start(args, fmt);6060- l = vsprintf(buf, fmt, args); /* hopefully i < sizeof(buf) */6161- va_end(args);6262-6363- buf_end = buf + l;6464-6565- for (p = buf; p < buf_end; p++) {6666- /* Crude cr/nl handling is better than none */6767- if (*p == '\n')6868- putPromChar('\r');6969- putPromChar(*p);7070- }7143}
···112112113113extern int pnx8550_console_port;114114115115-/* used by prom_printf */115115+/* used by early printk */116116void prom_putchar(char c)117117{118118 if (pnx8550_console_port != -1) {
+3-6
arch/mips/philips/pnx8550/common/setup.c
···4141#include <uart.h>4242#include <nand.h>43434444-extern void prom_printf(char *fmt, ...);4545-4644extern void __init board_setup(void);4745extern void pnx8550_machine_restart(char *);4846extern void pnx8550_machine_halt(void);···4951extern struct resource iomem_resource;5052extern void pnx8550_time_init(void);5153extern void rs_kgdb_hook(int tty_no);5252-extern void prom_printf(char *fmt, ...);5354extern char *prom_getcmdline(void);54555556struct resource standard_io_resources[] = {···138141 argptr += strlen("console=ttyS");139142 pnx8550_console_port = *argptr == '0' ? 0 : 1;140143141141- /* We must initialize the UART (console) before prom_printf */144144+ /* We must initialize the UART (console) before early printk */142145 /* Set LCR to 8-bit and BAUD to 38400 (no 5) */143146 ip3106_lcr(UART_BASE, pnx8550_console_port) =144147 PNX8XXX_UART_LCR_8BIT;···152155 argptr += strlen("kgdb=ttyS");153156 line = *argptr == '0' ? 0 : 1;154157 rs_kgdb_hook(line);155155- prom_printf("KGDB: Using ttyS%i for session, "156156- "please connect your debugger\n", line ? 1 : 0);158158+ pr_info("KGDB: Using ttyS%i for session, "159159+ "please connect your debugger\n", line ? 1 : 0);157160 }158161#endif159162 return;
···116116config SIBYTE_CFE117117 bool "Booting from CFE"118118 depends on SIBYTE_SB1xxx_SOC119119+ select SYS_HAS_EARLY_PRINTK119120 help120121 Make use of the CFE API for enumerating available memory,121122 controlling secondary CPUs, and possibly console output.···132131config SIBYTE_STANDALONE133132 bool134133 depends on SIBYTE_SB1xxx_SOC && !SIBYTE_CFE134134+ select SYS_HAS_EARLY_PRINTK135135 default y136136137137config SIBYTE_STANDALONE_RAM_SIZE
+1-1
arch/mips/sibyte/bcm1480/irq.c
···420420#ifdef CONFIG_GDB_CONSOLE421421 register_gdb_console();422422#endif423423- prom_printf("Waiting for GDB on UART port %d\n", kgdb_port);423423+ printk("Waiting for GDB on UART port %d\n", kgdb_port);424424 set_debug_traps();425425 breakpoint();426426 }
···221221 goto fail;222222 }223223 initrd_end = initrd_start + initrd_size;224224- prom_printf("Found initrd of %lx@%lx\n", initrd_size, initrd_start);224224+ printk("Found initrd of %lx@%lx\n", initrd_size, initrd_start);225225 return 1;226226 fail:227227- prom_printf("Bad initrd argument. Disabling initrd\n");227227+ printk("Bad initrd argument. Disabling initrd\n");228228 initrd_start = 0;229229 initrd_end = 0;230230 return 1;···281281 }282282 if (cfe_eptseal != CFE_EPTSEAL) {283283 /* too early for panic to do any good */284284- prom_printf("CFE's entrypoint seal doesn't match. Spinning.");284284+ printk("CFE's entrypoint seal doesn't match. Spinning.");285285 while (1) ;286286 }287287 cfe_init(cfe_handle, cfe_ept);···303303 } else {304304 /* The loader should have set the command line */305305 /* too early for panic to do any good */306306- prom_printf("LINUX_CMDLINE not defined in cfe.");306306+ printk("LINUX_CMDLINE not defined in cfe.");307307 while (1) ;308308 }309309 }
+12-12
arch/mips/sibyte/sb1250/setup.c
···6767 ret = setup_bcm112x();6868 break;6969 default:7070- prom_printf("Unknown SOC type %x\n", soc_type);7070+ printk("Unknown SOC type %x\n", soc_type);7171 ret = 1;7272 break;7373 }···112112 pass_str = "A0-A6";113113 war_pass = K_SYS_REVISION_BCM1250_PASS2;114114 } else {115115- prom_printf("Unknown BCM1250 rev %x\n", soc_pass);115115+ printk("Unknown BCM1250 rev %x\n", soc_pass);116116 ret = 1;117117 }118118 break;···140140 pass_str = "A2";141141 break;142142 default:143143- prom_printf("Unknown %s rev %x\n", soc_str, soc_pass);143143+ printk("Unknown %s rev %x\n", soc_str, soc_pass);144144 ret = 1;145145 }146146 return ret;···158158 soc_pass = G_SYS_REVISION(sys_rev);159159160160 if (sys_rev_decode()) {161161- prom_printf("Restart after failure to identify SiByte chip\n");161161+ printk("Restart after failure to identify SiByte chip\n");162162 machine_restart(NULL);163163 }164164165165 plldiv = G_SYS_PLL_DIV(__raw_readq(IOADDR(A_SCD_SYSTEM_CFG)));166166 zbbus_mhz = ((plldiv >> 1) * 50) + ((plldiv & 1) * 25);167167168168- prom_printf("Broadcom SiByte %s %s @ %d MHz (SB1 rev %d)\n",168168+ printk("Broadcom SiByte %s %s @ %d MHz (SB1 rev %d)\n",169169 soc_str, pass_str, zbbus_mhz * 2, sb1_pass);170170- prom_printf("Board type: %s\n", get_system_type());170170+ printk("Board type: %s\n", get_system_type());171171172172 switch (war_pass) {173173 case K_SYS_REVISION_BCM1250_PASS1:174174#ifndef CONFIG_SB1_PASS_1_WORKAROUNDS175175- prom_printf("@@@@ This is a BCM1250 A0-A2 (Pass 1) board, "175175+ printk("@@@@ This is a BCM1250 A0-A2 (Pass 1) board, "176176 "and the kernel doesn't have the proper "177177 "workarounds compiled in. @@@@\n");178178 bad_config = 1;···182182 /* Pass 2 - easiest as default for now - so many numbers */183183#if !defined(CONFIG_SB1_PASS_2_WORKAROUNDS) || \184184 !defined(CONFIG_SB1_PASS_2_1_WORKAROUNDS)185185- prom_printf("@@@@ This is a BCM1250 A3-A10 board, and the "185185+ printk("@@@@ This is a BCM1250 A3-A10 board, and the "186186 "kernel doesn't have the proper workarounds "187187 "compiled in. @@@@\n");188188 bad_config = 1;189189#endif190190#ifdef CONFIG_CPU_HAS_PREFETCH191191- prom_printf("@@@@ Prefetches may be enabled in this kernel, "191191+ printk("@@@@ Prefetches may be enabled in this kernel, "192192 "but are buggy on this board. @@@@\n");193193 bad_config = 1;194194#endif195195 break;196196 case K_SYS_REVISION_BCM1250_PASS2_2:197197#ifndef CONFIG_SB1_PASS_2_WORKAROUNDS198198- prom_printf("@@@@ This is a BCM1250 B1/B2. board, and the "198198+ printk("@@@@ This is a BCM1250 B1/B2. board, and the "199199 "kernel doesn't have the proper workarounds "200200 "compiled in. @@@@\n");201201 bad_config = 1;202202#endif203203#if defined(CONFIG_SB1_PASS_2_1_WORKAROUNDS) || \204204 !defined(CONFIG_CPU_HAS_PREFETCH)205205- prom_printf("@@@@ This is a BCM1250 B1/B2, but the kernel is "205205+ printk("@@@@ This is a BCM1250 B1/B2, but the kernel is "206206 "conservatively configured for an 'A' stepping. "207207 "@@@@\n");208208#endif···211211 break;212212 }213213 if (bad_config) {214214- prom_printf("Invalid configuration for this chip.\n");214214+ printk("Invalid configuration for this chip.\n");215215 machine_restart(NULL);216216 }217217}