bcm53xx: add Cisco Meraki MR32
[openwrt/openwrt.git] / target / linux / bcm53xx / patches-5.4 / 330-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 --- a/arch/arm/boot/dts/Makefile
53 +++ b/arch/arm/boot/dts/Makefile
54 @@ -119,6 +119,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
55 bcm47094-luxul-xwr-3150-v1.dtb \
56 bcm47094-netgear-r8500.dtb \
57 bcm47094-phicomm-k3.dtb \
58 + bcm53016-meraki-mr32.dtb \
59 bcm94708.dtb \
60 bcm94709.dtb \
61 bcm953012er.dtb \
62 --- /dev/null
63 +++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts
64 @@ -0,0 +1,197 @@
65 +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
66 +/*
67 + * Broadcom BCM470X / BCM5301X ARM platform code.
68 + * DTS for Meraki MR32 / Codename: Espresso
69 + *
70 + * Copyright (C) 2018-2020 Christian Lamparter <chunkeey@gmail.com>
71 + */
72 +
73 +/dts-v1/;
74 +
75 +#include "bcm4708.dtsi"
76 +#include "bcm5301x-nand-cs0-bch8.dtsi"
77 +#include <dt-bindings/leds/common.h>
78 +
79 +/ {
80 + compatible = "meraki,mr32", "brcm,brcm53016", "brcm,bcm4708";
81 + model = "Meraki MR32";
82 +
83 + chosen {
84 + bootargs = " console=ttyS0,115200n8 earlycon";
85 + };
86 +
87 + memory {
88 + reg = <0x00000000 0x08000000>;
89 + device_type = "memory";
90 + };
91 +
92 + aliases {
93 + serial1 = &uart2;
94 + };
95 +
96 + leds {
97 + compatible = "gpio-leds";
98 +
99 + sysled3 {
100 + function = LED_FUNCTION_FAULT;
101 + color = <LED_COLOR_ID_AMBER>;
102 + gpios = <&chipcommon 18 GPIO_ACTIVE_LOW>;
103 + panic-indicator;
104 + };
105 + sysled2 {
106 + function = LED_FUNCTION_INDICATOR;
107 + color = <LED_COLOR_ID_WHITE>;
108 + gpios = <&chipcommon 19 GPIO_ACTIVE_HIGH>;
109 + };
110 + };
111 +
112 + keys {
113 + compatible = "gpio-keys";
114 + #address-cells = <1>;
115 + #size-cells = <0>;
116 +
117 + restart {
118 + label = "Reset";
119 + linux,code = <KEY_RESTART>;
120 + gpios = <&chipcommon 21 GPIO_ACTIVE_LOW>;
121 + };
122 + };
123 +
124 + pwm-leds {
125 + compatible = "pwm-leds";
126 +
127 + red {
128 + /* SYS-LED 1 - Tricolor */
129 + function = LED_FUNCTION_INDICATOR;
130 + color = <LED_COLOR_ID_RED>;
131 + pwms = <&pwm 0 50000 0>;
132 + max-brightness = <255>;
133 + };
134 +
135 + green {
136 + /* SYS-LED 1 - Tricolor */
137 + function = LED_FUNCTION_POWER;
138 + color = <LED_COLOR_ID_GREEN>;
139 + pwms = <&pwm 1 50000 0>;
140 + max-brightness = <255>;
141 + };
142 +
143 + blue {
144 + /* SYS-LED 1 - Tricolor */
145 + function = LED_FUNCTION_INDICATOR;
146 + color = <LED_COLOR_ID_BLUE>;
147 + pwms = <&pwm 2 50000 0>;
148 + max-brightness = <255>;
149 + };
150 + };
151 +
152 + i2c {
153 + /*
154 + * The platform provided I2C does not budge.
155 + * This is a replacement until I can figure
156 + * out what are the missing bits...
157 + */
158 +
159 + compatible = "i2c-gpio";
160 + sda-gpios = <&chipcommon 5 GPIO_ACTIVE_HIGH>;
161 + scl-gpios = <&chipcommon 4 GPIO_ACTIVE_HIGH>;
162 + i2c-gpio,delay-us = <10>; /* close to 100 kHz */
163 + #address-cells = <1>;
164 + #size-cells = <0>;
165 +
166 + current_sense: ina219@45 {
167 + compatible = "ti,ina219";
168 + reg = <0x45>;
169 + shunt-resistor = <60000>; /* = 60 mOhms */
170 + };
171 +
172 + eeprom: eeprom@50 {
173 + compatible = "atmel,24c64";
174 + reg = <0x50>;
175 + pagesize = <32>;
176 + read-only;
177 + };
178 + };
179 +};
180 +
181 +&uart0 {
182 + clock-frequency = <62500000>;
183 + /delete-property/ clocks;
184 +};
185 +
186 +&uart1 {
187 + status = "disabled";
188 +};
189 +
190 +&uart2 {
191 + status = "okay";
192 + /*
193 + * bluetooth-le {
194 + * compatible = "brcm,bcm20732";
195 + * enable-gpios = <&chipcommon 20 GPIO_ACTIVE_HIGH>;
196 + *};
197 + */
198 +};
199 +
200 +&gmac1 {
201 + status = "disabled";
202 +};
203 +&gmac2 {
204 + status = "disabled";
205 +};
206 +&gmac3 {
207 + status = "disabled";
208 +};
209 +
210 +&pwm {
211 + status = "okay";
212 + pinctrl-names = "default";
213 + pinctrl-0 = <&pinmux_pwm>;
214 +};
215 +
216 +&nandcs {
217 + nand-ecc-algo = "hw";
218 +
219 + partitions {
220 + /*
221 + * The partition autodetection does not work for this device.
222 + * It will only detect the "nvram" partition with an incorrect size.
223 + * [ 1.721667] 1 bcm47xxpart partitions found on MTD device brcmnand.0
224 + * [ 1.727962] Creating 1 MTD partitions on "brcmnand.0":
225 + * [ 1.733117] 0x000000400000-0x000008000000 : "nvram"
226 + */
227 +
228 + compatible = "fixed-partitions";
229 + #address-cells = <0x1>;
230 + #size-cells = <0x1>;
231 +
232 + partition0@0 {
233 + label = "u-boot";
234 + reg = <0x0 0x100000>;
235 + read-only;
236 + };
237 +
238 + partition1@100000 {
239 + label = "bootkernel1";
240 + reg = <0x100000 0x300000>;
241 + read-only;
242 + };
243 +
244 + partition2@400000 {
245 + label = "nvram";
246 + reg = <0x400000 0x100000>;
247 + read-only;
248 + };
249 +
250 + partition3@500000 {
251 + label = "bootkernel2";
252 + reg = <0x500000 0x300000>;
253 + read-only;
254 + };
255 +
256 + partition4@800000 {
257 + label = "ubi";
258 + reg = <0x800000 0x7780000>;
259 + };
260 + };
261 +};