bce497bba7dd296228d8e60a167ec6384bcdf757
[openwrt/staging/ldir.git] / target / linux / bcm53xx / patches-5.10 / 036-v5.19-0008-ARM-dts-BCM5301X-Add-DT-for-WZR-1166DHP-DHP2.patch
1 From 417aea4436bb658d8c5c4dcd0e3c255931d0ee96 Mon Sep 17 00:00:00 2001
2 From: SHIMAMOTO Takayoshi <takayoshi.shimamoto.360@gmail.com>
3 Date: Fri, 22 Apr 2022 00:10:54 +0900
4 Subject: [PATCH] ARM: dts: BCM5301X: Add DT for WZR-1166DHP,DHP2
5
6 Buffalo WZR-1166DHP/WZR-1166DHP2 wireless router with
7
8 - BCM4708A0
9 - 128MiB NAND flash
10 - 2T2R 11ac/a/b/g/n Wi-Fi
11 - 4x 10/100/1000M ethernet switch
12 - 1x USB 3.0 port
13
14 WZR-1166DHP and WZR-1166DHP2 have different memory capacity.
15
16 WZR-1166DHP
17 - 512 MiB DDR2 SDRAM
18
19 WZR-1166DHP2
20 - 256 MiB DDR2 SDRAM
21
22 These hardware components are very similar to the WZR-1750DHP
23 except for the number of antennas.
24
25 Signed-off-by: SHIMAMOTO Takayoshi <takayoshi.shimamoto.360@gmail.com>
26 Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
27 ---
28 arch/arm/boot/dts/Makefile | 2 +
29 .../bcm4708-buffalo-wzr-1166dhp-common.dtsi | 192 ++++++++++++++++++
30 .../boot/dts/bcm4708-buffalo-wzr-1166dhp.dts | 26 +++
31 .../boot/dts/bcm4708-buffalo-wzr-1166dhp2.dts | 26 +++
32 4 files changed, 246 insertions(+)
33 create mode 100644 arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp-common.dtsi
34 create mode 100644 arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp.dts
35 create mode 100644 arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp2.dts
36
37 --- a/arch/arm/boot/dts/Makefile
38 +++ b/arch/arm/boot/dts/Makefile
39 @@ -99,6 +99,8 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
40 bcm4708-asus-rt-ac56u.dtb \
41 bcm4708-asus-rt-ac68u.dtb \
42 bcm4708-buffalo-wzr-1750dhp.dtb \
43 + bcm4708-buffalo-wzr-1166dhp.dtb \
44 + bcm4708-buffalo-wzr-1166dhp2.dtb \
45 bcm4708-linksys-ea6300-v1.dtb \
46 bcm4708-linksys-ea6500-v2.dtb \
47 bcm4708-luxul-xap-1510.dtb \
48 --- /dev/null
49 +++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp-common.dtsi
50 @@ -0,0 +1,192 @@
51 +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
52 +/*
53 + * Broadcom BCM470X / BCM5301X ARM platform code.
54 + * DTS for Buffalo WZR-1166DHP and WZR-1166DHP2
55 + *
56 + * Copyright (C) 2014 Rafał Miłecki <zajec5@gmail.com>
57 + * Copyright (C) 2022 SHIMAMOTO Takayoshi <takayoshi.shimamoto.360@gmail.com>
58 + */
59 +
60 +
61 +#include "bcm4708.dtsi"
62 +#include "bcm5301x-nand-cs0-bch8.dtsi"
63 +#include <dt-bindings/leds/common.h>
64 +
65 +/ {
66 + spi {
67 + compatible = "spi-gpio";
68 + num-chipselects = <1>;
69 + gpio-sck = <&chipcommon 7 0>;
70 + gpio-mosi = <&chipcommon 4 0>;
71 + cs-gpios = <&chipcommon 6 0>;
72 + #address-cells = <1>;
73 + #size-cells = <0>;
74 +
75 + hc595: gpio_spi@0 {
76 + compatible = "fairchild,74hc595";
77 + reg = <0>;
78 + registers-number = <1>;
79 + spi-max-frequency = <100000>;
80 +
81 + gpio-controller;
82 + #gpio-cells = <2>;
83 +
84 + };
85 + };
86 +
87 + leds {
88 + compatible = "gpio-leds";
89 +
90 + usb {
91 + /* label = "bcm53xx:blue:usb"; */
92 + function = LED_FUNCTION_USB;
93 + color = <LED_COLOR_ID_BLUE>;
94 + gpios = <&hc595 0 GPIO_ACTIVE_HIGH>;
95 + trigger-sources = <&ohci_port1>, <&ehci_port1>,
96 + <&xhci_port1>, <&ohci_port2>,
97 + <&ehci_port2>;
98 + linux,default-trigger = "usbport";
99 + };
100 +
101 + power0 {
102 + /* label = "bcm53xx:red:power"; */
103 + function = LED_FUNCTION_FAULT;
104 + color = <LED_COLOR_ID_RED>;
105 + gpios = <&hc595 1 GPIO_ACTIVE_HIGH>;
106 + };
107 +
108 + power1 {
109 + /* label = "bcm53xx:white:power"; */
110 + function = LED_FUNCTION_POWER;
111 + color = <LED_COLOR_ID_WHITE>;
112 + gpios = <&hc595 2 GPIO_ACTIVE_HIGH>;
113 + linux,default-trigger = "default-on";
114 + };
115 +
116 + router0 {
117 + /* label = "bcm53xx:blue:router"; */
118 + function = LED_FUNCTION_STATUS;
119 + color = <LED_COLOR_ID_BLUE>;
120 + gpios = <&hc595 3 GPIO_ACTIVE_HIGH>;
121 + linux,default-trigger = "default-on";
122 + };
123 +
124 + router1 {
125 + /* label = "bcm53xx:amber:router"; */
126 + function = LED_FUNCTION_STATUS;
127 + color = <LED_COLOR_ID_AMBER>;
128 + gpios = <&hc595 4 GPIO_ACTIVE_HIGH>;
129 + };
130 +
131 + wan {
132 + /* label = "bcm53xx:blue:wan"; */
133 + function = LED_FUNCTION_WAN;
134 + color = <LED_COLOR_ID_BLUE>;
135 + gpios = <&hc595 5 GPIO_ACTIVE_HIGH>;
136 + linux,default-trigger = "default-on";
137 + };
138 +
139 + wireless0 {
140 + /* label = "bcm53xx:blue:wireless"; */
141 + function = LED_FUNCTION_WLAN;
142 + color = <LED_COLOR_ID_BLUE>;
143 + gpios = <&hc595 6 GPIO_ACTIVE_HIGH>;
144 + };
145 +
146 + wireless1 {
147 + /* label = "bcm53xx:amber:wireless"; */
148 + function = LED_FUNCTION_WLAN;
149 + color = <LED_COLOR_ID_AMBER>;
150 + gpios = <&hc595 7 GPIO_ACTIVE_HIGH>;
151 + };
152 + };
153 +
154 + gpio-keys {
155 + compatible = "gpio-keys";
156 +
157 + restart {
158 + label = "Reset";
159 + linux,code = <KEY_RESTART>;
160 + gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
161 + };
162 +
163 + aoss {
164 + label = "AOSS";
165 + linux,code = <KEY_WPS_BUTTON>;
166 + gpios = <&chipcommon 12 GPIO_ACTIVE_LOW>;
167 + };
168 +
169 + /* Commit mode set by switch? */
170 + mode {
171 + label = "Mode";
172 + linux,code = <KEY_SETUP>;
173 + gpios = <&chipcommon 13 GPIO_ACTIVE_LOW>;
174 + };
175 +
176 + /* Switch: AP mode */
177 + sw_ap {
178 + label = "AP";
179 + linux,code = <BTN_0>;
180 + gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>;
181 + };
182 +
183 + eject {
184 + label = "USB eject";
185 + linux,code = <KEY_EJECTCD>;
186 + gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>;
187 + };
188 + };
189 +};
190 +
191 +&usb2 {
192 + vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
193 +};
194 +
195 +&usb3 {
196 + vcc-gpio = <&chipcommon 10 GPIO_ACTIVE_LOW>;
197 +};
198 +
199 +&spi_nor {
200 + status = "okay";
201 +};
202 +
203 +&usb3_phy {
204 + status = "okay";
205 +};
206 +
207 +&srab {
208 + status = "okay";
209 +
210 + ports {
211 + port@0 {
212 + reg = <0>;
213 + label = "lan1";
214 + };
215 +
216 + port@1 {
217 + reg = <1>;
218 + label = "lan2";
219 + };
220 +
221 + port@2 {
222 + reg = <2>;
223 + label = "lan3";
224 + };
225 +
226 + port@3 {
227 + reg = <3>;
228 + label = "lan4";
229 + };
230 +
231 + port@4 {
232 + reg = <4>;
233 + label = "wan";
234 + };
235 +
236 + port@5 {
237 + reg = <5>;
238 + label = "cpu";
239 + ethernet = <&gmac0>;
240 + };
241 + };
242 +};
243 --- /dev/null
244 +++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp.dts
245 @@ -0,0 +1,26 @@
246 +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
247 +/*
248 + * Device Tree Bindigs for Buffalo WZR-1166DHP
249 + *
250 + * Copyright (C) 2022 SHIMAMOTO Takayoshi <takayoshi.shimamoto.360@gmail.com>
251 + */
252 +
253 +/dts-v1/;
254 +
255 +#include "bcm4708-buffalo-wzr-1166dhp-common.dtsi"
256 +
257 +/ {
258 + compatible = "buffalo,wzr-1166dhp", "brcm,bcm4708";
259 + model = "Buffalo WZR-1166DHP";
260 +
261 + chosen {
262 + bootargs = "console=ttyS0,115200";
263 + };
264 +
265 + memory@0 {
266 + device_type = "memory";
267 + reg = <0x00000000 0x08000000>,
268 + <0x88000000 0x18000000>;
269 + };
270 +
271 +};
272 --- /dev/null
273 +++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp2.dts
274 @@ -0,0 +1,26 @@
275 +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
276 +/*
277 + * Device Tree Bindigs for Buffalo WZR-1166DHP2
278 + *
279 + * Copyright (C) 2022 SHIMAMOTO Takayoshi <takayoshi.shimamoto.360@gmail.com>
280 + */
281 +
282 +/dts-v1/;
283 +
284 +#include "bcm4708-buffalo-wzr-1166dhp-common.dtsi"
285 +
286 +/ {
287 + compatible = "buffalo,wzr-1166dhp2", "brcm,bcm4708";
288 + model = "Buffalo WZR-1166DHP2";
289 +
290 + chosen {
291 + bootargs = "console=ttyS0,115200";
292 + };
293 +
294 + memory@0 {
295 + device_type = "memory";
296 + reg = <0x00000000 0x08000000>,
297 + <0x88000000 0x08000000>;
298 + };
299 +
300 +};