615bdf4e13b7febe397471ab3c24828f8689c65a
[openwrt/staging/hauke.git] / target / linux / ramips / dts / mt7621_ubnt_unifi-flexhd.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "ubnt,unifi-flexhd", "mediatek,mt7621-soc";
10 model = "Ubiquiti UniFi FlexHD";
11
12 aliases {
13 label-mac-device = &gmac0;
14 led-boot = &led_blue;
15 led-failsafe = &led_blue;
16 led-running = &led_blue;
17 led-upgrade = &led_blue;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 keys {
25 compatible = "gpio-keys";
26
27 reset {
28 label = "reset";
29 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
30 linux,code = <KEY_RESTART>;
31 };
32 };
33 };
34
35 &spi0 {
36 status = "okay";
37
38 flash@0 {
39 compatible = "jedec,spi-nor";
40 reg = <0>;
41 spi-max-frequency = <50000000>;
42
43 partitions {
44 compatible = "fixed-partitions";
45 #address-cells = <1>;
46 #size-cells = <1>;
47
48 partition@0 {
49 label = "u-boot";
50 reg = <0x0 0x60000>;
51 read-only;
52 };
53
54 partition@60000 {
55 label = "u-boot-env";
56 reg = <0x60000 0x10000>;
57 read-only;
58 };
59
60 factory: partition@70000 {
61 label = "factory";
62 reg = <0x70000 0x10000>;
63 read-only;
64 };
65
66 eeprom: partition@80000 {
67 label = "eeprom";
68 reg = <0x80000 0x10000>;
69 read-only;
70 };
71
72 partition@90000 {
73 label = "bs";
74 reg = <0x90000 0x10000>;
75 };
76
77 partition@a0000 {
78 label = "cfg";
79 reg = <0xa0000 0x100000>;
80 read-only;
81 };
82
83 partition@1a0000 {
84 compatible = "denx,fit";
85 label = "firmware";
86 reg = <0x1a0000 0xf30000>;
87 };
88
89 partition@10d0000 {
90 label = "kernel1";
91 reg = <0x10d0000 0xf30000>;
92 read-only;
93 };
94 };
95 };
96 };
97
98 &eeprom {
99 compatible = "nvmem-cells";
100 #address-cells = <1>;
101 #size-cells = <1>;
102
103 macaddr_eeprom_0: macaddr@0 {
104 reg = <0x0 0x6>;
105 };
106 };
107
108 &gmac0 {
109 nvmem-cells = <&macaddr_eeprom_0>;
110 nvmem-cell-names = "mac-address";
111 };
112
113 &switch0 {
114 ports {
115 port@0 {
116 status = "okay";
117 label = "lan";
118 };
119 };
120 };
121
122 &pcie {
123 status = "okay";
124 };
125
126 &pcie0 {
127 wifi@0,0 {
128 reg = <0x0 0 0 0 0>;
129 mediatek,mtd-eeprom = <&factory 0x0>;
130 // On newer devices there is a MediaTek MAC in the above
131 // device EEPROM, so override it with a calculated one.
132 nvmem-cells = <&macaddr_eeprom_0>;
133 nvmem-cell-names = "mac-address";
134 mac-address-increment = <1>;
135 };
136 };
137
138 &pcie1 {
139 wifi@0,0 {
140 reg = <0x0 0 0 0 0>;
141 mediatek,mtd-eeprom = <&factory 0x8000>;
142 // On newer devices there is a MediaTek MAC in the above
143 // device EEPROM, so override it with a calculated one.
144 nvmem-cells = <&macaddr_eeprom_0>;
145 nvmem-cell-names = "mac-address";
146 mac-address-increment = <2>;
147 };
148 };
149
150 &i2c {
151 status = "okay";
152 clock-frequency = <400000>;
153
154 led-controller@30 {
155 compatible = "ubnt,ledbar";
156 reg = <0x30>;
157
158 enable-gpio = <&gpio 44 GPIO_ACTIVE_HIGH>;
159 reset-gpio = <&gpio 41 GPIO_ACTIVE_LOW>;
160 led-count = <8>;
161
162 red {
163 label = "red";
164 };
165
166 green {
167 label = "green";
168 };
169
170 led_blue: blue {
171 label = "blue";
172 };
173 };
174 };
175
176 &state_default {
177 gpio {
178 groups = "uart2";
179 function = "gpio";
180 };
181 };