ramips: add support for I-O DATA WN-GX300GR
[openwrt/openwrt.git] / target / linux / ramips / image / mt7621.mk
1 #
2 # MT7621 Profiles
3 #
4
5 DEVICE_VARS += TPLINK_BOARD_ID TPLINK_HEADER_VERSION TPLINK_HWID TPLINK_HWREV
6
7 define Build/ubnt-erx-factory-image
8 if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(KERNEL_SIZE)" ]; then \
9 echo '21001:6' > $(1).compat; \
10 $(TAR) -cf $(1) --transform='s/^.*/compat/' $(1).compat; \
11 \
12 $(TAR) -rf $(1) --transform='s/^.*/vmlinux.tmp/' $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE); \
13 mkhash md5 $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) > $(1).md5; \
14 $(TAR) -rf $(1) --transform='s/^.*/vmlinux.tmp.md5/' $(1).md5; \
15 \
16 echo "dummy" > $(1).rootfs; \
17 $(TAR) -rf $(1) --transform='s/^.*/squashfs.tmp/' $(1).rootfs; \
18 \
19 mkhash md5 $(1).rootfs > $(1).md5; \
20 $(TAR) -rf $(1) --transform='s/^.*/squashfs.tmp.md5/' $(1).md5; \
21 \
22 echo '$(BOARD) $(VERSION_CODE) $(VERSION_NUMBER)' > $(1).version; \
23 $(TAR) -rf $(1) --transform='s/^.*/version.tmp/' $(1).version; \
24 \
25 $(CP) $(1) $(BIN_DIR)/; \
26 else \
27 echo "WARNING: initramfs kernel image too big, cannot generate factory image" >&2; \
28 fi
29 endef
30
31 define Device/11acnas
32 DTS := 11ACNAS
33 IMAGE_SIZE := $(ralink_default_fw_size_16M)
34 DEVICE_TITLE := WeVO 11AC NAS Router
35 DEVICE_PACKAGES := kmod-mt7603 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
36 endef
37 TARGET_DEVICES += 11acnas
38
39 define Device/dir-860l-b1
40 DTS := DIR-860L-B1
41 BLOCKSIZE := 64k
42 IMAGES += factory.bin
43 KERNEL := kernel-bin | patch-dtb | relocate-kernel | lzma | uImage lzma
44 IMAGE_SIZE := $(ralink_default_fw_size_16M)
45 IMAGE/sysupgrade.bin := \
46 append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \
47 seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
48 pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
49 IMAGE/factory.bin := \
50 append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
51 append-rootfs | pad-rootfs -x 64 | \
52 seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
53 seama-seal -m "signature=wrgac13_dlink.2013gui_dir860lb" | \
54 check-size $$$$(IMAGE_SIZE)
55 DEVICE_TITLE := D-Link DIR-860L B1
56 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
57 endef
58 TARGET_DEVICES += dir-860l-b1
59
60 define Device/mediatek_ap-mt7621a-v60
61 DTS := AP-MT7621A-V60
62 IMAGE_SIZE := $(ralink_default_fw_size_8M)
63 DEVICE_TITLE := Mediatek AP-MT7621A-V60 EVB
64 DEVICE_PACKAGES := kmod-usb3 kmod-sdhci-mt7620 kmod-sound-mt7620
65 endef
66 TARGET_DEVICES += mediatek_ap-mt7621a-v60
67
68 define Device/ew1200
69 DTS := EW1200
70 IMAGE_SIZE := $(ralink_default_fw_size_16M)
71 DEVICE_TITLE := AFOUNDRY EW1200
72 DEVICE_PACKAGES := \
73 kmod-ata-core kmod-ata-ahci kmod-mt76x2 kmod-mt7603 kmod-usb3 \
74 kmod-usb-ledtrig-usbport wpad-mini
75 endef
76 TARGET_DEVICES += ew1200
77
78 define Device/firewrt
79 DTS := FIREWRT
80 IMAGE_SIZE := $(ralink_default_fw_size_16M)
81 DEVICE_TITLE := Firefly FireWRT
82 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
83 endef
84 TARGET_DEVICES += firewrt
85
86 define Device/gnubee_gb-pc1
87 DTS := GB-PC1
88 DEVICE_TITLE := GnuBee Personal Cloud One
89 DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620
90 IMAGE_SIZE := $(ralink_default_fw_size_32M)
91 endef
92 TARGET_DEVICES += gnubee_gb-pc1
93
94 define Device/gnubee_gb-pc2
95 DTS := GB-PC2
96 DEVICE_TITLE := GnuBee Personal Cloud Two
97 DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620
98 IMAGE_SIZE := $(ralink_default_fw_size_32M)
99 endef
100 TARGET_DEVICES += gnubee_gb-pc2
101
102 define Device/hc5962
103 DTS := HC5962
104 BLOCKSIZE := 128k
105 PAGESIZE := 2048
106 KERNEL_SIZE := 2097152
107 UBINIZE_OPTS := -E 5
108 IMAGE_SIZE := $(ralink_default_fw_size_32M)
109 IMAGES += factory.bin
110 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
111 IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size $$$$(IMAGE_SIZE)
112 DEVICE_TITLE := HiWiFi HC5962
113 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 wpad-mini
114 endef
115 TARGET_DEVICES += hc5962
116
117 define Device/iodata_wn-gx300gr
118 DTS := WN-GX300GR
119 IMAGE_SIZE := 7798784
120 DEVICE_TITLE := I-O DATA WN-GX300GR
121 DEVICE_PACKAGES := kmod-mt7603 wpad-mini
122 endef
123 TARGET_DEVICES += iodata_wn-gx300gr
124
125 define Device/k2p
126 DTS := K2P
127 IMAGE_SIZE := $(ralink_default_fw_size_16M)
128 DEVICE_TITLE := Phicomm K2P
129 endef
130 TARGET_DEVICES += k2p
131
132 define Device/mir3g
133 DTS := MIR3G
134 BLOCKSIZE := 128k
135 PAGESIZE := 2048
136 KERNEL_SIZE := 4096k
137 KERNEL := $(KERNEL_DTB) | uImage lzma
138 IMAGE_SIZE := 32768k
139 UBINIZE_OPTS := -E 5
140 IMAGES := sysupgrade.tar kernel1.bin rootfs0.bin
141 IMAGE/kernel1.bin := append-kernel
142 IMAGE/rootfs0.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
143 IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
144 DEVICE_TITLE := Xiaomi Mi Router 3G
145 SUPPORTED_DEVICES += R3G
146 DEVICE_PACKAGES := \
147 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini \
148 uboot-envtools
149 endef
150 TARGET_DEVICES += mir3g
151
152 define Device/mt7621
153 DTS := MT7621
154 BLOCKSIZE := 64k
155 IMAGE_SIZE := $(ralink_default_fw_size_4M)
156 DEVICE_TITLE := MediaTek MT7621 EVB
157 endef
158 TARGET_DEVICES += mt7621
159
160 define Device/newifi-d1
161 DTS := Newifi-D1
162 IMAGE_SIZE := $(ralink_default_fw_size_32M)
163 DEVICE_TITLE := Newifi D1
164 DEVICE_PACKAGES := \
165 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
166 endef
167 TARGET_DEVICES += newifi-d1
168
169 define Device/d-team_newifi-d2
170 DTS := Newifi-D2
171 IMAGE_SIZE := $(ralink_default_fw_size_32M)
172 DEVICE_TITLE := Newifi D2
173 DEVICE_PACKAGES := \
174 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
175 endef
176 TARGET_DEVICES += d-team_newifi-d2
177
178 define Device/pbr-m1
179 DTS := PBR-M1
180 IMAGE_SIZE := $(ralink_default_fw_size_16M)
181 DEVICE_TITLE := PBR-M1
182 DEVICE_PACKAGES := \
183 kmod-ata-core kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \
184 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
185 endef
186 TARGET_DEVICES += pbr-m1
187
188 define Device/r6220
189 DTS := R6220
190 BLOCKSIZE := 128k
191 PAGESIZE := 2048
192 KERNEL_SIZE := 4096k
193 KERNEL := $(KERNEL_DTB) | uImage lzma
194 IMAGE_SIZE := 28672k
195 UBINIZE_OPTS := -E 5
196 IMAGES := sysupgrade.tar kernel.bin rootfs.bin
197 IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
198 IMAGE/kernel.bin := append-kernel
199 IMAGE/rootfs.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
200 DEVICE_TITLE := Netgear R6220
201 DEVICE_PACKAGES := \
202 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
203 endef
204 TARGET_DEVICES += r6220
205
206 define Device/rb750gr3
207 DTS := RB750Gr3
208 IMAGE_SIZE := $(ralink_default_fw_size_16M)
209 DEVICE_TITLE := MikroTik RB750Gr3
210 DEVICE_PACKAGES := kmod-usb3 uboot-envtools
211 endef
212 TARGET_DEVICES += rb750gr3
213
214 define Device/re350-v1
215 DTS := RE350
216 DEVICE_TITLE := TP-LINK RE350 v1
217 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-mini
218 TPLINK_BOARD_ID := RE350-V1
219 TPLINK_HWID := 0x0
220 TPLINK_HWREV := 0
221 TPLINK_HEADER_VERSION := 1
222 IMAGE_SIZE := 6016k
223 KERNEL := $(KERNEL_DTB) | tplink-v1-header -e
224 IMAGES := sysupgrade.bin factory.bin
225 IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | append-metadata | check-size $$$$(IMAGE_SIZE)
226 IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
227 endef
228 TARGET_DEVICES += re350-v1
229
230 define Device/re6500
231 DTS := RE6500
232 DEVICE_TITLE := Linksys RE6500
233 DEVICE_PACKAGES := kmod-mt76x2 wpad-mini
234 endef
235 TARGET_DEVICES += re6500
236
237 define Device/sap-g3200u3
238 DTS := SAP-G3200U3
239 DEVICE_TITLE := STORYLiNK SAP-G3200U3
240 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
241 endef
242 TARGET_DEVICES += sap-g3200u3
243
244 define Device/sk-wb8
245 DTS := SK-WB8
246 IMAGE_SIZE := $(ralink_default_fw_size_16M)
247 DEVICE_TITLE := SamKnows Whitebox 8
248 DEVICE_PACKAGES := \
249 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport \
250 uboot-envtools wpad-mini
251 endef
252 TARGET_DEVICES += sk-wb8
253
254 define Device/timecloud
255 DTS := Timecloud
256 DEVICE_TITLE := Thunder Timecloud
257 DEVICE_PACKAGES := kmod-usb3
258 endef
259 TARGET_DEVICES += timecloud
260
261 define Device/u7621-06-256M-16M
262 DTS := U7621-06-256M-16M
263 IMAGE_SIZE := 16064k
264 DEVICE_TITLE := UniElec U7621-06 (256M RAM/16M flash)
265 DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3
266 endef
267 TARGET_DEVICES += u7621-06-256M-16M
268
269 define Device/ubnt-erx
270 DTS := UBNT-ERX
271 FILESYSTEMS := squashfs
272 KERNEL_SIZE := 3145728
273 KERNEL := $(KERNEL_DTB) | uImage lzma
274 IMAGES := sysupgrade.tar
275 KERNEL_INITRAMFS := $$(KERNEL) | ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
276 IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
277 DEVICE_TITLE := Ubiquiti EdgeRouter X
278 endef
279 TARGET_DEVICES += ubnt-erx
280
281 define Device/ubnt-erx-sfp
282 $(Device/ubnt-erx)
283 DTS := UBNT-ERX-SFP
284 DEVICE_TITLE := Ubiquiti EdgeRouter X-SFP
285 DEVICE_PACKAGES += kmod-i2c-algo-pca kmod-gpio-pca953x kmod-i2c-gpio-custom
286 endef
287 TARGET_DEVICES += ubnt-erx-sfp
288
289 define Device/vr500
290 DTS := VR500
291 IMAGE_SIZE := 66453504
292 DEVICE_TITLE := Planex VR500
293 DEVICE_PACKAGES := kmod-usb3
294 endef
295 TARGET_DEVICES += vr500
296
297 define Device/w2914nsv2
298 DTS := W2914NSV2
299 IMAGE_SIZE := $(ralink_default_fw_size_16M)
300 DEVICE_TITLE := WeVO W2914NS v2
301 DEVICE_PACKAGES := \
302 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
303 endef
304 TARGET_DEVICES += w2914nsv2
305
306 define Device/wf-2881
307 DTS := WF-2881
308 BLOCKSIZE := 128k
309 PAGESIZE := 2048
310 FILESYSTEMS := squashfs
311 IMAGE_SIZE := 129280k
312 KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma
313 UBINIZE_OPTS := -E 5
314 IMAGE/sysupgrade.bin := append-kernel | append-ubi | append-metadata | check-size $$$$(IMAGE_SIZE)
315 DEVICE_TITLE := NETIS WF-2881
316 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
317 endef
318 TARGET_DEVICES += wf-2881
319
320 define Device/mqmaker_witi-256m
321 DTS := WITI-256M
322 IMAGE_SIZE := $(ralink_default_fw_size_16M)
323 DEVICE_TITLE := MQmaker WiTi (256MB RAM)
324 DEVICE_PACKAGES := \
325 kmod-ata-core kmod-ata-ahci kmod-mt76x2 kmod-sdhci-mt7620 kmod-usb3 \
326 kmod-usb-ledtrig-usbport wpad-mini
327 SUPPORTED_DEVICES += witi
328 endef
329 TARGET_DEVICES += mqmaker_witi-256m
330
331 define Device/mqmaker_witi-512m
332 DTS := WITI-512M
333 IMAGE_SIZE := $(ralink_default_fw_size_16M)
334 DEVICE_TITLE := MQmaker WiTi (512MB RAM)
335 DEVICE_PACKAGES := \
336 kmod-ata-core kmod-ata-ahci kmod-mt76x2 kmod-sdhci-mt7620 kmod-usb3 \
337 kmod-usb-ledtrig-usbport wpad-mini
338 endef
339 TARGET_DEVICES += mqmaker_witi-512m
340
341 define Device/wndr3700v5
342 DTS := WNDR3700V5
343 IMAGE_SIZE := $(ralink_default_fw_size_16M)
344 DEVICE_TITLE := Netgear WNDR3700v5
345 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 wpad-mini
346 endef
347 TARGET_DEVICES += wndr3700v5
348
349 define Device/youhua_wr1200js
350 DTS := WR1200JS
351 IMAGE_SIZE := 16064k
352 DEVICE_TITLE := YouHua WR1200JS
353 DEVICE_PACKAGES := \
354 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
355 endef
356 TARGET_DEVICES += youhua_wr1200js
357
358 define Device/wsr-1166
359 DTS := WSR-1166
360 IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata
361 IMAGE_SIZE := $(ralink_default_fw_size_16M)
362 DEVICE_TITLE := Buffalo WSR-1166
363 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-mini
364 endef
365 TARGET_DEVICES += wsr-1166
366
367 define Device/wsr-600
368 DTS := WSR-600
369 IMAGE_SIZE := $(ralink_default_fw_size_16M)
370 DEVICE_TITLE := Buffalo WSR-600
371 DEVICE_PACKAGES := kmod-mt7603 kmod-rt2800-pci wpad-mini
372 endef
373 TARGET_DEVICES += wsr-600
374
375 define Device/zbt-we1326
376 DTS := ZBT-WE1326
377 IMAGE_SIZE := $(ralink_default_fw_size_16M)
378 DEVICE_TITLE := ZBT WE1326
379 DEVICE_PACKAGES := \
380 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-sdhci-mt7620 wpad-mini
381 endef
382 TARGET_DEVICES += zbt-we1326
383
384 define Device/zbtlink_zbt-we3526
385 DTS := ZBT-WE3526
386 IMAGE_SIZE := $(ralink_default_fw_size_16M)
387 DEVICE_TITLE := ZBT WE3526
388 DEVICE_PACKAGES := \
389 kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \
390 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
391 endef
392 TARGET_DEVICES += zbtlink_zbt-we3526
393
394 define Device/zbt-wg2626
395 DTS := ZBT-WG2626
396 IMAGE_SIZE := $(ralink_default_fw_size_16M)
397 DEVICE_TITLE := ZBT WG2626
398 DEVICE_PACKAGES := \
399 kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 \
400 kmod-usb-ledtrig-usbport wpad-mini
401 endef
402 TARGET_DEVICES += zbt-wg2626
403
404 define Device/zbt-wg3526-16M
405 DTS := ZBT-WG3526-16M
406 IMAGE_SIZE := $(ralink_default_fw_size_16M)
407 SUPPORTED_DEVICES += zbt-wg3526
408 DEVICE_TITLE := ZBT WG3526 (16MB flash)
409 DEVICE_PACKAGES := \
410 kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \
411 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
412 endef
413 TARGET_DEVICES += zbt-wg3526-16M
414
415 define Device/zbt-wg3526-32M
416 DTS := ZBT-WG3526-32M
417 IMAGE_SIZE := $(ralink_default_fw_size_32M)
418 SUPPORTED_DEVICES += ac1200pro
419 DEVICE_TITLE := ZBT WG3526 (32MB flash)
420 DEVICE_PACKAGES := \
421 kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \
422 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
423 endef
424 TARGET_DEVICES += zbt-wg3526-32M
425
426 # FIXME: is this still needed?
427 define Image/Prepare
428 #define Build/Compile
429 rm -rf $(KDIR)/relocate
430 $(CP) ../../generic/image/relocate $(KDIR)
431 $(MAKE) -C $(KDIR)/relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS)
432 $(CP) $(KDIR)/relocate/loader.bin $(KDIR)/loader.bin
433 endef