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