mediatek: Add support for Xiaomi Redmi Router AX6S
[openwrt/staging/hauke.git] / target / linux / bcm53xx / patches-5.4 / 033-v5.10-0004-ARM-BCM5301X-Add-DT-for-Meraki-MR32.patch
1 From ec88a9c344d9fd8c3b11bff1f99a0b6248ae256d Mon Sep 17 00:00:00 2001
2 From: Christian Lamparter <chunkeey@gmail.com>
3 Date: Sat, 22 Aug 2020 18:19:23 +0200
4 Subject: [PATCH] ARM: BCM5301X: Add DT for Meraki MR32
5
6 add support for the Cisco Meraki MR32.
7 This is a dual-band enterprise class 802.11ac access point.
8 The unit was donated by Chris Blake. Thank you!
9
10 SoC: Broadcom BCM53016A1 (1 GHz, 2 cores)
11 RAM: 128 MiB
12 NAND: 128 MiB Spansion S34ML01G2 (~114 MiB useable)
13 ETH: 1GBit Ethernet Port - PoE
14 WIFI1: Broadcom BCM43520 an+ac (2x2:2 - id: 0x4352)
15 WIFI2: Broadcom BCM43520 bgn (2x2:2 - id: 0x4352)
16 WIFI3: Broadcom BCM43428 abgn (1x1:1 - id: 43428)
17
18 BLE: Broadcom BCM20732 (ttyS1)
19 LEDS: 1 x Programmable RGB Status LED (driven by a PWM)
20 1 x White LED (GPIO)
21 1 x Orange LED Fault Indicator (GPIO)
22 2 x LAN Activity / Speed LEDs (On the RJ45 Port)
23 BUTTON: one Reset button
24 MISC: AT24C64 8KiB EEPROM (i2c - stores Ethernet MAC)
25 ina219 hardware monitor (i2c)
26 Kensington Lock
27
28 SERIAL:
29 WARNING: The serial port needs a TTL/RS-232 3V3 level converter!
30 The Serial setting is 115200-8-N-1. The board has a populated
31 right angle 1x4 0.1" pinheader.
32 The pinout is: VCC, RX, TX, GND.
33
34 Odd stuff:
35 - uart0 clock frequency is 62.5 MHz.
36 - The LEDs are labeled as SYS-LED1 through SYS-LED3
37 because of the silkscreen on the PCB.
38 - the original u-boot has been compiled with most functions
39 and commands disabled. The u-boot env isn't setup properly
40 either and as a result, the bcm47xxpart probing is not
41 working. Hence, the nand partitions are specified through a
42 "fixed-partition" binding.
43 - The "WICED SMART(TM)" Bluetooth LE 4.0 BCM20732 chip is
44 connected to uart2 of the SoC. The BCM20732 does not
45 provide a HCI. So the linux' bluetooth stack is useless.
46 The mock-up node with the compatible binding and
47 enable-gpios property is provided solely as documentation.
48
49 Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
50 Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
51 ---
52 arch/arm/boot/dts/Makefile | 1 +
53 arch/arm/boot/dts/bcm53016-meraki-mr32.dts | 197 +++++++++++++++++++++
54 2 files changed, 198 insertions(+)
55 create mode 100644 arch/arm/boot/dts/bcm53016-meraki-mr32.dts
56
57 --- a/arch/arm/boot/dts/Makefile
58 +++ b/arch/arm/boot/dts/Makefile
59 @@ -118,6 +118,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
60 bcm47094-luxul-xwr-3150-v1.dtb \
61 bcm47094-netgear-r8500.dtb \
62 bcm47094-phicomm-k3.dtb \
63 + bcm53016-meraki-mr32.dtb \
64 bcm94708.dtb \
65 bcm94709.dtb \
66 bcm953012er.dtb \
67 --- /dev/null
68 +++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts
69 @@ -0,0 +1,197 @@
70 +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
71 +/*
72 + * Broadcom BCM470X / BCM5301X ARM platform code.
73 + * DTS for Meraki MR32 / Codename: Espresso
74 + *
75 + * Copyright (C) 2018-2020 Christian Lamparter <chunkeey@gmail.com>
76 + */
77 +
78 +/dts-v1/;
79 +
80 +#include "bcm4708.dtsi"
81 +#include "bcm5301x-nand-cs0-bch8.dtsi"
82 +#include <dt-bindings/leds/common.h>
83 +
84 +/ {
85 + compatible = "meraki,mr32", "brcm,brcm53016", "brcm,bcm4708";
86 + model = "Meraki MR32";
87 +
88 + chosen {
89 + bootargs = " console=ttyS0,115200n8 earlycon";
90 + };
91 +
92 + memory {
93 + reg = <0x00000000 0x08000000>;
94 + device_type = "memory";
95 + };
96 +
97 + aliases {
98 + serial1 = &uart2;
99 + };
100 +
101 + leds {
102 + compatible = "gpio-leds";
103 +
104 + sysled3 {
105 + function = LED_FUNCTION_FAULT;
106 + color = <LED_COLOR_ID_AMBER>;
107 + gpios = <&chipcommon 18 GPIO_ACTIVE_LOW>;
108 + panic-indicator;
109 + };
110 + sysled2 {
111 + function = LED_FUNCTION_INDICATOR;
112 + color = <LED_COLOR_ID_WHITE>;
113 + gpios = <&chipcommon 19 GPIO_ACTIVE_HIGH>;
114 + };
115 + };
116 +
117 + keys {
118 + compatible = "gpio-keys";
119 + #address-cells = <1>;
120 + #size-cells = <0>;
121 +
122 + restart {
123 + label = "Reset";
124 + linux,code = <KEY_RESTART>;
125 + gpios = <&chipcommon 21 GPIO_ACTIVE_LOW>;
126 + };
127 + };
128 +
129 + pwm-leds {
130 + compatible = "pwm-leds";
131 +
132 + red {
133 + /* SYS-LED 1 - Tricolor */
134 + function = LED_FUNCTION_INDICATOR;
135 + color = <LED_COLOR_ID_RED>;
136 + pwms = <&pwm 0 50000 0>;
137 + max-brightness = <255>;
138 + };
139 +
140 + green {
141 + /* SYS-LED 1 - Tricolor */
142 + function = LED_FUNCTION_POWER;
143 + color = <LED_COLOR_ID_GREEN>;
144 + pwms = <&pwm 1 50000 0>;
145 + max-brightness = <255>;
146 + };
147 +
148 + blue {
149 + /* SYS-LED 1 - Tricolor */
150 + function = LED_FUNCTION_INDICATOR;
151 + color = <LED_COLOR_ID_BLUE>;
152 + pwms = <&pwm 2 50000 0>;
153 + max-brightness = <255>;
154 + };
155 + };
156 +
157 + i2c {
158 + /*
159 + * The platform provided I2C does not budge.
160 + * This is a replacement until I can figure
161 + * out what are the missing bits...
162 + */
163 +
164 + compatible = "i2c-gpio";
165 + sda-gpios = <&chipcommon 5 GPIO_ACTIVE_HIGH>;
166 + scl-gpios = <&chipcommon 4 GPIO_ACTIVE_HIGH>;
167 + i2c-gpio,delay-us = <10>; /* close to 100 kHz */
168 + #address-cells = <1>;
169 + #size-cells = <0>;
170 +
171 + current_sense: ina219@45 {
172 + compatible = "ti,ina219";
173 + reg = <0x45>;
174 + shunt-resistor = <60000>; /* = 60 mOhms */
175 + };
176 +
177 + eeprom: eeprom@50 {
178 + compatible = "atmel,24c64";
179 + reg = <0x50>;
180 + pagesize = <32>;
181 + read-only;
182 + };
183 + };
184 +};
185 +
186 +&uart0 {
187 + clock-frequency = <62500000>;
188 + /delete-property/ clocks;
189 +};
190 +
191 +&uart1 {
192 + status = "disabled";
193 +};
194 +
195 +&uart2 {
196 + status = "okay";
197 + /*
198 + * bluetooth-le {
199 + * compatible = "brcm,bcm20732";
200 + * enable-gpios = <&chipcommon 20 GPIO_ACTIVE_HIGH>;
201 + *};
202 + */
203 +};
204 +
205 +&gmac1 {
206 + status = "disabled";
207 +};
208 +&gmac2 {
209 + status = "disabled";
210 +};
211 +&gmac3 {
212 + status = "disabled";
213 +};
214 +
215 +&pwm {
216 + status = "okay";
217 + pinctrl-names = "default";
218 + pinctrl-0 = <&pinmux_pwm>;
219 +};
220 +
221 +&nandcs {
222 + nand-ecc-algo = "hw";
223 +
224 + partitions {
225 + /*
226 + * The partition autodetection does not work for this device.
227 + * It will only detect the "nvram" partition with an incorrect size.
228 + * [ 1.721667] 1 bcm47xxpart partitions found on MTD device brcmnand.0
229 + * [ 1.727962] Creating 1 MTD partitions on "brcmnand.0":
230 + * [ 1.733117] 0x000000400000-0x000008000000 : "nvram"
231 + */
232 +
233 + compatible = "fixed-partitions";
234 + #address-cells = <0x1>;
235 + #size-cells = <0x1>;
236 +
237 + partition0@0 {
238 + label = "u-boot";
239 + reg = <0x0 0x100000>;
240 + read-only;
241 + };
242 +
243 + partition1@100000 {
244 + label = "bootkernel1";
245 + reg = <0x100000 0x300000>;
246 + read-only;
247 + };
248 +
249 + partition2@400000 {
250 + label = "nvram";
251 + reg = <0x400000 0x100000>;
252 + read-only;
253 + };
254 +
255 + partition3@500000 {
256 + label = "bootkernel2";
257 + reg = <0x500000 0x300000>;
258 + read-only;
259 + };
260 +
261 + partition4@800000 {
262 + label = "ubi";
263 + reg = <0x800000 0x7780000>;
264 + };
265 + };
266 +};