ar71xx: add metadata to wpj344 and wpj558 images
[openwrt/openwrt.git] / target / linux / ar71xx / image / generic.mk
1 DEVICE_VARS += DAP_SIGNATURE NETGEAR_BOARD_ID NETGEAR_HW_ID NETGEAR_KERNEL_MAGIC ROOTFS_SIZE SEAMA_SIGNATURE
2
3 define Build/mkbuffaloimg
4 $(STAGING_DIR_HOST)/bin/mkbuffaloimg -B $(BOARDNAME) \
5 -R $$(($(subst k, * 1024,$(ROOTFS_SIZE)))) \
6 -K $$(($(subst k, * 1024,$(KERNEL_SIZE)))) \
7 -i $@ -o $@.new
8 mv $@.new $@
9 endef
10
11 define Build/mkwrggimg
12 $(STAGING_DIR_HOST)/bin/mkwrggimg -b \
13 -i $@ -o $@.imghdr -d /dev/mtdblock/1 \
14 -m $(BOARDNAME) -s $(DAP_SIGNATURE) \
15 -v LEDE -B $(REVISION)
16 mv $@.imghdr $@
17 endef
18
19 define Build/netgear-squashfs
20 rm -rf $@.fs $@.squashfs
21 mkdir -p $@.fs/image
22 cp $@ $@.fs/image/uImage
23 $(STAGING_DIR_HOST)/bin/mksquashfs-lzma \
24 $@.fs $@.squashfs \
25 -noappend -root-owned -be -b 65536 \
26 $(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
27
28 dd if=/dev/zero bs=1k count=1 >> $@.squashfs
29 mkimage \
30 -A mips -O linux -T filesystem -C none \
31 -M $(NETGEAR_KERNEL_MAGIC) \
32 -a 0xbf070000 -e 0xbf070000 \
33 -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
34 -d $@.squashfs $@
35 rm -rf $@.squashfs $@.fs
36 endef
37
38 define Build/netgear-uImage
39 $(call Build/uImage,$(1) -M $(NETGEAR_KERNEL_MAGIC))
40 endef
41
42 define Build/relocate-kernel
43 rm -rf $@.relocate
44 $(CP) ../../generic/image/relocate $@.relocate
45 $(MAKE) -j1 -C $@.relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS)
46 ( \
47 dd if=$@.relocate/loader.bin bs=32 conv=sync && \
48 perl -e '@s = stat("$@"); print pack("N", @s[7])' && \
49 cat "$@" \
50 ) > "$@.new"
51 mv "$@.new" "$@"
52 rm -rf $@.relocate
53 endef
54
55 define Build/seama
56 $(STAGING_DIR_HOST)/bin/seama -i $@ $(if $(1),$(1),-m "dev=/dev/mtdblock/1" -m "type=firmware")
57 mv $@.seama $@
58 endef
59
60 define Build/seama-seal
61 $(call Build/seama,-s $@.seama $(1))
62 endef
63
64 define Build/uImageHiWiFi
65 # Field ih_name needs to start with "tw150v1"
66 mkimage -A $(LINUX_KARCH) \
67 -O linux -T kernel \
68 -C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
69 -n 'tw150v1 $(call toupper,$(LINUX_KARCH)) LEDE Linux-$(LINUX_VERSION)' -d $@ $@.new
70 @mv $@.new $@
71 endef
72
73 define Build/wrgg-pad-rootfs
74 $(STAGING_DIR_HOST)/bin/padjffs2 $(IMAGE_ROOTFS) -c 64 >>$@
75 endef
76
77
78 define Device/ap121f
79 DEVICE_TITLE := ALFA Network AP121F
80 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage -swconfig
81 BOARDNAME := AP121F
82 IMAGE_SIZE := 16064k
83 CONSOLE := ttyATH0,115200
84 MTDPARTS := spi0.0:192k(u-boot)ro,64k(u-boot-env),64k(art)ro,-(firmware)
85 SUPPORTED_DEVICES := ap121f
86 IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | \
87 append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
88 endef
89 TARGET_DEVICES += ap121f
90
91 define Device/ap531b0
92 DEVICE_TITLE := Rockeetech AP531B0
93 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
94 BOARDNAME := AP531B0
95 IMAGE_SIZE := 16000k
96 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
97 endef
98 TARGET_DEVICES += ap531b0
99
100 define Device/ap90q
101 DEVICE_TITLE := YunCore AP90Q
102 BOARDNAME := AP90Q
103 IMAGE_SIZE := 16000k
104 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
105 endef
106 TARGET_DEVICES += ap90q
107
108 define Device/arduino-yun
109 DEVICE_TITLE := Arduino Yun
110 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
111 BOARDNAME := Yun
112 IMAGE_SIZE := 15936k
113 CONSOLE = ttyATH0,250000
114 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env),15936k(firmware),64k(nvram),64k(art)ro
115 endef
116 TARGET_DEVICES += arduino-yun
117
118 define Device/bsb
119 DEVICE_TITLE := Smart Electronics Black Swift board
120 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
121 BOARDNAME := BSB
122 IMAGE_SIZE := 16000k
123 CONSOLE := ttyATH0,115200
124 MTDPARTS := spi0.0:128k(u-boot)ro,64k(u-boot-env)ro,16128k(firmware),64k(art)ro
125 endef
126 TARGET_DEVICES += bsb
127
128 define Device/carambola2
129 DEVICE_TITLE := 8devices Carambola2
130 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
131 BOARDNAME := CARAMBOLA2
132 IMAGE_SIZE := 16000k
133 CONSOLE := ttyATH0,115200
134 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
135 endef
136 TARGET_DEVICES += carambola2
137
138 define Device/cf-e316n-v2
139 DEVICE_TITLE := COMFAST CF-E316N v2
140 BOARDNAME := CF-E316N-V2
141 IMAGE_SIZE := 16192k
142 MTDPARTS := spi0.0:64k(u-boot)ro,64k(art)ro,16192k(firmware),64k(art-backup)ro
143 endef
144 TARGET_DEVICES += cf-e316n-v2
145
146 define Device/cf-e320n-v2
147 $(Device/cf-e316n-v2)
148 DEVICE_TITLE := COMFAST CF-E320N v2
149 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
150 BOARDNAME := CF-E320N-V2
151 endef
152 TARGET_DEVICES += cf-e320n-v2
153
154 define Device/cf-e355ac
155 DEVICE_TITLE := COMFAST CF-E355AC
156 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ath10k ath10k-firmware-qca988x
157 BOARDNAME := CF-E355AC
158 IMAGE_SIZE := 16192k
159 MTDPARTS := spi0.0:64k(u-boot)ro,64k(art)ro,16192k(firmware),64k(art-backup)ro
160 endef
161 TARGET_DEVICES += cf-e355ac
162
163 define Device/cf-e380ac-v1
164 DEVICE_TITLE := COMFAST CF-E380AC v1
165 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ath10k ath10k-firmware-qca988x
166 BOARDNAME := CF-E380AC-V1
167 IMAGE_SIZE := 16128k
168 MTDPARTS := spi0.0:128k(u-boot)ro,64k(art)ro,16128k(firmware),64k(art-backup)ro
169 endef
170 TARGET_DEVICES += cf-e380ac-v1
171
172 define Device/cf-e380ac-v2
173 $(Device/cf-e380ac-v1)
174 DEVICE_TITLE := COMFAST CF-E380AC v2
175 BOARDNAME := CF-E380AC-V2
176 IMAGE_SIZE := 16000k
177 MTDPARTS := spi0.0:256k(u-boot)ro,64k(art)ro,16000k(firmware),64k(art-backup)ro
178 endef
179 TARGET_DEVICES += cf-e380ac-v2
180
181 define Device/cf-e520n
182 DEVICE_TITLE := COMFAST CF-E520N
183 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
184 BOARDNAME := CF-E520N
185 IMAGE_SIZE := 8000k
186 MTDPARTS := spi0.0:64k(u-boot)ro,64k(art)ro,8000k(firmware),64k(art-backup)ro
187 endef
188 TARGET_DEVICES += cf-e520n
189
190 define Device/cf-e530n
191 $(Device/cf-e520n)
192 DEVICE_TITLE := COMFAST CF-E530N
193 BOARDNAME := CF-E530N
194 endef
195 TARGET_DEVICES += cf-e530n
196
197 define Device/cpe505n
198 DEVICE_TITLE := P&W CPE505N
199 BOARDNAME := CPE505N
200 IMAGE_SIZE := 16000k
201 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
202 endef
203 TARGET_DEVICES += cpe505n
204
205 define Device/cpe830
206 $(Device/ap90q)
207 DEVICE_TITLE := YunCore CPE830
208 DEVICE_PACKAGES := rssileds
209 BOARDNAME := CPE830
210 endef
211 TARGET_DEVICES += cpe830
212
213 define Device/cpe870
214 DEVICE_TITLE := YunCore CPE870
215 DEVICE_PACKAGES := rssileds
216 BOARDNAME := CPE870
217 IMAGE_SIZE := 7936k
218 MTDPARTS := spi0.0:64k(u-boot)ro,64k(u-boot-env),7936k(firmware),64k(config)ro,64k(art)ro
219 endef
220 TARGET_DEVICES += cpe870
221
222 define Device/dragino2
223 BOARDNAME := DRAGINO2
224 CONSOLE := ttyATH0,115200
225 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
226 DEVICE_TITLE := Dragino 2 (MS14)
227 IMAGE_SIZE := 16000k
228 MTDPARTS := spi0.0:256k(u-boot)ro,16000k(firmware),64k(config)ro,64k(art)ro
229 endef
230 TARGET_DEVICES += dragino2
231
232 define Device/weio
233 DEVICE_TITLE := WeIO
234 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
235 BOARDNAME := WEIO
236 IMAGE_SIZE := 16000k
237 CONSOLE := ttyATH0,115200
238 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
239 endef
240 TARGET_DEVICES += weio
241
242 define Device/gl-ar150
243 DEVICE_TITLE := GL.iNet GL-AR150
244 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
245 BOARDNAME := GL-AR150
246 IMAGE_SIZE := 16000k
247 CONSOLE := ttyATH0,115200
248 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
249 endef
250 TARGET_DEVICES += gl-ar150
251
252 define Device/gl-ar300
253 DEVICE_TITLE := GL.iNet GL-AR300
254 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
255 BOARDNAME := GL-AR300
256 IMAGE_SIZE := 16000k
257 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
258 endef
259 TARGET_DEVICES += gl-ar300
260
261 define Device/gl-ar300m
262 DEVICE_TITLE := GL.iNet GL-AR300M
263 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
264 BOARDNAME := GL-AR300M
265 IMAGE_SIZE := 16000k
266 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
267 endef
268 TARGET_DEVICES += gl-ar300m
269
270 define Device/gl-domino
271 DEVICE_TITLE := GL.iNet Domino Pi
272 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
273 BOARDNAME := DOMINO
274 IMAGE_SIZE := 16000k
275 CONSOLE := ttyATH0,115200
276 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
277 endef
278 TARGET_DEVICES += gl-domino
279
280 define Device/gl-mifi
281 DEVICE_TITLE := GL.iNet GL-MiFi
282 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
283 BOARDNAME := GL-MIFI
284 IMAGE_SIZE := 16000k
285 CONSOLE := ttyATH0,115200
286 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
287 endef
288 TARGET_DEVICES += gl-mifi
289
290 define Device/gl-usb150
291 DEVICE_TITLE := GL.iNet GL-USB150
292 DEVICE_PACKAGES := -swconfig
293 BOARDNAME := GL-USB150
294 IMAGE_SIZE := 16000k
295 CONSOLE := ttyATH0,115200
296 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
297 SUPPORTED_DEVICES := gl-usb150
298 IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | \
299 append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
300 endef
301 TARGET_DEVICES += gl-usb150
302
303 define Device/lima
304 DEVICE_TITLE := 8devices Lima
305 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
306 BOARDNAME := LIMA
307 IMAGE_SIZE := 15616k
308 MTDPARTS := spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,256k(art)ro,-(firmware)
309 endef
310 TARGET_DEVICES += lima
311
312 define Device/mr12
313 DEVICE_TITLE := Meraki MR12
314 DEVICE_PACKAGES := kmod-spi-gpio
315 BOARDNAME := MR12
316 ROOTFS_SIZE := 13440k
317 IMAGE_SIZE := 15680k
318 MTDPARTS := spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2240k(kernel),64k(mac),128k(art)ro,15680k@0x80000(firmware)
319 IMAGE/kernel.bin := append-kernel
320 IMAGE/rootfs.bin := append-rootfs | pad-rootfs
321 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to $$$$(ROOTFS_SIZE) | append-kernel | check-size $$$$(IMAGE_SIZE)
322 IMAGES := kernel.bin rootfs.bin sysupgrade.bin
323 endef
324
325 define Device/mr16
326 $(Device/mr12)
327 DEVICE_TITLE := Meraki MR16
328 BOARDNAME := MR16
329 endef
330 TARGET_DEVICES += mr12 mr16
331
332 define Device/dr344
333 DEVICE_TITLE := Wallys DR344
334 BOARDNAME := DR344
335 KERNEL_SIZE := 1408k
336 ROOTFS_SIZE := 6336k
337 IMAGE_SIZE := 7744k
338 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k@0x50000(firmware)
339 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to $$$$(ROOTFS_SIZE) | append-kernel | check-size $$$$(IMAGE_SIZE)
340 endef
341 TARGET_DEVICES += dr344
342
343 define Device/dr531
344 DEVICE_TITLE := Wallys DR531
345 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
346 BOARDNAME := DR531
347 IMAGE_SIZE := 7808k
348 MTDPARTS := spi0.0:192k(u-boot)ro,64k(u-boot-env),64k(partition-table)ro,7808k(firmware),64k(art)ro
349 endef
350 TARGET_DEVICES += dr531
351
352 define Device/wndr3700
353 DEVICE_TITLE := NETGEAR WNDR3700
354 DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-wndr3700-usb
355 BOARDNAME := WNDR3700
356 NETGEAR_KERNEL_MAGIC := 0x33373030
357 NETGEAR_BOARD_ID := WNDR3700
358 IMAGE_SIZE := 7680k
359 MTDPARTS := spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,7680k(firmware),64k(art)ro
360 IMAGES := sysupgrade.bin factory.img factory-NA.img
361 KERNEL := kernel-bin | patch-cmdline | lzma -d20 | netgear-uImage lzma
362 IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | append-rootfs | pad-rootfs
363 IMAGE/sysupgrade.bin := $$(IMAGE/default) | check-size $$$$(IMAGE_SIZE)
364 IMAGE/factory.img := $$(IMAGE/default) | netgear-dni | check-size $$$$(IMAGE_SIZE)
365 IMAGE/factory-NA.img := $$(IMAGE/default) | netgear-dni NA | check-size $$$$(IMAGE_SIZE)
366 endef
367
368 define Device/wndr3700v2
369 $(Device/wndr3700)
370 DEVICE_TITLE := NETGEAR WNDR3700 v2
371 NETGEAR_BOARD_ID := WNDR3700v2
372 NETGEAR_KERNEL_MAGIC := 0x33373031
373 NETGEAR_HW_ID := 29763654+16+64
374 IMAGE_SIZE := 15872k
375 MTDPARTS := spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,15872k(firmware),64k(art)ro
376 IMAGES := sysupgrade.bin factory.img
377 endef
378
379 define Device/wndr3800
380 $(Device/wndr3700v2)
381 DEVICE_TITLE := NETGEAR WNDR3800
382 NETGEAR_BOARD_ID := WNDR3800
383 NETGEAR_HW_ID := 29763654+16+128
384 endef
385
386 define Device/wndr3800ch
387 $(Device/wndr3800)
388 DEVICE_TITLE := NETGEAR WNDR3800 (Ch)
389 NETGEAR_BOARD_ID := WNDR3800CH
390 endef
391
392 define Device/wndrmac
393 $(Device/wndr3700v2)
394 DEVICE_TITLE := NETGEAR WNDRMAC
395 NETGEAR_BOARD_ID := WNDRMAC
396 endef
397
398 define Device/wndrmacv2
399 $(Device/wndr3800)
400 DEVICE_TITLE := NETGEAR WNDRMAC v2
401 NETGEAR_BOARD_ID := WNDRMACv2
402 endef
403 TARGET_DEVICES += wndr3700 wndr3700v2 wndr3800 wndr3800ch wndrmac wndrmacv2
404
405 define Device/cap324
406 DEVICE_TITLE := PowerCloud CAP324 Cloud AP
407 BOARDNAME := CAP324
408 DEVICE_PROFILE := CAP324
409 IMAGE_SIZE := 15296k
410 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,15296k(firmware),640k(certs),64k(nvram),64k(art)ro
411 endef
412 TARGET_DEVICES += cap324
413
414 define Device/cap324-nocloud
415 DEVICE_TITLE := PowerCloud CAP324 Cloud AP (No-Cloud)
416 BOARDNAME := CAP324
417 DEVICE_PROFILE := CAP324
418 IMAGE_SIZE := 16000k
419 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
420 endef
421 TARGET_DEVICES += cap324-nocloud
422
423 define Device/cr3000
424 DEVICE_TITLE := PowerCloud CR3000 Cloud Router
425 BOARDNAME := CR3000
426 DEVICE_PROFILE := CR3000
427 IMAGE_SIZE := 7104k
428 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7104k(firmware),640k(certs),64k(nvram),64k(art)ro
429 endef
430 TARGET_DEVICES += cr3000
431
432 define Device/cr3000-nocloud
433 DEVICE_TITLE := PowerCloud CR3000 (No-Cloud)
434 BOARDNAME := CR3000
435 DEVICE_PROFILE := CR3000
436 IMAGE_SIZE := 7808k
437 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7808k(firmware),64k(art)ro
438 endef
439 TARGET_DEVICES += cr3000-nocloud
440
441 define Device/cr5000
442 DEVICE_TITLE := PowerCloud CR5000 Cloud Router
443 DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-usb-core
444 BOARDNAME := CR5000
445 DEVICE_PROFILE := CR5000
446 IMAGE_SIZE := 7104k
447 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7104k(firmware),640k(certs),64k(nvram),64k(art)ro
448 endef
449 TARGET_DEVICES += cr5000
450
451 define Device/cr5000-nocloud
452 DEVICE_TITLE := PowerCloud CR5000 (No-Cloud)
453 DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-usb-core
454 BOARDNAME := CR5000
455 DEVICE_PROFILE := CR5000
456 IMAGE_SIZE := 7808k
457 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7808k(firmware),64k(art)ro
458 endef
459 TARGET_DEVICES += cr5000-nocloud
460
461 define Device/pqi-air-pen
462 DEVICE_TITLE := PQI Air Pen
463 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage
464 BOARDNAME := PQI-AIR-PEN
465 IMAGE_SIZE := 7744k
466 CONSOLE := ttyATH0,115200
467 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(art)ro,64k(NVRAM)ro,7680k(firmware),64k(CONF)
468 endef
469 TARGET_DEVICES += pqi-air-pen
470
471 define Device/antminer-s1
472 $(Device/tplink-8mlzma)
473 DEVICE_TITLE := Antminer-S1
474 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-crypto-manager kmod-i2c-gpio-custom kmod-usb-hid
475 BOARDNAME := ANTMINER-S1
476 DEVICE_PROFILE := ANTMINERS1
477 TPLINK_HWID := 0x04440101
478 CONSOLE := ttyATH0,115200
479 endef
480
481 define Device/antminer-s3
482 $(Device/tplink-8mlzma)
483 DEVICE_TITLE := Antminer-S3
484 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-crypto-manager kmod-i2c-gpio-custom kmod-usb-hid
485 BOARDNAME := ANTMINER-S3
486 DEVICE_PROFILE := ANTMINERS3
487 TPLINK_HWID := 0x04440301
488 CONSOLE := ttyATH0,115200
489 endef
490
491 define Device/antrouter-r1
492 $(Device/tplink-8mlzma)
493 DEVICE_TITLE := Antrouter-R1
494 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
495 BOARDNAME := ANTROUTER-R1
496 DEVICE_PROFILE := ANTROUTERR1
497 TPLINK_HWID := 0x44440101
498 CONSOLE := ttyATH0,115200
499 endef
500
501 define Device/el-m150
502 $(Device/tplink-8mlzma)
503 DEVICE_TITLE := EasyLink EL-M150
504 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
505 BOARDNAME := EL-M150
506 DEVICE_PROFILE := ELM150
507 TPLINK_HWID := 0x01500101
508 CONSOLE := ttyATH0,115200
509 endef
510
511 define Device/el-mini
512 $(Device/tplink-8mlzma)
513 DEVICE_TITLE := EasyLink EL-MINI
514 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
515 BOARDNAME := EL-MINI
516 DEVICE_PROFILE := ELMINI
517 TPLINK_HWID := 0x01530001
518 CONSOLE := ttyATH0,115200
519 endef
520 TARGET_DEVICES += antminer-s1 antminer-s3 antrouter-r1 el-m150 el-mini
521
522 define Device/gl-inet-6408A-v1
523 $(Device/tplink-8mlzma)
524 DEVICE_TITLE := GL.iNet 6408
525 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
526 BOARDNAME := GL-INET
527 DEVICE_PROFILE := GLINET
528 TPLINK_HWID := 0x08000001
529 CONSOLE := ttyATH0,115200
530 endef
531
532 define Device/gl-inet-6416A-v1
533 $(Device/tplink-16mlzma)
534 DEVICE_TITLE := GL.iNet 6416
535 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
536 BOARDNAME := GL-INET
537 DEVICE_PROFILE := GLINET
538 TPLINK_HWID := 0x08000001
539 CONSOLE := ttyATH0,115200
540 endef
541 TARGET_DEVICES += gl-inet-6408A-v1 gl-inet-6416A-v1
542
543 define Device/jwap230
544 DEVICE_TITLE := jjPlus JWAP230
545 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
546 BOARDNAME := JWAP230
547 IMAGE_SIZE := 16000k
548 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
549 endef
550 TARGET_DEVICES += jwap230
551
552 define Device/r602n
553 DEVICE_TITLE := P&W R602N
554 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
555 BOARDNAME := R602N
556 IMAGE_SIZE := 16000k
557 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
558 endef
559 TARGET_DEVICES += r602n
560
561 define Device/rnx-n360rt
562 $(Device/tplink-4m)
563 DEVICE_TITLE := Rosewill RNX-N360RT
564 BOARDNAME := TL-WR941ND
565 DEVICE_PROFILE := RNXN360RT
566 TPLINK_HWID := 0x09410002
567 TPLINK_HWREV := 0x00420001
568 endef
569 TARGET_DEVICES += rnx-n360rt
570
571 define Device/mc-mac1200r
572 $(Device/tplink-8mlzma)
573 DEVICE_TITLE := Mercury MAC1200R
574 DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x
575 BOARDNAME := MC-MAC1200R
576 DEVICE_PROFILE := MAC1200R
577 TPLINK_HWID := 0x12000001
578 endef
579 TARGET_DEVICES += mc-mac1200r
580
581 define Device/minibox-v1
582 $(Device/tplink-16mlzma)
583 DEVICE_TITLE := Gainstrong MiniBox V1.0
584 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
585 BOARDNAME := MINIBOX-V1
586 DEVICE_PROFILE := MINIBOXV1
587 TPLINK_HWID := 0x3C000201
588 CONSOLE := ttyATH0,115200
589 endef
590 TARGET_DEVICES += minibox-v1
591
592 define Device/omy-g1
593 $(Device/tplink-16mlzma)
594 DEVICE_TITLE := OMYlink OMY-G1
595 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
596 BOARDNAME := OMY-G1
597 DEVICE_PROFILE := OMYG1
598 TPLINK_HWID := 0x06660101
599 endef
600
601 define Device/omy-x1
602 $(Device/tplink-8mlzma)
603 DEVICE_TITLE := OMYlink OMY-X1
604 BOARDNAME := OMY-X1
605 DEVICE_PROFILE := OMYX1
606 TPLINK_HWID := 0x06660201
607 endef
608 TARGET_DEVICES += omy-g1 omy-x1
609
610 define Device/onion-omega
611 $(Device/tplink-16mlzma)
612 DEVICE_TITLE := Onion Omega
613 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage kmod-i2c-core kmod-i2c-gpio-custom kmod-spi-bitbang kmod-spi-dev kmod-spi-gpio kmod-spi-gpio-custom kmod-usb-serial
614 BOARDNAME := ONION-OMEGA
615 DEVICE_PROFILE := OMEGA
616 TPLINK_HWID := 0x04700001
617 CONSOLE := ttyATH0,115200
618 endef
619 TARGET_DEVICES += onion-omega
620
621 define Device/sc1750
622 DEVICE_TITLE := Abicom SC1750
623 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
624 BOARDNAME := SC1750
625 IMAGE_SIZE := 15744k
626 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env),15744k(firmware),128k(APConfig),128k(kplog),64k(ART)
627 endef
628 TARGET_DEVICES += sc1750
629
630 define Device/sc300m
631 DEVICE_TITLE := Abicom SC300M
632 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
633 BOARDNAME := SC300M
634 IMAGE_SIZE := 15744k
635 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env),15744k(firmware),128k(APConfig),128k(kplog),64k(ART)
636 endef
637 TARGET_DEVICES += sc300m
638
639 define Device/sc450
640 DEVICE_TITLE := Abicom SC450
641 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
642 BOARDNAME := SC450
643 IMAGE_SIZE := 15744k
644 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env),15744k(firmware),128k(APConfig),128k(kplog),64k(ART)
645 endef
646 TARGET_DEVICES += sc450
647
648 define Device/smart-300
649 $(Device/tplink-8mlzma)
650 DEVICE_TITLE := NC-LINK SMART-300
651 BOARDNAME := SMART-300
652 DEVICE_PROFILE := SMART-300
653 TPLINK_HWID := 0x93410001
654 endef
655 TARGET_DEVICES += smart-300
656
657 define Device/som9331
658 $(Device/tplink-8mlzma)
659 DEVICE_TITLE := OpenEmbed SOM9331
660 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage kmod-i2c-core kmod-i2c-gpio-custom kmod-spi-bitbang kmod-spi-dev kmod-spi-gpio kmod-spi-gpio-custom kmod-usb-serial
661 BOARDNAME := SOM9331
662 DEVICE_PROFILE := SOM9331
663 TPLINK_HWID := 0x04800054
664 CONSOLE := ttyATH0,115200
665 endef
666 TARGET_DEVICES += som9331
667
668 define Device/sr3200
669 DEVICE_TITLE := YunCore SR3200
670 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ath10k ath10k-firmware-qca988x
671 BOARDNAME := SR3200
672 IMAGE_SIZE := 16000k
673 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
674 endef
675 TARGET_DEVICES += sr3200
676
677 define Device/xd3200
678 $(Device/sr3200)
679 DEVICE_TITLE := YunCore XD3200
680 DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x
681 BOARDNAME := XD3200
682 endef
683 TARGET_DEVICES += xd3200
684
685 define Device/tellstick-znet-lite
686 $(Device/tplink-16mlzma)
687 DEVICE_TITLE := TellStick ZNet Lite
688 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-acm kmod-usb-serial kmod-usb-serial-pl2303
689 BOARDNAME := TELLSTICK-ZNET-LITE
690 DEVICE_PROFILE := TELLSTICKZNETLITE
691 TPLINK_HWID := 0x00726001
692 CONSOLE := ttyATH0,115200
693 endef
694 TARGET_DEVICES += tellstick-znet-lite
695
696 define Device/oolite
697 $(Device/tplink-16mlzma)
698 DEVICE_TITLE := Gainstrong OOLITE
699 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
700 BOARDNAME := GS-OOLITE
701 DEVICE_PROFILE := OOLITE
702 TPLINK_HWID := 0x3C000101
703 CONSOLE := ttyATH0,115200
704 endef
705 TARGET_DEVICES += oolite
706
707 define Device/NBG6616
708 DEVICE_TITLE := ZyXEL NBG6616
709 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-rtc-pcf8563 kmod-ath10k ath10k-firmware-qca988x
710 BOARDNAME := NBG6616
711 KERNEL_SIZE := 2048k
712 IMAGE_SIZE := 15323k
713 MTDPARTS := spi0.0:192k(u-boot)ro,64k(env)ro,64k(RFdata)ro,384k(zyxel_rfsd),384k(romd),64k(header),2048k(kernel),13184k(rootfs),15232k@0x120000(firmware)
714 CMDLINE += mem=128M
715 IMAGES := sysupgrade.bin
716 KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma | jffs2 boot/vmlinux.lzma.uImage
717 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
718 # We cannot currently build a factory image. It is the sysupgrade image
719 # prefixed with a header (which is actually written into the MTD device).
720 # The header is 2kiB and is filled with 0xff. The format seems to be:
721 # 2 bytes: 0x0000
722 # 2 bytes: checksum of the data partition (big endian)
723 # 4 bytes: length of the contained image file (big endian)
724 # 32 bytes: Firmware Version string (NUL terminated, 0xff padded)
725 # 2 bytes: 0x0000
726 # 2 bytes: checksum over the header partition (big endian)
727 # 32 bytes: Model (e.g. "NBG6616", NUL termiated, 0xff padded)
728 # rest: 0xff padding
729 #
730 # The checksums are calculated by adding up all bytes and if a 16bit
731 # overflow occurs, one is added and the sum is masked to 16 bit:
732 # csum = csum + databyte; if (csum > 0xffff) { csum += 1; csum &= 0xffff };
733 # Should the file have an odd number of bytes then the byte len-0x800 is
734 # used additionally.
735 # The checksum for the header is calcualted over the first 2048 bytes with
736 # the firmware checksum as the placeholder during calculation.
737 #
738 # The header is padded with 0xff to the erase block size of the device.
739 endef
740 TARGET_DEVICES += NBG6616
741
742 define Device/c-55
743 DEVICE_TITLE := AirTight Networks C-55
744 DEVICE_PACKAGES := kmod-ath9k
745 BOARDNAME := C-55
746 KERNEL_SIZE := 2048k
747 IMAGE_SIZE := 15872k
748 MTDPARTS := spi0.0:256k(u-boot)ro,128k(u-boot-env)ro,2048k(kernel),13824k(rootfs),13824k(opt)ro,2624k(failsafe)ro,64k(art)ro,15872k@0x60000(firmware)
749 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
750 endef
751 TARGET_DEVICES += c-55
752
753 define Device/hiwifi-hc6361
754 DEVICE_TITLE := HiWiFi HC6361
755 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage \
756 kmod-fs-ext4 kmod-nls-iso8859-1 e2fsprogs
757 BOARDNAME := HiWiFi-HC6361
758 DEVICE_PROFILE := HIWIFI_HC6361
759 IMAGE_SIZE := 16128k
760 KERNEL := kernel-bin | patch-cmdline | lzma | uImageHiWiFi lzma
761 CONSOLE := ttyATH0,115200
762 MTDPARTS := spi0.0:64k(u-boot)ro,64k(bdinfo)ro,16128k(firmware),64k(backup)ro,64k(art)ro
763 endef
764 TARGET_DEVICES += hiwifi-hc6361
765
766 define Device/seama
767 LOADER_TYPE := bin
768 BLOCKSIZE := 64k
769 KERNEL := kernel-bin | patch-cmdline | relocate-kernel | lzma
770 KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | seama
771 KERNEL_INITRAMFS_SUFFIX = $$(KERNEL_SUFFIX).seama
772 IMAGES := sysupgrade.bin factory.bin
773
774 # 64 bytes offset:
775 # - 28 bytes seama_header
776 # - 36 bytes of META data (4-bytes aligned)
777 IMAGE/default := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs
778 IMAGE/sysupgrade.bin := \
779 $$(IMAGE/default) | seama | pad-rootfs | \
780 check-size $$$$(IMAGE_SIZE)
781 IMAGE/factory.bin := \
782 $$(IMAGE/default) | seama | pad-rootfs | \
783 seama-seal -m "signature=$$$$(SEAMA_SIGNATURE)" | \
784 check-size $$$$(IMAGE_SIZE)
785 SEAMA_SIGNATURE :=
786 endef
787
788 define Device/dir-869-a1
789 $(Device/seama)
790 DEVICE_TITLE := D-Link DIR-869 rev. A1
791 DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x
792 BOARDNAME := DIR-869-A1
793 IMAGE_SIZE := 15872k
794 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(devdata)ro,64k(devconf)ro,15872k(firmware),64k(radiocfg)ro
795 SEAMA_SIGNATURE := wrgac54_dlink.2015_dir869
796 IMAGE/factory.bin := \
797 $$(IMAGE/default) | pad-rootfs -x 64 | \
798 seama | seama-seal -m "signature=$$$$(SEAMA_SIGNATURE)" | \
799 check-size $$$$(IMAGE_SIZE)
800 endef
801
802 define Device/mynet-n600
803 $(Device/seama)
804 DEVICE_TITLE := Western Digital My Net N600
805 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
806 BOARDNAME := MYNET-N600
807 IMAGE_SIZE := 15808k
808 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(devdata)ro,64k(devconf)ro,15872k(firmware),64k(radiocfg)ro
809 SEAMA_SIGNATURE := wrgnd16_wd_db600
810 endef
811
812 define Device/mynet-n750
813 $(Device/seama)
814 DEVICE_TITLE := Western Digital My Net N750
815 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
816 BOARDNAME := MYNET-N750
817 IMAGE_SIZE := 15808k
818 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(devdata)ro,64k(devconf)ro,15872k(firmware),64k(radiocfg)ro
819 SEAMA_SIGNATURE := wrgnd13_wd_av
820 endef
821
822 define Device/qihoo-c301
823 $(Device/seama)
824 DEVICE_TITLE := Qihoo C301
825 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x
826 BOARDNAME := QIHOO-C301
827 IMAGE_SIZE := 15744k
828 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env),64k(devdata),64k(devconf),15744k(firmware),64k(warm_start),64k(action_image_config),64k(radiocfg)ro;spi0.1:15360k(upgrade2),1024k(privatedata)
829 SEAMA_SIGNATURE := wrgac26_qihoo360_360rg
830 endef
831 TARGET_DEVICES += dir-869-a1 mynet-n600 mynet-n750 qihoo-c301
832
833 define Device/dap-2695-a1
834 DEVICE_TITLE := D-Link DAP-2695 rev. A1
835 DEVICE_PACKAGES := ath10k-firmware-qca988x kmod-ath10k
836 BOARDNAME := DAP-2695-A1
837 IMAGES := factory.img sysupgrade.bin
838 IMAGE_SIZE := 15360k
839 IMAGE/factory.img := append-kernel | pad-offset 65536 160 | append-rootfs | wrgg-pad-rootfs | mkwrggimg | check-size $$$$(IMAGE_SIZE)
840 IMAGE/sysupgrade.bin := append-kernel | pad-offset 65536 160 | mkwrggimg | append-rootfs | wrgg-pad-rootfs | check-size $$$$(IMAGE_SIZE)
841 KERNEL := kernel-bin | patch-cmdline | relocate-kernel | lzma
842 KERNEL_INITRAMFS := $$(KERNEL) | mkwrggimg
843 MTDPARTS := spi0.0:256k(bootloader)ro,64k(bdcfg)ro,64k(rgdb)ro,64k(langpack)ro,15360k(firmware),448k(captival)ro,64k(certificate)ro,64k(radiocfg)ro
844 DAP_SIGNATURE := wapac02_dkbs_dap2695
845 endef
846 TARGET_DEVICES += dap-2695-a1
847
848 define Device/bhr-4grv2
849 DEVICE_TITLE := Buffalo BHR-4GRV2
850 BOARDNAME := BHR-4GRV2
851 ROOTFS_SIZE := 14528k
852 KERNEL_SIZE := 1472k
853 IMAGE_SIZE := 16000k
854 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware)
855 IMAGES := sysupgrade.bin factory.bin
856 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to $$$$(ROOTFS_SIZE) | append-kernel | check-size $$$$(IMAGE_SIZE)
857 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | mkbuffaloimg
858 endef
859 TARGET_DEVICES += bhr-4grv2
860
861 define Device/wpj-16m
862 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
863 MTDPARTS := spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
864 IMAGE_SIZE := 16128k
865 endef
866
867 define Device/wpj342
868 $(Device/wpj-16m)
869 DEVICE_TITLE := Compex WPJ342 (16MB flash)
870 BOARDNAME := WPJ342
871 endef
872
873 define Device/wpj344
874 $(Device/wpj-16m)
875 DEVICE_TITLE := Compex WPJ344 (16MB flash)
876 BOARDNAME := WPJ344
877 SUPPORTED_DEVICES := wpj344
878 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
879 append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
880 endef
881
882 define Device/wpj531
883 $(Device/wpj-16m)
884 DEVICE_TITLE := Compex WPJ531 (16MB flash)
885 BOARDNAME := WPJ531
886 endef
887
888 define Device/wpj558
889 $(Device/wpj-16m)
890 DEVICE_TITLE := Compex WPJ558 (16MB flash)
891 BOARDNAME := WPJ558
892 SUPPORTED_DEVICES := wpj558
893 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
894 append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
895 endef
896
897 define Device/wpj563
898 $(Device/wpj-16m)
899 DEVICE_TITLE := Compex WPJ563 (16MB flash)
900 BOARDNAME := WPJ563
901 endef
902 TARGET_DEVICES += wpj342 wpj344 wpj531 wpj558 wpj563
903
904 define Device/wrtnode2q
905 DEVICE_TITLE := WRTnode2Q
906 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage
907 BOARDNAME := WRTNODE2Q
908 IMAGE_SIZE := 16064k
909 MTDPARTS := spi0.0:192k(u-boot)ro,64k(u-boot-env),64k(art)ro,16064k(firmware),16384k@0x0(fullflash)
910 endef
911 TARGET_DEVICES += wrtnode2q
912
913 define Device/zbt-we1526
914 DEVICE_TITLE := Zbtlink ZBT-WE1526
915 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
916 BOARDNAME := ZBT-WE1526
917 IMAGE_SIZE := 16000k
918 KERNEL_SIZE := 1472k
919 ROOTFS_SIZE := 14528k
920 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware)
921 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to $$$$(ROOTFS_SIZE) | append-kernel | check-size $$$$(IMAGE_SIZE)
922 endef
923 TARGET_DEVICES += zbt-we1526
924
925 define Device/fritz300e
926 DEVICE_TITLE := AVM FRITZ!WLAN Repeater 300E
927 DEVICE_PACKAGES := fritz-tffs rssileds -swconfig -uboot-envtools
928 BOARDNAME := FRITZ300E
929 SUPPORTED_DEVICES := fritz300e
930 IMAGE_SIZE := 15232k
931 KERNEL := kernel-bin | patch-cmdline | lzma | eva-image
932 IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | \
933 append-squashfs-fakeroot-be | pad-to 256 | \
934 append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
935 endef
936 TARGET_DEVICES += fritz300e