summaryrefslogtreecommitdiff
path: root/target/linux/ramips/patches-3.10/0503-MIPS-ralink-add-MT7621-early_printk-support.patch
blob: 0da94808043be1f1163b9793d879a24c9b668543 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From 643e61b22155cd95ae6e18e57da50acd120da091 Mon Sep 17 00:00:00 2001
From: John Crispin <blogic@openwrt.org>
Date: Mon, 2 Dec 2013 16:11:33 +0100
Subject: [PATCH 503/507] MIPS: ralink: add MT7621 early_printk support

Signed-off-by: John Crispin <blogic@openwrt.org>
---
 arch/mips/ralink/early_printk.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

--- a/arch/mips/ralink/early_printk.c
+++ b/arch/mips/ralink/early_printk.c
@@ -13,6 +13,8 @@
 
 #ifdef CONFIG_SOC_RT288X
 #define EARLY_UART_BASE         0x300c00
+#elif defined(CONFIG_SOC_MT7621)
+#define EARLY_UART_BASE         0x1E000c00
 #else
 #define EARLY_UART_BASE         0x10000c00
 #endif
@@ -40,9 +42,13 @@ static inline u32 uart_r32(unsigned reg)
 
 void prom_putchar(unsigned char ch)
 {
-	while ((uart_r32(UART_REG_LSR) & UART_LSR_THRE) == 0)
+#ifdef CONFIG_SOC_MT7621
+	uart_w32(ch, UART_TX);
+	while ((uart_r32(0x14) & UART_LSR_THRE) == 0)
 		;
-	uart_w32(ch, UART_REG_TX);
+#else
 	while ((uart_r32(UART_REG_LSR) & UART_LSR_THRE) == 0)
 		;
+	uart_w32(ch, UART_REG_TX);
+#endif
 }