b57552a6f4c35cf5f98d8dbf2315e956fd31e96f
[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-usb3 kmod-usb-ledtrig-usbport kmod-mt76
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-usb3 kmod-usb-ledtrig-usbport
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 := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci
63 endef
64 TARGET_DEVICES += ew1200
65
66 define Device/firewrt
67 DTS := FIREWRT
68 IMAGE_SIZE := $(ralink_default_fw_size_16M)
69 DEVICE_TITLE := Firefly FireWRT
70 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport
71 endef
72 TARGET_DEVICES += firewrt
73
74 define Device/hc5962
75 DTS := HC5962
76 BLOCKSIZE := 128k
77 PAGESIZE := 2048
78 KERNEL_SIZE := 2097152
79 UBINIZE_OPTS := -E 5
80 IMAGE_SIZE := $(ralink_default_fw_size_32M)
81 IMAGES += factory.bin
82 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
83 IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size $$$$(IMAGE_SIZE)
84 DEVICE_TITLE := HiWiFi HC5962
85 DEVICE_PACKAGES := kmod-usb3 kmod-mt76
86 endef
87 TARGET_DEVICES += hc5962
88
89 define Device/mt7621
90 DTS := MT7621
91 BLOCKSIZE := 64k
92 IMAGE_SIZE := $(ralink_default_fw_size_4M)
93 DEVICE_TITLE := MediaTek MT7621 EVB
94 endef
95 TARGET_DEVICES += mt7621
96
97 define Device/newifi-d1
98 DTS := Newifi-D1
99 IMAGE_SIZE := $(ralink_default_fw_size_32M)
100 DEVICE_TITLE := Newifi D1
101 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport
102 endef
103 TARGET_DEVICES += newifi-d1
104
105 define Device/pbr-m1
106 DTS := PBR-M1
107 IMAGE_SIZE := $(ralink_default_fw_size_16M)
108 DEVICE_TITLE := PBR-M1
109 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620
110 endef
111 TARGET_DEVICES += pbr-m1
112
113 define Device/r6220
114 DTS := R6220
115 BLOCKSIZE := 128k
116 PAGESIZE := 2048
117 KERNEL_SIZE := 4096k
118 KERNEL := $(KERNEL_DTB) | uImage lzma
119 IMAGE_SIZE := 28672k
120 UBINIZE_OPTS := -E 5
121 IMAGES := sysupgrade.tar kernel.bin rootfs.bin
122 IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
123 IMAGE/kernel.bin := append-kernel
124 IMAGE/rootfs.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
125 DEVICE_TITLE := Netgear R6220
126 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport
127 endef
128 TARGET_DEVICES += r6220
129
130 define Device/rb750gr3
131 DTS := RB750Gr3
132 IMAGE_SIZE := $(ralink_default_fw_size_16M)
133 DEVICE_TITLE := MikroTik RB750Gr3
134 DEVICE_PACKAGES := kmod-usb3 uboot-envtools -kmod-mt76 -kmod-rt2x00-lib -kmod-mac80211 -kmod-cfg80211 -wpad-mini -iwinfo
135 endef
136 TARGET_DEVICES += rb750gr3
137
138 define Device/re6500
139 DTS := RE6500
140 DEVICE_TITLE := Linksys RE6500
141 endef
142 TARGET_DEVICES += re6500
143
144 define Device/sap-g3200u3
145 DTS := SAP-G3200U3
146 DEVICE_TITLE := STORYLiNK SAP-G3200U3
147 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport
148 endef
149 TARGET_DEVICES += sap-g3200u3
150
151 define Device/sk-wb8
152 DTS := SK-WB8
153 IMAGE_SIZE := $(ralink_default_fw_size_16M)
154 DEVICE_TITLE := SamKnows Whitebox 8
155 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport uboot-envtools
156 endef
157 TARGET_DEVICES += sk-wb8
158
159 define Device/timecloud
160 DTS := Timecloud
161 DEVICE_TITLE := Thunder Timecloud
162 DEVICE_PACKAGES := kmod-usb3
163 endef
164 TARGET_DEVICES += timecloud
165
166 define Device/ubnt-erx
167 DTS := UBNT-ERX
168 FILESYSTEMS := squashfs
169 KERNEL_SIZE := 3145728
170 KERNEL := $(KERNEL_DTB) | uImage lzma
171 IMAGES := sysupgrade.tar
172 KERNEL_INITRAMFS := $$(KERNEL) | ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
173 IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
174 DEVICE_TITLE := Ubiquiti EdgeRouter X
175 DEVICE_PACKAGES := -kmod-mt76 -kmod-mt7603 -kmod-mt76x2 -kmod-mt76-core -kmod-mac80211 -kmod-cfg80211 -wpad-mini -iwinfo
176 endef
177 TARGET_DEVICES += ubnt-erx
178
179 define Device/vr500
180 DTS := VR500
181 IMAGE_SIZE := 66453504
182 DEVICE_TITLE := Planex VR500
183 DEVICE_PACKAGES := kmod-usb3
184 endef
185 TARGET_DEVICES += vr500
186
187 define Device/w2914nsv2
188 DTS := W2914NSV2
189 IMAGE_SIZE := $(ralink_default_fw_size_16M)
190 DEVICE_TITLE := WeVO W2914NS v2
191 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-mt76
192 endef
193 TARGET_DEVICES += w2914nsv2
194
195 define Device/wf-2881
196 DTS := WF-2881
197 BLOCKSIZE := 128k
198 PAGESIZE := 2048
199 FILESYSTEMS := squashfs
200 IMAGE_SIZE := 129280k
201 KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma
202 UBINIZE_OPTS := -E 5
203 IMAGE/sysupgrade.bin := append-kernel | append-ubi | append-metadata | check-size $$$$(IMAGE_SIZE)
204 DEVICE_TITLE := NETIS WF-2881
205 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport
206 endef
207 TARGET_DEVICES += wf-2881
208
209 define Device/witi
210 DTS := WITI
211 IMAGE_SIZE := $(ralink_default_fw_size_16M)
212 DEVICE_TITLE := MQmaker WiTi
213 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620
214 endef
215 TARGET_DEVICES += witi
216
217 define Device/wndr3700v5
218 DTS := WNDR3700V5
219 IMAGE_SIZE := $(ralink_default_fw_size_16M)
220 DEVICE_TITLE := Netgear WNDR3700v5
221 DEVICE_PACKAGES := kmod-usb3
222 endef
223 TARGET_DEVICES += wndr3700v5
224
225 define Device/wsr-1166
226 DTS := WSR-1166
227 IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata
228 IMAGE_SIZE := $(ralink_default_fw_size_16M)
229 DEVICE_TITLE := Buffalo WSR-1166
230 endef
231 TARGET_DEVICES += wsr-1166
232
233 define Device/wsr-600
234 DTS := WSR-600
235 IMAGE_SIZE := $(ralink_default_fw_size_16M)
236 DEVICE_TITLE := Buffalo WSR-600
237 endef
238 TARGET_DEVICES += wsr-600
239
240 define Device/zbt-we1326
241 DTS := ZBT-WE1326
242 IMAGE_SIZE := $(ralink_default_fw_size_16M)
243 DEVICE_TITLE := ZBT WE1326
244 DEVICE_PACKAGES := kmod-usb3 kmod-sdhci-mt7620
245 endef
246 TARGET_DEVICES += zbt-we1326
247
248 define Device/zbt-wg2626
249 DTS := ZBT-WG2626
250 IMAGE_SIZE := $(ralink_default_fw_size_16M)
251 DEVICE_TITLE := ZBT WG2626
252 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620
253 endef
254 TARGET_DEVICES += zbt-wg2626
255
256 define Device/zbt-wg3526-16M
257 DTS := ZBT-WG3526-16M
258 IMAGE_SIZE := $(ralink_default_fw_size_16M)
259 SUPPORTED_DEVICES += zbt-wg3526
260 DEVICE_TITLE := ZBT WG3526 (16MB flash)
261 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620
262 endef
263 TARGET_DEVICES += zbt-wg3526-16M
264
265 define Device/zbt-wg3526-32M
266 DTS := ZBT-WG3526-32M
267 IMAGE_SIZE := $(ralink_default_fw_size_32M)
268 SUPPORTED_DEVICES += ac1200pro
269 DEVICE_TITLE := ZBT WG3526 (32MB flash)
270 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620
271 endef
272 TARGET_DEVICES += zbt-wg3526-32M
273
274 # FIXME: is this still needed?
275 define Image/Prepare
276 #define Build/Compile
277 rm -rf $(KDIR)/relocate
278 $(CP) ../../generic/image/relocate $(KDIR)
279 $(MAKE) -C $(KDIR)/relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS)
280 $(CP) $(KDIR)/relocate/loader.bin $(KDIR)/loader.bin
281 endef