1 From b14f8260724abec6c82970085dece6a143d3a0db Mon Sep 17 00:00:00 2001
2 From: Gabor Juhos <juhosg@openwrt.org>
3 Date: Mon, 5 Mar 2018 11:38:21 +0100
4 Subject: [PATCH 15/27] MIPS: ath79: enable uart during early_prink
6 Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
8 arch/mips/ath79/early_printk.c | 44 +++++++++++++++++++++++++++++++++++++++++-
9 1 file changed, 43 insertions(+), 1 deletion(-)
11 --- a/arch/mips/ath79/early_printk.c
12 +++ b/arch/mips/ath79/early_printk.c
13 @@ -58,6 +58,46 @@ static void prom_putchar_dummy(unsigned
17 +static void prom_enable_uart(u32 id)
19 + void __iomem *gpio_base;
24 + case REV_ID_MAJOR_AR71XX:
25 + uart_en = AR71XX_GPIO_FUNC_UART_EN;
28 + case REV_ID_MAJOR_AR7240:
29 + case REV_ID_MAJOR_AR7241:
30 + case REV_ID_MAJOR_AR7242:
31 + uart_en = AR724X_GPIO_FUNC_UART_EN;
34 + case REV_ID_MAJOR_AR913X:
35 + uart_en = AR913X_GPIO_FUNC_UART_EN;
38 + case REV_ID_MAJOR_AR9330:
39 + case REV_ID_MAJOR_AR9331:
40 + uart_en = AR933X_GPIO_FUNC_UART_EN;
43 + case REV_ID_MAJOR_AR9341:
44 + case REV_ID_MAJOR_AR9342:
45 + case REV_ID_MAJOR_AR9344:
51 + gpio_base = (void __iomem *)(KSEG1ADDR(AR71XX_GPIO_BASE));
52 + t = __raw_readl(gpio_base + AR71XX_GPIO_REG_FUNC);
54 + __raw_writel(t, gpio_base + AR71XX_GPIO_REG_FUNC);
57 static void prom_putchar_init(void)
60 @@ -88,8 +128,10 @@ static void prom_putchar_init(void)
63 _prom_putchar = prom_putchar_dummy;
68 + prom_enable_uart(id);
71 void prom_putchar(unsigned char ch)