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
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
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
25 set_wifi_led "rt2800pci-phy0::radio"
28 + ucidef_set_led_default "power" "power" "nexx:blue:power" "0"
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()
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() {
51 status_led="nexx-wt1520:white:power"
54 + status_led="nexx:blue:power"
57 status_led="mzkw300nh2:green:power"
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() {
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() {
85 diff --git a/target/linux/ramips/dts/WT3020-4M.dts b/target/linux/ramips/dts/WT3020-4M.dts
87 index 0000000..7583680
89 +++ b/target/linux/ramips/dts/WT3020-4M.dts
93 +/include/ "mt7620n.dtsi"
96 + compatible = "wt3020", "ralink,mt7620n-soc";
97 + model = "Nexx WT3020";
112 + #address-cells = <1>;
114 + compatible = "w25q32";
116 + linux,modalias = "m25p80", "w25q32";
117 + spi-max-frequency = <10000000>;
121 + reg = <0x0 0x30000>;
126 + label = "u-boot-env";
127 + reg = <0x30000 0x10000>;
131 + factory: partition@40000 {
133 + reg = <0x40000 0x10000>;
138 + label = "firmware";
139 + reg = <0x50000 0x3b0000>;
153 + ethernet@10100000 {
154 + mtd-mac-address = <&factory 0x4>;
155 + ralink,port-map = "wllll";
159 + ralink,mtd-eeprom = <&factory 0>;
163 + state_default: pinctrl0 {
165 + ralink,group = "ephy", "wled", "pa", "i2c", "wdt", "uartf";
166 + ralink,function = "gpio";
172 + compatible = "gpio-keys-polled";
173 + #address-cells = <1>;
175 + poll-interval = <20>;
178 + gpios = <&gpio0 1 1>;
179 + linux,code = <0x198>;
184 + compatible = "gpio-leds";
186 + label = "nexx:blue:power";
187 + gpios = <&gpio3 0 0>;
191 diff --git a/target/linux/ramips/dts/WT3020-8M.dts b/target/linux/ramips/dts/WT3020-8M.dts
193 index 0000000..5fa7c92
195 +++ b/target/linux/ramips/dts/WT3020-8M.dts
199 +/include/ "mt7620n.dtsi"
202 + compatible = "wt3020", "ralink,mt7620n-soc";
203 + model = "Nexx WT3020";
218 + #address-cells = <1>;
220 + compatible = "w25q64";
222 + linux,modalias = "m25p80", "w25q64";
223 + spi-max-frequency = <10000000>;
227 + reg = <0x0 0x30000>;
232 + label = "u-boot-env";
233 + reg = <0x30000 0x10000>;
237 + factory: partition@40000 {
239 + reg = <0x40000 0x10000>;
244 + label = "firmware";
245 + reg = <0x50000 0x7b0000>;
259 + ethernet@10100000 {
260 + mtd-mac-address = <&factory 0x4>;
261 + ralink,port-map = "wllll";
265 + ralink,mtd-eeprom = <&factory 0>;
269 + state_default: pinctrl0 {
271 + ralink,group = "ephy", "wled", "pa", "i2c", "wdt", "uartf";
272 + ralink,function = "gpio";
278 + compatible = "gpio-keys-polled";
279 + #address-cells = <1>;
281 + poll-interval = <20>;
284 + gpios = <&gpio0 1 1>;
285 + linux,code = <0x198>;
290 + compatible = "gpio-leds";
292 + label = "nexx:blue:power";
293 + gpios = <&gpio3 0 0>;
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)
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))