ramips: mt7621: convert to nvmem-layout
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_zbtlink_zbt-wg3526.dtsi
1 #include "mt7621.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "zbtlink,zbt-wg3526", "mediatek,mt7621-soc";
8
9 aliases {
10 led-boot = &led_status;
11 led-failsafe = &led_status;
12 led-running = &led_status;
13 led-upgrade = &led_status;
14 label-mac-device = &wifi0;
15 };
16
17 chosen {
18 bootargs = "console=ttyS0,115200";
19 };
20
21 keys {
22 compatible = "gpio-keys";
23
24 reset {
25 label = "reset";
26 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
27 linux,code = <KEY_RESTART>;
28 };
29 };
30
31 leds {
32 compatible = "gpio-leds";
33
34 led_status: status {
35 label = "green:status";
36 gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
37 };
38 };
39 };
40
41 &i2c {
42 status = "okay";
43 };
44
45 &sdhci {
46 status = "okay";
47 };
48
49 &spi0 {
50 status = "okay";
51
52 flash0: flash@0 {
53 compatible = "jedec,spi-nor";
54 reg = <0>;
55 spi-max-frequency = <10000000>;
56
57 partitions {
58 compatible = "fixed-partitions";
59 #address-cells = <1>;
60 #size-cells = <1>;
61
62 partition@0 {
63 label = "u-boot";
64 reg = <0x0 0x30000>;
65 read-only;
66 };
67
68 partition@30000 {
69 label = "u-boot-env";
70 reg = <0x30000 0x10000>;
71 read-only;
72 };
73
74 factory: partition@40000 {
75 label = "factory";
76 reg = <0x40000 0x10000>;
77 read-only;
78
79 nvmem-layout {
80 compatible = "fixed-layout";
81 #address-cells = <1>;
82 #size-cells = <1>;
83
84 eeprom_factory_0: eeprom@0 {
85 reg = <0x0 0x400>;
86 };
87
88 eeprom_factory_8000: eeprom@8000 {
89 reg = <0x8000 0x200>;
90 };
91
92 macaddr_factory_e000: macaddr@e000 {
93 reg = <0xe000 0x6>;
94 };
95 };
96 };
97
98 firmware: partition@50000 {
99 compatible = "denx,uimage";
100 label = "firmware";
101 };
102 };
103 };
104 };
105
106 &pcie {
107 status = "okay";
108 };
109
110 &pcie0 {
111 wifi0: wifi@0,0 {
112 compatible = "pci14c3,7603";
113 reg = <0x0000 0 0 0 0>;
114 nvmem-cells = <&eeprom_factory_0>;
115 nvmem-cell-names = "eeprom";
116 };
117 };
118
119 &pcie1 {
120 wifi1: wifi@0,0 {
121 compatible = "pci14c3,7662";
122 reg = <0x0000 0 0 0 0>;
123 nvmem-cells = <&eeprom_factory_8000>;
124 nvmem-cell-names = "eeprom";
125 ieee80211-freq-limit = <5000000 6000000>;
126
127 led {
128 led-sources = <2>;
129 };
130 };
131 };
132
133 &ethernet {
134 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
135 };
136
137 &gmac0 {
138 nvmem-cells = <&macaddr_factory_e000>;
139 nvmem-cell-names = "mac-address";
140 };
141
142 &switch0 {
143 ports {
144 port@0 {
145 status = "okay";
146 label = "lan1";
147 };
148
149 port@1 {
150 status = "okay";
151 label = "lan2";
152 };
153
154 port@2 {
155 status = "okay";
156 label = "lan3";
157 };
158
159 port@3 {
160 status = "okay";
161 label = "lan4";
162 };
163
164 port@4 {
165 status = "okay";
166 label = "wan";
167 nvmem-cells = <&macaddr_factory_e000>;
168 nvmem-cell-names = "mac-address";
169 mac-address-increment = <1>;
170 };
171 };
172 };
173
174 &state_default {
175 gpio {
176 groups = "wdt", "rgmii2";
177 function = "gpio";
178 };
179 };