-
Notifications
You must be signed in to change notification settings - Fork 5
/
0001-WT3020-Add-support-for-16M-flash.patch
184 lines (179 loc) · 4.15 KB
/
0001-WT3020-Add-support-for-16M-flash.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
From dfc5b34fbd7d98d255441183a7e78b72e44c7e71 Mon Sep 17 00:00:00 2001
From: fabianhu <[email protected]>
Date: Mon, 13 Mar 2017 09:22:09 +0100
Subject: [PATCH] WT3020: Add support for 16M flash
---
target/linux/ramips/base-files/lib/ramips.sh | 3 +
target/linux/ramips/dts/WT3020-16M.dts | 102 +++++++++++++++++++++++++++
target/linux/ramips/image/mt7620.mk | 9 +++
tools/firmware-utils/src/mkporayfw.c | 8 +++
4 files changed, 122 insertions(+)
create mode 100644 target/linux/ramips/dts/WT3020-16M.dts
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 6002362..207147a 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -622,6 +622,9 @@ ramips_board_detect() {
*"WT3020 (8M)")
name="wt3020-8M"
;;
+ *"WT3020 (16M)")
+ name="wt3020-16M"
+ ;;
*"WZR-AGL300NH")
name="wzr-agl300nh"
;;
diff --git a/target/linux/ramips/dts/WT3020-16M.dts b/target/linux/ramips/dts/WT3020-16M.dts
new file mode 100644
index 0000000..f7dfa26
--- /dev/null
+++ b/target/linux/ramips/dts/WT3020-16M.dts
@@ -0,0 +1,102 @@
+/dts-v1/;
+
+#include "mt7620n.dtsi"
+
+#include <dt-bindings/input/input.h>
+
+/ {
+ compatible = "wt3020", "ralink,mt7620n-soc";
+ model = "Nexx WT3020 (16M)";
+
+ gpio-keys-polled {
+ compatible = "gpio-keys-polled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ poll-interval = <20>;
+
+ reset {
+ label = "reset";
+ gpios = <&gpio0 1 1>;
+ linux,code = <KEY_RESTART>;
+ };
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+
+ power {
+ label = "wt3020:blue:power";
+ gpios = <&gpio3 0 0>;
+ };
+ };
+};
+
+&gpio2 {
+ status = "okay";
+};
+
+&gpio3 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "w25q64";
+ spi-max-frequency = <10000000>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xfb0000>;
+ };
+ };
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+ðernet {
+ mtd-mac-address = <&factory 0x4>;
+ mediatek,portmap = "wllll";
+};
+
+&wmac {
+ ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ default {
+ ralink,group = "ephy", "wled", "pa", "i2c", "wdt", "uartf";
+ ralink,function = "gpio";
+ };
+ };
+};
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index 7122cfd..438a6a6 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -426,6 +426,15 @@ define Device/wt3020-8M
endef
TARGET_DEVICES += wt3020-8M
+define Device/wt3020-16M
+ DTS := WT3020-16M
+ IMAGES += factory.bin
+ IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
+ poray-header -B WT3020 -F 16M
+ DEVICE_TITLE := Nexx WT3020 (16MB)
+endef
+TARGET_DEVICES += wt3020-16M
+
define Device/y1
DTS := Y1
IMAGE_SIZE := $(ralink_default_fw_size_16M)
diff --git a/tools/firmware-utils/src/mkporayfw.c b/tools/firmware-utils/src/mkporayfw.c
index 6ec4f32..6ef9afc 100644
--- a/tools/firmware-utils/src/mkporayfw.c
+++ b/tools/firmware-utils/src/mkporayfw.c
@@ -136,6 +136,9 @@ static struct flash_layout layouts[] = {
.id = "8M",
.fw_max_len = 0x7c0000,
}, {
+ .id = "16M",
+ .fw_max_len = 0xfc0000,
+ }, {
/* terminating entry */
}
};
@@ -230,6 +233,11 @@ static struct board_info boards[] = {
.id = "WT3020",
.hw_id = HWID_NEXX_WT3020,
.layout_id = "8M",
+ .key = KEY_NEXX_2,
+ }, {
+ .id = "WT3020",
+ .hw_id = HWID_NEXX_WT3020,
+ .layout_id = "16M",
.key = KEY_NEXX_2,
}, {
--
2.7.4