ramips: fix partitions and boot for RAVPower RP-WD03
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620n_ravpower_rp-wd03.dts
1 /dts-v1/;
2
3 #include "mt7620n.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "ravpower,rp-wd03", "ralink,mt7620n-soc";
10 model = "RAVPower RP-WD03";
11
12 chosen {
13 bootargs = "console=ttyS0,115200";
14 };
15
16 leds {
17 compatible = "gpio-leds";
18
19 green-wifi {
20 label = "rp-wd03:green:wifi";
21 gpios = <&gpio2 0 GPIO_ACTIVE_HIGH>;
22 };
23
24 blue-wifi {
25 label = "rp-wd03:blue:wifi";
26 gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>;
27 };
28 };
29
30 keys {
31 compatible = "gpio-keys";
32
33 reset {
34 label = "reset";
35 gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
36 linux,code = <KEY_RESTART>;
37 };
38 };
39
40 virtual_flash {
41 compatible = "mtd-concat";
42
43 devices = <&firmware1 &firmware2 &firmware3>;
44
45 partitions {
46 compatible = "fixed-partitions";
47 #address-cells = <1>;
48 #size-cells = <1>;
49
50 partition@0 {
51 compatible = "openwrt,okli";
52 label = "firmware";
53 reg = <0x0 0x0>;
54 };
55 };
56 };
57 };
58
59 &gpio2 {
60 status = "okay";
61 };
62
63 &gpio3 {
64 status = "okay";
65 };
66
67 &i2c {
68 status = "okay";
69 };
70
71 &spi0 {
72 status = "okay";
73
74 flash@0 {
75 compatible = "jedec,spi-nor";
76 reg = <0>;
77 spi-max-frequency = <50000000>;
78 m25p,fast-read;
79
80 partitions {
81 compatible = "fixed-partitions";
82 #address-cells = <1>;
83 #size-cells = <1>;
84
85 partition@0 {
86 label = "u-boot";
87 reg = <0x0 0x30000>;
88 read-only;
89 };
90
91 partition@30000 {
92 label = "config";
93 reg = <0x30000 0x10000>;
94 read-only;
95 };
96
97 factory: partition@40000 {
98 label = "factory";
99 reg = <0x40000 0x10000>;
100 read-only;
101 };
102
103 partition@50000 {
104 label = "loader";
105 reg = <0x50000 0x10000>;
106 read-only;
107 };
108
109 firmware2: partition@60000 {
110 label = "firmware2";
111 reg = <0x60000 0x170000>;
112 };
113
114 partition@1d0000 {
115 label = "u-boot-env";
116 reg = <0x1d0000 0x10000>;
117 };
118
119 firmware3: partition@1e0000 {
120 label = "firmware3";
121 reg = <0x1e0000 0x20000>;
122 };
123
124 firmware1: partition@200000 {
125 label = "firmware1";
126 reg = <0x200000 0x600000>;
127 };
128 };
129 };
130 };
131
132 &ehci {
133 status = "okay";
134 };
135
136 &ohci {
137 status = "okay";
138 };
139
140 &ethernet {
141 mtd-mac-address = <&factory 0x4000>;
142 };
143
144 &wmac {
145 ralink,mtd-eeprom = <&factory 0x0>;
146 };
147
148 &state_default {
149 gpio {
150 groups = "wled", "ephy";
151 function = "gpio";
152 };
153 };