1 include $(TOPDIR)/rules.mk
2 include $(INCLUDE_DIR)/image.mk
4 DEVICE_VARS += RAS_BOARD RAS_ROOTFS_SIZE RAS_VERSION \
5 WRGG_DEVNAME WRGG_SIGNATURE
9 KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
10 KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs
11 KERNEL_PREFIX := $$(IMAGE_PREFIX)
12 KERNEL_LOADADDR := 0x80208000
13 DEVICE_DTS = $$(SOC)-$(lastword $(subst _, ,$(1)))
14 SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
15 IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata
16 IMAGE/sysupgrade.bin/squashfs :=
19 define Device/FitImage
20 KERNEL_SUFFIX := -fit-uImage.itb
21 KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
25 define Device/FitImageLzma
26 KERNEL_SUFFIX := -fit-uImage.itb
27 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb
31 define Device/FitzImage
32 KERNEL_SUFFIX := -fit-zImage.itb
33 KERNEL = kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb
39 IMAGES := nand-factory.ubi nand-sysupgrade.bin
40 IMAGE/nand-factory.ubi := append-ubi
41 IMAGE/nand-sysupgrade.bin := sysupgrade-tar | append-metadata
44 define Device/DniImage
45 KERNEL_SUFFIX := -fit-uImage.itb
46 KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
50 IMAGES := factory.img sysupgrade.bin
51 IMAGE/factory.img := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | append-rootfs | pad-rootfs | netgear-dni
52 IMAGE/sysupgrade.bin := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | append-rootfs | pad-rootfs | append-metadata
54 DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID
57 -$(STAGING_DIR_HOST)/bin/mksenaofw \
58 -n $(BOARD_NAME) -r $(VENDOR_ID) -p $(1) \
59 -c $(DATECODE) -w $(2) -x $(CW_VER) -t 0 \
65 define Build/wrgg-image
68 -d "$(WRGG_DEVNAME)" \
69 -s "$(WRGG_SIGNATURE)" \
74 define Device/8dev_habanero-dvk
75 $(call Device/FitImageLzma)
76 DEVICE_VENDOR := 8devices
77 DEVICE_MODEL := Habanero DVK
80 DEVICE_PACKAGES := ipq-wifi-8dev_habanero-dvk
81 IMAGES := sysupgrade.bin
82 IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
84 TARGET_DEVICES += 8dev_habanero-dvk
86 define Device/8dev_jalapeno-common
87 $(call Device/FitImage)
94 define Device/8dev_jalapeno
95 $(call Device/8dev_jalapeno-common)
96 DEVICE_VENDOR := 8devices
97 DEVICE_MODEL := Jalapeno
99 TARGET_DEVICES += 8dev_jalapeno
101 define Device/alfa-network_ap120c-ac
102 $(call Device/FitImage)
103 $(call Device/UbiFit)
104 DEVICE_VENDOR := ALFA Network
105 DEVICE_MODEL := AP120C-AC
107 DEVICE_PACKAGES := kmod-usb-acm \
108 kmod-tpm-i2c-atmel uboot-envtools
112 IMAGES := nand-factory.bin nand-sysupgrade.bin
113 IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand
115 TARGET_DEVICES += alfa-network_ap120c-ac
117 define Device/aruba_ap-303
118 $(call Device/FitImageLzma)
119 DEVICE_VENDOR := Aruba
120 DEVICE_MODEL := AP-303
122 DEVICE_PACKAGES := ipq-wifi-aruba_ap-303
123 IMAGES := sysupgrade.bin
125 TARGET_DEVICES += aruba_ap-303
127 define Device/aruba_ap-303h
128 $(call Device/FitImageLzma)
129 DEVICE_VENDOR := Aruba
130 DEVICE_MODEL := AP-303H
132 DEVICE_PACKAGES := ipq-wifi-aruba_ap-303
133 IMAGES := sysupgrade.bin
135 TARGET_DEVICES += aruba_ap-303h
137 define Device/asus_map-ac2200
138 $(call Device/FitImageLzma)
139 DEVICE_VENDOR := ASUS
140 DEVICE_MODEL := Lyra (MAP-AC2200)
142 IMAGES := sysupgrade.bin
143 DEVICE_PACKAGES := ath10k-firmware-qca9888-ct kmod-ath3k
145 TARGET_DEVICES += asus_map-ac2200
147 define Device/asus_rt-ac58u
148 $(call Device/FitImageLzma)
149 DEVICE_VENDOR := ASUS
150 DEVICE_MODEL := RT-AC58U
155 IMAGE_SIZE := 20439364
156 FILESYSTEMS := squashfs
157 # Someone - in their infinite wisdom - decided to put the firmware
158 # version in front of the image name \03\00\00\04 => Version 3.0.0.4
159 # Since u-boot works with strings we either need another fixup step
160 # to add a version... or we are very careful not to add '\0' into that
161 # string and call it a day.... Yeah, we do the latter!
162 UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC58U')
163 IMAGES := sysupgrade.bin
164 DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers \
165 kmod-usb-ledtrig-usbport
167 TARGET_DEVICES += asus_rt-ac58u
169 define Device/avm_fritzbox-4040
170 $(call Device/FitImageLzma)
172 DEVICE_MODEL := FRITZ!Box 4040
174 BOARD_NAME := fritz4040
176 UBOOT_PATH := $(STAGING_DIR_IMAGE)/uboot-fritz4040.bin
177 UBOOT_PARTITION_SIZE := 524288
178 IMAGES = eva.bin sysupgrade.bin
179 IMAGE/eva.bin := append-uboot | pad-to $$$$(UBOOT_PARTITION_SIZE) | append-kernel | append-rootfs | pad-rootfs
180 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
181 DEVICE_PACKAGES := fritz-tffs fritz-caldata
183 TARGET_DEVICES += avm_fritzbox-4040
185 define Device/avm_fritzbox-7530
186 $(call Device/FitImageLzma)
188 DEVICE_MODEL := FRITZ!Box 7530
190 DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand
191 IMAGES := sysupgrade.bin
193 TARGET_DEVICES += avm_fritzbox-7530
195 define Device/avm_fritzrepeater-1200
196 $(call Device/FitImageLzma)
198 DEVICE_MODEL := FRITZ!Repeater 1200
200 DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand ipq-wifi-avm_fritzrepeater-1200
201 IMAGES := sysupgrade.bin
203 TARGET_DEVICES += avm_fritzrepeater-1200
205 define Device/avm_fritzrepeater-3000
206 $(call Device/FitImageLzma)
208 DEVICE_MODEL := FRITZ!Repeater 3000
210 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct fritz-caldata fritz-tffs-nand
211 IMAGES := sysupgrade.bin
213 TARGET_DEVICES += avm_fritzrepeater-3000
215 define Device/cilab_meshpoint-one
216 $(call Device/8dev_jalapeno-common)
217 DEVICE_VENDOR := Crisis Innovation Lab
218 DEVICE_MODEL := MeshPoint.One
219 DEVICE_PACKAGES := kmod-i2c-gpio kmod-iio-bmp280-i2c kmod-hwmon-ina2xx kmod-rtc-pcf2127
221 TARGET_DEVICES += cilab_meshpoint-one
223 define Device/compex_wpj419
224 $(call Device/FitImage)
225 $(call Device/UbiFit)
226 DEVICE_VENDOR := Compex
227 DEVICE_MODEL := WPJ419
229 DEVICE_DTS_CONFIG := config@12
233 FILESYSTEMS := squashfs
235 TARGET_DEVICES += compex_wpj419
237 define Device/compex_wpj428
238 $(call Device/FitImage)
239 DEVICE_VENDOR := Compex
240 DEVICE_MODEL := WPJ428
242 DEVICE_DTS_CONFIG := config@4
246 IMAGES = sysupgrade.bin
247 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
248 DEVICE_PACKAGES := kmod-gpio-beeper
250 TARGET_DEVICES += compex_wpj428
252 define Device/dlink_dap-2610
253 $(call Device/FitImageLzma)
254 DEVICE_VENDOR := D-Link
255 DEVICE_MODEL := DAP-2610
257 DEVICE_DTS_CONFIG := config@ap.dk01.1-c1
259 WRGG_DEVNAME := /dev/mtdblock/8
260 WRGG_SIGNATURE := wapac30_dkbs_dap2610
262 IMAGES := sysupgrade.bin factory.bin
263 # Bootloader expects a special 160 byte header which is added by
265 # Factory image size must be larger than 6MB, and size in wrgg header must
266 # match actual factory image size to be flashable from D-Link http server.
267 # Bootloader verifies checksum of wrgg image before booting, thus jffs2
268 # cannot be part of the wrgg image. This is solved in the factory image by
269 # having the rootfs at the end of the image (without pad-rootfs). And in
270 # the sysupgrade image only the kernel is included in the wrgg checksum,
271 # but this is not flashable from the D-link http server.
272 # append-rootfs must start on an erase block boundary.
273 IMAGE/factory.bin := append-kernel | pad-offset 6144k 160 | append-rootfs | wrgg-image | check-size $$$$(IMAGE_SIZE)
274 IMAGE/sysupgrade.bin := append-kernel | wrgg-image | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | append-metadata
275 DEVICE_PACKAGES := ipq-wifi-dlink_dap2610
277 TARGET_DEVICES += dlink_dap-2610
279 define Device/engenius_eap1300
280 $(call Device/FitImage)
281 DEVICE_VENDOR := EnGenius
282 DEVICE_MODEL := EAP1300
283 DEVICE_DTS_CONFIG := config@4
284 BOARD_NAME := eap1300
288 IMAGES := sysupgrade.bin
289 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
291 TARGET_DEVICES += engenius_eap1300
293 define Device/engenius_eap2200
294 $(call Device/FitImage)
295 $(call Device/UbiFit)
296 DEVICE_VENDOR := EnGenius
297 DEVICE_MODEL := EAP2200
301 DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-engenius_eap2200 -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers
303 TARGET_DEVICES += engenius_eap2200
305 define Device/engenius_emd1
306 $(call Device/FitImage)
307 DEVICE_VENDOR := EnGenius
309 DEVICE_DTS_CONFIG := config@4
312 IMAGES := sysupgrade.bin factory.bin
313 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
314 IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size $$$$(IMAGE_SIZE)
316 TARGET_DEVICES += engenius_emd1
318 define Device/engenius_ens620ext
319 $(call Device/FitImage)
320 DEVICE_VENDOR := EnGenius
321 DEVICE_MODEL := ENS620EXT
323 DEVICE_DTS_CONFIG := config@4
326 BOARD_NAME := ENS620EXT
329 PRODUCT_ID_NEW := 0xA4
336 FILESYSTEMS := squashfs
337 IMAGES := sysupgrade.bin factory_30.bin factory_35.bin
338 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | append-metadata
339 IMAGE/factory_30.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | SenaoFW $$$$(PRODUCT_ID) $$$$(FW_VER)
340 IMAGE/factory_35.bin := qsdk-ipq-factory-nor | check-size $$$$(IMAGE_SIZE) | SenaoFW $$$$(PRODUCT_ID_NEW) $$$$(FW_VER_NEW)
342 TARGET_DEVICES += engenius_ens620ext
344 define Device/ezviz_cs-w3-wd1200g-eup
345 $(call Device/FitImage)
346 DEVICE_VENDOR := EZVIZ
347 DEVICE_MODEL := CS-W3-WD1200G
348 DEVICE_VARIANT := EUP
349 DEVICE_DTS_CONFIG := config@4
352 IMAGES := sysupgrade.bin
353 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \
355 DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers \
356 ipq-wifi-ezviz_cs-w3-wd1200g-eup
358 TARGET_DEVICES += ezviz_cs-w3-wd1200g-eup
360 define Device/glinet_gl-b1300
361 $(call Device/FitImage)
362 DEVICE_VENDOR := GL.iNet
363 DEVICE_MODEL := GL-B1300
364 BOARD_NAME := gl-b1300
368 IMAGES := sysupgrade.bin
369 IMAGE/sysupgrade.bin := append-kernel |append-rootfs | pad-rootfs | append-metadata
371 TARGET_DEVICES += glinet_gl-b1300
373 define Device/linksys_ea6350v3
374 # The Linksys EA6350v3 has a uboot bootloader that does not
375 # support either booting lzma kernel images nor booting UBI
376 # partitions. This uboot, however, supports raw kernel images and
379 # As for the time of writing this, the device will boot the kernel
380 # from a fixed address with a fixed length of 3MiB. Also, the
381 # device has a hard-coded kernel command line that requieres the
382 # rootfs and alt_rootfs to be in mtd11 and mtd13 respectively.
383 # Oh... and the kernel partition overlaps with the rootfs
384 # partition (the same for alt_kernel and alt_rootfs).
386 # If you are planing re-partitioning the device, you may want to
387 # keep those details in mind:
388 # 1. The kernel adresses you should honor are 0x00000000 and
389 # 0x02800000 respectively.
390 # 2. The kernel size (plus the dtb) cannot exceed 3.00MiB in size.
391 # 3. You can use 'zImage', but not a raw 'Image' packed with lzma.
392 # 4. The kernel command line from uboot is harcoded to boot with
393 # rootfs either in mtd11 or mtd13.
394 $(call Device/FitzImage)
395 DEVICE_VENDOR := Linksys
396 DEVICE_MODEL := EA6350
404 IMAGES := factory.bin sysupgrade.bin
405 IMAGE/factory.bin := append-kernel | append-uImage-fakehdr filesystem | pad-to $$$${KERNEL_SIZE} | append-ubi | linksys-image type=EA6350v3
406 DEVICE_PACKAGES := uboot-envtools
408 TARGET_DEVICES += linksys_ea6350v3
410 define Device/linksys_ea8300
411 $(call Device/FitzImage)
412 DEVICE_VENDOR := Linksys
413 DEVICE_MODEL := EA8300
419 UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF
420 IMAGES := sysupgrade.bin factory.bin
421 IMAGE/factory.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-ubi | linksys-image type=EA8300
422 DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9888-ct ipq-wifi-linksys_ea8300 kmod-usb-ledtrig-usbport
424 TARGET_DEVICES += linksys_ea8300
426 define Device/meraki_mr33
427 $(call Device/FitImage)
428 DEVICE_VENDOR := Cisco Meraki
433 IMAGES = sysupgrade.bin
434 DEVICE_PACKAGES := -swconfig ath10k-firmware-qca9887-ct
436 TARGET_DEVICES += meraki_mr33
438 define Device/netgear_ex61x0v2
439 $(call Device/DniImage)
440 DEVICE_DTS_CONFIG := config@4
441 NETGEAR_BOARD_ID := EX6150v2series
442 NETGEAR_HW_ID := 29765285+16+0+128+2x2
446 define Device/netgear_ex6100v2
447 $(call Device/netgear_ex61x0v2)
448 DEVICE_VENDOR := Netgear
449 DEVICE_MODEL := EX6100
452 TARGET_DEVICES += netgear_ex6100v2
454 define Device/netgear_ex6150v2
455 $(call Device/netgear_ex61x0v2)
456 DEVICE_VENDOR := Netgear
457 DEVICE_MODEL := EX6150
460 TARGET_DEVICES += netgear_ex6150v2
462 define Device/openmesh_a42
463 $(call Device/FitImageLzma)
464 DEVICE_VENDOR := OpenMesh
467 DEVICE_DTS_CONFIG := config@om.a42
469 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
471 IMAGES = factory.bin sysupgrade.bin
472 IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A42
473 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
474 DEVICE_PACKAGES := uboot-envtools
476 TARGET_DEVICES += openmesh_a42
478 define Device/openmesh_a62
479 $(call Device/FitImageLzma)
480 DEVICE_VENDOR := OpenMesh
483 DEVICE_DTS_CONFIG := config@om.a62
485 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
487 IMAGES = factory.bin sysupgrade.bin
488 IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A62
489 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
490 DEVICE_PACKAGES := ath10k-firmware-qca9888-ct uboot-envtools
493 TARGET_DEVICES += openmesh_a62
495 define Device/qcom_ap-dk01.1-c1
496 DEVICE_VENDOR := Qualcomm Atheros
497 DEVICE_MODEL := AP-DK01.1
499 BOARD_NAME := ap-dk01.1-c1
501 DEVICE_DTS := qcom-ipq4019-ap.dk01.1-c1
505 $(call Device/FitImage)
506 IMAGES := sysupgrade.bin
507 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-rootfs | pad-rootfs | append-metadata
509 TARGET_DEVICES += qcom_ap-dk01.1-c1
511 define Device/qcom_ap-dk04.1-c1
512 $(call Device/FitImage)
513 $(call Device/UbiFit)
514 DEVICE_VENDOR := Qualcomm Atheros
515 DEVICE_MODEL := AP-DK04.1
518 DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1
523 BOARD_NAME := ap-dk04.1-c1
525 TARGET_DEVICES += qcom_ap-dk04.1-c1
527 define Device/qxwlan_e2600ac-c1
528 $(call Device/FitImage)
529 DEVICE_VENDOR := Qxwlan
530 DEVICE_MODEL := E2600AC
532 BOARD_NAME := e2600ac-c1
536 IMAGES := sysupgrade.bin
537 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
538 DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac
540 TARGET_DEVICES += qxwlan_e2600ac-c1
542 define Device/qxwlan_e2600ac-c2
543 $(call Device/FitImage)
544 $(call Device/UbiFit)
545 DEVICE_VENDOR := Qxwlan
546 DEVICE_MODEL := E2600AC
552 DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac
554 TARGET_DEVICES += qxwlan_e2600ac-c2
556 define Device/unielec_u4019-32m
557 $(call Device/FitImage)
558 DEVICE_VENDOR := Unielec
559 DEVICE_MODEL := U4019
560 DEVICE_VARIANT := 32M
561 BOARD_NAME := u4019-32m
565 IMAGES := sysupgrade.bin
566 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
568 TARGET_DEVICES += unielec_u4019-32m
570 define Device/zyxel_nbg6617
571 $(call Device/FitImageLzma)
572 DEVICE_VENDOR := ZyXEL
573 DEVICE_MODEL := NBG6617
575 ROOTFS_SIZE := 24960k
577 RAS_ROOTFS_SIZE := 19840k
578 RAS_VERSION := "$(VERSION_DIST) $(REVISION)"
579 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
580 IMAGES := sysupgrade.bin factory.bin
581 # The ZyXEL firmware allows flashing thru the web-gui only when the rootfs is
582 # at least as large as the one of the initial firmware image (not the current
583 # one on the device). This only applies to the Web-UI, the bootlaoder ignores
584 # this minimum-size. However, the larger image can be flashed both ways.
585 IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k | check-size $$$$(ROOTFS_SIZE) | zyxel-ras-image separate-kernel
586 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | check-size $$$$(ROOTFS_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata
587 DEVICE_PACKAGES := uboot-envtools kmod-usb-ledtrig-usbport
589 TARGET_DEVICES += zyxel_nbg6617
591 define Device/zyxel_wre6606
592 $(call Device/FitImage)
593 DEVICE_VENDOR := ZyXEL
594 DEVICE_MODEL := WRE6606
595 DEVICE_DTS_CONFIG := config@4
597 IMAGES := sysupgrade.bin
598 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
599 DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers
601 TARGET_DEVICES += zyxel_wre6606
603 $(eval $(call BuildImage))