ramips: build HuaWei HG255D image
[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/ew1200
61 DTS := EW1200
62 IMAGE_SIZE := $(ralink_default_fw_size_16M)
63 DEVICE_TITLE := AFOUNDRY EW1200
64 DEVICE_PACKAGES := \
65 kmod-ata-core kmod-ata-ahci kmod-mt76x2 kmod-mt7603 kmod-usb3 \
66 kmod-usb-ledtrig-usbport wpad-mini
67 endef
68 TARGET_DEVICES += ew1200
69
70 define Device/firewrt
71 DTS := FIREWRT
72 IMAGE_SIZE := $(ralink_default_fw_size_16M)
73 DEVICE_TITLE := Firefly FireWRT
74 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
75 endef
76 TARGET_DEVICES += firewrt
77
78 define Device/gb-pc1
79 DTS := GB-PC1
80 DEVICE_TITLE := GnuBee Personal Cloud One
81 DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620
82 IMAGE_SIZE := $(ralink_default_fw_size_32M)
83 endef
84 TARGET_DEVICES += gb-pc1
85
86 define Device/hc5962
87 DTS := HC5962
88 BLOCKSIZE := 128k
89 PAGESIZE := 2048
90 KERNEL_SIZE := 2097152
91 UBINIZE_OPTS := -E 5
92 IMAGE_SIZE := $(ralink_default_fw_size_32M)
93 IMAGES += factory.bin
94 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
95 IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size $$$$(IMAGE_SIZE)
96 DEVICE_TITLE := HiWiFi HC5962
97 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 wpad-mini
98 endef
99 TARGET_DEVICES += hc5962
100
101 define Device/k2p
102 DTS := K2P
103 IMAGE_SIZE := $(ralink_default_fw_size_16M)
104 DEVICE_TITLE := Phicomm K2P
105 endef
106 TARGET_DEVICES += k2p
107
108 define Device/mt7621
109 DTS := MT7621
110 BLOCKSIZE := 64k
111 IMAGE_SIZE := $(ralink_default_fw_size_4M)
112 DEVICE_TITLE := MediaTek MT7621 EVB
113 endef
114 TARGET_DEVICES += mt7621
115
116 define Device/newifi-d1
117 DTS := Newifi-D1
118 IMAGE_SIZE := $(ralink_default_fw_size_32M)
119 DEVICE_TITLE := Newifi D1
120 DEVICE_PACKAGES := \
121 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
122 endef
123 TARGET_DEVICES += newifi-d1
124
125 define Device/pbr-m1
126 DTS := PBR-M1
127 IMAGE_SIZE := $(ralink_default_fw_size_16M)
128 DEVICE_TITLE := PBR-M1
129 DEVICE_PACKAGES := \
130 kmod-ata-core kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \
131 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
132 endef
133 TARGET_DEVICES += pbr-m1
134
135 define Device/r6220
136 DTS := R6220
137 BLOCKSIZE := 128k
138 PAGESIZE := 2048
139 KERNEL_SIZE := 4096k
140 KERNEL := $(KERNEL_DTB) | uImage lzma
141 IMAGE_SIZE := 28672k
142 UBINIZE_OPTS := -E 5
143 IMAGES := sysupgrade.tar kernel.bin rootfs.bin
144 IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
145 IMAGE/kernel.bin := append-kernel
146 IMAGE/rootfs.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
147 DEVICE_TITLE := Netgear R6220
148 DEVICE_PACKAGES := \
149 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
150 endef
151 TARGET_DEVICES += r6220
152
153 define Device/rb750gr3
154 DTS := RB750Gr3
155 IMAGE_SIZE := $(ralink_default_fw_size_16M)
156 DEVICE_TITLE := MikroTik RB750Gr3
157 DEVICE_PACKAGES := kmod-usb3 uboot-envtools
158 endef
159 TARGET_DEVICES += rb750gr3
160
161 define Device/re350-v1
162 DTS := RE350
163 DEVICE_TITLE := TP-LINK RE350 v1
164 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-mini
165 TPLINK_BOARD_ID := RE350-V1
166 TPLINK_HWID := 0x0
167 TPLINK_HWREV := 0
168 TPLINK_HEADER_VERSION := 1
169 IMAGE_SIZE := 6016k
170 KERNEL := $(KERNEL_DTB) | tplink-v1-header -e
171 IMAGES := sysupgrade.bin factory.bin
172 IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | append-metadata | check-size $$$$(IMAGE_SIZE)
173 IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
174 endef
175 TARGET_DEVICES += re350-v1
176
177 define Device/re6500
178 DTS := RE6500
179 DEVICE_TITLE := Linksys RE6500
180 DEVICE_PACKAGES := kmod-mt76x2 wpad-mini
181 endef
182 TARGET_DEVICES += re6500
183
184 define Device/sap-g3200u3
185 DTS := SAP-G3200U3
186 DEVICE_TITLE := STORYLiNK SAP-G3200U3
187 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
188 endef
189 TARGET_DEVICES += sap-g3200u3
190
191 define Device/sk-wb8
192 DTS := SK-WB8
193 IMAGE_SIZE := $(ralink_default_fw_size_16M)
194 DEVICE_TITLE := SamKnows Whitebox 8
195 DEVICE_PACKAGES := \
196 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport \
197 uboot-envtools wpad-mini
198 endef
199 TARGET_DEVICES += sk-wb8
200
201 define Device/timecloud
202 DTS := Timecloud
203 DEVICE_TITLE := Thunder Timecloud
204 DEVICE_PACKAGES := kmod-usb3
205 endef
206 TARGET_DEVICES += timecloud
207
208 define Device/ubnt-erx
209 DTS := UBNT-ERX
210 FILESYSTEMS := squashfs
211 KERNEL_SIZE := 3145728
212 KERNEL := $(KERNEL_DTB) | uImage lzma
213 IMAGES := sysupgrade.tar
214 KERNEL_INITRAMFS := $$(KERNEL) | ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
215 IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
216 DEVICE_TITLE := Ubiquiti EdgeRouter X
217 endef
218 TARGET_DEVICES += ubnt-erx
219
220 define Device/ubnt-erx-sfp
221 $(Device/ubnt-erx)
222 DTS := UBNT-ERX-SFP
223 DEVICE_TITLE := Ubiquiti EdgeRouter X-SFP
224 DEVICE_PACKAGES += kmod-i2c-algo-pca kmod-gpio-pca953x kmod-i2c-gpio-custom
225 endef
226 TARGET_DEVICES += ubnt-erx-sfp
227
228 define Device/vr500
229 DTS := VR500
230 IMAGE_SIZE := 66453504
231 DEVICE_TITLE := Planex VR500
232 DEVICE_PACKAGES := kmod-usb3
233 endef
234 TARGET_DEVICES += vr500
235
236 define Device/w2914nsv2
237 DTS := W2914NSV2
238 IMAGE_SIZE := $(ralink_default_fw_size_16M)
239 DEVICE_TITLE := WeVO W2914NS v2
240 DEVICE_PACKAGES := \
241 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport kmod-mt76 \
242 wpad-mini
243 endef
244 TARGET_DEVICES += w2914nsv2
245
246 define Device/wf-2881
247 DTS := WF-2881
248 BLOCKSIZE := 128k
249 PAGESIZE := 2048
250 FILESYSTEMS := squashfs
251 IMAGE_SIZE := 129280k
252 KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma
253 UBINIZE_OPTS := -E 5
254 IMAGE/sysupgrade.bin := append-kernel | append-ubi | append-metadata | check-size $$$$(IMAGE_SIZE)
255 DEVICE_TITLE := NETIS WF-2881
256 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport
257 endef
258 TARGET_DEVICES += wf-2881
259
260 define Device/witi
261 DTS := WITI
262 IMAGE_SIZE := $(ralink_default_fw_size_16M)
263 DEVICE_TITLE := MQmaker WiTi
264 DEVICE_PACKAGES := \
265 kmod-ata-core kmod-ata-ahci kmod-mt76x2 kmod-sdhci-mt7620 kmod-usb3 \
266 kmod-usb-ledtrig-usbport wpad-mini
267 endef
268 TARGET_DEVICES += witi
269
270 define Device/wndr3700v5
271 DTS := WNDR3700V5
272 IMAGE_SIZE := $(ralink_default_fw_size_16M)
273 DEVICE_TITLE := Netgear WNDR3700v5
274 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 wpad-mini
275 endef
276 TARGET_DEVICES += wndr3700v5
277
278 define Device/wsr-1166
279 DTS := WSR-1166
280 IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata
281 IMAGE_SIZE := $(ralink_default_fw_size_16M)
282 DEVICE_TITLE := Buffalo WSR-1166
283 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-mini
284 endef
285 TARGET_DEVICES += wsr-1166
286
287 define Device/wsr-600
288 DTS := WSR-600
289 IMAGE_SIZE := $(ralink_default_fw_size_16M)
290 DEVICE_TITLE := Buffalo WSR-600
291 DEVICE_PACKAGES := kmod-mt7603 kmod-rt2800-pci wpad-mini
292 endef
293 TARGET_DEVICES += wsr-600
294
295 define Device/zbt-we1326
296 DTS := ZBT-WE1326
297 IMAGE_SIZE := $(ralink_default_fw_size_16M)
298 DEVICE_TITLE := ZBT WE1326
299 DEVICE_PACKAGES := \
300 kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-sdhci-mt7620 wpad-mini
301 endef
302 TARGET_DEVICES += zbt-we1326
303
304 define Device/zbt-wg2626
305 DTS := ZBT-WG2626
306 IMAGE_SIZE := $(ralink_default_fw_size_16M)
307 DEVICE_TITLE := ZBT WG2626
308 DEVICE_PACKAGES := \
309 kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 \
310 kmod-usb-ledtrig-usbport wpad-mini
311 endef
312 TARGET_DEVICES += zbt-wg2626
313
314 define Device/zbt-wg3526-16M
315 DTS := ZBT-WG3526-16M
316 IMAGE_SIZE := $(ralink_default_fw_size_16M)
317 SUPPORTED_DEVICES += zbt-wg3526
318 DEVICE_TITLE := ZBT WG3526 (16MB flash)
319 DEVICE_PACKAGES := \
320 kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \
321 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
322 endef
323 TARGET_DEVICES += zbt-wg3526-16M
324
325 define Device/zbt-wg3526-32M
326 DTS := ZBT-WG3526-32M
327 IMAGE_SIZE := $(ralink_default_fw_size_32M)
328 SUPPORTED_DEVICES += ac1200pro
329 DEVICE_TITLE := ZBT WG3526 (32MB flash)
330 DEVICE_PACKAGES := \
331 kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \
332 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini
333 endef
334 TARGET_DEVICES += zbt-wg3526-32M
335
336 # FIXME: is this still needed?
337 define Image/Prepare
338 #define Build/Compile
339 rm -rf $(KDIR)/relocate
340 $(CP) ../../generic/image/relocate $(KDIR)
341 $(MAKE) -C $(KDIR)/relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS)
342 $(CP) $(KDIR)/relocate/loader.bin $(KDIR)/loader.bin
343 endef