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