ramips: mt7621: convert to nvmem-layout
[openwrt/staging/nbd.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 label = "factory";
41 reg = <0x70000 0x40000>;
42 read-only;
43
44 nvmem-layout {
45 compatible = "fixed-layout";
46 #address-cells = <1>;
47 #size-cells = <1>;
48
49 eeprom_factory_0: eeprom@0 {
50 reg = <0x0 0x400>;
51 };
52 };
53 };
54
55 eeprom: partition@b0000 {
56 label = "eeprom";
57 reg = <0xb0000 0x10000>;
58 read-only;
59
60 nvmem-layout {
61 compatible = "fixed-layout";
62 #address-cells = <1>;
63 #size-cells = <1>;
64
65 macaddr_eeprom_0: macaddr@0 {
66 reg = <0x0 0x6>;
67 };
68
69 macaddr_eeprom_6: macaddr@6 {
70 reg = <0x6 0x6>;
71 };
72 };
73 };
74
75 partition@c0000 {
76 label = "bs";
77 reg = <0xc0000 0x10000>;
78 };
79
80 partition@d0000 {
81 label = "cfg";
82 reg = <0xd0000 0x100000>;
83 read-only;
84 };
85
86 partition@1d0000 {
87 compatible = "denx,fit";
88 label = "firmware";
89 reg = <0x1d0000 0xf10000>;
90 };
91
92 partition@10e0000 {
93 label = "kernel1";
94 reg = <0x10e0000 0xf10000>;
95 };
96 };
97 };
98 };
99
100 &gmac0 {
101 nvmem-cells = <&macaddr_eeprom_0>;
102 nvmem-cell-names = "mac-address";
103 };
104
105 &wlan_2g {
106 nvmem-cells = <&eeprom_factory_0>, <&macaddr_eeprom_0>;
107 nvmem-cell-names = "eeprom", "mac-address";
108 };
109
110 &wlan_5g {
111 compatible = "mediatek,mt76";
112
113 mediatek,mtd-eeprom = <&factory 0x20000>;
114
115 nvmem-cells = <&macaddr_eeprom_6>;
116 nvmem-cell-names = "mac-address";
117
118 /* This is a workaround.
119 *
120 * Ubiquiti uses a +2 offset in the first octet relative
121 * to the 2.4 GHz WMAC. Other octets are identical.
122 *
123 * The vendor firmware increases the last octet by 2 for each
124 * VAP.
125 *
126 * This is in conflict on how mac80211 addresses subsequent VAPs.
127 * mac80211 increases the first octet by two for each VAP, leading
128 * to conflicting MAC addresses for subsequent interfaces.
129 */
130 mac-address-increment = <1>;
131
132 ieee80211-freq-limit = <5000000 6000000>;
133
134 mediatek,disable-radar-background;
135 };