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