ar71xx: add comments for Image/BuildLoader{, Alone}.
[openwrt.git] / 0001-ramips-add-support-for-Nexx-WT3020-devices.patch
1 From fceb829eca2bc088ad66b18099b57dc96f1bae43 Mon Sep 17 00:00:00 2001
2 From: Roger Pueyo Centelles <roger.pueyo@guifi.net>
3 Date: Sun, 19 Oct 2014 17:50:01 +0200
4 Subject: [PATCH] ramips: add support for Nexx WT3020 devices
5
6 ---
7  target/linux/ramips/base-files/etc/board.d/01_leds |   3 +
8  .../linux/ramips/base-files/etc/board.d/02_network |   1 +
9  target/linux/ramips/base-files/etc/diag.sh         |   3 +
10  target/linux/ramips/base-files/lib/ramips.sh       |   3 +
11  .../ramips/base-files/lib/upgrade/platform.sh      |   1 +
12  target/linux/ramips/dts/WT3020-4M.dts              | 100 +++++++++++++++++++++
13  target/linux/ramips/dts/WT3020-8M.dts              | 100 +++++++++++++++++++++
14  target/linux/ramips/image/Makefile                 |   2 +
15  8 files changed, 213 insertions(+)
16  create mode 100644 target/linux/ramips/dts/WT3020-4M.dts
17  create mode 100644 target/linux/ramips/dts/WT3020-8M.dts
18
19 diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
20 index 26f384d..7ca7ffb 100755
21 --- a/target/linux/ramips/base-files/etc/board.d/01_leds
22 +++ b/target/linux/ramips/base-files/etc/board.d/01_leds
23 @@ -213,6 +213,9 @@ case $board in
24         wt1520)
25                 set_wifi_led "rt2800pci-phy0::radio"
26                 ;;
27 +       wt3020)
28 +               ucidef_set_led_default "power" "power" "nexx:blue:power" "0"
29 +               ;;
30         y1 |\
31         y1s)
32                 ucidef_set_led_default "power" "power" "lenovo:blue:power" "1"
33 diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
34 index 7ecec5f..ff8fbc0 100755
35 --- a/target/linux/ramips/base-files/etc/board.d/02_network
36 +++ b/target/linux/ramips/base-files/etc/board.d/02_network
37 @@ -127,6 +127,7 @@ ramips_setup_interfaces()
38         hg255d | \
39         rt-n14u | \
40         wrtnode | \
41 +       wt3020 | \
42         ur-326n4g | \
43         zbt-wa05)
44                 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
45 diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
46 index aed7d6a..2977099 100755
47 --- a/target/linux/ramips/base-files/etc/diag.sh
48 +++ b/target/linux/ramips/base-files/etc/diag.sh
49 @@ -170,6 +170,9 @@ get_status_led() {
50         nexx-wt1520)
51                 status_led="nexx-wt1520:white:power"
52                 ;;
53 +       nexx-wt3020)
54 +               status_led="nexx:blue:power"
55 +               ;;
56         mzk-w300nh2)
57                 status_led="mzkw300nh2:green:power"
58                 ;;
59 diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
60 index 08c5dff..88fa623 100755
61 --- a/target/linux/ramips/base-files/lib/ramips.sh
62 +++ b/target/linux/ramips/base-files/lib/ramips.sh
63 @@ -184,6 +184,9 @@ ramips_board_detect() {
64         *"Nexx WT1520")
65                 name="wt1520"
66                 ;;
67 +       *"Nexx WT3020")
68 +               name="wt3020"
69 +               ;;
70         *"NW718")
71                 name="nw718"
72                 ;;
73 diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
74 index 61a0935..c9a418e 100755
75 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
76 +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
77 @@ -97,6 +97,7 @@ platform_check_image() {
78         wr8305rt |\
79         wrtnode |\
80         wt1520 |\
81 +       wt3020 |\
82         x5 |\
83         x8 |\
84         y1 |\
85 diff --git a/target/linux/ramips/dts/WT3020-4M.dts b/target/linux/ramips/dts/WT3020-4M.dts
86 new file mode 100644
87 index 0000000..7583680
88 --- /dev/null
89 +++ b/target/linux/ramips/dts/WT3020-4M.dts
90 @@ -0,0 +1,100 @@
91 +/dts-v1/;
92 +
93 +/include/ "mt7620n.dtsi"
94 +
95 +/ {
96 +       compatible = "wt3020", "ralink,mt7620n-soc";
97 +       model = "Nexx WT3020";
98 +
99 +       palmbus@10000000 {
100 +                gpio2: gpio@660 {
101 +                        status = "okay";
102 +                };
103 +
104 +                gpio3: gpio@688 {
105 +                        status = "okay";
106 +                };
107 +
108 +               spi@b00 {
109 +                       status = "okay";
110 +
111 +                       m25p80@0 {
112 +                               #address-cells = <1>;
113 +                               #size-cells = <1>;
114 +                               compatible = "w25q32";
115 +                               reg = <0 0>;
116 +                               linux,modalias = "m25p80", "w25q32";
117 +                               spi-max-frequency = <10000000>;
118 +
119 +                               partition@0 {
120 +                                       label = "u-boot";
121 +                                       reg = <0x0 0x30000>;
122 +                                       read-only;
123 +                               };
124 +
125 +                               partition@30000 {
126 +                                       label = "u-boot-env";
127 +                                       reg = <0x30000 0x10000>;
128 +                                       read-only;
129 +                               };
130 +
131 +                               factory: partition@40000 {
132 +                                       label = "factory";
133 +                                       reg = <0x40000 0x10000>;
134 +                                       read-only;
135 +                               };
136 +
137 +                               partition@50000 {
138 +                                       label = "firmware";
139 +                                       reg = <0x50000 0x3b0000>;
140 +                               };
141 +                       };
142 +               };
143 +       };
144 +
145 +       ehci@101c0000 {
146 +               status = "okay";
147 +       };
148 +
149 +       ohci@101c1000 {
150 +               status = "okay";
151 +       };
152 +
153 +       ethernet@10100000 {
154 +               mtd-mac-address = <&factory 0x4>;
155 +               ralink,port-map = "wllll";
156 +       };
157 +
158 +       wmac@10180000 {
159 +               ralink,mtd-eeprom = <&factory 0>;
160 +       };
161 +
162 +       pinctrl {
163 +               state_default: pinctrl0 {
164 +                       default {
165 +                               ralink,group = "ephy", "wled", "pa", "i2c", "wdt", "uartf";
166 +                               ralink,function = "gpio";
167 +                       };
168 +               };
169 +       };
170 +
171 +       gpio-keys-polled {
172 +               compatible = "gpio-keys-polled";
173 +               #address-cells = <1>;
174 +               #size-cells = <0>;
175 +               poll-interval = <20>;
176 +               reset {
177 +                       label = "reset";
178 +                       gpios = <&gpio0 1 1>;
179 +                       linux,code = <0x198>;
180 +               };
181 +       };
182 +
183 +        gpio-leds {
184 +                compatible = "gpio-leds";
185 +                power {
186 +                        label = "nexx:blue:power";
187 +                        gpios = <&gpio3 0 0>;
188 +                };
189 +        };
190 +};
191 diff --git a/target/linux/ramips/dts/WT3020-8M.dts b/target/linux/ramips/dts/WT3020-8M.dts
192 new file mode 100644
193 index 0000000..5fa7c92
194 --- /dev/null
195 +++ b/target/linux/ramips/dts/WT3020-8M.dts
196 @@ -0,0 +1,100 @@
197 +/dts-v1/;
198 +
199 +/include/ "mt7620n.dtsi"
200 +
201 +/ {
202 +       compatible = "wt3020", "ralink,mt7620n-soc";
203 +       model = "Nexx WT3020";
204 +
205 +       palmbus@10000000 {
206 +                gpio2: gpio@660 {
207 +                        status = "okay";
208 +                };
209 +
210 +                gpio3: gpio@688 {
211 +                        status = "okay";
212 +                };
213 +
214 +               spi@b00 {
215 +                       status = "okay";
216 +
217 +                       m25p80@0 {
218 +                               #address-cells = <1>;
219 +                               #size-cells = <1>;
220 +                               compatible = "w25q64";
221 +                               reg = <0 0>;
222 +                               linux,modalias = "m25p80", "w25q64";
223 +                               spi-max-frequency = <10000000>;
224 +
225 +                               partition@0 {
226 +                                       label = "u-boot";
227 +                                       reg = <0x0 0x30000>;
228 +                                       read-only;
229 +                               };
230 +
231 +                               partition@30000 {
232 +                                       label = "u-boot-env";
233 +                                       reg = <0x30000 0x10000>;
234 +                                       read-only;
235 +                               };
236 +
237 +                               factory: partition@40000 {
238 +                                       label = "factory";
239 +                                       reg = <0x40000 0x10000>;
240 +                                       read-only;
241 +                               };
242 +
243 +                               partition@50000 {
244 +                                       label = "firmware";
245 +                                       reg = <0x50000 0x7b0000>;
246 +                               };
247 +                       };
248 +               };
249 +       };
250 +
251 +       ehci@101c0000 {
252 +               status = "okay";
253 +       };
254 +
255 +       ohci@101c1000 {
256 +               status = "okay";
257 +       };
258 +
259 +       ethernet@10100000 {
260 +               mtd-mac-address = <&factory 0x4>;
261 +               ralink,port-map = "wllll";
262 +       };
263 +
264 +       wmac@10180000 {
265 +               ralink,mtd-eeprom = <&factory 0>;
266 +       };
267 +
268 +       pinctrl {
269 +               state_default: pinctrl0 {
270 +                       default {
271 +                               ralink,group = "ephy", "wled", "pa", "i2c", "wdt", "uartf";
272 +                               ralink,function = "gpio";
273 +                       };
274 +               };
275 +       };
276 +
277 +       gpio-keys-polled {
278 +               compatible = "gpio-keys-polled";
279 +               #address-cells = <1>;
280 +               #size-cells = <0>;
281 +               poll-interval = <20>;
282 +               reset {
283 +                       label = "reset";
284 +                       gpios = <&gpio0 1 1>;
285 +                       linux,code = <0x198>;
286 +               };
287 +       };
288 +
289 +        gpio-leds {
290 +                compatible = "gpio-leds";
291 +                power {
292 +                        label = "nexx:blue:power";
293 +                        gpios = <&gpio3 0 0>;
294 +                };
295 +        };
296 +};
297 diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
298 index f048caf..a93b82c 100644
299 --- a/target/linux/ramips/image/Makefile
300 +++ b/target/linux/ramips/image/Makefile
301 @@ -769,6 +769,7 @@ Image/Build/Profile/WMR300=$(call BuildFirmware/Default8M/$(1),$(1),wmr-300,WMR3
302  Image/Build/Profile/RT-N14U=$(call BuildFirmware/Default8M/$(1),$(1),rt-n14u,RT-N14U)
303  Image/Build/Profile/WR8305RT=$(call BuildFirmware/Default8M/$(1),$(1),wr8305rt,WR8305RT)
304  Image/Build/Profile/WRTNODE=$(call BuildFirmware/Default16M/$(1),$(1),wrtnode,WRTNODE)
305 +Image/Build/Profile/WT3020=$(call BuildFirmware/DefaultDualSize/$(1),$(1),wt3020,WT3020)
306  Image/Build/Profile/ZBT-WA05=$(call BuildFirmware/Default8M/$(1),$(1),zbt-wa05,ZBT-WA05)
307  
308  ifeq ($(SUBTARGET),mt7620n)
309 @@ -778,6 +779,7 @@ define Image/Build/Profile/Default
310         $(call Image/Build/Profile/RT-N14U,$(1))
311         $(call Image/Build/Profile/WR8305RT,$(1))
312         $(call Image/Build/Profile/WRTNODE,$(1))
313 +       $(call Image/Build/Profile/WT3020,$(1))
314         $(call Image/Build/Profile/ZBT-WA05,$(1))
315  endef
316  endif
317 -- 
318 2.1.1
319