1 include $(TOPDIR)/rules.mk
2 include $(INCLUDE_DIR)/image.mk
4 DEVICE_VARS += RAS_BOARD RAS_ROOTFS_SIZE RAS_VERSION
8 KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
9 KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs
10 KERNEL_PREFIX := $$(IMAGE_PREFIX)
11 KERNEL_LOADADDR := 0x80208000
12 SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
13 IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata
14 IMAGE/sysupgrade.bin/squashfs :=
17 define Device/FitImage
18 KERNEL_SUFFIX := -fit-uImage.itb
19 KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
23 define Device/FitImageLzma
24 KERNEL_SUFFIX := -fit-uImage.itb
25 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb
29 define Device/FitzImage
30 KERNEL_SUFFIX := -fit-zImage.itb
31 KERNEL = kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb
37 IMAGES := nand-factory.ubi nand-sysupgrade.bin
38 IMAGE/nand-factory.ubi := append-ubi
39 IMAGE/nand-sysupgrade.bin := sysupgrade-tar | append-metadata
42 define Device/DniImage
43 KERNEL_SUFFIX := -fit-uImage.itb
44 KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
48 IMAGES := factory.img sysupgrade.bin
49 IMAGE/factory.img := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | append-rootfs | pad-rootfs | netgear-dni
50 IMAGE/sysupgrade.bin := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | append-rootfs | pad-rootfs | append-metadata
52 DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID
55 -$(STAGING_DIR_HOST)/bin/mksenaofw \
56 -n $(BOARD_NAME) -r $(VENDOR_ID) -p $(1) \
57 -c $(DATECODE) -w $(2) -x $(CW_VER) -t 0 \
63 define Device/8dev_jalapeno-common
64 $(call Device/FitImage)
70 define Device/8dev_jalapeno
71 $(call Device/8dev_jalapeno-common)
72 DEVICE_VENDOR := 8devices
73 DEVICE_MODEL := Jalapeno
74 DEVICE_DTS := qcom-ipq4018-jalapeno
76 TARGET_DEVICES += 8dev_jalapeno
78 define Device/alfa-network_ap120c-ac
79 $(call Device/FitImage)
81 DEVICE_VENDOR := ALFA Network
82 DEVICE_MODEL := AP120C-AC
83 DEVICE_DTS := qcom-ipq4018-ap120c-ac
84 DEVICE_PACKAGES := kmod-usb-acm \
85 kmod-tpm-i2c-atmel uboot-envtools
89 IMAGES := nand-factory.bin nand-sysupgrade.bin
90 IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand
92 TARGET_DEVICES += alfa-network_ap120c-ac
94 define Device/aruba_ap-303
95 $(call Device/FitImageLzma)
96 DEVICE_VENDOR := Aruba
97 DEVICE_MODEL := AP-303
98 DEVICE_DTS := qcom-ipq4029-ap-303
99 DEVICE_PACKAGES := ipq-wifi-aruba_ap-303
100 IMAGES := sysupgrade.bin
102 TARGET_DEVICES += aruba_ap-303
104 define Device/asus_map-ac2200
105 $(call Device/FitImageLzma)
106 DEVICE_VENDOR := ASUS
107 DEVICE_MODEL := Lyra (MAP-AC2200)
108 DEVICE_DTS := qcom-ipq4019-map-ac2200
109 IMAGES := sysupgrade.bin
110 DEVICE_PACKAGES := ath10k-firmware-qca9888-ct kmod-ath3k
112 TARGET_DEVICES += asus_map-ac2200
114 define Device/asus_rt-ac58u
115 $(call Device/FitImageLzma)
116 DEVICE_VENDOR := ASUS
117 DEVICE_MODEL := RT-AC58U
118 DEVICE_DTS := qcom-ipq4018-rt-ac58u
122 IMAGE_SIZE := 20439364
123 FILESYSTEMS := squashfs
124 # Someone - in their infinite wisdom - decided to put the firmware
125 # version in front of the image name \03\00\00\04 => Version 3.0.0.4
126 # Since u-boot works with strings we either need another fixup step
127 # to add a version... or we are very careful not to add '\0' into that
128 # string and call it a day.... Yeah, we do the latter!
129 UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC58U')
130 IMAGES := sysupgrade.bin
131 DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers \
132 kmod-usb-ledtrig-usbport
134 TARGET_DEVICES += asus_rt-ac58u
136 define Device/avm_fritzbox-4040
137 $(call Device/FitImageLzma)
139 DEVICE_MODEL := FRITZ!Box 4040
140 DEVICE_DTS := qcom-ipq4018-fritz4040
141 BOARD_NAME := fritz4040
143 UBOOT_PATH := $(STAGING_DIR_IMAGE)/uboot-fritz4040.bin
144 UBOOT_PARTITION_SIZE := 524288
145 IMAGES = eva.bin sysupgrade.bin
146 IMAGE/eva.bin := append-uboot | pad-to $$$$(UBOOT_PARTITION_SIZE) | append-kernel | append-rootfs | pad-rootfs
147 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
148 DEVICE_PACKAGES := fritz-tffs fritz-caldata
150 TARGET_DEVICES += avm_fritzbox-4040
152 define Device/avm_fritzbox-7530
153 $(call Device/FitImageLzma)
155 DEVICE_MODEL := FRITZ!Box 7530
156 DEVICE_DTS := qcom-ipq4019-fritzbox-7530
157 DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand
158 IMAGES := sysupgrade.bin
160 TARGET_DEVICES += avm_fritzbox-7530
162 define Device/avm_fritzrepeater-1200
163 $(call Device/FitImageLzma)
165 DEVICE_MODEL := FRITZ!Repeater 1200
166 DEVICE_DTS := qcom-ipq4019-fritzrepeater-1200
167 DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand ipq-wifi-avm_fritzrepeater-1200
168 IMAGES := sysupgrade.bin
170 TARGET_DEVICES += avm_fritzrepeater-1200
172 define Device/avm_fritzrepeater-3000
173 $(call Device/FitImageLzma)
175 DEVICE_MODEL := FRITZ!Repeater 3000
176 DEVICE_DTS := qcom-ipq4019-fritzrepeater-3000
177 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct fritz-caldata fritz-tffs-nand
178 IMAGES := sysupgrade.bin
180 TARGET_DEVICES += avm_fritzrepeater-3000
182 define Device/cilab_meshpoint-one
183 $(call Device/8dev_jalapeno-common)
184 DEVICE_DTS := qcom-ipq4018-meshpoint-one
185 DEVICE_VENDOR := Crisis Innovation Lab
186 DEVICE_MODEL := MeshPoint.One
187 DEVICE_PACKAGES := kmod-i2c-gpio kmod-iio-bmp280-i2c kmod-hwmon-ina2xx kmod-rtc-pcf2127
189 TARGET_DEVICES += cilab_meshpoint-one
191 define Device/compex_wpj419
192 $(call Device/FitImage)
193 $(call Device/UbiFit)
194 DEVICE_VENDOR := Compex
195 DEVICE_MODEL := WPJ419
196 DEVICE_DTS := qcom-ipq4019-wpj419
197 DEVICE_DTS_CONFIG := config@12
201 FILESYSTEMS := squashfs
203 TARGET_DEVICES += compex_wpj419
205 define Device/compex_wpj428
206 $(call Device/FitImage)
207 DEVICE_VENDOR := Compex
208 DEVICE_MODEL := WPJ428
209 DEVICE_DTS := qcom-ipq4028-wpj428
210 DEVICE_DTS_CONFIG := config@4
214 IMAGES = sysupgrade.bin
215 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
216 DEVICE_PACKAGES := kmod-gpio-beeper
218 TARGET_DEVICES += compex_wpj428
220 define Device/engenius_eap1300
221 $(call Device/FitImage)
222 DEVICE_VENDOR := EnGenius
223 DEVICE_MODEL := EAP1300
224 DEVICE_DTS_CONFIG := config@4
225 BOARD_NAME := eap1300
226 DEVICE_DTS := qcom-ipq4018-eap1300
229 IMAGES := sysupgrade.bin
230 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
232 TARGET_DEVICES += engenius_eap1300
234 define Device/engenius_ens620ext
235 $(call Device/FitImage)
236 DEVICE_VENDOR := EnGenius
237 DEVICE_MODEL := ENS620EXT
238 DEVICE_DTS := qcom-ipq4018-ens620ext
239 DEVICE_DTS_CONFIG := config@4
242 BOARD_NAME := ENS620EXT
245 PRODUCT_ID_NEW := 0xA4
252 FILESYSTEMS := squashfs
253 IMAGES := sysupgrade.bin factory_30.bin factory_35.bin
254 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | append-metadata
255 IMAGE/factory_30.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | SenaoFW $$$$(PRODUCT_ID) $$$$(FW_VER)
256 IMAGE/factory_35.bin := qsdk-ipq-factory-nor | check-size $$$$(IMAGE_SIZE) | SenaoFW $$$$(PRODUCT_ID_NEW) $$$$(FW_VER_NEW)
258 TARGET_DEVICES += engenius_ens620ext
260 define Device/glinet_gl-b1300
261 $(call Device/FitImage)
262 DEVICE_VENDOR := GL.iNet
263 DEVICE_MODEL := GL-B1300
264 BOARD_NAME := gl-b1300
265 DEVICE_DTS := qcom-ipq4029-gl-b1300
268 IMAGES := sysupgrade.bin
269 IMAGE/sysupgrade.bin := append-kernel |append-rootfs | pad-rootfs | append-metadata
271 TARGET_DEVICES += glinet_gl-b1300
273 define Device/linksys_ea6350v3
274 # The Linksys EA6350v3 has a uboot bootloader that does not
275 # support either booting lzma kernel images nor booting UBI
276 # partitions. This uboot, however, supports raw kernel images and
279 # As for the time of writing this, the device will boot the kernel
280 # from a fixed address with a fixed length of 3MiB. Also, the
281 # device has a hard-coded kernel command line that requieres the
282 # rootfs and alt_rootfs to be in mtd11 and mtd13 respectively.
283 # Oh... and the kernel partition overlaps with the rootfs
284 # partition (the same for alt_kernel and alt_rootfs).
286 # If you are planing re-partitioning the device, you may want to
287 # keep those details in mind:
288 # 1. The kernel adresses you should honor are 0x00000000 and
289 # 0x02800000 respectively.
290 # 2. The kernel size (plus the dtb) cannot exceed 3.00MiB in size.
291 # 3. You can use 'zImage', but not a raw 'Image' packed with lzma.
292 # 4. The kernel command line from uboot is harcoded to boot with
293 # rootfs either in mtd11 or mtd13.
294 $(call Device/FitzImage)
295 DEVICE_VENDOR := Linksys
296 DEVICE_MODEL := EA6350
298 DEVICE_DTS := qcom-ipq4018-ea6350v3
304 IMAGES := factory.bin sysupgrade.bin
305 IMAGE/factory.bin := append-kernel | append-uImage-fakehdr filesystem | pad-to $$$${KERNEL_SIZE} | append-ubi | linksys-image type=EA6350v3
306 DEVICE_PACKAGES := uboot-envtools
308 TARGET_DEVICES += linksys_ea6350v3
310 define Device/linksys_ea8300
311 $(call Device/FitzImage)
312 DEVICE_VENDOR := Linksys
313 DEVICE_MODEL := EA8300
314 DEVICE_DTS := qcom-ipq4019-linksys_ea8300
319 UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF
320 IMAGES := sysupgrade.bin factory.bin
321 IMAGE/factory.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-ubi | linksys-image type=EA8300
322 DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9888-ct ipq-wifi-linksys_ea8300 kmod-usb-ledtrig-usbport
324 TARGET_DEVICES += linksys_ea8300
326 define Device/meraki_mr33
327 $(call Device/FitImage)
328 DEVICE_VENDOR := Cisco Meraki
330 DEVICE_DTS := qcom-ipq4029-mr33
333 IMAGES = sysupgrade.bin
334 DEVICE_PACKAGES := -swconfig ath10k-firmware-qca9887-ct
336 TARGET_DEVICES += meraki_mr33
338 define Device/netgear_ex61x0v2
339 $(call Device/DniImage)
340 DEVICE_DTS_CONFIG := config@4
341 NETGEAR_BOARD_ID := EX6150v2series
342 NETGEAR_HW_ID := 29765285+16+0+128+2x2
345 define Device/netgear_ex6100v2
346 $(call Device/netgear_ex61x0v2)
347 DEVICE_VENDOR := Netgear
348 DEVICE_MODEL := EX6100
350 DEVICE_DTS := qcom-ipq4018-ex6100v2
352 TARGET_DEVICES += netgear_ex6100v2
354 define Device/netgear_ex6150v2
355 $(call Device/netgear_ex61x0v2)
356 DEVICE_VENDOR := Netgear
357 DEVICE_MODEL := EX6150
359 DEVICE_DTS := qcom-ipq4018-ex6150v2
361 TARGET_DEVICES += netgear_ex6150v2
363 define Device/openmesh_a42
364 $(call Device/FitImageLzma)
365 DEVICE_VENDOR := OpenMesh
367 DEVICE_DTS := qcom-ipq4018-a42
368 DEVICE_DTS_CONFIG := config@om.a42
370 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
372 IMAGES = factory.bin sysupgrade.bin
373 IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A42
374 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
375 DEVICE_PACKAGES := uboot-envtools
377 TARGET_DEVICES += openmesh_a42
379 define Device/openmesh_a62
380 $(call Device/FitImageLzma)
381 DEVICE_VENDOR := OpenMesh
383 DEVICE_DTS := qcom-ipq4019-a62
384 DEVICE_DTS_CONFIG := config@om.a62
386 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
388 IMAGES = factory.bin sysupgrade.bin
389 IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A62
390 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
391 DEVICE_PACKAGES := ath10k-firmware-qca9888-ct uboot-envtools
394 TARGET_DEVICES += openmesh_a62
396 define Device/qcom_ap-dk01.1-c1
397 DEVICE_VENDOR := Qualcomm Atheros
398 DEVICE_MODEL := AP-DK01.1
400 BOARD_NAME := ap-dk01.1-c1
401 DEVICE_DTS := qcom-ipq4019-ap.dk01.1-c1
405 $(call Device/FitImage)
406 IMAGES := sysupgrade.bin
407 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-rootfs | pad-rootfs | append-metadata
409 TARGET_DEVICES += qcom_ap-dk01.1-c1
411 define Device/qcom_ap-dk04.1-c1
412 $(call Device/FitImage)
413 $(call Device/UbiFit)
414 DEVICE_VENDOR := Qualcomm Atheros
415 DEVICE_MODEL := AP-DK04.1
417 DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1
422 BOARD_NAME := ap-dk04.1-c1
424 TARGET_DEVICES += qcom_ap-dk04.1-c1
426 define Device/qxwlan_e2600ac-c1
427 $(call Device/FitImage)
428 DEVICE_VENDOR := Qxwlan
429 DEVICE_MODEL := E2600AC
431 BOARD_NAME := e2600ac-c1
432 DEVICE_DTS := qcom-ipq4019-qxwlan-e2600ac-c1
435 IMAGES := sysupgrade.bin
436 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
437 DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac
439 TARGET_DEVICES += qxwlan_e2600ac-c1
441 define Device/qxwlan_e2600ac-c2
442 $(call Device/FitImage)
443 $(call Device/UbiFit)
444 DEVICE_VENDOR := Qxwlan
445 DEVICE_MODEL := E2600AC
447 DEVICE_DTS := qcom-ipq4019-qxwlan-e2600ac-c2
451 DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac
453 TARGET_DEVICES += qxwlan_e2600ac-c2
455 define Device/unielec_u4019-32m
456 $(call Device/FitImage)
457 DEVICE_VENDOR := Unielec
458 DEVICE_MODEL := U4019
459 DEVICE_VARIANT := 32M
460 BOARD_NAME := u4019-32m
461 DEVICE_DTS := qcom-ipq4019-unielec-u4019-32m
464 IMAGES := sysupgrade.bin
465 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
467 TARGET_DEVICES += unielec_u4019-32m
469 define Device/zyxel_nbg6617
470 $(call Device/FitImageLzma)
471 DEVICE_VENDOR := ZyXEL
472 DEVICE_MODEL := NBG6617
473 DEVICE_DTS := qcom-ipq4018-nbg6617
474 ROOTFS_SIZE := 24960k
476 RAS_ROOTFS_SIZE := 19840k
477 RAS_VERSION := "$(VERSION_DIST) $(REVISION)"
478 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
479 IMAGES := sysupgrade.bin factory.bin
480 # The ZyXEL firmware allows flashing thru the web-gui only when the rootfs is
481 # at least as large as the one of the initial firmware image (not the current
482 # one on the device). This only applies to the Web-UI, the bootlaoder ignores
483 # this minimum-size. However, the larger image can be flashed both ways.
484 IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k | check-size $$$$(ROOTFS_SIZE) | zyxel-ras-image separate-kernel
485 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | check-size $$$$(ROOTFS_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata
486 DEVICE_PACKAGES := uboot-envtools kmod-usb-ledtrig-usbport
488 TARGET_DEVICES += zyxel_nbg6617
490 define Device/zyxel_wre6606
491 $(call Device/FitImage)
492 DEVICE_VENDOR := ZyXEL
493 DEVICE_MODEL := WRE6606
494 DEVICE_DTS_CONFIG := config@4
495 DEVICE_DTS := qcom-ipq4018-wre6606
496 IMAGES := sysupgrade.bin
497 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
498 DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers
500 TARGET_DEVICES += zyxel_wre6606
502 $(eval $(call BuildImage))