ramips: convert MT7603 EEPROM to NVMEM format
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_d-team_pbr-m1.dts
1 #include "mt7621.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "d-team,pbr-m1", "mediatek,mt7621-soc";
8 model = "PBR-M1";
9
10 aliases {
11 led-boot = &led_sys;
12 led-failsafe = &led_sys;
13 led-running = &led_sys;
14 led-upgrade = &led_sys;
15 };
16
17 chosen {
18 bootargs = "console=ttyS0,115200";
19 };
20
21 leds {
22 compatible = "gpio-leds";
23
24 power {
25 label = "blue:power";
26 gpios = <&gpio 31 GPIO_ACTIVE_LOW>;
27 default-state = "on";
28 };
29
30 led_sys: sys {
31 label = "blue:sys";
32 gpios = <&gpio 32 GPIO_ACTIVE_LOW>;
33 };
34
35 internet {
36 label = "blue:internet";
37 gpios = <&gpio 29 GPIO_ACTIVE_LOW>;
38 };
39
40 wlan2g {
41 label = "blue:wlan2g";
42 gpios = <&gpio 33 GPIO_ACTIVE_LOW>;
43 };
44
45 wlan5g {
46 label = "blue:wlan5g";
47 gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
48 };
49 };
50
51 keys {
52 compatible = "gpio-keys";
53
54 reset {
55 label = "reset";
56 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
57 linux,code = <KEY_RESTART>;
58 };
59 };
60
61 gpio_export {
62 compatible = "gpio-export";
63 #size-cells = <0>;
64
65 power_usb2 {
66 gpio-export,name = "power_usb2";
67 gpio-export,output = <1>;
68 gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
69 };
70
71 power_usb3 {
72 gpio-export,name = "power_usb3";
73 gpio-export,output = <1>;
74 gpios = <&gpio 25 GPIO_ACTIVE_HIGH>;
75 };
76
77 power_sata {
78 gpio-export,name = "power_sata";
79 gpio-export,output = <1>;
80 gpios = <&gpio 27 GPIO_ACTIVE_HIGH>;
81 };
82 };
83
84 beeper: beeper {
85 compatible = "gpio-beeper";
86 gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
87 };
88 };
89
90 &i2c {
91 status = "okay";
92
93 rtc@51 {
94 status = "okay";
95 compatible = "nxp,pcf8563";
96 reg = <0x51>;
97 };
98 };
99
100 &sdhci {
101 status = "okay";
102 };
103
104 &spi0 {
105 status = "okay";
106
107 flash@0 {
108 compatible = "jedec,spi-nor";
109 reg = <0>;
110 spi-max-frequency = <50000000>;
111 m25p,fast-read;
112 broken-flash-reset;
113
114 partitions {
115 compatible = "fixed-partitions";
116 #address-cells = <1>;
117 #size-cells = <1>;
118
119 partition@0 {
120 label = "u-boot";
121 reg = <0x0 0x30000>;
122 read-only;
123 };
124
125 partition@30000 {
126 label = "u-boot-env";
127 reg = <0x30000 0x10000>;
128 read-only;
129 };
130
131 factory: partition@40000 {
132 compatible = "nvmem-cells";
133 label = "factory";
134 reg = <0x40000 0x10000>;
135 #address-cells = <1>;
136 #size-cells = <1>;
137 read-only;
138
139 eeprom_factory_0: eeprom@0 {
140 reg = <0x0 0x400>;
141 };
142
143 macaddr_factory_e000: macaddr@e000 {
144 reg = <0xe000 0x6>;
145 };
146
147 macaddr_factory_e006: macaddr@e006 {
148 reg = <0xe006 0x6>;
149 };
150 };
151
152 partition@50000 {
153 compatible = "denx,uimage";
154 label = "firmware";
155 reg = <0x50000 0x1fb0000>;
156 };
157 };
158 };
159 };
160
161 &pinctrl {
162 uart3_gpio: uart3-gpio {
163 uart3 {
164 groups = "uart3";
165 function = "gpio";
166 };
167 };
168 };
169
170 &pcie {
171 status = "okay";
172 pinctrl-0 = <&pcie_pins>, <&uart3_gpio>;
173 reset-gpios = <&gpio 19 GPIO_ACTIVE_LOW>,
174 <&gpio 7 GPIO_ACTIVE_LOW>;
175 };
176
177 &pcie0 {
178 mt76@0,0 {
179 reg = <0x0000 0 0 0 0>;
180 mediatek,mtd-eeprom = <&factory 0x8000>;
181 ieee80211-freq-limit = <5000000 6000000>;
182 };
183 };
184
185 &pcie1 {
186 mt76@0,0 {
187 reg = <0x0000 0 0 0 0>;
188 nvmem-cells = <&eeprom_factory_0>;
189 nvmem-cell-names = "eeprom";
190 };
191 };
192
193 &ethernet {
194 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
195 };
196
197 &gmac0 {
198 nvmem-cells = <&macaddr_factory_e000>;
199 nvmem-cell-names = "mac-address";
200 };
201
202 &switch0 {
203 ports {
204 port@0 {
205 status = "okay";
206 label = "lan1";
207 };
208
209 port@1 {
210 status = "okay";
211 label = "lan2";
212 };
213
214 port@2 {
215 status = "okay";
216 label = "lan3";
217 };
218
219 port@3 {
220 status = "okay";
221 label = "lan4";
222 };
223
224 port@4 {
225 status = "okay";
226 label = "wan";
227 nvmem-cells = <&macaddr_factory_e006>;
228 nvmem-cell-names = "mac-address";
229 };
230 };
231 };
232
233 &state_default {
234 gpio {
235 groups = "wdt", "rgmii2", "jtag";
236 function = "gpio";
237 };
238 };