2 +++ b/arch/mips/ath25/early_printk.c
5 + * This file is subject to the terms and conditions of the GNU General Public
6 + * License. See the file "COPYING" in the main directory of this archive
9 + * Copyright (C) 2010 Gabor Juhos <juhosg@openwrt.org>
12 +#include <linux/mm.h>
13 +#include <linux/io.h>
14 +#include <linux/serial_reg.h>
17 +#include "ar2315_regs.h"
18 +#include "ar5312_regs.h"
20 +static inline void prom_uart_wr(void __iomem *base, unsigned reg,
23 + __raw_writel(ch, base + 4 * reg);
26 +static inline unsigned char prom_uart_rr(void __iomem *base, unsigned reg)
28 + return __raw_readl(base + 4 * reg);
31 +void prom_putchar(unsigned char ch)
33 + static void __iomem *base;
35 + if (unlikely(base == NULL)) {
37 + base = (void __iomem *)(KSEG1ADDR(AR2315_UART0_BASE));
39 + base = (void __iomem *)(KSEG1ADDR(AR5312_UART0_BASE));
42 + while ((prom_uart_rr(base, UART_LSR) & UART_LSR_THRE) == 0)
44 + prom_uart_wr(base, UART_TX, ch);
45 + while ((prom_uart_rr(base, UART_LSR) & UART_LSR_THRE) == 0)
49 --- a/arch/mips/ath25/Makefile
50 +++ b/arch/mips/ath25/Makefile
54 obj-y += board.o prom.o devices.o
56 +obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
58 obj-$(CONFIG_SOC_AR5312) += ar5312.o
59 obj-$(CONFIG_SOC_AR2315) += ar2315.o
60 --- a/arch/mips/Kconfig
61 +++ b/arch/mips/Kconfig
62 @@ -106,6 +106,7 @@ config ATH25
63 select SYS_HAS_CPU_MIPS32_R1
64 select SYS_SUPPORTS_BIG_ENDIAN
65 select SYS_SUPPORTS_32BIT_KERNEL
66 + select SYS_HAS_EARLY_PRINTK
68 Support for AR231x and AR531x based boards