ramips: mt7621: harmonize naming scheme for Mikrotik
[oweals/openwrt.git] / target / linux / ramips / dts / mt7621_mikrotik_routerboard-m33g.dts
1 /dts-v1/;
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/gpio/gpio.h>
7
8 / {
9         compatible = "mikrotik,routerboard-m33g", "mediatek,mt7621-soc";
10         model = "MikroTik RouterBOARD M33G";
11
12         aliases {
13                 led-boot = &led_usr;
14                 led-failsafe = &led_usr;
15                 led-running = &led_usr;
16                 led-upgrade = &led_usr;
17         };
18
19         chosen {
20                 bootargs = "console=ttyS0,115200";
21         };
22
23         leds {
24                 compatible = "gpio-leds";
25
26                 led_usr: usr {
27                         label = "routerboard-m33g:green:usr";
28                         gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
29                 };
30         };
31
32         keys {
33                 compatible = "gpio-keys";
34
35                 res {
36                         label = "res";
37                         gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
38                         linux,code = <KEY_RESTART>;
39                 };
40         };
41
42         pcie0_vcc_reg {
43                 compatible = "regulator-fixed";
44                 regulator-name = "pcie0_vcc";
45
46                 regulator-min-microvolt = <3300000>;
47                 regulator-max-microvolt = <3300000>;
48                 gpio = <&gpio 9 GPIO_ACTIVE_HIGH>;
49                 enable-active-high;
50                 regulator-boot-on;
51                 regulator-always-on;
52         };
53
54         pcie1_vcc_reg {
55                 compatible = "regulator-fixed";
56                 regulator-name = "pcie1_vcc";
57
58                 regulator-min-microvolt = <3300000>;
59                 regulator-max-microvolt = <3300000>;
60                 gpio = <&gpio 10 GPIO_ACTIVE_HIGH>;
61                 enable-active-high;
62                 regulator-boot-on;
63                 regulator-always-on;
64         };
65
66         pcie2_vcc_reg {
67                 compatible = "regulator-fixed";
68                 regulator-name = "pcie2_vcc";
69
70                 regulator-min-microvolt = <3300000>;
71                 regulator-max-microvolt = <3300000>;
72                 gpio = <&gpio 11 GPIO_ACTIVE_HIGH>;
73                 enable-active-high;
74                 regulator-boot-on;
75                 regulator-always-on;
76         };
77
78         usb_vcc_reg {
79                 compatible = "regulator-fixed";
80                 regulator-name = "usb_vcc";
81
82                 regulator-min-microvolt = <5000000>;
83                 regulator-max-microvolt = <5000000>;
84                 gpio = <&gpio 12 GPIO_ACTIVE_HIGH>;
85                 enable-active-high;
86                 regulator-always-on;
87         };
88 };
89
90 &spi0 {
91         status = "okay";
92
93         w25q40@0 {
94                 compatible = "jedec,spi-nor";
95                 reg = <0>;
96                 spi-max-frequency = <3125000>;
97
98                 partitions {
99                         compatible = "fixed-partitions";
100                         #address-cells = <1>;
101                         #size-cells = <1>;
102
103                         partition@0 {
104                                 label = "RouterBoot";
105                                 reg = <0x0 0x40000>;
106                                 read-only;
107                                 compatible = "fixed-partitions";
108                                 #address-cells = <1>;
109                                 #size-cells = <1>;
110
111                                 partition@0 {
112                                         label = "bootloader1";
113                                         reg = <0x0 0xf000>;
114                                         read-only;
115                                 };
116
117                                 hard_config: partition@f000 {
118                                         label = "hard_config";
119                                         reg = <0xf000 0x1000>;
120                                         read-only;
121                                 };
122
123                                 partition@10000 {
124                                         label = "bootloader2";
125                                         reg = <0x10000 0xf000>;
126                                         read-only;
127                                 };
128
129                                 partition@20000 {
130                                         label = "soft_config";
131                                         reg = <0x20000 0x1000>;
132                                 };
133
134                                 partition@30000 {
135                                         label = "bios";
136                                         reg = <0x30000 0x1000>;
137                                         read-only;
138                                 };
139                         };
140                 };
141         };
142
143         w25q128@1 {
144                 compatible = "jedec,spi-nor";
145                 reg = <1>;
146                 // XXX empiric value to obtain actual 10MHz SCK at the chip
147                 spi-max-frequency = <3125000>;
148
149                 partitions {
150                         compatible = "fixed-partitions";
151                         #address-cells = <1>;
152                         #size-cells = <1>;
153
154                         // Region <0x0 0x40000> seems reserved by OEM
155
156                         partition@40000 {
157                                 compatible = "mikrotik,minor";
158                                 label = "firmware";
159                                 reg = <0x040000 0xFC0000>;
160                         };
161                 };
162         };
163 };
164
165 &gmac0 {
166         mtd-mac-address = <&hard_config 0x0010>;
167         mtd-mac-address-increment = <1>;
168 };
169
170 &switch0 {
171         ports {
172                 port@0 {
173                         status = "okay";
174                         label = "wan";
175                         mtd-mac-address = <&hard_config 0x0010>;
176                         mtd-mac-address-increment = <2>;
177                 };
178
179                 port@1 {
180                         status = "okay";
181                         label = "lan1";
182                 };
183
184                 port@2 {
185                         status = "okay";
186                         label = "lan2";
187                 };
188         };
189 };
190
191 &state_default {
192         gpio {
193                 groups = "uart2", "wdt";
194                 function = "gpio";
195         };
196 };
197
198 &sdhci {
199         status = "okay";
200 };
201
202 &i2c {
203         status = "okay";
204 };
205
206 &pcie {
207         status = "okay";
208 };