1 From f55a400f4a691f3750eaf7bfcd6ecbf7ed1622f0 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/33] MIPS: ath79: enable uart during early_prink
6 This patch ensures, that the poinmux register is properly setup for the
7 boot console uart when early_printk is enabled.
9 Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
10 Signed-off-by: John Crispin <john@phrozen.org>
12 arch/mips/ath79/early_printk.c | 44 +++++++++++++++++++++++++++++++++++++++++-
13 1 file changed, 43 insertions(+), 1 deletion(-)
15 --- a/arch/mips/ath79/early_printk.c
16 +++ b/arch/mips/ath79/early_printk.c
17 @@ -58,6 +58,46 @@ static void prom_putchar_dummy(unsigned
21 +static void prom_enable_uart(u32 id)
23 + void __iomem *gpio_base;
28 + case REV_ID_MAJOR_AR71XX:
29 + uart_en = AR71XX_GPIO_FUNC_UART_EN;
32 + case REV_ID_MAJOR_AR7240:
33 + case REV_ID_MAJOR_AR7241:
34 + case REV_ID_MAJOR_AR7242:
35 + uart_en = AR724X_GPIO_FUNC_UART_EN;
38 + case REV_ID_MAJOR_AR913X:
39 + uart_en = AR913X_GPIO_FUNC_UART_EN;
42 + case REV_ID_MAJOR_AR9330:
43 + case REV_ID_MAJOR_AR9331:
44 + uart_en = AR933X_GPIO_FUNC_UART_EN;
47 + case REV_ID_MAJOR_AR9341:
48 + case REV_ID_MAJOR_AR9342:
49 + case REV_ID_MAJOR_AR9344:
55 + gpio_base = (void __iomem *)(KSEG1ADDR(AR71XX_GPIO_BASE));
56 + t = __raw_readl(gpio_base + AR71XX_GPIO_REG_FUNC);
58 + __raw_writel(t, gpio_base + AR71XX_GPIO_REG_FUNC);
61 static void prom_putchar_init(void)
64 @@ -92,8 +132,10 @@ static void prom_putchar_init(void)
67 _prom_putchar = prom_putchar_dummy;
72 + prom_enable_uart(id);
75 void prom_putchar(unsigned char ch)