d78175cf74d6ae754a1f6396ed0a1cb2303cc7fd
[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/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 += 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/k2p
118 DTS := K2P
119 IMAGE_SIZE := $(ralink_default_fw_size_16M)
120 DEVICE_TITLE := Phicomm K2P
121 endef
122 TARGET_DEVICES += k2p
123
124 define Device/mir3g
125 DTS := MIR3G
126 BLOCKSIZE := 128k
127 PAGESIZE := 2048
128 KERNEL_SIZE := 4096k
129 KERNEL := $(KERNEL_DTB) | uImage lzma
130 IMAGE_SIZE := 32768k
131 UBINIZE_OPTS := -E 5
132 IMAGES := sysupgrade.tar kernel1.bin rootfs0.bin
133 IMAGE/kernel1.bin := append-kernel
134 IMAGE/rootfs0.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
135 IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
136 DEVICE_TITLE := Xiaomi Mi Router 3G
137 SUPPORTED_DEVICES += R3G
138 DEVICE_PACKAGES := \
139 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini \
140 uboot-envtools
141 endef
142 TARGET_DEVICES += mir3g
143
144 define Device/mt7621
145 DTS := MT7621
146 BLOCKSIZE := 64k
147 IMAGE_SIZE := $(ralink_default_fw_size_4M)
148 DEVICE_TITLE := MediaTek MT7621 EVB
149 endef
150 TARGET_DEVICES += mt7621
151
152 define Device/newifi-d1
153 DTS := Newifi-D1
154 IMAGE_SIZE := $(ralink_default_fw_size_32M)
155 DEVICE_TITLE := Newifi D1
156 DEVICE_PACKAGES := \
157 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
158 endef
159 TARGET_DEVICES += newifi-d1
160
161 define Device/d-team_newifi-d2
162 DTS := Newifi-D2
163 IMAGE_SIZE := $(ralink_default_fw_size_32M)
164 DEVICE_TITLE := Newifi D2
165 DEVICE_PACKAGES := \
166 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport
167 endef
168 TARGET_DEVICES += d-team_newifi-d2
169
170 define Device/pbr-m1
171 DTS := PBR-M1
172 IMAGE_SIZE := $(ralink_default_fw_size_16M)
173 DEVICE_TITLE := PBR-M1
174 DEVICE_PACKAGES := \
175 kmod-ata-core kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \
176 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
177 endef
178 TARGET_DEVICES += pbr-m1
179
180 define Device/r6220
181 DTS := R6220
182 BLOCKSIZE := 128k
183 PAGESIZE := 2048
184 KERNEL_SIZE := 4096k
185 KERNEL := $(KERNEL_DTB) | uImage lzma
186 IMAGE_SIZE := 28672k
187 UBINIZE_OPTS := -E 5
188 IMAGES := sysupgrade.tar kernel.bin rootfs.bin
189 IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
190 IMAGE/kernel.bin := append-kernel
191 IMAGE/rootfs.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
192 DEVICE_TITLE := Netgear R6220
193 DEVICE_PACKAGES := \
194 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
195 endef
196 TARGET_DEVICES += r6220
197
198 define Device/rb750gr3
199 DTS := RB750Gr3
200 IMAGE_SIZE := $(ralink_default_fw_size_16M)
201 DEVICE_TITLE := MikroTik RB750Gr3
202 DEVICE_PACKAGES := kmod-usb3 uboot-envtools
203 endef
204 TARGET_DEVICES += rb750gr3
205
206 define Device/re350-v1
207 DTS := RE350
208 DEVICE_TITLE := TP-LINK RE350 v1
209 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-mini
210 TPLINK_BOARD_ID := RE350-V1
211 TPLINK_HWID := 0x0
212 TPLINK_HWREV := 0
213 TPLINK_HEADER_VERSION := 1
214 IMAGE_SIZE := 6016k
215 KERNEL := $(KERNEL_DTB) | tplink-v1-header -e
216 IMAGES := sysupgrade.bin factory.bin
217 IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | append-metadata | check-size $$$$(IMAGE_SIZE)
218 IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
219 endef
220 TARGET_DEVICES += re350-v1
221
222 define Device/re6500
223 DTS := RE6500
224 DEVICE_TITLE := Linksys RE6500
225 DEVICE_PACKAGES := kmod-mt76x2 wpad-mini
226 endef
227 TARGET_DEVICES += re6500
228
229 define Device/sap-g3200u3
230 DTS := SAP-G3200U3
231 DEVICE_TITLE := STORYLiNK SAP-G3200U3
232 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
233 endef
234 TARGET_DEVICES += sap-g3200u3
235
236 define Device/sk-wb8
237 DTS := SK-WB8
238 IMAGE_SIZE := $(ralink_default_fw_size_16M)
239 DEVICE_TITLE := SamKnows Whitebox 8
240 DEVICE_PACKAGES := \
241 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport \
242 uboot-envtools wpad-mini
243 endef
244 TARGET_DEVICES += sk-wb8
245
246 define Device/timecloud
247 DTS := Timecloud
248 DEVICE_TITLE := Thunder Timecloud
249 DEVICE_PACKAGES := kmod-usb3
250 endef
251 TARGET_DEVICES += timecloud
252
253 define Device/u7621-06-256M-16M
254 DTS := U7621-06-256M-16M
255 IMAGE_SIZE := 16064k
256 DEVICE_TITLE := UniElec U7621-06 (256M RAM/16M flash)
257 DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3
258 endef
259 TARGET_DEVICES += u7621-06-256M-16M
260
261 define Device/ubnt-erx
262 DTS := UBNT-ERX
263 FILESYSTEMS := squashfs
264 KERNEL_SIZE := 3145728
265 KERNEL := $(KERNEL_DTB) | uImage lzma
266 IMAGES := sysupgrade.tar
267 KERNEL_INITRAMFS := $$(KERNEL) | ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
268 IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
269 DEVICE_TITLE := Ubiquiti EdgeRouter X
270 endef
271 TARGET_DEVICES += ubnt-erx
272
273 define Device/ubnt-erx-sfp
274 $(Device/ubnt-erx)
275 DTS := UBNT-ERX-SFP
276 DEVICE_TITLE := Ubiquiti EdgeRouter X-SFP
277 DEVICE_PACKAGES += kmod-i2c-algo-pca kmod-gpio-pca953x kmod-i2c-gpio-custom
278 endef
279 TARGET_DEVICES += ubnt-erx-sfp
280
281 define Device/vr500
282 DTS := VR500
283 IMAGE_SIZE := 66453504
284 DEVICE_TITLE := Planex VR500
285 DEVICE_PACKAGES := kmod-usb3
286 endef
287 TARGET_DEVICES += vr500
288
289 define Device/w2914nsv2
290 DTS := W2914NSV2
291 IMAGE_SIZE := $(ralink_default_fw_size_16M)
292 DEVICE_TITLE := WeVO W2914NS v2
293 DEVICE_PACKAGES := \
294 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport kmod-mt76 \
295 wpad-mini
296 endef
297 TARGET_DEVICES += w2914nsv2
298
299 define Device/wf-2881
300 DTS := WF-2881
301 BLOCKSIZE := 128k
302 PAGESIZE := 2048
303 FILESYSTEMS := squashfs
304 IMAGE_SIZE := 129280k
305 KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma
306 UBINIZE_OPTS := -E 5
307 IMAGE/sysupgrade.bin := append-kernel | append-ubi | append-metadata | check-size $$$$(IMAGE_SIZE)
308 DEVICE_TITLE := NETIS WF-2881
309 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport
310 endef
311 TARGET_DEVICES += wf-2881
312
313 define Device/witi
314 DTS := WITI
315 IMAGE_SIZE := $(ralink_default_fw_size_16M)
316 DEVICE_TITLE := MQmaker WiTi
317 DEVICE_PACKAGES := \
318 kmod-ata-core kmod-ata-ahci kmod-mt76x2 kmod-sdhci-mt7620 kmod-usb3 \
319 kmod-usb-ledtrig-usbport wpad-mini
320 endef
321 TARGET_DEVICES += witi
322
323 define Device/wndr3700v5
324 DTS := WNDR3700V5
325 IMAGE_SIZE := $(ralink_default_fw_size_16M)
326 DEVICE_TITLE := Netgear WNDR3700v5
327 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 wpad-mini
328 endef
329 TARGET_DEVICES += wndr3700v5
330
331 define Device/youhua_wr1200js
332 DTS := WR1200JS
333 IMAGE_SIZE := 16064k
334 DEVICE_TITLE := YouHua WR1200JS
335 DEVICE_PACKAGES := \
336 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport
337 endef
338 TARGET_DEVICES += youhua_wr1200js
339
340 define Device/wsr-1166
341 DTS := WSR-1166
342 IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata
343 IMAGE_SIZE := $(ralink_default_fw_size_16M)
344 DEVICE_TITLE := Buffalo WSR-1166
345 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-mini
346 endef
347 TARGET_DEVICES += wsr-1166
348
349 define Device/wsr-600
350 DTS := WSR-600
351 IMAGE_SIZE := $(ralink_default_fw_size_16M)
352 DEVICE_TITLE := Buffalo WSR-600
353 DEVICE_PACKAGES := kmod-mt7603 kmod-rt2800-pci wpad-mini
354 endef
355 TARGET_DEVICES += wsr-600
356
357 define Device/zbt-we1326
358 DTS := ZBT-WE1326
359 IMAGE_SIZE := $(ralink_default_fw_size_16M)
360 DEVICE_TITLE := ZBT WE1326
361 DEVICE_PACKAGES := \
362 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-sdhci-mt7620 wpad-mini
363 endef
364 TARGET_DEVICES += zbt-we1326
365
366 define Device/zbtlink_zbt-we3526
367 DTS := ZBT-WE3526
368 IMAGE_SIZE := $(ralink_default_fw_size_16M)
369 DEVICE_TITLE := ZBT WE3526
370 DEVICE_PACKAGES := \
371 kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \
372 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
373 endef
374 TARGET_DEVICES += zbtlink_zbt-we3526
375
376 define Device/zbt-wg2626
377 DTS := ZBT-WG2626
378 IMAGE_SIZE := $(ralink_default_fw_size_16M)
379 DEVICE_TITLE := ZBT WG2626
380 DEVICE_PACKAGES := \
381 kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 \
382 kmod-usb-ledtrig-usbport wpad-mini
383 endef
384 TARGET_DEVICES += zbt-wg2626
385
386 define Device/zbt-wg3526-16M
387 DTS := ZBT-WG3526-16M
388 IMAGE_SIZE := $(ralink_default_fw_size_16M)
389 SUPPORTED_DEVICES += zbt-wg3526
390 DEVICE_TITLE := ZBT WG3526 (16MB flash)
391 DEVICE_PACKAGES := \
392 kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \
393 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
394 endef
395 TARGET_DEVICES += zbt-wg3526-16M
396
397 define Device/zbt-wg3526-32M
398 DTS := ZBT-WG3526-32M
399 IMAGE_SIZE := $(ralink_default_fw_size_32M)
400 SUPPORTED_DEVICES += ac1200pro
401 DEVICE_TITLE := ZBT WG3526 (32MB flash)
402 DEVICE_PACKAGES := \
403 kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \
404 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
405 endef
406 TARGET_DEVICES += zbt-wg3526-32M
407
408 # FIXME: is this still needed?
409 define Image/Prepare
410 #define Build/Compile
411 rm -rf $(KDIR)/relocate
412 $(CP) ../../generic/image/relocate $(KDIR)
413 $(MAKE) -C $(KDIR)/relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS)
414 $(CP) $(KDIR)/relocate/loader.bin $(KDIR)/loader.bin
415 endef