bf69953eac06e28dcbc78206d59540edc5dd20a4
[oweals/openwrt.git] / target / linux / ipq40xx / image / Makefile
1 include $(TOPDIR)/rules.mk
2 include $(INCLUDE_DIR)/image.mk
3
4 DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID
5 DEVICE_VARS += RAS_BOARD RAS_ROOTFS_SIZE RAS_VERSION
6 DEVICE_VARS += WRGG_DEVNAME WRGG_SIGNATURE
7
8 define Device/Default
9         PROFILES := Default
10         KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
11         KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs
12         KERNEL_PREFIX := $$(IMAGE_PREFIX)
13         KERNEL_LOADADDR := 0x80208000
14         DEVICE_DTS = $$(SOC)-$(lastword $(subst _, ,$(1)))
15         SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
16         IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata
17         IMAGE/sysupgrade.bin/squashfs :=
18 endef
19
20 define Device/FitImage
21         KERNEL_SUFFIX := -fit-uImage.itb
22         KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
23         KERNEL_NAME := Image
24 endef
25
26 define Device/FitImageLzma
27         KERNEL_SUFFIX := -fit-uImage.itb
28         KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb
29         KERNEL_NAME := Image
30 endef
31
32 define Device/FitzImage
33         KERNEL_SUFFIX := -fit-zImage.itb
34         KERNEL = kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb
35         KERNEL_NAME := zImage
36 endef
37
38 define Device/UbiFit
39         KERNEL_IN_UBI := 1
40         IMAGES := nand-factory.ubi nand-sysupgrade.bin
41         IMAGE/nand-factory.ubi := append-ubi
42         IMAGE/nand-sysupgrade.bin := sysupgrade-tar | append-metadata
43 endef
44
45 define Device/DniImage
46         KERNEL_SUFFIX := -fit-uImage.itb
47         KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
48         KERNEL_NAME := Image
49         NETGEAR_BOARD_ID :=
50         NETGEAR_HW_ID :=
51         IMAGES := factory.img sysupgrade.bin
52         IMAGE/factory.img := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | append-rootfs | pad-rootfs | netgear-dni
53         IMAGE/sysupgrade.bin := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | append-rootfs | pad-rootfs | append-metadata
54 endef
55
56 define Build/append-rootfshdr
57         mkimage -A $(LINUX_KARCH) \
58                 -O linux -T filesystem \
59                 -C lzma -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
60                 -n root.squashfs -d $(IMAGE_ROOTFS) $@.new
61         dd if=$@.new bs=64 count=1 >> $(IMAGE_KERNEL)
62 endef
63
64 define Build/mkmylofw_32m
65         $(eval device_id=$(word 1,$(1)))
66         $(eval revision=$(word 2,$(1)))
67
68         let \
69                 size="$$(stat -c%s $@)" \
70                 pad="$(subst k,* 1024,$(BLOCKSIZE))" \
71                 pad="(pad - (size % pad)) % pad" \
72                 newsize='size + pad'; \
73                 $(STAGING_DIR_HOST)/bin/mkmylofw \
74                 -B WPE72 -i 0x11f6:$(device_id):0x11f6:$(device_id) -r $(revision) \
75                 -s 0x2000000 -p0x180000:$$newsize:al:0x80208000:"OpenWrt":$@ \
76                 $@.new
77         @mv $@.new $@
78 endef
79
80 define Build/qsdk-ipq-factory-nand-askey
81         $(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh $@.its\
82                 askey_kernel $(IMAGE_KERNEL) \
83                 askey_fs $(IMAGE_ROOTFS) \
84                 ubifs $@
85         PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
86         @mv $@.new $@
87 endef
88
89 define Build/SenaoFW
90         -$(STAGING_DIR_HOST)/bin/mksenaofw \
91                 -n $(BOARD_NAME) -r $(VENDOR_ID) -p $(1) \
92                 -c $(DATECODE) -w $(2) -x $(CW_VER) -t 0 \
93                 -e $@ \
94                 -o $@.new
95         @cp $@.new $@
96 endef
97
98 define Build/wrgg-image
99         mkwrggimg -i $@ \
100         -o $@.new \
101         -d "$(WRGG_DEVNAME)" \
102         -s "$(WRGG_SIGNATURE)" \
103         -v "" -m "" -B ""
104         mv $@.new $@
105 endef
106
107 define Device/8dev_habanero-dvk
108         $(call Device/FitImageLzma)
109         DEVICE_VENDOR := 8devices
110         DEVICE_MODEL := Habanero DVK
111         IMAGE_SIZE := 30976k
112         SOC := qcom-ipq4019
113         DEVICE_PACKAGES := ipq-wifi-8dev_habanero-dvk
114         IMAGES := sysupgrade.bin
115         IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-rootfs | pad-rootfs | append-metadata | check-size
116 endef
117 TARGET_DEVICES += 8dev_habanero-dvk
118
119 define Device/8dev_jalapeno-common
120         $(call Device/FitImage)
121         $(call Device/UbiFit)
122         BLOCKSIZE := 128k
123         PAGESIZE := 2048
124         SOC := qcom-ipq4018
125 endef
126
127 define Device/8dev_jalapeno
128         $(call Device/8dev_jalapeno-common)
129         DEVICE_VENDOR := 8devices
130         DEVICE_MODEL := Jalapeno
131 endef
132 TARGET_DEVICES += 8dev_jalapeno
133
134 define Device/alfa-network_ap120c-ac
135         $(call Device/FitImage)
136         $(call Device/UbiFit)
137         DEVICE_VENDOR := ALFA Network
138         DEVICE_MODEL := AP120C-AC
139         SOC := qcom-ipq4018
140         DEVICE_PACKAGES := kmod-usb-acm \
141                 kmod-tpm-i2c-atmel uboot-envtools
142         BLOCKSIZE := 128k
143         PAGESIZE := 2048
144         IMAGE_SIZE := 65536k
145         IMAGES := nand-factory.bin nand-sysupgrade.bin
146         IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand
147 endef
148 TARGET_DEVICES += alfa-network_ap120c-ac
149
150 define Device/aruba_ap-303
151         $(call Device/FitImageLzma)
152         DEVICE_VENDOR := Aruba
153         DEVICE_MODEL := AP-303
154         SOC := qcom-ipq4029
155         DEVICE_PACKAGES := ipq-wifi-aruba_ap-303
156         IMAGES := sysupgrade.bin
157 endef
158 TARGET_DEVICES += aruba_ap-303
159
160 define Device/aruba_ap-303h
161         $(call Device/FitImageLzma)
162         DEVICE_VENDOR := Aruba
163         DEVICE_MODEL := AP-303H
164         SOC := qcom-ipq4029
165         DEVICE_PACKAGES := ipq-wifi-aruba_ap-303
166         IMAGES := sysupgrade.bin
167 endef
168 TARGET_DEVICES += aruba_ap-303h
169
170 define Device/asus_map-ac2200
171         $(call Device/FitImageLzma)
172         DEVICE_VENDOR := ASUS
173         DEVICE_MODEL := Lyra (MAP-AC2200)
174         SOC := qcom-ipq4019
175         IMAGES := sysupgrade.bin
176         DEVICE_PACKAGES := ath10k-firmware-qca9888-ct kmod-ath3k
177 endef
178 TARGET_DEVICES += asus_map-ac2200
179
180 define Device/asus_rt-ac58u
181         $(call Device/FitImageLzma)
182         DEVICE_VENDOR := ASUS
183         DEVICE_MODEL := RT-AC58U
184         SOC := qcom-ipq4018
185         BLOCKSIZE := 128k
186         PAGESIZE := 2048
187         DTB_SIZE := 65536
188         IMAGE_SIZE := 20439364
189         FILESYSTEMS := squashfs
190 #       Someone - in their infinite wisdom - decided to put the firmware
191 #       version in front of the image name \03\00\00\04 => Version 3.0.0.4
192 #       Since u-boot works with strings we either need another fixup step
193 #       to add a version... or we are very careful not to add '\0' into that
194 #       string and call it a day.... Yeah, we do the latter!
195         UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC58U')
196         IMAGES := sysupgrade.bin
197         DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers \
198                 kmod-usb-ledtrig-usbport
199 endef
200 TARGET_DEVICES += asus_rt-ac58u
201
202 define Device/avm_fritzbox-4040
203         $(call Device/FitImageLzma)
204         DEVICE_VENDOR := AVM
205         DEVICE_MODEL := FRITZ!Box 4040
206         SOC := qcom-ipq4018
207         BOARD_NAME := fritz4040
208         IMAGE_SIZE := 29056k
209         UBOOT_PATH := $(STAGING_DIR_IMAGE)/uboot-fritz4040.bin
210         UBOOT_PARTITION_SIZE := 524288
211         IMAGES = eva.bin sysupgrade.bin
212         IMAGE/eva.bin := append-uboot | pad-to $$$$(UBOOT_PARTITION_SIZE) | append-kernel | append-rootfs | pad-rootfs
213         IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
214         DEVICE_PACKAGES := fritz-tffs fritz-caldata
215 endef
216 TARGET_DEVICES += avm_fritzbox-4040
217
218 define Device/avm_fritzbox-7530
219         $(call Device/FitImageLzma)
220         DEVICE_VENDOR := AVM
221         DEVICE_MODEL := FRITZ!Box 7530
222         SOC := qcom-ipq4019
223         DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand
224         IMAGES := sysupgrade.bin
225 endef
226 TARGET_DEVICES += avm_fritzbox-7530
227
228 define Device/avm_fritzrepeater-1200
229         $(call Device/FitImageLzma)
230         DEVICE_VENDOR := AVM
231         DEVICE_MODEL := FRITZ!Repeater 1200
232         SOC := qcom-ipq4019
233         DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand ipq-wifi-avm_fritzrepeater-1200
234         IMAGES := sysupgrade.bin
235 endef
236 TARGET_DEVICES += avm_fritzrepeater-1200
237
238 define Device/avm_fritzrepeater-3000
239         $(call Device/FitImageLzma)
240         DEVICE_VENDOR := AVM
241         DEVICE_MODEL := FRITZ!Repeater 3000
242         SOC := qcom-ipq4019
243         DEVICE_PACKAGES := ath10k-firmware-qca9984-ct fritz-caldata fritz-tffs-nand
244         IMAGES := sysupgrade.bin
245 endef
246 TARGET_DEVICES += avm_fritzrepeater-3000
247
248 define Device/cellc_rtl30vw
249         KERNEL_SUFFIX := -fit-uImage.itb
250         KERNEL_INITRAMFS = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
251         KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb | uImage lzma | pad-to 2048
252         KERNEL_NAME := Image
253         KERNEL_IN_UBI :=
254         IMAGES := nand-factory.bin nand-sysupgrade.bin
255         IMAGE/nand-factory.bin := append-rootfshdr | append-ubi | qsdk-ipq-factory-nand-askey
256         IMAGE/nand-sysupgrade.bin := append-rootfshdr | sysupgrade-tar | append-metadata
257         DEVICE_VENDOR := Cell C
258         DEVICE_MODEL := RTL30VW
259         SOC := qcom-ipq4019
260         DEVICE_DTS_CONFIG := config@5
261         KERNEL_INSTALL := 1
262         KERNEL_SIZE := 4096k
263         IMAGE_SIZE := 57344k
264         BLOCKSIZE := 128k
265         PAGESIZE := 2048
266         DEVICE_PACKAGES := kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi ipq-wifi-cellc_rtl30vw
267 endef
268 TARGET_DEVICES += cellc_rtl30vw
269
270 define Device/cilab_meshpoint-one
271         $(call Device/8dev_jalapeno-common)
272         DEVICE_VENDOR := Crisis Innovation Lab
273         DEVICE_MODEL := MeshPoint.One
274         DEVICE_PACKAGES := kmod-i2c-gpio kmod-iio-bmp280-i2c kmod-hwmon-ina2xx kmod-rtc-pcf2127
275 endef
276 TARGET_DEVICES += cilab_meshpoint-one
277
278 define Device/compex_wpj419
279         $(call Device/FitImage)
280         $(call Device/UbiFit)
281         DEVICE_VENDOR := Compex
282         DEVICE_MODEL := WPJ419
283         SOC := qcom-ipq4019
284         DEVICE_DTS_CONFIG := config@12
285         KERNEL_INSTALL := 1
286         BLOCKSIZE := 128k
287         PAGESIZE := 2048
288         FILESYSTEMS := squashfs
289 endef
290 TARGET_DEVICES += compex_wpj419
291
292 define Device/compex_wpj428
293         $(call Device/FitImage)
294         DEVICE_VENDOR := Compex
295         DEVICE_MODEL := WPJ428
296         SOC := qcom-ipq4028
297         DEVICE_DTS_CONFIG := config@4
298         BLOCKSIZE := 64k
299         IMAGE_SIZE := 31232k
300         KERNEL_SIZE := 4096k
301         IMAGES = sysupgrade.bin cpximg-6a04.bin
302         IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
303         IMAGE/cpximg-6a04.bin := append-kernel | append-rootfs | pad-rootfs | mkmylofw_32m 0x8A2 3
304         DEVICE_PACKAGES := kmod-gpio-beeper
305 endef
306 TARGET_DEVICES += compex_wpj428
307
308 define Device/dlink_dap-2610
309         $(call Device/FitImageLzma)
310         DEVICE_VENDOR := D-Link
311         DEVICE_MODEL := DAP-2610
312         SOC := qcom-ipq4018
313         DEVICE_DTS_CONFIG := config@ap.dk01.1-c1
314         BLOCKSIZE := 64k
315         WRGG_DEVNAME := /dev/mtdblock/8
316         WRGG_SIGNATURE := wapac30_dkbs_dap2610
317         IMAGE_SIZE := 14080k
318         IMAGES := sysupgrade.bin factory.bin
319         # Bootloader expects a special 160 byte header which is added by
320         # wrgg-image.
321         # Factory image size must be larger than 6MB, and size in wrgg header must
322         # match actual factory image size to be flashable from D-Link http server.
323         # Bootloader verifies checksum of wrgg image before booting, thus jffs2
324         # cannot be part of the wrgg image. This is solved in the factory image by
325         # having the rootfs at the end of the image (without pad-rootfs). And in
326         # the sysupgrade image only the kernel is included in the wrgg checksum,
327         # but this is not flashable from the D-link http server.
328         # append-rootfs must start on an erase block boundary.
329         IMAGE/factory.bin    := append-kernel | pad-offset 6144k 160 | append-rootfs | wrgg-image | check-size
330         IMAGE/sysupgrade.bin := append-kernel | wrgg-image | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size | append-metadata
331         DEVICE_PACKAGES := ipq-wifi-dlink_dap2610
332 endef
333 TARGET_DEVICES += dlink_dap-2610
334
335 define Device/engenius_eap1300
336         $(call Device/FitImage)
337         DEVICE_VENDOR := EnGenius
338         DEVICE_MODEL := EAP1300
339         DEVICE_DTS_CONFIG := config@4
340         BOARD_NAME := eap1300
341         SOC := qcom-ipq4018
342         KERNEL_SIZE := 5120k
343         IMAGE_SIZE := 25344k
344         IMAGES := sysupgrade.bin
345         IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
346 endef
347 TARGET_DEVICES += engenius_eap1300
348
349 define Device/engenius_eap2200
350         $(call Device/FitImage)
351         $(call Device/UbiFit)
352         DEVICE_VENDOR := EnGenius
353         DEVICE_MODEL := EAP2200
354         SOC := qcom-ipq4019
355         BLOCKSIZE := 128k
356         PAGESIZE := 2048
357         DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-engenius_eap2200 -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers
358 endef
359 TARGET_DEVICES += engenius_eap2200
360
361 define Device/engenius_emd1
362         $(call Device/FitImage)
363         DEVICE_VENDOR := EnGenius
364         DEVICE_MODEL := EMD1
365         DEVICE_DTS_CONFIG := config@4
366         SOC := qcom-ipq4018
367         IMAGE_SIZE := 30720k
368         IMAGES := sysupgrade.bin factory.bin
369         IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
370         IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size
371 endef
372 TARGET_DEVICES += engenius_emd1
373
374 define Device/engenius_ens620ext
375         $(call Device/FitImage)
376         DEVICE_VENDOR := EnGenius
377         DEVICE_MODEL := ENS620EXT
378         SOC := qcom-ipq4018
379         DEVICE_DTS_CONFIG := config@4
380         BLOCKSIZE := 64k
381         PAGESIZE := 256
382         BOARD_NAME := ENS620EXT
383         VENDOR_ID := 0x0101
384         PRODUCT_ID := 0x79
385         PRODUCT_ID_NEW := 0xA4
386         DATECODE := 190507
387         FW_VER := 3.1.2
388         FW_VER_NEW := 3.5.6
389         CW_VER := 1.8.99
390         IMAGE_SIZE := 21312k
391         KERNEL_SIZE := 5120k
392         FILESYSTEMS := squashfs
393         IMAGES := sysupgrade.bin factory_30.bin factory_35.bin
394         IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size | append-metadata
395         IMAGE/factory_30.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size | SenaoFW $$$$(PRODUCT_ID) $$$$(FW_VER)
396         IMAGE/factory_35.bin := qsdk-ipq-factory-nor | check-size | SenaoFW $$$$(PRODUCT_ID_NEW) $$$$(FW_VER_NEW)
397 endef
398 TARGET_DEVICES += engenius_ens620ext
399
400 define Device/ezviz_cs-w3-wd1200g-eup
401         $(call Device/FitImage)
402         DEVICE_VENDOR := EZVIZ
403         DEVICE_MODEL := CS-W3-WD1200G
404         DEVICE_VARIANT := EUP
405         DEVICE_DTS_CONFIG := config@4
406         IMAGE_SIZE := 14848k
407         SOC := qcom-ipq4018
408         IMAGES := sysupgrade.bin
409         IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \
410                 append-metadata
411         DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers \
412                 ipq-wifi-ezviz_cs-w3-wd1200g-eup
413 endef
414 TARGET_DEVICES += ezviz_cs-w3-wd1200g-eup
415
416 define Device/glinet_gl-b1300
417         $(call Device/FitImage)
418         DEVICE_VENDOR := GL.iNet
419         DEVICE_MODEL := GL-B1300
420         BOARD_NAME := gl-b1300
421         SOC := qcom-ipq4029
422         KERNEL_SIZE := 4096k
423         IMAGE_SIZE := 26624k
424         IMAGES := sysupgrade.bin
425         IMAGE/sysupgrade.bin := append-kernel |append-rootfs | pad-rootfs | append-metadata
426 endef
427 TARGET_DEVICES += glinet_gl-b1300
428
429 define Device/linksys_ea6350v3
430         # The Linksys EA6350v3 has a uboot bootloader that does not
431         # support either booting lzma kernel images nor booting UBI
432         # partitions. This uboot, however, supports raw kernel images and
433         # gzipped images.
434         #
435         # As for the time of writing this, the device will boot the kernel
436         # from a fixed address with a fixed length of 3MiB. Also, the
437         # device has a hard-coded kernel command line that requieres the
438         # rootfs and alt_rootfs to be in mtd11 and mtd13 respectively.
439         # Oh... and the kernel partition overlaps with the rootfs
440         # partition (the same for alt_kernel and alt_rootfs).
441         #
442         # If you are planing re-partitioning the device, you may want to
443         # keep those details in mind:
444         # 1. The kernel adresses you should honor are 0x00000000 and
445         #    0x02800000 respectively.
446         # 2. The kernel size (plus the dtb) cannot exceed 3.00MiB in size.
447         # 3. You can use 'zImage', but not a raw 'Image' packed with lzma.
448         # 4. The kernel command line from uboot is harcoded to boot with
449         #    rootfs either in mtd11 or mtd13.
450         $(call Device/FitzImage)
451         DEVICE_VENDOR := Linksys
452         DEVICE_MODEL := EA6350
453         DEVICE_VARIANT := v3
454         SOC := qcom-ipq4018
455         BLOCKSIZE := 128k
456         PAGESIZE := 2048
457         KERNEL_SIZE := 3072k
458         IMAGE_SIZE := 37888k
459         UBINIZE_OPTS := -E 5
460         IMAGES := factory.bin sysupgrade.bin
461         IMAGE/factory.bin := append-kernel | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA6350v3
462         DEVICE_PACKAGES := uboot-envtools
463 endef
464 TARGET_DEVICES += linksys_ea6350v3
465
466 define Device/linksys_ea8300
467         $(call Device/FitzImage)
468         DEVICE_VENDOR := Linksys
469         DEVICE_MODEL := EA8300
470         SOC := qcom-ipq4019
471         KERNEL_SIZE := 3072k
472         IMAGE_SIZE := 87040k
473         BLOCKSIZE := 128k
474         PAGESIZE := 2048
475         UBINIZE_OPTS := -E 5    # EOD marks to "hide" factory sig at EOF
476         IMAGES := sysupgrade.bin factory.bin
477         IMAGE/factory.bin  := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA8300
478         DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9888-ct ipq-wifi-linksys_ea8300 kmod-usb-ledtrig-usbport
479 endef
480 TARGET_DEVICES += linksys_ea8300
481
482 define Device/meraki_mr33
483         $(call Device/FitImage)
484         DEVICE_VENDOR := Cisco Meraki
485         DEVICE_MODEL := MR33
486         SOC := qcom-ipq4029
487         BLOCKSIZE := 128k
488         PAGESIZE := 2048
489         IMAGES = sysupgrade.bin
490         DEVICE_PACKAGES := -swconfig ath10k-firmware-qca9887-ct
491 endef
492 TARGET_DEVICES += meraki_mr33
493
494 define Device/mobipromo_cm520-79f
495         $(call Device/FitzImage)
496         $(call Device/UbiFit)
497         DEVICE_VENDOR := MobiPromo
498         DEVICE_MODEL := CM520-79F
499         SOC := qcom-ipq4019
500         BLOCKSIZE := 128k
501         PAGESIZE := 2048
502         DEVICE_PACKAGES := ipq-wifi-mobipromo_cm520-79f kmod-usb-ledtrig-usbport
503 endef
504 TARGET_DEVICES += mobipromo_cm520-79f
505
506 define Device/netgear_ex61x0v2
507         $(call Device/DniImage)
508         DEVICE_DTS_CONFIG := config@4
509         NETGEAR_BOARD_ID := EX6150v2series
510         NETGEAR_HW_ID := 29765285+16+0+128+2x2
511         SOC := qcom-ipq4018
512 endef
513
514 define Device/netgear_ex6100v2
515         $(call Device/netgear_ex61x0v2)
516         DEVICE_VENDOR := Netgear
517         DEVICE_MODEL := EX6100
518         DEVICE_VARIANT := v2
519 endef
520 TARGET_DEVICES += netgear_ex6100v2
521
522 define Device/netgear_ex6150v2
523         $(call Device/netgear_ex61x0v2)
524         DEVICE_VENDOR := Netgear
525         DEVICE_MODEL := EX6150
526         DEVICE_VARIANT := v2
527 endef
528 TARGET_DEVICES += netgear_ex6150v2
529
530 define Device/openmesh_a42
531         $(call Device/FitImageLzma)
532         DEVICE_VENDOR := OpenMesh
533         DEVICE_MODEL := A42
534         SOC := qcom-ipq4018
535         DEVICE_DTS_CONFIG := config@om.a42
536         BLOCKSIZE := 64k
537         KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
538         IMAGE_SIZE := 15616k
539         IMAGES = factory.bin sysupgrade.bin
540         IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A42
541         IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
542         DEVICE_PACKAGES := uboot-envtools
543 endef
544 TARGET_DEVICES += openmesh_a42
545
546 define Device/openmesh_a62
547         $(call Device/FitImageLzma)
548         DEVICE_VENDOR := OpenMesh
549         DEVICE_MODEL := A62
550         SOC := qcom-ipq4019
551         DEVICE_DTS_CONFIG := config@om.a62
552         BLOCKSIZE := 64k
553         KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
554         IMAGE_SIZE := 15552k
555         IMAGES = factory.bin sysupgrade.bin
556         IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A62
557         IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
558         DEVICE_PACKAGES := ath10k-firmware-qca9888-ct uboot-envtools
559 endef
560
561 TARGET_DEVICES += openmesh_a62
562
563 define Device/qcom_ap-dk01.1-c1
564         DEVICE_VENDOR := Qualcomm Atheros
565         DEVICE_MODEL := AP-DK01.1
566         DEVICE_VARIANT := C1
567         BOARD_NAME := ap-dk01.1-c1
568         SOC := qcom-ipq4019
569         DEVICE_DTS := qcom-ipq4019-ap.dk01.1-c1
570         KERNEL_INSTALL := 1
571         KERNEL_SIZE := 4096k
572         IMAGE_SIZE := 26624k
573         $(call Device/FitImage)
574         IMAGES := sysupgrade.bin
575         IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | append-metadata
576 endef
577 TARGET_DEVICES += qcom_ap-dk01.1-c1
578
579 define Device/qcom_ap-dk04.1-c1
580         $(call Device/FitImage)
581         $(call Device/UbiFit)
582         DEVICE_VENDOR := Qualcomm Atheros
583         DEVICE_MODEL := AP-DK04.1
584         DEVICE_VARIANT := C1
585         SOC := qcom-ipq4019
586         DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1
587         KERNEL_INSTALL := 1
588         KERNEL_SIZE := 4048k
589         BLOCKSIZE := 128k
590         PAGESIZE := 2048
591         BOARD_NAME := ap-dk04.1-c1
592 endef
593 TARGET_DEVICES += qcom_ap-dk04.1-c1
594
595 define Device/qxwlan_e2600ac-c1
596         $(call Device/FitImage)
597         DEVICE_VENDOR := Qxwlan
598         DEVICE_MODEL := E2600AC
599         DEVICE_VARIANT := C1
600         BOARD_NAME := e2600ac-c1
601         SOC := qcom-ipq4019
602         KERNEL_SIZE := 4096k
603         IMAGE_SIZE := 31232k
604         IMAGES := sysupgrade.bin
605         IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
606         DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac
607 endef
608 TARGET_DEVICES += qxwlan_e2600ac-c1
609
610 define Device/qxwlan_e2600ac-c2
611         $(call Device/FitImage)
612         $(call Device/UbiFit)
613         DEVICE_VENDOR := Qxwlan
614         DEVICE_MODEL := E2600AC
615         DEVICE_VARIANT := C2
616         SOC := qcom-ipq4019
617         KERNEL_INSTALL := 1
618         BLOCKSIZE := 128k
619         PAGESIZE := 2048
620         DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac
621 endef
622 TARGET_DEVICES += qxwlan_e2600ac-c2
623
624 define Device/unielec_u4019-32m
625         $(call Device/FitImage)
626         DEVICE_VENDOR := Unielec
627         DEVICE_MODEL := U4019
628         DEVICE_VARIANT := 32M
629         BOARD_NAME := u4019-32m
630         SOC := qcom-ipq4019
631         KERNEL_SIZE := 4096k
632         IMAGE_SIZE := 31232k
633         IMAGES := sysupgrade.bin
634         IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
635 endef
636 TARGET_DEVICES += unielec_u4019-32m
637
638 define Device/zyxel_nbg6617
639         $(call Device/FitImageLzma)
640         DEVICE_VENDOR := ZyXEL
641         DEVICE_MODEL := NBG6617
642         SOC := qcom-ipq4018
643         ROOTFS_SIZE := 24960k
644         RAS_BOARD := NBG6617
645         RAS_ROOTFS_SIZE := 19840k
646         RAS_VERSION := "$(VERSION_DIST) $(REVISION)"
647         IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
648         IMAGES := sysupgrade.bin factory.bin
649 #       The ZyXEL firmware allows flashing thru the web-gui only when the rootfs is
650 #       at least as large as the one of the initial firmware image (not the current
651 #       one on the device). This only applies to the Web-UI, the bootlaoder ignores
652 #       this minimum-size. However, the larger image can be flashed both ways.
653         IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k | check-size $$$$(ROOTFS_SIZE) | zyxel-ras-image separate-kernel
654         IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | check-size $$$$(ROOTFS_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata
655         DEVICE_PACKAGES := uboot-envtools kmod-usb-ledtrig-usbport
656 endef
657 TARGET_DEVICES += zyxel_nbg6617
658
659 define Device/zyxel_wre6606
660         $(call Device/FitImage)
661         DEVICE_VENDOR := ZyXEL
662         DEVICE_MODEL := WRE6606
663         DEVICE_DTS_CONFIG := config@4
664         SOC := qcom-ipq4018
665         IMAGES := sysupgrade.bin
666         IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
667         DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers
668 endef
669 TARGET_DEVICES += zyxel_wre6606
670
671 $(eval $(call BuildImage))