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