53ec4307e1f035a96770948f6eee061bfd7b1bee
[openwrt/staging/dedeckeh.git] / target / linux / brcm2708 / patches-4.4 / 0025-bcm2835-Add-support-for-uart1.patch
1 From 0b7e0b20da67546344f9fc8e57699adfe61b8953 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
3 Date: Sat, 15 Aug 2015 20:50:02 +0200
4 Subject: [PATCH 025/381] bcm2835: Add support for uart1
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 This is a hack until a proper solution is agreed upon.
10 Martin Sperl is doing some work in this area.
11
12 Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
13 ---
14 arch/arm/mach-bcm/board_bcm2835.c | 25 +++++++++++++++++++++++++
15 1 file changed, 25 insertions(+)
16
17 --- a/arch/arm/mach-bcm/board_bcm2835.c
18 +++ b/arch/arm/mach-bcm/board_bcm2835.c
19 @@ -22,6 +22,29 @@
20 #include <asm/mach/arch.h>
21 #include <asm/mach/map.h>
22
23 +/* Use this hack until a proper solution is agreed upon */
24 +static void __init bcm2835_init_uart1(void)
25 +{
26 + struct device_node *np;
27 +
28 + np = of_find_compatible_node(NULL, NULL, "brcm,bcm2835-aux-uart");
29 + if (of_device_is_available(np)) {
30 + np = of_find_compatible_node(NULL, NULL,
31 + "bcrm,bcm2835-aux-enable");
32 + if (np) {
33 + void __iomem *base = of_iomap(np, 0);
34 +
35 + if (!base) {
36 + pr_err("bcm2835: Failed enabling Mini UART\n");
37 + return;
38 + }
39 +
40 + writel(1, base);
41 + pr_info("bcm2835: Mini UART enabled\n");
42 + }
43 + }
44 +}
45 +
46 static void __init bcm2835_init(void)
47 {
48 struct device_node *np = of_find_node_by_path("/system");
49 @@ -42,6 +65,8 @@ static void __init bcm2835_init(void)
50 system_rev = val;
51 if (!of_property_read_u64(np, "linux,serial", &val64))
52 system_serial_low = val64;
53 +
54 + bcm2835_init_uart1();
55 }
56
57 static const char * const bcm2835_compat[] = {