diff options
Diffstat (limited to 'arch/mips/mips-boards')
-rw-r--r-- | arch/mips/mips-boards/generic/Makefile | 4 | ||||
-rw-r--r-- | arch/mips/mips-boards/generic/console.c (renamed from arch/mips/mips-boards/generic/printf.c) | 12 | ||||
-rw-r--r-- | arch/mips/mips-boards/generic/init.c | 9 | ||||
-rw-r--r-- | arch/mips/mips-boards/generic/memory.c | 11 | ||||
-rw-r--r-- | arch/mips/mips-boards/sim/Makefile | 6 | ||||
-rw-r--r-- | arch/mips/mips-boards/sim/sim_console.c (renamed from arch/mips/mips-boards/sim/sim_printf.c) | 44 | ||||
-rw-r--r-- | arch/mips/mips-boards/sim/sim_mem.c | 2 | ||||
-rw-r--r-- | arch/mips/mips-boards/sim/sim_setup.c | 6 |
8 files changed, 29 insertions, 65 deletions
diff --git a/arch/mips/mips-boards/generic/Makefile b/arch/mips/mips-boards/generic/Makefile index 0a30f5dc9b72..aade36d78787 100644 --- a/arch/mips/mips-boards/generic/Makefile +++ b/arch/mips/mips-boards/generic/Makefile @@ -18,7 +18,9 @@ # Makefile for the MIPS boards generic routines under Linux. # -obj-y := reset.o display.o init.o memory.o printf.o \ +obj-y := reset.o display.o init.o memory.o \ cmdline.o time.o + +obj-$(CONFIG_EARLY_PRINTK) += console.o obj-$(CONFIG_PCI) += pci.o obj-$(CONFIG_KGDB) += gdb_hook.o diff --git a/arch/mips/mips-boards/generic/printf.c b/arch/mips/mips-boards/generic/console.c index 1a711bd79b51..4d8ab99e4155 100644 --- a/arch/mips/mips-boards/generic/printf.c +++ b/arch/mips/mips-boards/generic/console.c @@ -17,10 +17,9 @@ * * Putting things on the screen/serial line using YAMONs facilities. */ +#include <linux/console.h> #include <linux/init.h> -#include <linux/kernel.h> #include <linux/serial_reg.h> -#include <linux/spinlock.h> #include <asm/io.h> #ifdef CONFIG_MIPS_ATLAS @@ -67,12 +66,3 @@ int prom_putchar(char c) return 1; } - -char prom_getchar(void) -{ - while (!(serial_in(UART_LSR) & UART_LSR_DR)) - ; - - return serial_in(UART_RX); -} - diff --git a/arch/mips/mips-boards/generic/init.c b/arch/mips/mips-boards/generic/init.c index 58a0fe883591..b11337600129 100644 --- a/arch/mips/mips-boards/generic/init.c +++ b/arch/mips/mips-boards/generic/init.c @@ -167,7 +167,7 @@ static void __init console_config(void) flow = 'r'; sprintf (console_string, " console=ttyS0,%d%c%c%c", baud, parity, bits, flow); strcat (prom_getcmdline(), console_string); - prom_printf("Config serial console:%s\n", console_string); + pr_info("Config serial console:%s\n", console_string); } } #endif @@ -210,8 +210,9 @@ void __init kgdb_config (void) generic_getDebugChar = rs_getDebugChar; } - prom_printf("KGDB: Using serial line /dev/ttyS%d at %d for session, " - "please connect your debugger\n", line ? 1 : 0, speed); + pr_info("KGDB: Using serial line /dev/ttyS%d at %d for " + "session, please connect your debugger\n", + line ? 1 : 0, speed); { char *s; @@ -382,7 +383,7 @@ void __init prom_init(void) board_nmi_handler_setup = mips_nmi_setup; board_ejtag_handler_setup = mips_ejtag_setup; - prom_printf("\nLINUX started...\n"); + pr_info("\nLINUX started...\n"); prom_init_cmdline(); prom_meminit(); #ifdef CONFIG_SERIAL_8250_CONSOLE diff --git a/arch/mips/mips-boards/generic/memory.c b/arch/mips/mips-boards/generic/memory.c index ebf0e16c5a0d..ae39953da2c4 100644 --- a/arch/mips/mips-boards/generic/memory.c +++ b/arch/mips/mips-boards/generic/memory.c @@ -59,11 +59,12 @@ struct prom_pmemblock * __init prom_getmdesc(void) /* otherwise look in the environment */ memsize_str = prom_getenv("memsize"); if (!memsize_str) { - prom_printf("memsize not set in boot prom, set to default (32Mb)\n"); + printk(KERN_WARNING + "memsize not set in boot prom, set to default (32Mb)\n"); physical_memsize = 0x02000000; } else { #ifdef DEBUG - prom_printf("prom_memsize = %s\n", memsize_str); + pr_debug("prom_memsize = %s\n", memsize_str); #endif physical_memsize = simple_strtol(memsize_str, NULL, 0); } @@ -141,12 +142,12 @@ void __init prom_meminit(void) struct prom_pmemblock *p; #ifdef DEBUG - prom_printf("YAMON MEMORY DESCRIPTOR dump:\n"); + pr_debug("YAMON MEMORY DESCRIPTOR dump:\n"); p = prom_getmdesc(); while (p->size) { int i = 0; - prom_printf("[%d,%p]: base<%08lx> size<%08lx> type<%s>\n", - i, p, p->base, p->size, mtypes[p->type]); + pr_debug("[%d,%p]: base<%08lx> size<%08lx> type<%s>\n", + i, p, p->base, p->size, mtypes[p->type]); p++; i++; } diff --git a/arch/mips/mips-boards/sim/Makefile b/arch/mips/mips-boards/sim/Makefile index a12e32aafde0..6aeebc9122f2 100644 --- a/arch/mips/mips-boards/sim/Makefile +++ b/arch/mips/mips-boards/sim/Makefile @@ -1,5 +1,7 @@ # # Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved. +# Copyright (C) 2007 MIPS Technologies, Inc. +# written by Ralf Baechle (ralf@linux-mips.org) # # This program is free software; you can distribute it and/or modify it # under the terms of the GNU General Public License (Version 2) as @@ -15,5 +17,7 @@ # 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. # -obj-y := sim_setup.o sim_mem.o sim_time.o sim_printf.o sim_int.o sim_cmdline.o +obj-y := sim_setup.o sim_mem.o sim_time.o sim_int.o sim_cmdline.o + +obj-$(CONFIG_EARLY_PRINTK) += sim_console.o obj-$(CONFIG_SMP) += sim_smp.o diff --git a/arch/mips/mips-boards/sim/sim_printf.c b/arch/mips/mips-boards/sim/sim_console.c index 3ee5a0b501a6..de595a9ccb27 100644 --- a/arch/mips/mips-boards/sim/sim_printf.c +++ b/arch/mips/mips-boards/sim/sim_console.c @@ -1,7 +1,4 @@ /* - * Carsten Langgaard, carstenl@mips.com - * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved. - * * This program is free software; you can distribute it and/or modify it * under the terms of the GNU General Public License (Version 2) as * published by the Free Software Foundation. @@ -15,14 +12,14 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. * - * Putting things on the screen/serial line using YAMONs facilities. + * Carsten Langgaard, carstenl@mips.com + * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved. + * Copyright (C) 2007 MIPS Technologies, Inc. + * written by Ralf Baechle */ #include <linux/init.h> -#include <linux/kernel.h> #include <linux/serial_reg.h> -#include <linux/spinlock.h> #include <asm/io.h> -#include <asm/system.h> static inline unsigned int serial_in(int offset) { @@ -34,41 +31,10 @@ static inline void serial_out(int offset, int value) outb(value, 0x3f8 + offset); } -int putPromChar(char c) +void __init prom_putchar(char c) { while ((serial_in(UART_LSR) & UART_LSR_THRE) == 0) ; serial_out(UART_TX, c); - - return 1; -} - -char getPromChar(void) -{ - while (!(serial_in(UART_LSR) & 1)) - ; - - return serial_in(UART_RX); -} - -void prom_printf(char *fmt, ...) -{ - va_list args; - int l; - char *p, *buf_end; - char buf[1024]; - - va_start(args, fmt); - l = vsprintf(buf, fmt, args); /* hopefully i < sizeof(buf) */ - va_end(args); - - buf_end = buf + l; - - for (p = buf; p < buf_end; p++) { - /* Crude cr/nl handling is better than none */ - if (*p == '\n') - putPromChar('\r'); - putPromChar(*p); - } } diff --git a/arch/mips/mips-boards/sim/sim_mem.c b/arch/mips/mips-boards/sim/sim_mem.c index 46bc16f8b15d..e408ef0bcd6e 100644 --- a/arch/mips/mips-boards/sim/sim_mem.c +++ b/arch/mips/mips-boards/sim/sim_mem.c @@ -46,7 +46,7 @@ struct prom_pmemblock * __init prom_getmdesc(void) unsigned int memsize; memsize = 0x02000000; - prom_printf("Setting default memory size 0x%08x\n", memsize); + pr_info("Setting default memory size 0x%08x\n", memsize); memset(mdesc, 0, sizeof(mdesc)); diff --git a/arch/mips/mips-boards/sim/sim_setup.c b/arch/mips/mips-boards/sim/sim_setup.c index ea2066c3a1f7..b705f09e57c3 100644 --- a/arch/mips/mips-boards/sim/sim_setup.c +++ b/arch/mips/mips-boards/sim/sim_setup.c @@ -55,7 +55,7 @@ void __init plat_mem_setup(void) serial_init(); board_time_init = sim_time_init; - prom_printf("Linux started...\n"); + pr_info("Linux started...\n"); #ifdef CONFIG_MIPS_MT_SMP sanitize_tlb_entries(); @@ -66,7 +66,7 @@ void prom_init(void) { set_io_port_base(0xbfd00000); - prom_printf("\nLINUX started...\n"); + pr_info("\nLINUX started...\n"); prom_init_cmdline(); prom_meminit(); } @@ -91,7 +91,7 @@ static void __init serial_init(void) s.timeout = 4; if (early_serial_setup(&s) != 0) { - prom_printf(KERN_ERR "Serial setup failed!\n"); + printk(KERN_ERR "Serial setup failed!\n"); } #endif |