ramips: simplify state_default/pinctrl0 in device DTS files
[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         chosen {
20                 bootargs = "console=ttyS0,115200";
21         };
22
23         leds {
24                 compatible = "gpio-leds";
25
26                 led_usr: usr {
27                         label = "rbm33g:green:usr";
28                         gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
29                 };
30         };
31
32         keys {
33                 compatible = "gpio-keys";
34
35                 res {
36                         label = "res";
37                         gpios = <&gpio0 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 = <&gpio0 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 = <&gpio0 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 = <&gpio0 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 = <&gpio0 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 &ethernet {
166         mtd-mac-address = <&hard_config 0x0010>;
167         mtd-mac-address-increment = <1>;
168 };
169
170 &state_default {
171         gpio {
172                 ralink,group = "uart2", "wdt";
173                 ralink,function = "gpio";
174         };
175 };
176
177 &sdhci {
178         status = "okay";
179 };
180
181 &i2c {
182         status = "okay";
183 };
184
185 &pcie {
186         status = "okay";
187 };