提交 36a88530 编写于 作者: R Ralf Baechle

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

early_printk is a so much saner thing.
Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 ca471c86
...@@ -176,7 +176,7 @@ config MACH_DECSTATION ...@@ -176,7 +176,7 @@ config MACH_DECSTATION
bool "DECstations" bool "DECstations"
select BOOT_ELF32 select BOOT_ELF32
select DMA_NONCOHERENT select DMA_NONCOHERENT
select EARLY_PRINTK select SYS_HAS_EARLY_PRINTK
select IRQ_CPU select IRQ_CPU
select SYS_HAS_CPU_R3000 select SYS_HAS_CPU_R3000
select SYS_HAS_CPU_R4X00 select SYS_HAS_CPU_R4X00
...@@ -242,6 +242,7 @@ config MACH_JAZZ ...@@ -242,6 +242,7 @@ config MACH_JAZZ
config LASAT config LASAT
bool "LASAT Networks platforms" bool "LASAT Networks platforms"
select DMA_NONCOHERENT select DMA_NONCOHERENT
select SYS_HAS_EARLY_PRINTK
select HW_HAS_PCI select HW_HAS_PCI
select MIPS_GT64120 select MIPS_GT64120
select MIPS_NILE4 select MIPS_NILE4
...@@ -256,6 +257,7 @@ config MIPS_ATLAS ...@@ -256,6 +257,7 @@ config MIPS_ATLAS
bool "MIPS Atlas board" bool "MIPS Atlas board"
select BOOT_ELF32 select BOOT_ELF32
select DMA_NONCOHERENT select DMA_NONCOHERENT
select SYS_HAS_EARLY_PRINTK
select IRQ_CPU select IRQ_CPU
select HW_HAS_PCI select HW_HAS_PCI
select MIPS_BOARDS_GEN select MIPS_BOARDS_GEN
...@@ -301,6 +303,7 @@ config MIPS_MALTA ...@@ -301,6 +303,7 @@ config MIPS_MALTA
select SYS_HAS_CPU_MIPS64_R1 select SYS_HAS_CPU_MIPS64_R1
select SYS_HAS_CPU_NEVADA select SYS_HAS_CPU_NEVADA
select SYS_HAS_CPU_RM7000 select SYS_HAS_CPU_RM7000
select SYS_HAS_EARLY_PRINTK
select SYS_SUPPORTS_32BIT_KERNEL select SYS_SUPPORTS_32BIT_KERNEL
select SYS_SUPPORTS_64BIT_KERNEL select SYS_SUPPORTS_64BIT_KERNEL
select SYS_SUPPORTS_BIG_ENDIAN select SYS_SUPPORTS_BIG_ENDIAN
...@@ -316,6 +319,7 @@ config MIPS_SEAD ...@@ -316,6 +319,7 @@ config MIPS_SEAD
depends on EXPERIMENTAL depends on EXPERIMENTAL
select IRQ_CPU select IRQ_CPU
select DMA_NONCOHERENT select DMA_NONCOHERENT
select SYS_HAS_EARLY_PRINTK
select MIPS_BOARDS_GEN select MIPS_BOARDS_GEN
select SYS_HAS_CPU_MIPS32_R1 select SYS_HAS_CPU_MIPS32_R1
select SYS_HAS_CPU_MIPS32_R2 select SYS_HAS_CPU_MIPS32_R2
...@@ -353,9 +357,11 @@ config WR_PPMC ...@@ -353,9 +357,11 @@ config WR_PPMC
config MIPS_SIM config MIPS_SIM
bool 'MIPS simulator (MIPSsim)' bool 'MIPS simulator (MIPSsim)'
select DMA_NONCOHERENT select DMA_NONCOHERENT
select SYS_HAS_EARLY_PRINTK
select IRQ_CPU select IRQ_CPU
select SYS_HAS_CPU_MIPS32_R1 select SYS_HAS_CPU_MIPS32_R1
select SYS_HAS_CPU_MIPS32_R2 select SYS_HAS_CPU_MIPS32_R2
select SYS_HAS_EARLY_PRINTK
select SYS_SUPPORTS_32BIT_KERNEL select SYS_SUPPORTS_32BIT_KERNEL
select SYS_SUPPORTS_BIG_ENDIAN select SYS_SUPPORTS_BIG_ENDIAN
select SYS_SUPPORTS_LITTLE_ENDIAN select SYS_SUPPORTS_LITTLE_ENDIAN
...@@ -376,6 +382,7 @@ config MOMENCO_JAGUAR_ATX ...@@ -376,6 +382,7 @@ config MOMENCO_JAGUAR_ATX
select RM7000_CPU_SCACHE select RM7000_CPU_SCACHE
select SWAP_IO_SPACE select SWAP_IO_SPACE
select SYS_HAS_CPU_RM9000 select SYS_HAS_CPU_RM9000
select SYS_HAS_EARLY_PRINTK
select SYS_SUPPORTS_32BIT_KERNEL select SYS_SUPPORTS_32BIT_KERNEL
select SYS_SUPPORTS_64BIT_KERNEL select SYS_SUPPORTS_64BIT_KERNEL
select SYS_SUPPORTS_BIG_ENDIAN select SYS_SUPPORTS_BIG_ENDIAN
...@@ -513,6 +520,7 @@ config PMC_YOSEMITE ...@@ -513,6 +520,7 @@ config PMC_YOSEMITE
select IRQ_CPU_RM9K select IRQ_CPU_RM9K
select SWAP_IO_SPACE select SWAP_IO_SPACE
select SYS_HAS_CPU_RM9000 select SYS_HAS_CPU_RM9000
select SYS_HAS_EARLY_PRINTK
select SYS_SUPPORTS_32BIT_KERNEL select SYS_SUPPORTS_32BIT_KERNEL
select SYS_SUPPORTS_64BIT_KERNEL select SYS_SUPPORTS_64BIT_KERNEL
select SYS_SUPPORTS_BIG_ENDIAN select SYS_SUPPORTS_BIG_ENDIAN
...@@ -573,6 +581,7 @@ config SGI_IP22 ...@@ -573,6 +581,7 @@ config SGI_IP22
select SWAP_IO_SPACE select SWAP_IO_SPACE
select SYS_HAS_CPU_R4X00 select SYS_HAS_CPU_R4X00
select SYS_HAS_CPU_R5000 select SYS_HAS_CPU_R5000
select SYS_HAS_EARLY_PRINTK
select SYS_SUPPORTS_32BIT_KERNEL select SYS_SUPPORTS_32BIT_KERNEL
select SYS_SUPPORTS_64BIT_KERNEL select SYS_SUPPORTS_64BIT_KERNEL
select SYS_SUPPORTS_BIG_ENDIAN select SYS_SUPPORTS_BIG_ENDIAN
...@@ -587,7 +596,7 @@ config SGI_IP27 ...@@ -587,7 +596,7 @@ config SGI_IP27
select ARC64 select ARC64
select BOOT_ELF64 select BOOT_ELF64
select DMA_IP27 select DMA_IP27
select EARLY_PRINTK select SYS_HAS_EARLY_PRINTK
select HW_HAS_PCI select HW_HAS_PCI
select NR_CPUS_DEFAULT_64 select NR_CPUS_DEFAULT_64
select PCI_DOMAINS select PCI_DOMAINS
...@@ -749,6 +758,7 @@ config SNI_RM ...@@ -749,6 +758,7 @@ config SNI_RM
select SYS_HAS_CPU_R5000 select SYS_HAS_CPU_R5000
select SYS_HAS_CPU_R10000 select SYS_HAS_CPU_R10000
select R5000_CPU_SCACHE select R5000_CPU_SCACHE
select SYS_HAS_EARLY_PRINTK
select SYS_SUPPORTS_32BIT_KERNEL select SYS_SUPPORTS_32BIT_KERNEL
select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
select SYS_SUPPORTS_BIG_ENDIAN select SYS_SUPPORTS_BIG_ENDIAN
...@@ -897,6 +907,20 @@ config DMA_NEED_PCI_MAP_STATE ...@@ -897,6 +907,20 @@ config DMA_NEED_PCI_MAP_STATE
bool bool
config EARLY_PRINTK config EARLY_PRINTK
bool "Early printk" if EMBEDDED && DEBUG_KERNEL
depends on SYS_HAS_EARLY_PRINTK
default y
help
This option enables special console drivers which allow the kernel
to print messages very early in the bootup process.
This is useful for kernel debugging when your machine crashes very
early before the console code is initialized. For normal operation
it is not recommended because it looks on some machines ugly and
oesn't cooperate with an X server. You should normally N here,
unless you want to debug such a crash.
config SYS_HAS_EARLY_PRINTK
bool bool
config GENERIC_ISA_DMA config GENERIC_ISA_DMA
...@@ -1033,6 +1057,7 @@ config SOC_PNX8550 ...@@ -1033,6 +1057,7 @@ config SOC_PNX8550
select DMA_NONCOHERENT select DMA_NONCOHERENT
select HW_HAS_PCI select HW_HAS_PCI
select SYS_HAS_CPU_MIPS32_R1 select SYS_HAS_CPU_MIPS32_R1
select SYS_HAS_EARLY_PRINTK
select SYS_SUPPORTS_32BIT_KERNEL select SYS_SUPPORTS_32BIT_KERNEL
select GENERIC_HARDIRQS_NO__DO_IRQ select GENERIC_HARDIRQS_NO__DO_IRQ
select SYS_SUPPORTS_KGDB select SYS_SUPPORTS_KGDB
...@@ -1093,7 +1118,7 @@ config HAVE_STD_PC_SERIAL_PORT ...@@ -1093,7 +1118,7 @@ config HAVE_STD_PC_SERIAL_PORT
config ARC_CONSOLE config ARC_CONSOLE
bool "ARC console support" bool "ARC console support"
depends on SGI_IP22 || SNI_RM depends on SGI_IP22 || (SNI_RM && CPU_LITTLE_ENDIAN)
config ARC_MEMORY config ARC_MEMORY
bool bool
......
...@@ -29,35 +29,3 @@ void prom_putchar(char c) ...@@ -29,35 +29,3 @@ void prom_putchar(char c)
ArcWrite(1, &it, 1, &cnt); ArcWrite(1, &it, 1, &cnt);
bc_enable(); bc_enable();
} }
char prom_getchar(void)
{
ULONG cnt;
CHAR c;
bc_disable();
ArcRead(0, &c, 1, &cnt);
bc_enable();
return c;
}
void prom_printf(char *fmt, ...)
{
va_list args;
char ppbuf[1024];
char *bptr;
va_start(args, fmt);
vsprintf(ppbuf, fmt, args);
bptr = ppbuf;
while (*bptr != 0) {
if (*bptr == '\n')
prom_putchar('\r');
prom_putchar(*bptr++);
}
va_end(args);
}
...@@ -24,12 +24,15 @@ void __init prom_init(void) ...@@ -24,12 +24,15 @@ void __init prom_init(void)
{ {
PSYSTEM_PARAMETER_BLOCK pb = PROMBLOCK; PSYSTEM_PARAMETER_BLOCK pb = PROMBLOCK;
romvec = ROMVECTOR; romvec = ROMVECTOR;
ULONG cnt;
CHAR c;
prom_argc = fw_arg0; prom_argc = fw_arg0;
_prom_argv = (LONG *) fw_arg1; _prom_argv = (LONG *) fw_arg1;
_prom_envp = (LONG *) fw_arg2; _prom_envp = (LONG *) fw_arg2;
if (pb->magic != 0x53435241) { if (pb->magic != 0x53435241) {
prom_printf("Aieee, bad prom vector magic %08lx\n", pb->magic); printk(KERN_CRIT "Aieee, bad prom vector magic %08lx\n", pb->magic);
while(1) while(1)
; ;
} }
...@@ -41,8 +44,8 @@ void __init prom_init(void) ...@@ -41,8 +44,8 @@ void __init prom_init(void)
prom_meminit(); prom_meminit();
#ifdef DEBUG_PROM_INIT #ifdef DEBUG_PROM_INIT
prom_printf("Press a key to reboot\n"); pr_info("Press a key to reboot\n");
prom_getchar(); ArcRead(0, &c, 1, &cnt);
ArcEnterInteractiveMode(); ArcEnterInteractiveMode();
#endif #endif
} }
...@@ -118,11 +118,11 @@ void __init prom_meminit(void) ...@@ -118,11 +118,11 @@ void __init prom_meminit(void)
#ifdef DEBUG #ifdef DEBUG
int i = 0; int i = 0;
prom_printf("ARCS MEMORY DESCRIPTOR dump:\n"); printk("ARCS MEMORY DESCRIPTOR dump:\n");
p = ArcGetMemoryDescriptor(PROM_NULL_MDESC); p = ArcGetMemoryDescriptor(PROM_NULL_MDESC);
while(p) { while(p) {
prom_printf("[%d,%p]: base<%08lx> pages<%08lx> type<%s>\n", printk("[%d,%p]: base<%08lx> pages<%08lx> type<%s>\n",
i, p, p->base, p->pages, mtypes(p->type)); i, p, p->base, p->pages, mtypes(p->type));
p = ArcGetMemoryDescriptor(p); p = ArcGetMemoryDescriptor(p);
i++; i++;
} }
......
...@@ -93,11 +93,11 @@ static char *iflags[] = { ...@@ -93,11 +93,11 @@ static char *iflags[] = {
static void __init static void __init
dump_component(pcomponent *p) dump_component(pcomponent *p)
{ {
prom_printf("[%p]:class<%s>type<%s>flags<%s>ver<%d>rev<%d>", printk("[%p]:class<%s>type<%s>flags<%s>ver<%d>rev<%d>",
p, classes[p->class], types[p->type], p, classes[p->class], types[p->type],
iflags[p->iflags], p->vers, p->rev); iflags[p->iflags], p->vers, p->rev);
prom_printf("key<%08lx>\n\tamask<%08lx>cdsize<%d>ilen<%d>iname<%s>\n", printk("key<%08lx>\n\tamask<%08lx>cdsize<%d>ilen<%d>iname<%s>\n",
p->key, p->amask, (int)p->cdsize, (int)p->ilen, p->iname); p->key, p->amask, (int)p->cdsize, (int)p->ilen, p->iname);
} }
static void __init static void __init
......
...@@ -19,29 +19,3 @@ static void putchar(int c) ...@@ -19,29 +19,3 @@ static void putchar(int c)
COBALT_UART[UART_TX] = c; COBALT_UART[UART_TX] = c;
} }
static void cons_write(struct console *c, const char *s, unsigned n)
{
while(n-- && *s)
putchar(*s++);
}
static struct console cons_info =
{
.name = "uart",
.write = cons_write,
.flags = CON_PRINTBUFFER | CON_BOOT,
.index = -1,
};
void __init cobalt_early_console(void)
{
register_console(&cons_info);
printk("Cobalt: early console registered\n");
}
void __init disable_early_printk(void)
{
unregister_console(&cons_info);
}
...@@ -150,10 +150,6 @@ void __init plat_mem_setup(void) ...@@ -150,10 +150,6 @@ void __init plat_mem_setup(void)
#endif #endif
if (cobalt_board_id > COBALT_BRD_ID_RAQ1) { if (cobalt_board_id > COBALT_BRD_ID_RAQ1) {
#ifdef CONFIG_EARLY_PRINTK
cobalt_early_console();
#endif
#ifdef CONFIG_SERIAL_8250 #ifdef CONFIG_SERIAL_8250
uart.line = 0; uart.line = 0;
uart.type = PORT_UNKNOWN; uart.type = PORT_UNKNOWN;
......
...@@ -16,40 +16,12 @@ ...@@ -16,40 +16,12 @@
#include <asm/dec/prom.h> #include <asm/dec/prom.h>
static void __init prom_console_write(struct console *con, const char *s, void prom_putchar(char c)
unsigned int c)
{ {
static char sfmt[] __initdata = "%%%us"; char s[2];
char fmt[13];
snprintf(fmt, sizeof(fmt), sfmt, c); s[0] = c;
prom_printf(fmt, s); s[1] = '\0';
}
static struct console promcons __initdata = {
.name = "prom",
.write = prom_console_write,
.flags = CON_PRINTBUFFER,
.index = -1,
};
static int promcons_output __initdata = 0;
void __init register_prom_console(void)
{
if (!promcons_output) {
promcons_output = 1;
register_console(&promcons);
}
}
void __init unregister_prom_console(void) prom_printf( s);
{
if (promcons_output) {
unregister_console(&promcons);
promcons_output = 0;
}
} }
void disable_early_printk(void)
__attribute__((alias("unregister_prom_console")));
...@@ -24,11 +24,6 @@ static void prom_console_write(struct console *co, const char *s, ...@@ -24,11 +24,6 @@ static void prom_console_write(struct console *co, const char *s,
} }
} }
int prom_getchar(void)
{
return 0;
}
static struct console sercons = { static struct console sercons = {
.name = "ttyS", .name = "ttyS",
.write = prom_console_write, .write = prom_console_write,
......
...@@ -65,5 +65,6 @@ obj-$(CONFIG_64BIT) += cpu-bugs64.o ...@@ -65,5 +65,6 @@ obj-$(CONFIG_64BIT) += cpu-bugs64.o
obj-$(CONFIG_I8253) += i8253.o obj-$(CONFIG_I8253) += i8253.o
obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
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) 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)
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2002, 2003, 06, 07 Ralf Baechle (ralf@linux-mips.org)
* Copyright (C) 2007 MIPS Technologies, Inc.
* written by Ralf Baechle (ralf@linux-mips.org)
*/
#include <linux/console.h>
#include <linux/init.h>
extern void prom_putchar(char);
static void early_console_write(struct console *con, const char *s, unsigned n)
{
while (n-- && *s) {
if (*s == '\n')
prom_putchar('\r');
prom_putchar(*s);
s++;
}
}
static struct console early_console = {
.name = "early",
.write = early_console_write,
.flags = CON_PRINTBUFFER | CON_BOOT,
.index = -1
};
void __init setup_early_printk(void)
{
register_console(&early_console);
}
void __init disable_early_printk(void)
{
unregister_console(&early_console);
}
...@@ -525,6 +525,14 @@ void __init setup_arch(char **cmdline_p) ...@@ -525,6 +525,14 @@ void __init setup_arch(char **cmdline_p)
{ {
cpu_probe(); cpu_probe();
prom_init(); prom_init();
#ifdef CONFIG_EARLY_PRINTK
{
extern void setup_early_printk(void);
setup_early_printk();
}
#endif
cpu_report(); cpu_report();
#if defined(CONFIG_VT) #if defined(CONFIG_VT)
......
...@@ -110,12 +110,13 @@ int lasat_init_board_info(void) ...@@ -110,12 +110,13 @@ int lasat_init_board_info(void)
sizeof(struct lasat_eeprom_struct) - 4); sizeof(struct lasat_eeprom_struct) - 4);
if (crc != lasat_board_info.li_eeprom_info.crc32) { if (crc != lasat_board_info.li_eeprom_info.crc32) {
prom_printf("WARNING...\nWARNING...\nEEPROM CRC does not match calculated, attempting to soldier on...\n"); printk(KERN_WARNING "WARNING...\nWARNING...\nEEPROM CRC does "
"not match calculated, attempting to soldier on...\n");
} }
if (lasat_board_info.li_eeprom_info.version != LASAT_EEPROM_VERSION) if (lasat_board_info.li_eeprom_info.version != LASAT_EEPROM_VERSION) {
{ printk(KERN_WARNING "WARNING...\nWARNING...\nEEPROM version "
prom_printf("WARNING...\nWARNING...\nEEPROM version %d, wanted version %d, attempting to soldier on...\n", "%d, wanted version %d, attempting to soldier on...\n",
(unsigned int)lasat_board_info.li_eeprom_info.version, (unsigned int)lasat_board_info.li_eeprom_info.version,
LASAT_EEPROM_VERSION); LASAT_EEPROM_VERSION);
} }
...@@ -124,7 +125,9 @@ int lasat_init_board_info(void) ...@@ -124,7 +125,9 @@ int lasat_init_board_info(void)
cfg1 = lasat_board_info.li_eeprom_info.cfg[1]; cfg1 = lasat_board_info.li_eeprom_info.cfg[1];
if ( LASAT_W0_DSCTYPE(cfg0) != 1) { if ( LASAT_W0_DSCTYPE(cfg0) != 1) {
prom_printf("WARNING...\nWARNING...\nInvalid configuration read from EEPROM, attempting to soldier on..."); printk(KERN_WARNING "WARNING...\nWARNING...\n"
"Invalid configuration read from EEPROM, attempting to "
"soldier on...");
} }
/* We have a valid configuration */ /* We have a valid configuration */
......
...@@ -23,10 +23,6 @@ ...@@ -23,10 +23,6 @@
#define PROM_PUTC_ADDR PROM_JUMP_TABLE_ENTRY(1) #define PROM_PUTC_ADDR PROM_JUMP_TABLE_ENTRY(1)
#define PROM_MONITOR_ADDR PROM_JUMP_TABLE_ENTRY(2) #define PROM_MONITOR_ADDR PROM_JUMP_TABLE_ENTRY(2)
static void null_prom_printf(const char * fmt, ...)
{
}
static void null_prom_display(const char *string, int pos, int clear) static void null_prom_display(const char *string, int pos, int clear)
{ {
} }
...@@ -40,50 +36,29 @@ static void null_prom_putc(char c) ...@@ -40,50 +36,29 @@ static void null_prom_putc(char c)
} }
/* these are functions provided by the bootloader */ /* these are functions provided by the bootloader */
static void (* prom_putc)(char c) = null_prom_putc; static void (* __prom_putc)(char c) = null_prom_putc;
void (* prom_printf)(const char * fmt, ...) = null_prom_printf;
void prom_putchar(char c)
{
__prom_putc(c);
}
void (* prom_display)(const char *string, int pos, int clear) = void (* prom_display)(const char *string, int pos, int clear) =
null_prom_display; null_prom_display;
void (* prom_monitor)(void) = null_prom_monitor; void (* prom_monitor)(void) = null_prom_monitor;
unsigned int lasat_ndelay_divider; unsigned int lasat_ndelay_divider;
#define PROM_PRINTFBUF_SIZE 256
static char prom_printfbuf[PROM_PRINTFBUF_SIZE];
static void real_prom_printf(const char * fmt, ...)
{
va_list ap;
int len;
char *c = prom_printfbuf;
int i;
va_start(ap, fmt);
len = vsnprintf(prom_printfbuf, PROM_PRINTFBUF_SIZE, fmt, ap);
va_end(ap);
/* output overflowed the buffer */
if (len < 0 || len > PROM_PRINTFBUF_SIZE)
len = PROM_PRINTFBUF_SIZE;
for (i=0; i < len; i++) {
if (*c == '\n')
prom_putc('\r');
prom_putc(*c++);
}
}
static void setup_prom_vectors(void) static void setup_prom_vectors(void)
{ {
u32 version = *(u32 *)(RESET_VECTOR + 0x90); u32 version = *(u32 *)(RESET_VECTOR + 0x90);
if (version >= 307) { if (version >= 307) {
prom_display = (void *)PROM_DISPLAY_ADDR; prom_display = (void *)PROM_DISPLAY_ADDR;
prom_putc = (void *)PROM_PUTC_ADDR; __prom_putc = (void *)PROM_PUTC_ADDR;
prom_printf = real_prom_printf;
prom_monitor = (void *)PROM_MONITOR_ADDR; prom_monitor = (void *)PROM_MONITOR_ADDR;
} }
prom_printf("prom vectors set up\n"); printk("prom vectors set up\n");
} }
static struct at93c_defs at93c_defs[N_MACHTYPES] = { static struct at93c_defs at93c_defs[N_MACHTYPES] = {
...@@ -101,11 +76,11 @@ void __init prom_init(void) ...@@ -101,11 +76,11 @@ void __init prom_init(void)
setup_prom_vectors(); setup_prom_vectors();
if (current_cpu_data.cputype == CPU_R5000) { if (current_cpu_data.cputype == CPU_R5000) {
prom_printf("LASAT 200 board\n"); printk("LASAT 200 board\n");
mips_machtype = MACH_LASAT_200; mips_machtype = MACH_LASAT_200;
lasat_ndelay_divider = LASAT_200_DIVIDER; lasat_ndelay_divider = LASAT_200_DIVIDER;
} else { } else {
prom_printf("LASAT 100 board\n"); printk("LASAT 100 board\n");
mips_machtype = MACH_LASAT_100; mips_machtype = MACH_LASAT_100;
lasat_ndelay_divider = LASAT_100_DIVIDER; lasat_ndelay_divider = LASAT_100_DIVIDER;
} }
......
...@@ -2,5 +2,4 @@ ...@@ -2,5 +2,4 @@
#define PROM_H #define PROM_H
extern void (* prom_display)(const char *string, int pos, int clear); extern void (* prom_display)(const char *string, int pos, int clear);
extern void (* prom_monitor)(void); extern void (* prom_monitor)(void);
extern void (* prom_printf)(const char * fmt, ...);
#endif #endif
...@@ -178,5 +178,5 @@ void __init plat_mem_setup(void) ...@@ -178,5 +178,5 @@ void __init plat_mem_setup(void)
/* Switch from prom exception handler to normal mode */ /* Switch from prom exception handler to normal mode */
change_c0_status(ST0_BEV,0); change_c0_status(ST0_BEV,0);
prom_printf("Lasat specific initialization complete\n"); pr_info("Lasat specific initialization complete\n");
} }
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
# Makefile for MIPS-specific library files.. # Makefile for MIPS-specific library files..
# #
lib-y += csum_partial.o memcpy.o memcpy-inatomic.o memset.o promlib.o \ lib-y += csum_partial.o memcpy.o memcpy-inatomic.o memset.o strlen_user.o \
strlen_user.o strncpy_user.o strnlen_user.o uncached.o strncpy_user.o strnlen_user.o uncached.o
obj-y += iomap.o obj-y += iomap.o
obj-$(CONFIG_PCI) += iomap-pci.o obj-$(CONFIG_PCI) += iomap-pci.o
......
#include <stdarg.h>
#include <linux/kernel.h>
extern void prom_putchar(char);
void prom_printf(char *fmt, ...)
{
va_list args;
char ppbuf[1024];
char *bptr;
va_start(args, fmt);
vsprintf(ppbuf, fmt, args);
bptr = ppbuf;
while (*bptr != 0) {
if (*bptr == '\n')
prom_putchar('\r');
prom_putchar(*bptr++);
}
va_end(args);
}
...@@ -18,7 +18,9 @@ ...@@ -18,7 +18,9 @@
# Makefile for the MIPS boards generic routines under Linux. # 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 cmdline.o time.o
obj-$(CONFIG_EARLY_PRINTK) += console.o
obj-$(CONFIG_PCI) += pci.o obj-$(CONFIG_PCI) += pci.o
obj-$(CONFIG_KGDB) += gdb_hook.o obj-$(CONFIG_KGDB) += gdb_hook.o
...@@ -17,10 +17,9 @@ ...@@ -17,10 +17,9 @@
* *
* Putting things on the screen/serial line using YAMONs facilities. * Putting things on the screen/serial line using YAMONs facilities.
*/ */
#include <linux/console.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h>
#include <linux/serial_reg.h> #include <linux/serial_reg.h>
#include <linux/spinlock.h>
#include <asm/io.h> #include <asm/io.h>
#ifdef CONFIG_MIPS_ATLAS #ifdef CONFIG_MIPS_ATLAS
...@@ -67,12 +66,3 @@ int prom_putchar(char c) ...@@ -67,12 +66,3 @@ int prom_putchar(char c)
return 1; return 1;
} }
char prom_getchar(void)
{
while (!(serial_in(UART_LSR) & UART_LSR_DR))
;
return serial_in(UART_RX);
}
...@@ -167,7 +167,7 @@ static void __init console_config(void) ...@@ -167,7 +167,7 @@ static void __init console_config(void)
flow = 'r'; flow = 'r';
sprintf (console_string, " console=ttyS0,%d%c%c%c", baud, parity, bits, flow); sprintf (console_string, " console=ttyS0,%d%c%c%c", baud, parity, bits, flow);
strcat (prom_getcmdline(), console_string); strcat (prom_getcmdline(), console_string);
prom_printf("Config serial console:%s\n", console_string); pr_info("Config serial console:%s\n", console_string);
} }
} }
#endif #endif
...@@ -210,8 +210,9 @@ void __init kgdb_config (void) ...@@ -210,8 +210,9 @@ void __init kgdb_config (void)
generic_getDebugChar = rs_getDebugChar; generic_getDebugChar = rs_getDebugChar;
} }
prom_printf("KGDB: Using serial line /dev/ttyS%d at %d for session, " pr_info("KGDB: Using serial line /dev/ttyS%d at %d for "
"please connect your debugger\n", line ? 1 : 0, speed); "session, please connect your debugger\n",
line ? 1 : 0, speed);
{ {
char *s; char *s;
...@@ -382,7 +383,7 @@ void __init prom_init(void) ...@@ -382,7 +383,7 @@ void __init prom_init(void)
board_nmi_handler_setup = mips_nmi_setup; board_nmi_handler_setup = mips_nmi_setup;
board_ejtag_handler_setup = mips_ejtag_setup; board_ejtag_handler_setup = mips_ejtag_setup;
prom_printf("\nLINUX started...\n"); pr_info("\nLINUX started...\n");
prom_init_cmdline(); prom_init_cmdline();
prom_meminit(); prom_meminit();
#ifdef CONFIG_SERIAL_8250_CONSOLE #ifdef CONFIG_SERIAL_8250_CONSOLE
......
...@@ -59,11 +59,12 @@ struct prom_pmemblock * __init prom_getmdesc(void) ...@@ -59,11 +59,12 @@ struct prom_pmemblock * __init prom_getmdesc(void)
/* otherwise look in the environment */ /* otherwise look in the environment */
memsize_str = prom_getenv("memsize"); memsize_str = prom_getenv("memsize");
if (!memsize_str) { 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; physical_memsize = 0x02000000;
} else { } else {
#ifdef DEBUG #ifdef DEBUG
prom_printf("prom_memsize = %s\n", memsize_str); pr_debug("prom_memsize = %s\n", memsize_str);
#endif #endif
physical_memsize = simple_strtol(memsize_str, NULL, 0); physical_memsize = simple_strtol(memsize_str, NULL, 0);
} }
...@@ -141,12 +142,12 @@ void __init prom_meminit(void) ...@@ -141,12 +142,12 @@ void __init prom_meminit(void)
struct prom_pmemblock *p; struct prom_pmemblock *p;
#ifdef DEBUG #ifdef DEBUG
prom_printf("YAMON MEMORY DESCRIPTOR dump:\n"); pr_debug("YAMON MEMORY DESCRIPTOR dump:\n");
p = prom_getmdesc(); p = prom_getmdesc();
while (p->size) { while (p->size) {
int i = 0; int i = 0;
prom_printf("[%d,%p]: base<%08lx> size<%08lx> type<%s>\n", pr_debug("[%d,%p]: base<%08lx> size<%08lx> type<%s>\n",
i, p, p->base, p->size, mtypes[p->type]); i, p, p->base, p->size, mtypes[p->type]);
p++; p++;
i++; i++;
} }
......
# #
# Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved. # 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 # 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 # under the terms of the GNU General Public License (Version 2) as
...@@ -15,5 +17,7 @@ ...@@ -15,5 +17,7 @@
# 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. # 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 obj-$(CONFIG_SMP) += sim_smp.o
/* /*
* 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 * 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 * under the terms of the GNU General Public License (Version 2) as
* published by the Free Software Foundation. * published by the Free Software Foundation.
...@@ -15,14 +12,14 @@ ...@@ -15,14 +12,14 @@
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. * 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/init.h>
#include <linux/kernel.h>
#include <linux/serial_reg.h> #include <linux/serial_reg.h>
#include <linux/spinlock.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/system.h>
static inline unsigned int serial_in(int offset) static inline unsigned int serial_in(int offset)
{ {
...@@ -34,41 +31,10 @@ static inline void serial_out(int offset, int value) ...@@ -34,41 +31,10 @@ static inline void serial_out(int offset, int value)
outb(value, 0x3f8 + offset); outb(value, 0x3f8 + offset);
} }
int putPromChar(char c) void __init prom_putchar(char c)
{ {
while ((serial_in(UART_LSR) & UART_LSR_THRE) == 0) while ((serial_in(UART_LSR) & UART_LSR_THRE) == 0)
; ;
serial_out(UART_TX, c); 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);
}
} }
...@@ -46,7 +46,7 @@ struct prom_pmemblock * __init prom_getmdesc(void) ...@@ -46,7 +46,7 @@ struct prom_pmemblock * __init prom_getmdesc(void)
unsigned int memsize; unsigned int memsize;
memsize = 0x02000000; 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)); memset(mdesc, 0, sizeof(mdesc));
......
...@@ -55,7 +55,7 @@ void __init plat_mem_setup(void) ...@@ -55,7 +55,7 @@ void __init plat_mem_setup(void)
serial_init(); serial_init();
board_time_init = sim_time_init; board_time_init = sim_time_init;
prom_printf("Linux started...\n"); pr_info("Linux started...\n");
#ifdef CONFIG_MIPS_MT_SMP #ifdef CONFIG_MIPS_MT_SMP
sanitize_tlb_entries(); sanitize_tlb_entries();
...@@ -66,7 +66,7 @@ void prom_init(void) ...@@ -66,7 +66,7 @@ void prom_init(void)
{ {
set_io_port_base(0xbfd00000); set_io_port_base(0xbfd00000);
prom_printf("\nLINUX started...\n"); pr_info("\nLINUX started...\n");
prom_init_cmdline(); prom_init_cmdline();
prom_meminit(); prom_meminit();
} }
...@@ -91,7 +91,7 @@ static void __init serial_init(void) ...@@ -91,7 +91,7 @@ static void __init serial_init(void)
s.timeout = 4; s.timeout = 4;
if (early_serial_setup(&s) != 0) { if (early_serial_setup(&s) != 0) {
prom_printf(KERN_ERR "Serial setup failed!\n"); printk(KERN_ERR "Serial setup failed!\n");
} }
#endif #endif
......
...@@ -77,66 +77,66 @@ static uint32_t extract_dc(unsigned short addr, int data); ...@@ -77,66 +77,66 @@ static uint32_t extract_dc(unsigned short addr, int data);
static inline void breakout_errctl(unsigned int val) static inline void breakout_errctl(unsigned int val)
{ {
if (val & CP0_ERRCTL_RECOVERABLE) if (val & CP0_ERRCTL_RECOVERABLE)
prom_printf(" recoverable"); printk(" recoverable");
if (val & CP0_ERRCTL_DCACHE) if (val & CP0_ERRCTL_DCACHE)
prom_printf(" dcache"); printk(" dcache");
if (val & CP0_ERRCTL_ICACHE) if (val & CP0_ERRCTL_ICACHE)
prom_printf(" icache"); printk(" icache");
if (val & CP0_ERRCTL_MULTIBUS) if (val & CP0_ERRCTL_MULTIBUS)
prom_printf(" multiple-buserr"); printk(" multiple-buserr");
prom_printf("\n"); printk("\n");
} }
static inline void breakout_cerri(unsigned int val) static inline void breakout_cerri(unsigned int val)
{ {
if (val & CP0_CERRI_TAG_PARITY) if (val & CP0_CERRI_TAG_PARITY)
prom_printf(" tag-parity"); printk(" tag-parity");
if (val & CP0_CERRI_DATA_PARITY) if (val & CP0_CERRI_DATA_PARITY)
prom_printf(" data-parity"); printk(" data-parity");
if (val & CP0_CERRI_EXTERNAL) if (val & CP0_CERRI_EXTERNAL)
prom_printf(" external"); printk(" external");
prom_printf("\n"); printk("\n");
} }
static inline void breakout_cerrd(unsigned int val) static inline void breakout_cerrd(unsigned int val)
{ {
switch (val & CP0_CERRD_CAUSES) { switch (val & CP0_CERRD_CAUSES) {
case CP0_CERRD_LOAD: case CP0_CERRD_LOAD:
prom_printf(" load,"); printk(" load,");
break; break;
case CP0_CERRD_STORE: case CP0_CERRD_STORE:
prom_printf(" store,"); printk(" store,");
break; break;
case CP0_CERRD_FILLWB: case CP0_CERRD_FILLWB:
prom_printf(" fill/wb,"); printk(" fill/wb,");
break; break;
case CP0_CERRD_COHERENCY: case CP0_CERRD_COHERENCY:
prom_printf(" coherency,"); printk(" coherency,");
break; break;
case CP0_CERRD_DUPTAG: case CP0_CERRD_DUPTAG:
prom_printf(" duptags,"); printk(" duptags,");
break; break;
default: default:
prom_printf(" NO CAUSE,"); printk(" NO CAUSE,");
break; break;
} }
if (!(val & CP0_CERRD_TYPES)) if (!(val & CP0_CERRD_TYPES))
prom_printf(" NO TYPE"); printk(" NO TYPE");
else { else {
if (val & CP0_CERRD_MULTIPLE) if (val & CP0_CERRD_MULTIPLE)
prom_printf(" multi-err"); printk(" multi-err");
if (val & CP0_CERRD_TAG_STATE) if (val & CP0_CERRD_TAG_STATE)
prom_printf(" tag-state"); printk(" tag-state");
if (val & CP0_CERRD_TAG_ADDRESS) if (val & CP0_CERRD_TAG_ADDRESS)
prom_printf(" tag-address"); printk(" tag-address");
if (val & CP0_CERRD_DATA_SBE) if (val & CP0_CERRD_DATA_SBE)
prom_printf(" data-SBE"); printk(" data-SBE");
if (val & CP0_CERRD_DATA_DBE) if (val & CP0_CERRD_DATA_DBE)
prom_printf(" data-DBE"); printk(" data-DBE");
if (val & CP0_CERRD_EXTERNAL) if (val & CP0_CERRD_EXTERNAL)
prom_printf(" external"); printk(" external");
} }
prom_printf("\n"); printk("\n");
} }
#ifndef CONFIG_SIBYTE_BUS_WATCHER #ifndef CONFIG_SIBYTE_BUS_WATCHER
...@@ -157,18 +157,18 @@ static void check_bus_watcher(void) ...@@ -157,18 +157,18 @@ static void check_bus_watcher(void)
l2_tag = in64(IO_SPACE_BASE | A_L2_ECC_TAG); l2_tag = in64(IO_SPACE_BASE | A_L2_ECC_TAG);
#endif #endif
memio_err = csr_in32(IOADDR(A_BUS_MEM_IO_ERRORS)); memio_err = csr_in32(IOADDR(A_BUS_MEM_IO_ERRORS));
prom_printf("Bus watcher error counters: %08x %08x\n", l2_err, memio_err); printk("Bus watcher error counters: %08x %08x\n", l2_err, memio_err);
prom_printf("\nLast recorded signature:\n"); printk("\nLast recorded signature:\n");
prom_printf("Request %02x from %d, answered by %d with Dcode %d\n", printk("Request %02x from %d, answered by %d with Dcode %d\n",
(unsigned int)(G_SCD_BERR_TID(status) & 0x3f), (unsigned int)(G_SCD_BERR_TID(status) & 0x3f),
(int)(G_SCD_BERR_TID(status) >> 6), (int)(G_SCD_BERR_TID(status) >> 6),
(int)G_SCD_BERR_RID(status), (int)G_SCD_BERR_RID(status),
(int)G_SCD_BERR_DCODE(status)); (int)G_SCD_BERR_DCODE(status));
#ifdef DUMP_L2_ECC_TAG_ON_ERROR #ifdef DUMP_L2_ECC_TAG_ON_ERROR
prom_printf("Last L2 tag w/ bad ECC: %016llx\n", l2_tag); printk("Last L2 tag w/ bad ECC: %016llx\n", l2_tag);
#endif #endif
} else { } else {
prom_printf("Bus watcher indicates no error\n"); printk("Bus watcher indicates no error\n");
} }
} }
#else #else
...@@ -187,11 +187,11 @@ asmlinkage void sb1_cache_error(void) ...@@ -187,11 +187,11 @@ asmlinkage void sb1_cache_error(void)
#else #else
csr_out32(M_SCD_TRACE_CFG_FREEZE, IO_SPACE_BASE | A_SCD_TRACE_CFG); csr_out32(M_SCD_TRACE_CFG_FREEZE, IO_SPACE_BASE | A_SCD_TRACE_CFG);
#endif #endif
prom_printf("Trace buffer frozen\n"); printk("Trace buffer frozen\n");
#endif #endif
prom_printf("Cache error exception on CPU %x:\n", printk("Cache error exception on CPU %x:\n",
(read_c0_prid() >> 25) & 0x7); (read_c0_prid() >> 25) & 0x7);
__asm__ __volatile__ ( __asm__ __volatile__ (
" .set push\n\t" " .set push\n\t"
...@@ -209,43 +209,43 @@ asmlinkage void sb1_cache_error(void) ...@@ -209,43 +209,43 @@ asmlinkage void sb1_cache_error(void)
"=r" (dpahi), "=r" (dpalo), "=r" (eepc)); "=r" (dpahi), "=r" (dpalo), "=r" (eepc));
cerr_dpa = (((uint64_t)dpahi) << 32) | dpalo; cerr_dpa = (((uint64_t)dpahi) << 32) | dpalo;
prom_printf(" c0_errorepc == %08x\n", eepc); printk(" c0_errorepc == %08x\n", eepc);
prom_printf(" c0_errctl == %08x", errctl); printk(" c0_errctl == %08x", errctl);
breakout_errctl(errctl); breakout_errctl(errctl);
if (errctl & CP0_ERRCTL_ICACHE) { if (errctl & CP0_ERRCTL_ICACHE) {
prom_printf(" c0_cerr_i == %08x", cerr_i); printk(" c0_cerr_i == %08x", cerr_i);
breakout_cerri(cerr_i); breakout_cerri(cerr_i);
if (CP0_CERRI_IDX_VALID(cerr_i)) { if (CP0_CERRI_IDX_VALID(cerr_i)) {
/* Check index of EPC, allowing for delay slot */ /* Check index of EPC, allowing for delay slot */
if (((eepc & SB1_CACHE_INDEX_MASK) != (cerr_i & SB1_CACHE_INDEX_MASK)) && if (((eepc & SB1_CACHE_INDEX_MASK) != (cerr_i & SB1_CACHE_INDEX_MASK)) &&
((eepc & SB1_CACHE_INDEX_MASK) != ((cerr_i & SB1_CACHE_INDEX_MASK) - 4))) ((eepc & SB1_CACHE_INDEX_MASK) != ((cerr_i & SB1_CACHE_INDEX_MASK) - 4)))
prom_printf(" cerr_i idx doesn't match eepc\n"); printk(" cerr_i idx doesn't match eepc\n");
else { else {
res = extract_ic(cerr_i & SB1_CACHE_INDEX_MASK, res = extract_ic(cerr_i & SB1_CACHE_INDEX_MASK,
(cerr_i & CP0_CERRI_DATA) != 0); (cerr_i & CP0_CERRI_DATA) != 0);
if (!(res & cerr_i)) if (!(res & cerr_i))
prom_printf("...didn't see indicated icache problem\n"); printk("...didn't see indicated icache problem\n");
} }
} }
} }
if (errctl & CP0_ERRCTL_DCACHE) { if (errctl & CP0_ERRCTL_DCACHE) {
prom_printf(" c0_cerr_d == %08x", cerr_d); printk(" c0_cerr_d == %08x", cerr_d);
breakout_cerrd(cerr_d); breakout_cerrd(cerr_d);
if (CP0_CERRD_DPA_VALID(cerr_d)) { if (CP0_CERRD_DPA_VALID(cerr_d)) {
prom_printf(" c0_cerr_dpa == %010llx\n", cerr_dpa); printk(" c0_cerr_dpa == %010llx\n", cerr_dpa);
if (!CP0_CERRD_IDX_VALID(cerr_d)) { if (!CP0_CERRD_IDX_VALID(cerr_d)) {
res = extract_dc(cerr_dpa & SB1_CACHE_INDEX_MASK, res = extract_dc(cerr_dpa & SB1_CACHE_INDEX_MASK,
(cerr_d & CP0_CERRD_DATA) != 0); (cerr_d & CP0_CERRD_DATA) != 0);
if (!(res & cerr_d)) if (!(res & cerr_d))
prom_printf("...didn't see indicated dcache problem\n"); printk("...didn't see indicated dcache problem\n");
} else { } else {
if ((cerr_dpa & SB1_CACHE_INDEX_MASK) != (cerr_d & SB1_CACHE_INDEX_MASK)) if ((cerr_dpa & SB1_CACHE_INDEX_MASK) != (cerr_d & SB1_CACHE_INDEX_MASK))
prom_printf(" cerr_d idx doesn't match cerr_dpa\n"); printk(" cerr_d idx doesn't match cerr_dpa\n");
else { else {
res = extract_dc(cerr_d & SB1_CACHE_INDEX_MASK, res = extract_dc(cerr_d & SB1_CACHE_INDEX_MASK,
(cerr_d & CP0_CERRD_DATA) != 0); (cerr_d & CP0_CERRD_DATA) != 0);
if (!(res & cerr_d)) if (!(res & cerr_d))
prom_printf("...didn't see indicated problem\n"); printk("...didn't see indicated problem\n");
} }
} }
} }
...@@ -334,7 +334,7 @@ static uint32_t extract_ic(unsigned short addr, int data) ...@@ -334,7 +334,7 @@ static uint32_t extract_ic(unsigned short addr, int data)
uint8_t lru; uint8_t lru;
int res = 0; int res = 0;
prom_printf("Icache index 0x%04x ", addr); printk("Icache index 0x%04x ", addr);
for (way = 0; way < 4; way++) { for (way = 0; way < 4; way++) {
/* Index-load-tag-I */ /* Index-load-tag-I */
__asm__ __volatile__ ( __asm__ __volatile__ (
...@@ -354,7 +354,7 @@ static uint32_t extract_ic(unsigned short addr, int data) ...@@ -354,7 +354,7 @@ static uint32_t extract_ic(unsigned short addr, int data)
taglo = ((unsigned long long)taglohi << 32) | taglolo; taglo = ((unsigned long long)taglohi << 32) | taglolo;
if (way == 0) { if (way == 0) {
lru = (taghi >> 14) & 0xff; lru = (taghi >> 14) & 0xff;
prom_printf("[Bank %d Set 0x%02x] LRU > %d %d %d %d > MRU\n", printk("[Bank %d Set 0x%02x] LRU > %d %d %d %d > MRU\n",
((addr >> 5) & 0x3), /* bank */ ((addr >> 5) & 0x3), /* bank */
((addr >> 7) & 0x3f), /* index */ ((addr >> 7) & 0x3f), /* index */
(lru & 0x3), (lru & 0x3),
...@@ -369,19 +369,19 @@ static uint32_t extract_ic(unsigned short addr, int data) ...@@ -369,19 +369,19 @@ static uint32_t extract_ic(unsigned short addr, int data)
if (valid) { if (valid) {
tlo_tmp = taglo & 0xfff3ff; tlo_tmp = taglo & 0xfff3ff;
if (((taglo >> 10) & 1) ^ range_parity(tlo_tmp, 23, 0)) { if (((taglo >> 10) & 1) ^ range_parity(tlo_tmp, 23, 0)) {
prom_printf(" ** bad parity in VTag0/G/ASID\n"); printk(" ** bad parity in VTag0/G/ASID\n");
res |= CP0_CERRI_TAG_PARITY; res |= CP0_CERRI_TAG_PARITY;
} }
if (((taglo >> 11) & 1) ^ range_parity(taglo, 63, 24)) { if (((taglo >> 11) & 1) ^ range_parity(taglo, 63, 24)) {
prom_printf(" ** bad parity in R/VTag1\n"); printk(" ** bad parity in R/VTag1\n");
res |= CP0_CERRI_TAG_PARITY; res |= CP0_CERRI_TAG_PARITY;
} }
} }
if (valid ^ ((taghi >> 27) & 1)) { if (valid ^ ((taghi >> 27) & 1)) {
prom_printf(" ** bad parity for valid bit\n"); printk(" ** bad parity for valid bit\n");
res |= CP0_CERRI_TAG_PARITY; res |= CP0_CERRI_TAG_PARITY;
} }
prom_printf(" %d [VA %016llx] [Vld? %d] raw tags: %08X-%016llX\n", printk(" %d [VA %016llx] [Vld? %d] raw tags: %08X-%016llX\n",
way, va, valid, taghi, taglo); way, va, valid, taghi, taglo);
if (data) { if (data) {
...@@ -407,21 +407,21 @@ static uint32_t extract_ic(unsigned short addr, int data) ...@@ -407,21 +407,21 @@ static uint32_t extract_ic(unsigned short addr, int data)
: "r" ((way << 13) | addr | (offset << 3))); : "r" ((way << 13) | addr | (offset << 3)));
predecode = (datahi >> 8) & 0xff; predecode = (datahi >> 8) & 0xff;
if (((datahi >> 16) & 1) != (uint32_t)range_parity(predecode, 7, 0)) { if (((datahi >> 16) & 1) != (uint32_t)range_parity(predecode, 7, 0)) {
prom_printf(" ** bad parity in predecode\n"); printk(" ** bad parity in predecode\n");
res |= CP0_CERRI_DATA_PARITY; res |= CP0_CERRI_DATA_PARITY;
} }
/* XXXKW should/could check predecode bits themselves */ /* XXXKW should/could check predecode bits themselves */
if (((datahi >> 4) & 0xf) ^ inst_parity(insta)) { if (((datahi >> 4) & 0xf) ^ inst_parity(insta)) {
prom_printf(" ** bad parity in instruction a\n"); printk(" ** bad parity in instruction a\n");
res |= CP0_CERRI_DATA_PARITY; res |= CP0_CERRI_DATA_PARITY;
} }
if ((datahi & 0xf) ^ inst_parity(instb)) { if ((datahi & 0xf) ^ inst_parity(instb)) {
prom_printf(" ** bad parity in instruction b\n"); printk(" ** bad parity in instruction b\n");
res |= CP0_CERRI_DATA_PARITY; res |= CP0_CERRI_DATA_PARITY;
} }
prom_printf(" %05X-%08X%08X", datahi, insta, instb); printk(" %05X-%08X%08X", datahi, insta, instb);
} }
prom_printf("\n"); printk("\n");
} }
} }
return res; return res;
...@@ -489,7 +489,7 @@ static uint32_t extract_dc(unsigned short addr, int data) ...@@ -489,7 +489,7 @@ static uint32_t extract_dc(unsigned short addr, int data)
uint8_t ecc, lru; uint8_t ecc, lru;
int res = 0; int res = 0;
prom_printf("Dcache index 0x%04x ", addr); printk("Dcache index 0x%04x ", addr);
for (way = 0; way < 4; way++) { for (way = 0; way < 4; way++) {
__asm__ __volatile__ ( __asm__ __volatile__ (
" .set push\n\t" " .set push\n\t"
...@@ -509,7 +509,7 @@ static uint32_t extract_dc(unsigned short addr, int data) ...@@ -509,7 +509,7 @@ static uint32_t extract_dc(unsigned short addr, int data)
pa = (taglo & 0xFFFFFFE000ULL) | addr; pa = (taglo & 0xFFFFFFE000ULL) | addr;
if (way == 0) { if (way == 0) {
lru = (taghi >> 14) & 0xff; lru = (taghi >> 14) & 0xff;
prom_printf("[Bank %d Set 0x%02x] LRU > %d %d %d %d > MRU\n", printk("[Bank %d Set 0x%02x] LRU > %d %d %d %d > MRU\n",
((addr >> 11) & 0x2) | ((addr >> 5) & 1), /* bank */ ((addr >> 11) & 0x2) | ((addr >> 5) & 1), /* bank */
((addr >> 6) & 0x3f), /* index */ ((addr >> 6) & 0x3f), /* index */
(lru & 0x3), (lru & 0x3),
...@@ -519,15 +519,15 @@ static uint32_t extract_dc(unsigned short addr, int data) ...@@ -519,15 +519,15 @@ static uint32_t extract_dc(unsigned short addr, int data)
} }
state = (taghi >> 25) & 0x1f; state = (taghi >> 25) & 0x1f;
valid = DC_TAG_VALID(state); valid = DC_TAG_VALID(state);
prom_printf(" %d [PA %010llx] [state %s (%02x)] raw tags: %08X-%016llX\n", printk(" %d [PA %010llx] [state %s (%02x)] raw tags: %08X-%016llX\n",
way, pa, dc_state_str(state), state, taghi, taglo); way, pa, dc_state_str(state), state, taghi, taglo);
if (valid) { if (valid) {
if (((taglo >> 11) & 1) ^ range_parity(taglo, 39, 26)) { if (((taglo >> 11) & 1) ^ range_parity(taglo, 39, 26)) {
prom_printf(" ** bad parity in PTag1\n"); printk(" ** bad parity in PTag1\n");
res |= CP0_CERRD_TAG_ADDRESS; res |= CP0_CERRD_TAG_ADDRESS;
} }
if (((taglo >> 10) & 1) ^ range_parity(taglo, 25, 13)) { if (((taglo >> 10) & 1) ^ range_parity(taglo, 25, 13)) {
prom_printf(" ** bad parity in PTag0\n"); printk(" ** bad parity in PTag0\n");
res |= CP0_CERRD_TAG_ADDRESS; res |= CP0_CERRD_TAG_ADDRESS;
} }
} else { } else {
...@@ -567,13 +567,13 @@ static uint32_t extract_dc(unsigned short addr, int data) ...@@ -567,13 +567,13 @@ static uint32_t extract_dc(unsigned short addr, int data)
} }
res |= (bits == 1) ? CP0_CERRD_DATA_SBE : CP0_CERRD_DATA_DBE; res |= (bits == 1) ? CP0_CERRD_DATA_SBE : CP0_CERRD_DATA_DBE;
} }
prom_printf(" %02X-%016llX", datahi, datalo); printk(" %02X-%016llX", datahi, datalo);
} }
prom_printf("\n"); printk("\n");
if (bad_ecc) if (bad_ecc)
prom_printf(" dwords w/ bad ECC: %d %d %d %d\n", printk(" dwords w/ bad ECC: %d %d %d %d\n",
!!(bad_ecc & 8), !!(bad_ecc & 4), !!(bad_ecc & 8), !!(bad_ecc & 4),
!!(bad_ecc & 2), !!(bad_ecc & 1)); !!(bad_ecc & 2), !!(bad_ecc & 1));
} }
} }
return res; return res;
......
...@@ -74,11 +74,6 @@ void prom_putchar(char c) ...@@ -74,11 +74,6 @@ void prom_putchar(char c)
uart->iu_thr = c; uart->iu_thr = c;
} }
char __init prom_getchar(void)
{
return 0;
}
static void inline ja_console_probe(void) static void inline ja_console_probe(void)
{ {
struct uart_port up; struct uart_port up;
......
...@@ -112,7 +112,7 @@ void __init prom_free_prom_memory(void) ...@@ -112,7 +112,7 @@ void __init prom_free_prom_memory(void)
extern int pnx8550_console_port; extern int pnx8550_console_port;
/* used by prom_printf */ /* used by early printk */
void prom_putchar(char c) void prom_putchar(char c)
{ {
if (pnx8550_console_port != -1) { if (pnx8550_console_port != -1) {
......
...@@ -41,8 +41,6 @@ ...@@ -41,8 +41,6 @@
#include <uart.h> #include <uart.h>
#include <nand.h> #include <nand.h>
extern void prom_printf(char *fmt, ...);
extern void __init board_setup(void); extern void __init board_setup(void);
extern void pnx8550_machine_restart(char *); extern void pnx8550_machine_restart(char *);
extern void pnx8550_machine_halt(void); extern void pnx8550_machine_halt(void);
...@@ -51,7 +49,6 @@ extern struct resource ioport_resource; ...@@ -51,7 +49,6 @@ extern struct resource ioport_resource;
extern struct resource iomem_resource; extern struct resource iomem_resource;
extern void pnx8550_time_init(void); extern void pnx8550_time_init(void);
extern void rs_kgdb_hook(int tty_no); extern void rs_kgdb_hook(int tty_no);
extern void prom_printf(char *fmt, ...);
extern char *prom_getcmdline(void); extern char *prom_getcmdline(void);
struct resource standard_io_resources[] = { struct resource standard_io_resources[] = {
...@@ -141,7 +138,7 @@ void __init plat_mem_setup(void) ...@@ -141,7 +138,7 @@ void __init plat_mem_setup(void)
argptr += strlen("console=ttyS"); argptr += strlen("console=ttyS");
pnx8550_console_port = *argptr == '0' ? 0 : 1; pnx8550_console_port = *argptr == '0' ? 0 : 1;
/* We must initialize the UART (console) before prom_printf */ /* We must initialize the UART (console) before early printk */
/* Set LCR to 8-bit and BAUD to 38400 (no 5) */ /* Set LCR to 8-bit and BAUD to 38400 (no 5) */
ip3106_lcr(UART_BASE, pnx8550_console_port) = ip3106_lcr(UART_BASE, pnx8550_console_port) =
PNX8XXX_UART_LCR_8BIT; PNX8XXX_UART_LCR_8BIT;
...@@ -155,8 +152,8 @@ void __init plat_mem_setup(void) ...@@ -155,8 +152,8 @@ void __init plat_mem_setup(void)
argptr += strlen("kgdb=ttyS"); argptr += strlen("kgdb=ttyS");
line = *argptr == '0' ? 0 : 1; line = *argptr == '0' ? 0 : 1;
rs_kgdb_hook(line); rs_kgdb_hook(line);
prom_printf("KGDB: Using ttyS%i for session, " pr_info("KGDB: Using ttyS%i for session, "
"please connect your debugger\n", line ? 1 : 0); "please connect your debugger\n", line ? 1 : 0);
} }
#endif #endif
return; return;
......
...@@ -107,8 +107,3 @@ void prom_putchar(char c) ...@@ -107,8 +107,3 @@ void prom_putchar(char c)
while ((readb_outer_space(lsr) & 0x20) == 0); while ((readb_outer_space(lsr) & 0x20) == 0);
writeb_outer_space(thr, c); writeb_outer_space(thr, c);
} }
char __init prom_getchar(void)
{
return 0;
}
...@@ -6,12 +6,6 @@ ...@@ -6,12 +6,6 @@
* Copyright (C) 2001, 2002 Ralf Baechle * Copyright (C) 2001, 2002 Ralf Baechle
*/ */
#include <linux/init.h> #include <linux/init.h>
#include <linux/console.h>
#include <linux/kdev_t.h>
#include <linux/major.h>
#include <linux/termios.h>
#include <linux/sched.h>
#include <linux/tty.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/semaphore.h> #include <asm/semaphore.h>
...@@ -38,37 +32,10 @@ static inline struct ioc3_uartregs *console_uart(void) ...@@ -38,37 +32,10 @@ static inline struct ioc3_uartregs *console_uart(void)
return &ioc3->sregs.uarta; return &ioc3->sregs.uarta;
} }
void prom_putchar(char c) void __init prom_putchar(char c)
{ {
struct ioc3_uartregs *uart = console_uart(); struct ioc3_uartregs *uart = console_uart();
while ((uart->iu_lsr & 0x20) == 0); while ((uart->iu_lsr & 0x20) == 0);
uart->iu_thr = c; uart->iu_thr = c;
} }
static void ioc3_console_write(struct console *con, const char *s, unsigned n)
{
while (n-- && *s) {
if (*s == '\n')
prom_putchar('\r');
prom_putchar(*s);
s++;
}
}
static struct console ioc3_console = {
.name = "ioc3",
.write = ioc3_console_write,
.flags = CON_PRINTBUFFER | CON_BOOT,
.index = -1
};
__init void ip27_setup_console(void)
{
register_console(&ioc3_console);
}
void __init disable_early_printk(void)
{
unregister_console(&ioc3_console);
}
...@@ -116,6 +116,7 @@ config SB1_CERR_STALL ...@@ -116,6 +116,7 @@ config SB1_CERR_STALL
config SIBYTE_CFE config SIBYTE_CFE
bool "Booting from CFE" bool "Booting from CFE"
depends on SIBYTE_SB1xxx_SOC depends on SIBYTE_SB1xxx_SOC
select SYS_HAS_EARLY_PRINTK
help help
Make use of the CFE API for enumerating available memory, Make use of the CFE API for enumerating available memory,
controlling secondary CPUs, and possibly console output. controlling secondary CPUs, and possibly console output.
...@@ -131,6 +132,7 @@ config SIBYTE_CFE_CONSOLE ...@@ -131,6 +132,7 @@ config SIBYTE_CFE_CONSOLE
config SIBYTE_STANDALONE config SIBYTE_STANDALONE
bool bool
depends on SIBYTE_SB1xxx_SOC && !SIBYTE_CFE depends on SIBYTE_SB1xxx_SOC && !SIBYTE_CFE
select SYS_HAS_EARLY_PRINTK
default y default y
config SIBYTE_STANDALONE_RAM_SIZE config SIBYTE_STANDALONE_RAM_SIZE
......
...@@ -420,7 +420,7 @@ void __init arch_init_irq(void) ...@@ -420,7 +420,7 @@ void __init arch_init_irq(void)
#ifdef CONFIG_GDB_CONSOLE #ifdef CONFIG_GDB_CONSOLE
register_gdb_console(); register_gdb_console();
#endif #endif
prom_printf("Waiting for GDB on UART port %d\n", kgdb_port); printk("Waiting for GDB on UART port %d\n", kgdb_port);
set_debug_traps(); set_debug_traps();
breakpoint(); breakpoint();
} }
......
...@@ -69,7 +69,7 @@ static inline int sys_rev_decode(void) ...@@ -69,7 +69,7 @@ static inline int sys_rev_decode(void)
break; break;
default: default:
prom_printf("Unknown part type %x\n", part_type); printk("Unknown part type %x\n", part_type);
ret = 1; ret = 1;
break; break;
} }
...@@ -102,7 +102,7 @@ static inline int setup_bcm1x80_bcm1x55(void) ...@@ -102,7 +102,7 @@ static inline int setup_bcm1x80_bcm1x55(void)
pass_str = "B0 (pass2)"; pass_str = "B0 (pass2)";
break; break;
default: default:
prom_printf("Unknown %s rev %x\n", soc_str, soc_pass); printk("Unknown %s rev %x\n", soc_str, soc_pass);
periph_rev = 1; periph_rev = 1;
pass_str = "Unknown Revision"; pass_str = "Unknown Revision";
break; break;
...@@ -122,14 +122,14 @@ void bcm1480_setup(void) ...@@ -122,14 +122,14 @@ void bcm1480_setup(void)
soc_pass = G_SYS_REVISION(sys_rev); soc_pass = G_SYS_REVISION(sys_rev);
if (sys_rev_decode()) { if (sys_rev_decode()) {
prom_printf("Restart after failure to identify SiByte chip\n"); printk("Restart after failure to identify SiByte chip\n");
machine_restart(NULL); machine_restart(NULL);
} }
plldiv = G_BCM1480_SYS_PLL_DIV(__raw_readq(IOADDR(A_SCD_SYSTEM_CFG))); plldiv = G_BCM1480_SYS_PLL_DIV(__raw_readq(IOADDR(A_SCD_SYSTEM_CFG)));
zbbus_mhz = ((plldiv >> 1) * 50) + ((plldiv & 1) * 25); zbbus_mhz = ((plldiv >> 1) * 50) + ((plldiv & 1) * 25);
prom_printf("Broadcom SiByte %s %s @ %d MHz (SB-1A rev %d)\n", printk("Broadcom SiByte %s %s @ %d MHz (SB-1A rev %d)\n",
soc_str, pass_str, zbbus_mhz * 2, sb1_pass); soc_str, pass_str, zbbus_mhz * 2, sb1_pass);
prom_printf("Board type: %s\n", get_system_type()); printk("Board type: %s\n", get_system_type());
} }
...@@ -221,10 +221,10 @@ static int __init initrd_setup(char *str) ...@@ -221,10 +221,10 @@ static int __init initrd_setup(char *str)
goto fail; goto fail;
} }
initrd_end = initrd_start + initrd_size; initrd_end = initrd_start + initrd_size;
prom_printf("Found initrd of %lx@%lx\n", initrd_size, initrd_start); printk("Found initrd of %lx@%lx\n", initrd_size, initrd_start);
return 1; return 1;
fail: fail:
prom_printf("Bad initrd argument. Disabling initrd\n"); printk("Bad initrd argument. Disabling initrd\n");
initrd_start = 0; initrd_start = 0;
initrd_end = 0; initrd_end = 0;
return 1; return 1;
...@@ -281,7 +281,7 @@ void __init prom_init(void) ...@@ -281,7 +281,7 @@ void __init prom_init(void)
} }
if (cfe_eptseal != CFE_EPTSEAL) { if (cfe_eptseal != CFE_EPTSEAL) {
/* too early for panic to do any good */ /* too early for panic to do any good */
prom_printf("CFE's entrypoint seal doesn't match. Spinning."); printk("CFE's entrypoint seal doesn't match. Spinning.");
while (1) ; while (1) ;
} }
cfe_init(cfe_handle, cfe_ept); cfe_init(cfe_handle, cfe_ept);
...@@ -303,7 +303,7 @@ void __init prom_init(void) ...@@ -303,7 +303,7 @@ void __init prom_init(void)
} else { } else {
/* The loader should have set the command line */ /* The loader should have set the command line */
/* too early for panic to do any good */ /* too early for panic to do any good */
prom_printf("LINUX_CMDLINE not defined in cfe."); printk("LINUX_CMDLINE not defined in cfe.");
while (1) ; while (1) ;
} }
} }
......
...@@ -67,7 +67,7 @@ static int __init sys_rev_decode(void) ...@@ -67,7 +67,7 @@ static int __init sys_rev_decode(void)
ret = setup_bcm112x(); ret = setup_bcm112x();
break; break;
default: default:
prom_printf("Unknown SOC type %x\n", soc_type); printk("Unknown SOC type %x\n", soc_type);
ret = 1; ret = 1;
break; break;
} }
...@@ -112,7 +112,7 @@ static int __init setup_bcm1250(void) ...@@ -112,7 +112,7 @@ static int __init setup_bcm1250(void)
pass_str = "A0-A6"; pass_str = "A0-A6";
war_pass = K_SYS_REVISION_BCM1250_PASS2; war_pass = K_SYS_REVISION_BCM1250_PASS2;
} else { } else {
prom_printf("Unknown BCM1250 rev %x\n", soc_pass); printk("Unknown BCM1250 rev %x\n", soc_pass);
ret = 1; ret = 1;
} }
break; break;
...@@ -140,7 +140,7 @@ static int __init setup_bcm112x(void) ...@@ -140,7 +140,7 @@ static int __init setup_bcm112x(void)
pass_str = "A2"; pass_str = "A2";
break; break;
default: default:
prom_printf("Unknown %s rev %x\n", soc_str, soc_pass); printk("Unknown %s rev %x\n", soc_str, soc_pass);
ret = 1; ret = 1;
} }
return ret; return ret;
...@@ -158,21 +158,21 @@ void __init sb1250_setup(void) ...@@ -158,21 +158,21 @@ void __init sb1250_setup(void)
soc_pass = G_SYS_REVISION(sys_rev); soc_pass = G_SYS_REVISION(sys_rev);
if (sys_rev_decode()) { if (sys_rev_decode()) {
prom_printf("Restart after failure to identify SiByte chip\n"); printk("Restart after failure to identify SiByte chip\n");
machine_restart(NULL); machine_restart(NULL);
} }
plldiv = G_SYS_PLL_DIV(__raw_readq(IOADDR(A_SCD_SYSTEM_CFG))); plldiv = G_SYS_PLL_DIV(__raw_readq(IOADDR(A_SCD_SYSTEM_CFG)));
zbbus_mhz = ((plldiv >> 1) * 50) + ((plldiv & 1) * 25); zbbus_mhz = ((plldiv >> 1) * 50) + ((plldiv & 1) * 25);
prom_printf("Broadcom SiByte %s %s @ %d MHz (SB1 rev %d)\n", printk("Broadcom SiByte %s %s @ %d MHz (SB1 rev %d)\n",
soc_str, pass_str, zbbus_mhz * 2, sb1_pass); soc_str, pass_str, zbbus_mhz * 2, sb1_pass);
prom_printf("Board type: %s\n", get_system_type()); printk("Board type: %s\n", get_system_type());
switch (war_pass) { switch (war_pass) {
case K_SYS_REVISION_BCM1250_PASS1: case K_SYS_REVISION_BCM1250_PASS1:
#ifndef CONFIG_SB1_PASS_1_WORKAROUNDS #ifndef CONFIG_SB1_PASS_1_WORKAROUNDS
prom_printf("@@@@ This is a BCM1250 A0-A2 (Pass 1) board, " printk("@@@@ This is a BCM1250 A0-A2 (Pass 1) board, "
"and the kernel doesn't have the proper " "and the kernel doesn't have the proper "
"workarounds compiled in. @@@@\n"); "workarounds compiled in. @@@@\n");
bad_config = 1; bad_config = 1;
...@@ -182,27 +182,27 @@ void __init sb1250_setup(void) ...@@ -182,27 +182,27 @@ void __init sb1250_setup(void)
/* Pass 2 - easiest as default for now - so many numbers */ /* Pass 2 - easiest as default for now - so many numbers */
#if !defined(CONFIG_SB1_PASS_2_WORKAROUNDS) || \ #if !defined(CONFIG_SB1_PASS_2_WORKAROUNDS) || \
!defined(CONFIG_SB1_PASS_2_1_WORKAROUNDS) !defined(CONFIG_SB1_PASS_2_1_WORKAROUNDS)
prom_printf("@@@@ This is a BCM1250 A3-A10 board, and the " printk("@@@@ This is a BCM1250 A3-A10 board, and the "
"kernel doesn't have the proper workarounds " "kernel doesn't have the proper workarounds "
"compiled in. @@@@\n"); "compiled in. @@@@\n");
bad_config = 1; bad_config = 1;
#endif #endif
#ifdef CONFIG_CPU_HAS_PREFETCH #ifdef CONFIG_CPU_HAS_PREFETCH
prom_printf("@@@@ Prefetches may be enabled in this kernel, " printk("@@@@ Prefetches may be enabled in this kernel, "
"but are buggy on this board. @@@@\n"); "but are buggy on this board. @@@@\n");
bad_config = 1; bad_config = 1;
#endif #endif
break; break;
case K_SYS_REVISION_BCM1250_PASS2_2: case K_SYS_REVISION_BCM1250_PASS2_2:
#ifndef CONFIG_SB1_PASS_2_WORKAROUNDS #ifndef CONFIG_SB1_PASS_2_WORKAROUNDS
prom_printf("@@@@ This is a BCM1250 B1/B2. board, and the " printk("@@@@ This is a BCM1250 B1/B2. board, and the "
"kernel doesn't have the proper workarounds " "kernel doesn't have the proper workarounds "
"compiled in. @@@@\n"); "compiled in. @@@@\n");
bad_config = 1; bad_config = 1;
#endif #endif
#if defined(CONFIG_SB1_PASS_2_1_WORKAROUNDS) || \ #if defined(CONFIG_SB1_PASS_2_1_WORKAROUNDS) || \
!defined(CONFIG_CPU_HAS_PREFETCH) !defined(CONFIG_CPU_HAS_PREFETCH)
prom_printf("@@@@ This is a BCM1250 B1/B2, but the kernel is " printk("@@@@ This is a BCM1250 B1/B2, but the kernel is "
"conservatively configured for an 'A' stepping. " "conservatively configured for an 'A' stepping. "
"@@@@\n"); "@@@@\n");
#endif #endif
...@@ -211,7 +211,7 @@ void __init sb1250_setup(void) ...@@ -211,7 +211,7 @@ void __init sb1250_setup(void)
break; break;
} }
if (bad_config) { if (bad_config) {
prom_printf("Invalid configuration for this chip.\n"); printk("Invalid configuration for this chip.\n");
machine_restart(NULL); machine_restart(NULL);
} }
} }
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
* Copyright (C) 2005-2006 Thomas Bogendoerfer (tsbogend@alpha.franken.de) * Copyright (C) 2005-2006 Thomas Bogendoerfer (tsbogend@alpha.franken.de)
*/ */
#define DEBUG
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/string.h> #include <linux/string.h>
...@@ -32,14 +34,13 @@ ...@@ -32,14 +34,13 @@
#define PROM_ENTRY(x) (PROM_VEC + (x)) #define PROM_ENTRY(x) (PROM_VEC + (x))
#define DEBUG
#ifdef DEBUG
#define DBG_PRINTF(x...) prom_printf(x)
#else
#define DBG_PRINTF(x...)
#endif
static int *(*__prom_putchar)(int) = (int *(*)(int))PROM_ENTRY(PROM_PUTCHAR); static int *(*__prom_putchar)(int) = (int *(*)(int))PROM_ENTRY(PROM_PUTCHAR);
void prom_putchar(char c)
{
__prom_putchar(c);
}
static char *(*__prom_getenv)(char *) = (char *(*)(char *))PROM_ENTRY(PROM_GETENV); static char *(*__prom_getenv)(char *) = (char *(*)(char *))PROM_ENTRY(PROM_GETENV);
static void (*__prom_get_memconf)(void *) = (void (*)(void *))PROM_ENTRY(PROM_GET_MEMCONF); static void (*__prom_get_memconf)(void *) = (void (*)(void *))PROM_ENTRY(PROM_GET_MEMCONF);
...@@ -48,26 +49,6 @@ char *prom_getenv (char *s) ...@@ -48,26 +49,6 @@ char *prom_getenv (char *s)
return __prom_getenv(s); return __prom_getenv(s);
} }
void prom_printf(char *fmt, ...)
{
va_list args;
char ppbuf[1024];
char *bptr;
va_start(args, fmt);
vsprintf(ppbuf, fmt, args);
bptr = ppbuf;
while (*bptr != 0) {
if (*bptr == '\n')
__prom_putchar('\r');
__prom_putchar(*bptr++);
}
va_end(args);
}
void __init prom_free_prom_memory(void) void __init prom_free_prom_memory(void)
{ {
} }
...@@ -94,15 +75,15 @@ static void sni_idprom_dump(void) ...@@ -94,15 +75,15 @@ static void sni_idprom_dump(void)
{ {
int i; int i;
prom_printf("SNI IDProm dump:\n"); pr_debug("SNI IDProm dump:\n");
for (i = 0; i < 256; i++) { for (i = 0; i < 256; i++) {
if (i%16 == 0) if (i%16 == 0)
prom_printf("%04x ", i); pr_debug("%04x ", i);
prom_printf("%02x ", *(unsigned char *) (SNI_IDPROM_BASE + i)); printk("%02x ", *(unsigned char *) (SNI_IDPROM_BASE + i));
if (i % 16 == 15) if (i % 16 == 15)
prom_printf("\n"); printk("\n");
} }
} }
#endif #endif
...@@ -121,12 +102,12 @@ static void sni_mem_init(void ) ...@@ -121,12 +102,12 @@ static void sni_mem_init(void )
/* MemSIZE from prom in 16MByte chunks */ /* MemSIZE from prom in 16MByte chunks */
memsize = *((unsigned char *) SNI_IDPROM_MEMSIZE) * 16; memsize = *((unsigned char *) SNI_IDPROM_MEMSIZE) * 16;
DBG_PRINTF("IDProm memsize: %lu MByte\n", memsize); pr_debug("IDProm memsize: %lu MByte\n", memsize);
/* get memory bank layout from prom */ /* get memory bank layout from prom */
__prom_get_memconf(&memconf); __prom_get_memconf(&memconf);
DBG_PRINTF("prom_get_mem_conf memory configuration:\n"); pr_debug("prom_get_mem_conf memory configuration:\n");
for (i = 0;i < 8 && memconf[i].size; i++) { for (i = 0;i < 8 && memconf[i].size; i++) {
if (sni_brd_type == SNI_BRD_PCI_TOWER || if (sni_brd_type == SNI_BRD_PCI_TOWER ||
sni_brd_type == SNI_BRD_PCI_TOWER_CPLUS) { sni_brd_type == SNI_BRD_PCI_TOWER_CPLUS) {
...@@ -135,7 +116,7 @@ static void sni_mem_init(void ) ...@@ -135,7 +116,7 @@ static void sni_mem_init(void )
memconf[i].base -= 0x20000000; memconf[i].base -= 0x20000000;
} }
} }
DBG_PRINTF("Bank%d: %08x @ %08x\n", i, pr_debug("Bank%d: %08x @ %08x\n", i,
memconf[i].size, memconf[i].base); memconf[i].size, memconf[i].base);
add_memory_region(memconf[i].base, memconf[i].size, BOOT_MEM_RAM); add_memory_region(memconf[i].base, memconf[i].size, BOOT_MEM_RAM);
} }
...@@ -248,7 +229,7 @@ void __init prom_init(void) ...@@ -248,7 +229,7 @@ void __init prom_init(void)
systype = "RM300-Exx"; systype = "RM300-Exx";
break; break;
} }
DBG_PRINTF("Found SNI brdtype %02x name %s\n", sni_brd_type,systype); pr_debug("Found SNI brdtype %02x name %s\n", sni_brd_type,systype);
#ifdef DEBUG #ifdef DEBUG
sni_idprom_dump(); sni_idprom_dump();
......
...@@ -237,8 +237,6 @@ static inline void lasat_ndelay(unsigned int ns) ...@@ -237,8 +237,6 @@ static inline void lasat_ndelay(unsigned int ns)
__delay(ns / lasat_ndelay_divider); __delay(ns / lasat_ndelay_divider);
} }
extern void (* prom_printf)(const char *fmt, ...);
#endif /* !defined (_LANGUAGE_ASSEMBLY) */ #endif /* !defined (_LANGUAGE_ASSEMBLY) */
#define LASAT_SERVICEMODE_MAGIC_1 0xdeadbeef #define LASAT_SERVICEMODE_MAGIC_1 0xdeadbeef
......
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
extern char *prom_getcmdline(void); extern char *prom_getcmdline(void);
extern char *prom_getenv(char *name); extern char *prom_getenv(char *name);
extern void setup_prom_printf(int tty_no);
extern void prom_printf(char *fmt, ...);
extern void prom_init_cmdline(void); extern void prom_init_cmdline(void);
extern void prom_meminit(void); extern void prom_meminit(void);
extern void prom_fixup_mem_map(unsigned long start_mem, unsigned long end_mem); extern void prom_fixup_mem_map(unsigned long start_mem, unsigned long end_mem);
......
...@@ -33,9 +33,6 @@ extern int prom_flags; ...@@ -33,9 +33,6 @@ extern int prom_flags;
extern void prom_putchar(char c); extern void prom_putchar(char c);
extern char prom_getchar(void); extern char prom_getchar(void);
/* Generic printf() using ARCS console I/O. */
extern void prom_printf(char *fmt, ...);
/* Memory descriptor management. */ /* Memory descriptor management. */
#define PROM_MAX_PMEMBLOCKS 32 #define PROM_MAX_PMEMBLOCKS 32
struct prom_pmemblock { struct prom_pmemblock {
......
...@@ -57,8 +57,6 @@ extern void bcm1480_mask_irq(int cpu, int irq); ...@@ -57,8 +57,6 @@ extern void bcm1480_mask_irq(int cpu, int irq);
extern void bcm1480_unmask_irq(int cpu, int irq); extern void bcm1480_unmask_irq(int cpu, int irq);
extern void bcm1480_smp_finish(void); extern void bcm1480_smp_finish(void);
extern void prom_printf(char *fmt, ...);
#define AT_spin \ #define AT_spin \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
".set noat\n" \ ".set noat\n" \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册