[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>
This commit is contained in:
@@ -110,12 +110,13 @@ int lasat_init_board_info(void)
|
||||
sizeof(struct lasat_eeprom_struct) - 4);
|
||||
|
||||
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)
|
||||
{
|
||||
prom_printf("WARNING...\nWARNING...\nEEPROM version %d, wanted version %d, attempting to soldier on...\n",
|
||||
if (lasat_board_info.li_eeprom_info.version != LASAT_EEPROM_VERSION) {
|
||||
printk(KERN_WARNING "WARNING...\nWARNING...\nEEPROM version "
|
||||
"%d, wanted version %d, attempting to soldier on...\n",
|
||||
(unsigned int)lasat_board_info.li_eeprom_info.version,
|
||||
LASAT_EEPROM_VERSION);
|
||||
}
|
||||
@@ -124,7 +125,9 @@ int lasat_init_board_info(void)
|
||||
cfg1 = lasat_board_info.li_eeprom_info.cfg[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 */
|
||||
|
||||
|
@@ -23,10 +23,6 @@
|
||||
#define PROM_PUTC_ADDR PROM_JUMP_TABLE_ENTRY(1)
|
||||
#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)
|
||||
{
|
||||
}
|
||||
@@ -40,50 +36,29 @@ static void null_prom_putc(char c)
|
||||
}
|
||||
|
||||
/* these are functions provided by the bootloader */
|
||||
static void (* prom_putc)(char c) = null_prom_putc;
|
||||
void (* prom_printf)(const char * fmt, ...) = null_prom_printf;
|
||||
static void (* __prom_putc)(char c) = null_prom_putc;
|
||||
|
||||
void prom_putchar(char c)
|
||||
{
|
||||
__prom_putc(c);
|
||||
}
|
||||
|
||||
void (* prom_display)(const char *string, int pos, int clear) =
|
||||
null_prom_display;
|
||||
void (* prom_monitor)(void) = null_prom_monitor;
|
||||
|
||||
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)
|
||||
{
|
||||
u32 version = *(u32 *)(RESET_VECTOR + 0x90);
|
||||
|
||||
if (version >= 307) {
|
||||
prom_display = (void *)PROM_DISPLAY_ADDR;
|
||||
prom_putc = (void *)PROM_PUTC_ADDR;
|
||||
prom_printf = real_prom_printf;
|
||||
__prom_putc = (void *)PROM_PUTC_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] = {
|
||||
@@ -101,11 +76,11 @@ void __init prom_init(void)
|
||||
setup_prom_vectors();
|
||||
|
||||
if (current_cpu_data.cputype == CPU_R5000) {
|
||||
prom_printf("LASAT 200 board\n");
|
||||
printk("LASAT 200 board\n");
|
||||
mips_machtype = MACH_LASAT_200;
|
||||
lasat_ndelay_divider = LASAT_200_DIVIDER;
|
||||
} else {
|
||||
prom_printf("LASAT 100 board\n");
|
||||
printk("LASAT 100 board\n");
|
||||
mips_machtype = MACH_LASAT_100;
|
||||
lasat_ndelay_divider = LASAT_100_DIVIDER;
|
||||
}
|
||||
|
@@ -2,5 +2,4 @@
|
||||
#define PROM_H
|
||||
extern void (* prom_display)(const char *string, int pos, int clear);
|
||||
extern void (* prom_monitor)(void);
|
||||
extern void (* prom_printf)(const char * fmt, ...);
|
||||
#endif
|
||||
|
@@ -178,5 +178,5 @@ void __init plat_mem_setup(void)
|
||||
/* Switch from prom exception handler to normal mode */
|
||||
change_c0_status(ST0_BEV,0);
|
||||
|
||||
prom_printf("Lasat specific initialization complete\n");
|
||||
pr_info("Lasat specific initialization complete\n");
|
||||
}
|
||||
|
Reference in New Issue
Block a user