490f507fa97c99de4a8ed9a920f3bd0742b788bc
[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         flash@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 = "mikrotik,routerboot-partitions";
108                                 #address-cells = <1>;
109                                 #size-cells = <1>;
110
111                                 partition@0 {
112                                         label = "bootloader1";
113                                         reg = <0x0 0x0>;
114                                         read-only;
115                                 };
116
117                                 hard_config: hard_config {
118                                         read-only;
119                                 };
120
121                                 partition@10000 {
122                                         label = "bootloader2";
123                                         reg = <0x10000 0xf000>;
124                                         read-only;
125                                 };
126
127                                 soft_config {
128                                 };
129
130                                 partition@30000 {
131                                         label = "bios";
132                                         reg = <0x30000 0x1000>;
133                                         read-only;
134                                 };
135                         };
136                 };
137         };
138
139         flash@1 {
140                 compatible = "jedec,spi-nor";
141                 reg = <1>;
142                 // XXX empiric value to obtain actual 10MHz SCK at the chip
143                 spi-max-frequency = <3125000>;
144
145                 partitions {
146                         compatible = "fixed-partitions";
147                         #address-cells = <1>;
148                         #size-cells = <1>;
149
150                         // Region <0x0 0x40000> seems reserved by OEM
151
152                         partition@40000 {
153                                 compatible = "mikrotik,minor";
154                                 label = "firmware";
155                                 reg = <0x040000 0xFC0000>;
156                         };
157                 };
158         };
159 };
160
161 &switch0 {
162         ports {
163                 port@0 {
164                         status = "okay";
165                         label = "wan";
166                 };
167
168                 port@1 {
169                         status = "okay";
170                         label = "lan1";
171                 };
172
173                 port@2 {
174                         status = "okay";
175                         label = "lan2";
176                 };
177         };
178 };
179
180 &state_default {
181         gpio {
182                 groups = "uart2", "wdt";
183                 function = "gpio";
184         };
185 };
186
187 &sdhci {
188         status = "okay";
189 };
190
191 &i2c {
192         status = "okay";
193 };
194
195 &pcie {
196         status = "okay";
197 };