bcm53xx: add support for Asus RT-N18U LEDs & buttons
[openwrt.git] / target / linux / bcm53xx / patches-3.14 / 304-ARM-BCM5301X-Add-DT-for-Asus-RT-N18U.patch
1 From 89fe6f9b7875f74e7d63a90ae3a51d84d3cf9369 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
3 Date: Thu, 9 Oct 2014 18:16:26 +0200
4 Subject: [PATCH] ARM: BCM5301X: Add DT for Asus RT-N18U
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
10 ---
11  arch/arm/boot/dts/Makefile                  |  3 +-
12  arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts | 88 +++++++++++++++++++++++++++++
13  arch/arm/boot/dts/bcm47081.dtsi             | 26 +++++++++
14  arch/arm/mach-bcm/bcm_5301x.c               |  1 +
15  4 files changed, 117 insertions(+), 1 deletion(-)
16  create mode 100644 arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts
17  create mode 100644 arch/arm/boot/dts/bcm47081.dtsi
18
19 diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
20 index 17c717b..330e0e0 100644
21 --- a/arch/arm/boot/dts/Makefile
22 +++ b/arch/arm/boot/dts/Makefile
23 @@ -53,7 +53,8 @@ dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb
24  dtb-$(CONFIG_ARCH_BCM_5301X) += \
25         bcm4708-buffalo-wzr-1750dhp.dtb \
26         bcm4708-netgear-r6250.dtb \
27 -       bcm4708-netgear-r6300-v2.dtb
28 +       bcm4708-netgear-r6300-v2.dtb \
29 +       bcm47081-asus-rt-n18u.dtb
30  dtb-$(CONFIG_ARCH_BERLIN) += \
31         berlin2-sony-nsz-gs7.dtb        \
32         berlin2cd-google-chromecast.dtb
33 diff --git a/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts b/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts
34 new file mode 100644
35 index 0000000..cf8e9a5
36 --- /dev/null
37 +++ b/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts
38 @@ -0,0 +1,88 @@
39 +/*
40 + * Broadcom BCM470X / BCM5301X arm platform code.
41 + * DTS for Asus RT-N18U
42 + *
43 + * Copyright © 2014 Rafał Miłecki <zajec5@gmail.com>
44 + *
45 + * Licensed under the GNU/GPL. See COPYING for details.
46 + */
47 +
48 +/dts-v1/;
49 +
50 +#include "bcm47081.dtsi"
51 +
52 +/ {
53 +       compatible = "asus,rt-n18u", "brcm,bcm47081";
54 +       model = "Asus RT-N18U (BCM47081)";
55 +
56 +       chosen {
57 +               bootargs = "console=ttyS0,115200";
58 +       };
59 +
60 +       memory {
61 +               reg = <0x00000000 0x08000000>;
62 +       };
63 +
64 +       chipcommonA {
65 +               uart0: serial@0300 {
66 +                       status = "okay";
67 +               };
68 +
69 +               uart1: serial@0400 {
70 +                       status = "okay";
71 +               };
72 +       };
73 +
74 +       leds {
75 +               compatible = "gpio-leds";
76 +
77 +               power {
78 +                       label = "bcm53xx:blue:power";
79 +                       gpios = <&chipcommon 0 GPIO_ACTIVE_LOW>;
80 +                       linux,default-trigger = "default-on";
81 +               };
82 +
83 +               usb2 {
84 +                       label = "bcm53xx:blue:usb2";
85 +                       gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>;
86 +                       linux,default-trigger = "default-off";
87 +               };
88 +
89 +               wan {
90 +                       label = "bcm53xx:blue:wan";
91 +                       gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>;
92 +                       linux,default-trigger = "default-on";
93 +               };
94 +
95 +               lan {
96 +                       label = "bcm53xx:blue:lan";
97 +                       gpios = <&chipcommon 9 GPIO_ACTIVE_LOW>;
98 +                       linux,default-trigger = "default-on";
99 +               };
100 +
101 +               usb3 {
102 +                       label = "bcm53xx:blue:usb3";
103 +                       gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>;
104 +                       linux,default-trigger = "default-off";
105 +               };
106 +       };
107 +
108 +       gpio-keys {
109 +               compatible = "gpio-keys-polled";
110 +               #address-cells = <1>;
111 +               #size-cells = <0>;
112 +               poll-interval = <200>;
113 +
114 +               restart {
115 +                       label = "Reset";
116 +                       linux,code = <KEY_RESTART>;
117 +                       gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
118 +               };
119 +
120 +               wps {
121 +                       label = "WPS";
122 +                       linux,code = <KEY_WPS_BUTTON>;
123 +                       gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
124 +               };
125 +       };
126 +};
127 diff --git a/arch/arm/boot/dts/bcm47081.dtsi b/arch/arm/boot/dts/bcm47081.dtsi
128 new file mode 100644
129 index 0000000..f720012
130 --- /dev/null
131 +++ b/arch/arm/boot/dts/bcm47081.dtsi
132 @@ -0,0 +1,26 @@
133 +/*
134 + * Broadcom BCM470X / BCM5301X ARM platform code.
135 + * DTS for BCM47081 SoC.
136 + *
137 + * Copyright © 2014 Rafał Miłecki <zajec5@gmail.com>
138 + *
139 + * Licensed under the GNU/GPL. See COPYING for details.
140 + */
141 +
142 +#include "bcm5301x.dtsi"
143 +
144 +/ {
145 +       compatible = "brcm,bcm47081";
146 +
147 +       cpus {
148 +               #address-cells = <1>;
149 +               #size-cells = <0>;
150 +
151 +               cpu@0 {
152 +                       device_type = "cpu";
153 +                       compatible = "arm,cortex-a9";
154 +                       next-level-cache = <&L2>;
155 +                       reg = <0x0>;
156 +               };
157 +       };
158 +};
159 diff --git a/arch/arm/mach-bcm/bcm_5301x.c b/arch/arm/mach-bcm/bcm_5301x.c
160 index b0a6da9..de29646 100644
161 --- a/arch/arm/mach-bcm/bcm_5301x.c
162 +++ b/arch/arm/mach-bcm/bcm_5301x.c
163 @@ -81,6 +81,7 @@ static void bcm5301x_restart(enum reboot_mode mode, const char *cmd)
164  
165  static const char __initconst *bcm5301x_dt_compat[] = {
166         "brcm,bcm4708",
167 +       "brcm,bcm47081",
168         NULL,
169  };
170  
171 -- 
172 1.8.4.5
173