ramips: convert MT7915 EEPROM to NVMEM format
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_ubnt_unifi-6-lite.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621_ubnt_unifi.dtsi"
4
5 / {
6 compatible = "ubnt,unifi-6-lite", "mediatek,mt7621-soc";
7 model = "Ubiquiti UniFi 6 Lite";
8
9 chosen {
10 bootargs-override = "console=ttyS0,115200";
11 };
12 };
13
14 &spi0 {
15 status = "okay";
16
17 flash@0 {
18 compatible = "jedec,spi-nor";
19 reg = <0>;
20 spi-max-frequency = <50000000>;
21
22 partitions {
23 compatible = "fixed-partitions";
24 #address-cells = <1>;
25 #size-cells = <1>;
26
27 partition@0 {
28 label = "u-boot";
29 reg = <0x0 0x60000>;
30 read-only;
31 };
32
33 partition@60000 {
34 label = "u-boot-env";
35 reg = <0x60000 0x10000>;
36 read-only;
37 };
38
39 factory: partition@70000 {
40 compatible = "nvmem-cells";
41 label = "factory";
42 reg = <0x70000 0x40000>;
43 #address-cells = <1>;
44 #size-cells = <1>;
45 read-only;
46
47 eeprom_factory_0: eeprom@0 {
48 reg = <0x0 0x400>;
49 };
50
51 eeprom_factory_20000: eeprom@20000 {
52 reg = <0x20000 0xe00>;
53 };
54 };
55
56 eeprom: partition@b0000 {
57 compatible = "nvmem-cells";
58 label = "eeprom";
59 reg = <0xb0000 0x10000>;
60 #address-cells = <1>;
61 #size-cells = <1>;
62 read-only;
63
64 macaddr_eeprom_0: macaddr@0 {
65 reg = <0x0 0x6>;
66 };
67
68 macaddr_eeprom_6: macaddr@6 {
69 reg = <0x6 0x6>;
70 };
71 };
72
73 partition@c0000 {
74 label = "bs";
75 reg = <0xc0000 0x10000>;
76 };
77
78 partition@d0000 {
79 label = "cfg";
80 reg = <0xd0000 0x100000>;
81 read-only;
82 };
83
84 partition@1d0000 {
85 compatible = "denx,fit";
86 label = "firmware";
87 reg = <0x1d0000 0xf10000>;
88 };
89
90 partition@10e0000 {
91 label = "kernel1";
92 reg = <0x10e0000 0xf10000>;
93 };
94 };
95 };
96 };
97
98 &gmac0 {
99 nvmem-cells = <&macaddr_eeprom_0>;
100 nvmem-cell-names = "mac-address";
101 };
102
103 &wlan_2g {
104 nvmem-cells = <&eeprom_factory_0>, <&macaddr_eeprom_0>;
105 nvmem-cell-names = "eeprom", "mac-address";
106 };
107
108 &wlan_5g {
109 compatible = "mediatek,mt76";
110
111 nvmem-cells = <&eeprom_factory_20000>, <&macaddr_eeprom_6>;
112 nvmem-cell-names = "eeprom", "mac-address";
113
114 /* This is a workaround.
115 *
116 * Ubiquiti uses a +2 offset in the first octet relative
117 * to the 2.4 GHz WMAC. Other octets are identical.
118 *
119 * The vendor firmware increases the last octet by 2 for each
120 * VAP.
121 *
122 * This is in conflict on how mac80211 addresses subsequent VAPs.
123 * mac80211 increases the first octet by two for each VAP, leading
124 * to conflicting MAC addresses for subsequent interfaces.
125 */
126 mac-address-increment = <1>;
127
128 ieee80211-freq-limit = <5000000 6000000>;
129
130 mediatek,disable-radar-background;
131 };