ramips: mt7621: convert to nvmem-layout
[openwrt/staging/nbd.git] / target / linux / ramips / dts / mt7621_mqmaker_witi.dts
1 #include "mt7621.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "mqmaker,witi", "mediatek,mt7621-soc";
8 model = "MQmaker WiTi";
9
10 keys {
11 compatible = "gpio-keys";
12
13 reset {
14 label = "reset";
15 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
16 linux,code = <KEY_RESTART>;
17 };
18 };
19 };
20
21 &i2c {
22 status = "okay";
23
24 rtc@51 {
25 status = "okay";
26 compatible = "nxp,pcf8563";
27 reg = <0x51>;
28 };
29 };
30
31 &sdhci {
32 status = "okay";
33 };
34
35 &spi0 {
36 status = "okay";
37
38 flash@0 {
39 compatible = "jedec,spi-nor";
40 reg = <0>;
41 spi-max-frequency = <10000000>;
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 0x30000>;
51 read-only;
52 };
53
54 partition@30000 {
55 label = "u-boot-env";
56 reg = <0x30000 0x10000>;
57 read-only;
58 };
59
60 factory: partition@40000 {
61 label = "factory";
62 reg = <0x40000 0x10000>;
63
64 nvmem-layout {
65 compatible = "fixed-layout";
66 #address-cells = <1>;
67 #size-cells = <1>;
68
69 eeprom_factory_0: eeprom@0 {
70 reg = <0x0 0x200>;
71 };
72
73 eeprom_factory_8000: eeprom@8000 {
74 reg = <0x8000 0x200>;
75 };
76
77 macaddr_factory_e000: macaddr@e000 {
78 reg = <0xe000 0x6>;
79 };
80 };
81 };
82
83 partition@50000 {
84 compatible = "denx,uimage";
85 label = "firmware";
86 reg = <0x50000 0xfb0000>;
87 };
88 };
89 };
90 };
91
92 &pcie {
93 status = "okay";
94 };
95
96 &pcie0 {
97 mt76@0,0 {
98 reg = <0x0000 0 0 0 0>;
99 ieee80211-freq-limit = <5000000 6000000>;
100 nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000>;
101 nvmem-cell-names = "eeprom", "mac-address";
102 };
103 };
104
105 &pcie1 {
106 mt76@0,0 {
107 reg = <0x0000 0 0 0 0>;
108 ieee80211-freq-limit = <2400000 2500000>;
109 nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000>;
110 nvmem-cell-names = "eeprom", "mac-address";
111 };
112 };
113
114 &gmac0 {
115 nvmem-cells = <&macaddr_factory_e000>;
116 nvmem-cell-names = "mac-address";
117 };
118
119 &gmac1 {
120 status = "okay";
121 label = "wan2";
122 phy-mode = "rgmii-rxid";
123 phy-handle = <&ethphy5>;
124
125 nvmem-cells = <&macaddr_factory_e000>;
126 nvmem-cell-names = "mac-address";
127 mac-address-increment = <1>;
128 };
129
130 &mdio {
131 ethphy5: ethernet-phy@5 {
132 reg = <5>;
133 };
134 };
135
136 &switch0 {
137 ports {
138 port@0 {
139 status = "okay";
140 label = "lan1";
141 };
142
143 port@1 {
144 status = "okay";
145 label = "lan2";
146 };
147
148 port@2 {
149 status = "okay";
150 label = "lan3";
151 };
152
153 port@3 {
154 status = "okay";
155 label = "lan4";
156 };
157
158 port@4 {
159 status = "okay";
160 label = "wan1";
161
162 nvmem-cells = <&macaddr_factory_e000>;
163 nvmem-cell-names = "mac-address";
164 mac-address-increment = <1>;
165 };
166 };
167 };
168
169 &state_default {
170 gpio {
171 groups = "wdt";
172 function = "gpio";
173 };
174 };