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