summaryrefslogtreecommitdiff
path: root/target/linux/lantiq/patches-3.2/0031-MIPS-lantiq-convert-falcon-debug-uart-to-clkdev-api.patch
blob: a1e61ff5b08776e507eb29bbde99f36a97356389 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
From 96cc1d1baabe7bc6df02e90bcd78e6dde542d384 Mon Sep 17 00:00:00 2001
From: John Crispin <blogic@openwrt.org>
Date: Tue, 21 Feb 2012 14:25:21 +0100
Subject: [PATCH 31/73] MIPS: lantiq: convert falcon debug uart to clkdev api

On Falcon SoCs we have a secondary serial port that can be used to help
debug the voice core. For the port to work several clocking bits need to
be activated. We convert the code to clkdev api.

Signed-off-by: John Crispin <blogic@openwrt.org>
---
 arch/mips/lantiq/falcon/prom.c |    4 +---
 drivers/tty/serial/lantiq.c    |    7 ++++---
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/arch/mips/lantiq/falcon/prom.c b/arch/mips/lantiq/falcon/prom.c
index f98b389..2a4eea17 100644
--- a/arch/mips/lantiq/falcon/prom.c
+++ b/arch/mips/lantiq/falcon/prom.c
@@ -43,10 +43,8 @@ ltq_soc_setup(void)
 	ltq_register_asc(0);
 	ltq_register_wdt();
 	falcon_register_gpio();
-	if (register_asc1) {
+	if (register_asc1)
 		ltq_register_asc(1);
-		ltq_sysctl_activate(SYSCTL_SYS1, ACTS_ASC1_ACT);
-	}
 }
 
 void __init
diff --git a/drivers/tty/serial/lantiq.c b/drivers/tty/serial/lantiq.c
index 1542ad6..82956de 100644
--- a/drivers/tty/serial/lantiq.c
+++ b/drivers/tty/serial/lantiq.c
@@ -117,6 +117,7 @@ static DEFINE_SPINLOCK(ltq_asc_lock);
 
 struct ltq_uart_port {
 	struct uart_port	port;
+	struct clk		*fpiclk;
 	struct clk		*clk;
 	unsigned int		tx_irq;
 	unsigned int		rx_irq;
@@ -319,7 +320,7 @@ lqasc_startup(struct uart_port *port)
 	struct ltq_uart_port *ltq_port = to_ltq_uart_port(port);
 	int retval;
 
-	port->uartclk = clk_get_rate(ltq_port->clk);
+	port->uartclk = clk_get_rate(ltq_port->fpiclk);
 
 	ltq_w32_mask(ASCCLC_DISS | ASCCLC_RMCMASK, (1 << ASCCLC_RMCOFFSET),
 		port->membase + LTQ_ASC_CLC);
@@ -646,7 +647,7 @@ lqasc_console_setup(struct console *co, char *options)
 
 	port = &ltq_port->port;
 
-	port->uartclk = clk_get_rate(ltq_port->clk);
+	port->uartclk = clk_get_rate(ltq_port->fpiclk);
 
 	if (options)
 		uart_parse_options(options, &baud, &parity, &bits, &flow);
@@ -731,7 +732,7 @@ lqasc_probe(struct platform_device *pdev)
 	port->irq	= tx_irq; /* unused, just to be backward-compatibe */
 	port->mapbase	= mmres->start;
 
-	ltq_port->clk	= clk;
+	ltq_port->fpiclk = clk;
 
 	ltq_port->tx_irq = tx_irq;
 	ltq_port->rx_irq = rx_irq;
-- 
1.7.9.1