1 --- a/arch/mips/lantiq/Kconfig
2 +++ b/arch/mips/lantiq/Kconfig
3 @@ -33,4 +33,19 @@ endchoice
4 source "arch/mips/lantiq/falcon/Kconfig"
5 source "arch/mips/lantiq/xway/Kconfig"
9 + prompt "Early printk port"
10 + default LANTIQ_PROM_ASC1
12 + Choose which serial port is used, until the console driver is loaded
14 +config LANTIQ_PROM_ASC0
17 +config LANTIQ_PROM_ASC1
24 +++ b/arch/mips/lantiq/early_printk.c
27 + * This program is free software; you can redistribute it and/or modify it
28 + * under the terms of the GNU General Public License version 2 as published
29 + * by the Free Software Foundation.
31 + * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
34 +#include <linux/init.h>
35 +#include <linux/cpu.h>
39 +#ifdef CONFIG_SOC_LANTIQ_XWAY
41 +#ifdef CONFIG_LANTIQ_PROM_ASC0
42 +#define LQ_ASC_BASE KSEG1ADDR(LQ_ASC0_BASE)
44 +#define LQ_ASC_BASE KSEG1ADDR(LQ_ASC1_BASE)
47 +#elif CONFIG_SOC_LANTIQ_FALCON
48 +#include <falcon/gpon_reg_base.h>
49 +#ifdef CONFIG_LANTIQ_PROM_ASC0
50 +#define LQ_ASC_BASE GPON_ASC0_BASE
52 +#define LQ_ASC_BASE GPON_ASC1_BASE
58 +#define LQ_ASC_FSTAT 0x0048
59 +#define LQ_ASC_TBUF 0x0020
60 +#define TXMASK 0x3F00
63 +static char buf[ASC_BUF];
68 + unsigned long flags;
70 + local_irq_save(flags);
71 + while ((lq_r32((u32 *)(LQ_ASC_BASE + LQ_ASC_FSTAT)) & TXMASK) >> TXOFFSET);
74 + lq_w32('\r', (u32 *)(LQ_ASC_BASE + LQ_ASC_TBUF));
75 + lq_w32(c, (u32 *)(LQ_ASC_BASE + LQ_ASC_TBUF));
76 + local_irq_restore(flags);
80 +early_printf(const char *fmt, ...)
86 + va_start(args, fmt);
87 + l = vsnprintf(buf, ASC_BUF, fmt, args);
91 + for (p = buf; p < buf_end; p++)