3475a42438a8f6f196d5b62ee5cc14e47bd1db7a
[openwrt/openwrt.git] / target / linux / ramips / image / mt7621.mk
1 #
2 # MT7621 Profiles
3 #
4
5 define Build/ubnt-erx-factory-image
6 if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(KERNEL_SIZE)" ]; then \
7 echo '21001:6' > $(1).compat; \
8 $(TAR) -cf $(1) --transform='s/^.*/compat/' $(1).compat; \
9 \
10 $(TAR) -rf $(1) --transform='s/^.*/vmlinux.tmp/' $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE); \
11 mkhash md5 $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) > $(1).md5; \
12 $(TAR) -rf $(1) --transform='s/^.*/vmlinux.tmp.md5/' $(1).md5; \
13 \
14 echo "dummy" > $(1).rootfs; \
15 $(TAR) -rf $(1) --transform='s/^.*/squashfs.tmp/' $(1).rootfs; \
16 \
17 mkhash md5 $(1).rootfs > $(1).md5; \
18 $(TAR) -rf $(1) --transform='s/^.*/squashfs.tmp.md5/' $(1).md5; \
19 \
20 echo '$(BOARD) $(VERSION_CODE) $(VERSION_NUMBER)' > $(1).version; \
21 $(TAR) -rf $(1) --transform='s/^.*/version.tmp/' $(1).version; \
22 \
23 $(CP) $(1) $(BIN_DIR)/; \
24 else \
25 echo "WARNING: initramfs kernel image too big, cannot generate factory image" >&2; \
26 fi
27 endef
28
29 define Device/11acnas
30 DTS := 11ACNAS
31 IMAGE_SIZE := $(ralink_default_fw_size_16M)
32 DEVICE_TITLE := WeVO 11AC NAS Router
33 DEVICE_PACKAGES := kmod-mt7603 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
34 endef
35 TARGET_DEVICES += 11acnas
36
37 define Device/dir-860l-b1
38 DTS := DIR-860L-B1
39 BLOCKSIZE := 64k
40 IMAGES += factory.bin
41 KERNEL := kernel-bin | patch-dtb | relocate-kernel | lzma | uImage lzma
42 IMAGE_SIZE := $(ralink_default_fw_size_16M)
43 IMAGE/sysupgrade.bin := \
44 append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \
45 seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
46 pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
47 IMAGE/factory.bin := \
48 append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
49 append-rootfs | pad-rootfs -x 64 | \
50 seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
51 seama-seal -m "signature=wrgac13_dlink.2013gui_dir860lb" | \
52 check-size $$$$(IMAGE_SIZE)
53 DEVICE_TITLE := D-Link DIR-860L B1
54 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
55 endef
56 TARGET_DEVICES += dir-860l-b1
57
58 define Device/ew1200
59 DTS := EW1200
60 IMAGE_SIZE := $(ralink_default_fw_size_16M)
61 DEVICE_TITLE := AFOUNDRY EW1200
62 DEVICE_PACKAGES := \
63 kmod-ata-core kmod-ata-ahci kmod-mt76x2 kmod-usb3 \
64 kmod-usb-ledtrig-usbport wpad-mini
65 endef
66 TARGET_DEVICES += ew1200
67
68 define Device/firewrt
69 DTS := FIREWRT
70 IMAGE_SIZE := $(ralink_default_fw_size_16M)
71 DEVICE_TITLE := Firefly FireWRT
72 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
73 endef
74 TARGET_DEVICES += firewrt
75
76 define Device/hc5962
77 DTS := HC5962
78 BLOCKSIZE := 128k
79 PAGESIZE := 2048
80 KERNEL_SIZE := 2097152
81 UBINIZE_OPTS := -E 5
82 IMAGE_SIZE := $(ralink_default_fw_size_32M)
83 IMAGES += factory.bin
84 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
85 IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size $$$$(IMAGE_SIZE)
86 DEVICE_TITLE := HiWiFi HC5962
87 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 wpad-mini
88 endef
89 TARGET_DEVICES += hc5962
90
91 define Device/mt7621
92 DTS := MT7621
93 BLOCKSIZE := 64k
94 IMAGE_SIZE := $(ralink_default_fw_size_4M)
95 DEVICE_TITLE := MediaTek MT7621 EVB
96 endef
97 TARGET_DEVICES += mt7621
98
99 define Device/newifi-d1
100 DTS := Newifi-D1
101 IMAGE_SIZE := $(ralink_default_fw_size_32M)
102 DEVICE_TITLE := Newifi D1
103 DEVICE_PACKAGES := \
104 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
105 endef
106 TARGET_DEVICES += newifi-d1
107
108 define Device/pbr-m1
109 DTS := PBR-M1
110 IMAGE_SIZE := $(ralink_default_fw_size_16M)
111 DEVICE_TITLE := PBR-M1
112 DEVICE_PACKAGES := \
113 kmod-ata-core kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \
114 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
115 endef
116 TARGET_DEVICES += pbr-m1
117
118 define Device/r6220
119 DTS := R6220
120 BLOCKSIZE := 128k
121 PAGESIZE := 2048
122 KERNEL_SIZE := 4096k
123 KERNEL := $(KERNEL_DTB) | uImage lzma
124 IMAGE_SIZE := 28672k
125 UBINIZE_OPTS := -E 5
126 IMAGES := sysupgrade.tar kernel.bin rootfs.bin
127 IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
128 IMAGE/kernel.bin := append-kernel
129 IMAGE/rootfs.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
130 DEVICE_TITLE := Netgear R6220
131 DEVICE_PACKAGES := \
132 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
133 endef
134 TARGET_DEVICES += r6220
135
136 define Device/rb750gr3
137 DTS := RB750Gr3
138 IMAGE_SIZE := $(ralink_default_fw_size_16M)
139 DEVICE_TITLE := MikroTik RB750Gr3
140 DEVICE_PACKAGES := kmod-usb3 uboot-envtools
141 endef
142 TARGET_DEVICES += rb750gr3
143
144 define Device/re6500
145 DTS := RE6500
146 DEVICE_TITLE := Linksys RE6500
147 DEVICE_PACKAGES := kmod-mt76x2 wpad-mini
148 endef
149 TARGET_DEVICES += re6500
150
151 define Device/sap-g3200u3
152 DTS := SAP-G3200U3
153 DEVICE_TITLE := STORYLiNK SAP-G3200U3
154 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
155 endef
156 TARGET_DEVICES += sap-g3200u3
157
158 define Device/sk-wb8
159 DTS := SK-WB8
160 IMAGE_SIZE := $(ralink_default_fw_size_16M)
161 DEVICE_TITLE := SamKnows Whitebox 8
162 DEVICE_PACKAGES := \
163 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport \
164 uboot-envtools wpad-mini
165 endef
166 TARGET_DEVICES += sk-wb8
167
168 define Device/timecloud
169 DTS := Timecloud
170 DEVICE_TITLE := Thunder Timecloud
171 DEVICE_PACKAGES := kmod-usb3
172 endef
173 TARGET_DEVICES += timecloud
174
175 define Device/ubnt-erx
176 DTS := UBNT-ERX
177 FILESYSTEMS := squashfs
178 KERNEL_SIZE := 3145728
179 KERNEL := $(KERNEL_DTB) | uImage lzma
180 IMAGES := sysupgrade.tar
181 KERNEL_INITRAMFS := $$(KERNEL) | ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
182 IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
183 DEVICE_TITLE := Ubiquiti EdgeRouter X
184 endef
185 TARGET_DEVICES += ubnt-erx
186
187 define Device/ubnt-erx-sfp
188 DTS := UBNT-ERX-SFP
189 FILESYSTEMS := squashfs
190 KERNEL_SIZE := 3145728
191 KERNEL := $(KERNEL_DTB) | uImage lzma
192 IMAGES := sysupgrade.tar
193 KERNEL_INITRAMFS := $$(KERNEL) | ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
194 IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
195 DEVICE_TITLE := Ubiquiti EdgeRouter X-SFP
196 DEVICE_PACKAGES := -kmod-mt76 -kmod-rt2x00-lib -kmod-mac80211 -kmod-cfg80211 -wpad-mini -iwinfo kmod-i2c-algo-pca kmod-gpio-pca953x kmod-i2c-gpio-custom
197 endef
198 TARGET_DEVICES += ubnt-erx-sfp
199
200 define Device/vr500
201 DTS := VR500
202 IMAGE_SIZE := 66453504
203 DEVICE_TITLE := Planex VR500
204 DEVICE_PACKAGES := kmod-usb3
205 endef
206 TARGET_DEVICES += vr500
207
208 define Device/w2914nsv2
209 DTS := W2914NSV2
210 IMAGE_SIZE := $(ralink_default_fw_size_16M)
211 DEVICE_TITLE := WeVO W2914NS v2
212 DEVICE_PACKAGES := \
213 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport kmod-mt76 \
214 wpad-mini
215 endef
216 TARGET_DEVICES += w2914nsv2
217
218 define Device/wf-2881
219 DTS := WF-2881
220 BLOCKSIZE := 128k
221 PAGESIZE := 2048
222 FILESYSTEMS := squashfs
223 IMAGE_SIZE := 129280k
224 KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma
225 UBINIZE_OPTS := -E 5
226 IMAGE/sysupgrade.bin := append-kernel | append-ubi | append-metadata | check-size $$$$(IMAGE_SIZE)
227 DEVICE_TITLE := NETIS WF-2881
228 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport
229 endef
230 TARGET_DEVICES += wf-2881
231
232 define Device/witi
233 DTS := WITI
234 IMAGE_SIZE := $(ralink_default_fw_size_16M)
235 DEVICE_TITLE := MQmaker WiTi
236 DEVICE_PACKAGES := \
237 kmod-ata-core kmod-ata-ahci kmod-mt76x2 kmod-sdhci-mt7620 kmod-usb3 \
238 kmod-usb-ledtrig-usbport wpad-mini
239 endef
240 TARGET_DEVICES += witi
241
242 define Device/wndr3700v5
243 DTS := WNDR3700V5
244 IMAGE_SIZE := $(ralink_default_fw_size_16M)
245 DEVICE_TITLE := Netgear WNDR3700v5
246 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 wpad-mini
247 endef
248 TARGET_DEVICES += wndr3700v5
249
250 define Device/wsr-1166
251 DTS := WSR-1166
252 IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata
253 IMAGE_SIZE := $(ralink_default_fw_size_16M)
254 DEVICE_TITLE := Buffalo WSR-1166
255 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-mini
256 endef
257 TARGET_DEVICES += wsr-1166
258
259 define Device/wsr-600
260 DTS := WSR-600
261 IMAGE_SIZE := $(ralink_default_fw_size_16M)
262 DEVICE_TITLE := Buffalo WSR-600
263 DEVICE_PACKAGES := kmod-mt7603 kmod-rt2800-pci wpad-mini
264 endef
265 TARGET_DEVICES += wsr-600
266
267 define Device/zbt-we1326
268 DTS := ZBT-WE1326
269 IMAGE_SIZE := $(ralink_default_fw_size_16M)
270 DEVICE_TITLE := ZBT WE1326
271 DEVICE_PACKAGES := \
272 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-sdhci-mt7620 wpad-mini
273 endef
274 TARGET_DEVICES += zbt-we1326
275
276 define Device/zbt-wg2626
277 DTS := ZBT-WG2626
278 IMAGE_SIZE := $(ralink_default_fw_size_16M)
279 DEVICE_TITLE := ZBT WG2626
280 DEVICE_PACKAGES := \
281 kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 \
282 kmod-usb-ledtrig-usbport wpad-mini
283 endef
284 TARGET_DEVICES += zbt-wg2626
285
286 define Device/zbt-wg3526-16M
287 DTS := ZBT-WG3526-16M
288 IMAGE_SIZE := $(ralink_default_fw_size_16M)
289 SUPPORTED_DEVICES += zbt-wg3526
290 DEVICE_TITLE := ZBT WG3526 (16MB flash)
291 DEVICE_PACKAGES := \
292 kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \
293 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
294 endef
295 TARGET_DEVICES += zbt-wg3526-16M
296
297 define Device/zbt-wg3526-32M
298 DTS := ZBT-WG3526-32M
299 IMAGE_SIZE := $(ralink_default_fw_size_32M)
300 SUPPORTED_DEVICES += ac1200pro
301 DEVICE_TITLE := ZBT WG3526 (32MB flash)
302 DEVICE_PACKAGES := \
303 kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \
304 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
305 endef
306 TARGET_DEVICES += zbt-wg3526-32M
307
308 # FIXME: is this still needed?
309 define Image/Prepare
310 #define Build/Compile
311 rm -rf $(KDIR)/relocate
312 $(CP) ../../generic/image/relocate $(KDIR)
313 $(MAKE) -C $(KDIR)/relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS)
314 $(CP) $(KDIR)/relocate/loader.bin $(KDIR)/loader.bin
315 endef