ramips: mt7621: nix mac-address-increment
[openwrt/staging/jow.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 nvmem-layout {
72 compatible = "fixed-layout";
73 #address-cells = <1>;
74 #size-cells = <1>;
75
76 macaddr_eeprom_0: macaddr@0 {
77 compatible = "mac-base";
78 reg = <0x0 0x6>;
79 #nvmem-cell-cells = <1>;
80 };
81 };
82 };
83
84 partition@90000 {
85 label = "bs";
86 reg = <0x90000 0x10000>;
87 };
88
89 partition@a0000 {
90 label = "cfg";
91 reg = <0xa0000 0x100000>;
92 read-only;
93 };
94
95 partition@1a0000 {
96 compatible = "denx,fit";
97 label = "firmware";
98 reg = <0x1a0000 0xf30000>;
99 };
100
101 partition@10d0000 {
102 label = "kernel1";
103 reg = <0x10d0000 0xf30000>;
104 read-only;
105 };
106 };
107 };
108 };
109
110 &gmac0 {
111 nvmem-cells = <&macaddr_eeprom_0 0>;
112 nvmem-cell-names = "mac-address";
113 };
114
115 &switch0 {
116 ports {
117 port@0 {
118 status = "okay";
119 label = "lan";
120 };
121 };
122 };
123
124 &pcie {
125 status = "okay";
126 };
127
128 &pcie0 {
129 wifi@0,0 {
130 reg = <0x0 0 0 0 0>;
131 mediatek,mtd-eeprom = <&factory 0x0>;
132 // On newer devices there is a MediaTek MAC in the above
133 // device EEPROM, so override it with a calculated one.
134 nvmem-cells = <&macaddr_eeprom_0 1>;
135 nvmem-cell-names = "mac-address";
136 };
137 };
138
139 &pcie1 {
140 wifi@0,0 {
141 reg = <0x0 0 0 0 0>;
142 mediatek,mtd-eeprom = <&factory 0x8000>;
143 // On newer devices there is a MediaTek MAC in the above
144 // device EEPROM, so override it with a calculated one.
145 nvmem-cells = <&macaddr_eeprom_0 2>;
146 nvmem-cell-names = "mac-address";
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 };