ipq40xx: add support for GL.iNet GL-B2200
[openwrt/staging/jow.git] / target / linux / ipq40xx / image / generic.mk
1
2 DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID
3 DEVICE_VARS += RAS_BOARD RAS_ROOTFS_SIZE RAS_VERSION
4 DEVICE_VARS += WRGG_DEVNAME WRGG_SIGNATURE
5
6 define Device/FitImage
7 KERNEL_SUFFIX := -fit-uImage.itb
8 KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
9 KERNEL_NAME := Image
10 endef
11
12 define Device/FitImageLzma
13 KERNEL_SUFFIX := -fit-uImage.itb
14 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb
15 KERNEL_NAME := Image
16 endef
17
18 define Device/FitzImage
19 KERNEL_SUFFIX := -fit-zImage.itb
20 KERNEL = kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb
21 KERNEL_NAME := zImage
22 endef
23
24 define Device/UbiFit
25 KERNEL_IN_UBI := 1
26 IMAGES := nand-factory.ubi nand-sysupgrade.bin
27 IMAGE/nand-factory.ubi := append-ubi
28 IMAGE/nand-sysupgrade.bin := sysupgrade-tar | append-metadata
29 endef
30
31 define Device/DniImage
32 $(call Device/FitzImage)
33 NETGEAR_BOARD_ID :=
34 NETGEAR_HW_ID :=
35 IMAGES += factory.img
36 IMAGE/factory.img := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | append-rootfs | pad-rootfs | netgear-dni
37 IMAGE/sysupgrade.bin := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | \
38 append-rootfs | pad-rootfs | check-size | append-metadata
39 endef
40
41 define Build/append-rootfshdr
42 mkimage -A $(LINUX_KARCH) \
43 -O linux -T filesystem \
44 -C lzma -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
45 -n root.squashfs -d $(IMAGE_ROOTFS) $@.new
46 dd if=$@.new bs=64 count=1 >> $(IMAGE_KERNEL)
47 endef
48
49 define Build/append-rutx-metadata
50 echo \
51 '{ \
52 "device_code": [".*"], \
53 "hwver": [".*"], \
54 "batch": [".*"], \
55 "serial": [".*"], \
56 "supported_devices":["teltonika,rutx"] \
57 }' | fwtool -I - $@
58 endef
59
60 define Build/mkmylofw_32m
61 $(eval device_id=$(word 1,$(1)))
62 $(eval revision=$(word 2,$(1)))
63
64 let \
65 size="$$(stat -c%s $@)" \
66 pad="$(subst k,* 1024,$(BLOCKSIZE))" \
67 pad="(pad - (size % pad)) % pad" \
68 newsize='size + pad'; \
69 $(STAGING_DIR_HOST)/bin/mkmylofw \
70 -B WPE72 -i 0x11f6:$(device_id):0x11f6:$(device_id) -r $(revision) \
71 -s 0x2000000 -p0x180000:$$newsize:al:0x80208000:"OpenWrt":$@ \
72 $@.new
73 @mv $@.new $@
74 endef
75
76 define Build/wac5xx-netgear-tar
77 mkdir $@.tmp
78 mv $@ $@.tmp/wac5xx-ubifs-root.img
79 md5sum $@.tmp/wac5xx-ubifs-root.img > $@.tmp/wac5xx-ubifs-root.md5sum
80 echo "WAC505 WAC510" > $@.tmp/metadata.txt
81 echo "WAC505_V9.9.9.9" > $@.tmp/version
82 tar -C $@.tmp/ -cf $@ .
83 rm -rf $@.tmp
84 endef
85
86 define Build/qsdk-ipq-factory-nand-askey
87 $(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh $@.its\
88 askey_kernel $(IMAGE_KERNEL) \
89 askey_fs $(IMAGE_ROOTFS) \
90 ubifs $@
91 PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
92 @mv $@.new $@
93 endef
94
95 define Build/qsdk-ipq-app-gpt
96 cp $@ $@.tmp 2>/dev/null || true
97 ptgen -g -o $@.tmp -a 1 -l 1024 \
98 -t 0x2e -N 0:HLOS -r -p 32M \
99 -t 0x83 -N rootfs -r -p 128M \
100 -N rootfs_data -p 512M
101 cat $@.tmp >> $@
102 rm $@.tmp
103 endef
104
105 define Build/SenaoFW
106 -$(STAGING_DIR_HOST)/bin/mksenaofw \
107 -n $(BOARD_NAME) -r $(VENDOR_ID) -p $(1) \
108 -c $(DATECODE) -w $(2) -x $(CW_VER) -t 0 \
109 -e $@ \
110 -o $@.new
111 @cp $@.new $@
112 endef
113
114 define Build/wrgg-image
115 mkwrggimg -i $@ \
116 -o $@.new \
117 -d "$(WRGG_DEVNAME)" \
118 -s "$(WRGG_SIGNATURE)" \
119 -v "" -m "" -B ""
120 mv $@.new $@
121 endef
122
123 define Device/8dev_habanero-dvk
124 $(call Device/FitImageLzma)
125 DEVICE_VENDOR := 8devices
126 DEVICE_MODEL := Habanero DVK
127 IMAGE_SIZE := 30976k
128 SOC := qcom-ipq4019
129 DEVICE_PACKAGES := ipq-wifi-8dev_habanero-dvk
130 IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-rootfs | pad-rootfs | check-size | append-metadata
131 endef
132 TARGET_DEVICES += 8dev_habanero-dvk
133
134 define Device/8dev_jalapeno-common
135 $(call Device/FitImage)
136 $(call Device/UbiFit)
137 BLOCKSIZE := 128k
138 PAGESIZE := 2048
139 SOC := qcom-ipq4018
140 endef
141
142 define Device/8dev_jalapeno
143 $(call Device/8dev_jalapeno-common)
144 DEVICE_VENDOR := 8devices
145 DEVICE_MODEL := Jalapeno
146 endef
147 TARGET_DEVICES += 8dev_jalapeno
148
149 define Device/alfa-network_ap120c-ac
150 $(call Device/FitImage)
151 $(call Device/UbiFit)
152 DEVICE_VENDOR := ALFA Network
153 DEVICE_MODEL := AP120C-AC
154 SOC := qcom-ipq4018
155 DEVICE_PACKAGES := kmod-usb-acm kmod-tpm-i2c-atmel
156 BLOCKSIZE := 128k
157 PAGESIZE := 2048
158 IMAGE_SIZE := 65536k
159 IMAGES := nand-factory.bin nand-sysupgrade.bin
160 IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand
161 endef
162 TARGET_DEVICES += alfa-network_ap120c-ac
163
164 define Device/aruba_glenmorangie
165 $(call Device/FitImageLzma)
166 DEVICE_VENDOR := Aruba
167 SOC := qcom-ipq4029
168 DEVICE_PACKAGES := ipq-wifi-aruba_ap-303
169 endef
170
171 define Device/aruba_ap-303
172 $(call Device/aruba_glenmorangie)
173 DEVICE_MODEL := AP-303
174 endef
175 TARGET_DEVICES += aruba_ap-303
176
177 define Device/aruba_ap-303h
178 $(call Device/aruba_glenmorangie)
179 DEVICE_MODEL := AP-303H
180 endef
181 TARGET_DEVICES += aruba_ap-303h
182
183 define Device/aruba_ap-365
184 $(call Device/aruba_glenmorangie)
185 DEVICE_MODEL := AP-365
186 DEVICE_PACKAGES += kmod-hwmon-ad7418
187 endef
188 TARGET_DEVICES += aruba_ap-365
189
190 define Device/asus_map-ac2200
191 $(call Device/FitImageLzma)
192 DEVICE_VENDOR := ASUS
193 DEVICE_MODEL := Lyra (MAP-AC2200)
194 SOC := qcom-ipq4019
195 DEVICE_PACKAGES := ath10k-firmware-qca9888-ct kmod-ath3k
196 endef
197 TARGET_DEVICES += asus_map-ac2200
198
199 define Device/asus_rt-ac58u
200 $(call Device/FitImageLzma)
201 DEVICE_VENDOR := ASUS
202 DEVICE_MODEL := RT-AC58U
203 SOC := qcom-ipq4018
204 BLOCKSIZE := 128k
205 PAGESIZE := 2048
206 DTB_SIZE := 65536
207 IMAGE_SIZE := 20439364
208 FILESYSTEMS := squashfs
209 # Someone - in their infinite wisdom - decided to put the firmware
210 # version in front of the image name \03\00\00\04 => Version 3.0.0.4
211 # Since u-boot works with strings we either need another fixup step
212 # to add a version... or we are very careful not to add '\0' into that
213 # string and call it a day.... Yeah, we do the latter!
214 UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC58U')
215 DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers \
216 kmod-usb-ledtrig-usbport
217 endef
218 TARGET_DEVICES += asus_rt-ac58u
219
220 define Device/avm_fritzbox-4040
221 $(call Device/FitImageLzma)
222 DEVICE_VENDOR := AVM
223 DEVICE_MODEL := FRITZ!Box 4040
224 SOC := qcom-ipq4018
225 BOARD_NAME := fritz4040
226 IMAGE_SIZE := 29056k
227 UBOOT_PATH := $(STAGING_DIR_IMAGE)/uboot-fritz4040.bin
228 UBOOT_PARTITION_SIZE := 524288
229 IMAGES += eva.bin
230 IMAGE/eva.bin := append-uboot | pad-to $$$$(UBOOT_PARTITION_SIZE) | append-kernel | append-rootfs | pad-rootfs
231 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size | append-metadata
232 DEVICE_PACKAGES := fritz-tffs fritz-caldata
233 endef
234 TARGET_DEVICES += avm_fritzbox-4040
235
236 define Device/avm_fritzbox-7530
237 $(call Device/FitImageLzma)
238 DEVICE_VENDOR := AVM
239 DEVICE_MODEL := FRITZ!Box 7530
240 SOC := qcom-ipq4019
241 DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand
242 endef
243 TARGET_DEVICES += avm_fritzbox-7530
244
245 define Device/avm_fritzrepeater-1200
246 $(call Device/FitImageLzma)
247 DEVICE_VENDOR := AVM
248 DEVICE_MODEL := FRITZ!Repeater 1200
249 SOC := qcom-ipq4019
250 DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand ipq-wifi-avm_fritzrepeater-1200
251 endef
252 TARGET_DEVICES += avm_fritzrepeater-1200
253
254 define Device/avm_fritzrepeater-3000
255 $(call Device/FitImageLzma)
256 DEVICE_VENDOR := AVM
257 DEVICE_MODEL := FRITZ!Repeater 3000
258 SOC := qcom-ipq4019
259 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct fritz-caldata fritz-tffs-nand
260 endef
261 TARGET_DEVICES += avm_fritzrepeater-3000
262
263 define Device/buffalo_wtr-m2133hp
264 $(call Device/FitImage)
265 $(call Device/UbiFit)
266 DEVICE_VENDOR := Buffalo
267 DEVICE_MODEL := WTR-M2133HP
268 SOC := qcom-ipq4019
269 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct ipq-wifi-buffalo_wtr-m2133hp
270 BLOCKSIZE := 128k
271 PAGESIZE := 2048
272 endef
273 TARGET_DEVICES += buffalo_wtr-m2133hp
274
275 define Device/cellc_rtl30vw
276 KERNEL_SUFFIX := -fit-zImage.itb
277 KERNEL_INITRAMFS = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
278 KERNEL = kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb | uImage lzma | pad-to 2048
279 KERNEL_NAME := zImage
280 KERNEL_IN_UBI :=
281 IMAGES := nand-factory.bin nand-sysupgrade.bin
282 IMAGE/nand-factory.bin := append-rootfshdr | append-ubi | qsdk-ipq-factory-nand-askey
283 IMAGE/nand-sysupgrade.bin := append-rootfshdr | sysupgrade-tar | append-metadata
284 DEVICE_VENDOR := Cell C
285 DEVICE_MODEL := RTL30VW
286 SOC := qcom-ipq4019
287 DEVICE_DTS_CONFIG := config@5
288 KERNEL_INSTALL := 1
289 KERNEL_SIZE := 4096k
290 IMAGE_SIZE := 57344k
291 BLOCKSIZE := 128k
292 PAGESIZE := 2048
293 DEVICE_PACKAGES := kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi ipq-wifi-cellc_rtl30vw
294 endef
295 TARGET_DEVICES += cellc_rtl30vw
296
297 define Device/cilab_meshpoint-one
298 $(call Device/8dev_jalapeno-common)
299 DEVICE_VENDOR := Crisis Innovation Lab
300 DEVICE_MODEL := MeshPoint.One
301 DEVICE_PACKAGES := kmod-i2c-gpio kmod-iio-bmp280-i2c kmod-hwmon-ina2xx kmod-rtc-pcf2127
302 endef
303 TARGET_DEVICES += cilab_meshpoint-one
304
305 define Device/compex_wpj419
306 $(call Device/FitImage)
307 $(call Device/UbiFit)
308 DEVICE_VENDOR := Compex
309 DEVICE_MODEL := WPJ419
310 SOC := qcom-ipq4019
311 DEVICE_DTS_CONFIG := config@12
312 KERNEL_INSTALL := 1
313 BLOCKSIZE := 128k
314 PAGESIZE := 2048
315 FILESYSTEMS := squashfs
316 endef
317 TARGET_DEVICES += compex_wpj419
318
319 define Device/compex_wpj428
320 $(call Device/FitImage)
321 DEVICE_VENDOR := Compex
322 DEVICE_MODEL := WPJ428
323 SOC := qcom-ipq4028
324 DEVICE_DTS_CONFIG := config@4
325 BLOCKSIZE := 64k
326 IMAGE_SIZE := 31232k
327 KERNEL_SIZE := 4096k
328 IMAGES += cpximg-6a04.bin
329 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
330 IMAGE/cpximg-6a04.bin := append-kernel | append-rootfs | pad-rootfs | mkmylofw_32m 0x8A2 3
331 DEVICE_PACKAGES := kmod-gpio-beeper
332 DEFAULT := n
333 endef
334 TARGET_DEVICES += compex_wpj428
335
336 define Device/devolo_magic-2-wifi-next
337 $(call Device/FitImage)
338 DEVICE_VENDOR := devolo
339 DEVICE_MODEL := Magic 2 WiFi next
340 SOC := qcom-ipq4018
341 KERNEL_SIZE := 4096k
342
343 # If the bootloader sees 0xDEADC0DE and this trailer at the 64k boundary of a TFTP image
344 # it will bootm it, just like we want for the initramfs.
345 KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to 64k |\
346 append-string -e '\xDE\xAD\xC0\xDE{"fl_initramfs":""}\x00'
347
348 IMAGE_SIZE := 26624k
349 IMAGES := sysupgrade.bin
350 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
351 DEVICE_PACKAGES := ipq-wifi-devolo_magic-2-wifi-next
352 DEFAULT := n
353 endef
354 TARGET_DEVICES += devolo_magic-2-wifi-next
355
356 define Device/dlink_dap-2610
357 $(call Device/FitImageLzma)
358 DEVICE_VENDOR := D-Link
359 DEVICE_MODEL := DAP-2610
360 SOC := qcom-ipq4018
361 DEVICE_DTS_CONFIG := config@ap.dk01.1-c1
362 BLOCKSIZE := 64k
363 WRGG_DEVNAME := /dev/mtdblock/8
364 WRGG_SIGNATURE := wapac30_dkbs_dap2610
365 IMAGE_SIZE := 14080k
366 IMAGES += factory.bin
367 # Bootloader expects a special 160 byte header which is added by
368 # wrgg-image.
369 # Factory image size must be larger than 6MB, and size in wrgg header must
370 # match actual factory image size to be flashable from D-Link http server.
371 # Bootloader verifies checksum of wrgg image before booting, thus jffs2
372 # cannot be part of the wrgg image. This is solved in the factory image by
373 # having the rootfs at the end of the image (without pad-rootfs). And in
374 # the sysupgrade image only the kernel is included in the wrgg checksum,
375 # but this is not flashable from the D-link http server.
376 # append-rootfs must start on an erase block boundary.
377 IMAGE/factory.bin := append-kernel | pad-offset 6144k 160 | append-rootfs | wrgg-image | check-size
378 IMAGE/sysupgrade.bin := append-kernel | wrgg-image | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size | append-metadata
379 DEVICE_PACKAGES := ipq-wifi-dlink_dap2610
380 endef
381 TARGET_DEVICES += dlink_dap-2610
382
383 define Device/edgecore_ecw5211
384 $(call Device/FitImage)
385 $(call Device/UbiFit)
386 DEVICE_VENDOR := Edgecore
387 DEVICE_MODEL := ECW5211
388 SOC := qcom-ipq4018
389 BLOCKSIZE := 128k
390 PAGESIZE := 2048
391 DEVICE_DTS_CONFIG := config@ap.dk01.1-c2
392 DEVICE_PACKAGES := kmod-tpm-i2c-atmel kmod-usb-acm
393 endef
394 TARGET_DEVICES += edgecore_ecw5211
395
396 define Device/edgecore_oap100
397 $(call Device/FitImage)
398 $(call Device/UbiFit)
399 DEVICE_VENDOR := Edgecore
400 DEVICE_MODEL := OAP100
401 SOC := qcom-ipq4019
402 BLOCKSIZE := 128k
403 PAGESIZE := 2048
404 IMAGES := nand-sysupgrade.bin
405 DEVICE_DTS_CONFIG := config@ap.dk07.1-c1
406 DEVICE_PACKAGES := ipq-wifi-edgecore_oap100 kmod-usb-acm kmod-usb-net kmod-usb-net-cdc-qmi uqmi
407 endef
408 TARGET_DEVICES += edgecore_oap100
409
410 define Device/engenius_eap1300
411 $(call Device/FitImage)
412 DEVICE_VENDOR := EnGenius
413 DEVICE_MODEL := EAP1300
414 DEVICE_DTS_CONFIG := config@4
415 BOARD_NAME := eap1300
416 SOC := qcom-ipq4018
417 KERNEL_SIZE := 5120k
418 IMAGE_SIZE := 25344k
419 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
420 endef
421 TARGET_DEVICES += engenius_eap1300
422
423 define Device/engenius_eap2200
424 $(call Device/FitImage)
425 $(call Device/UbiFit)
426 DEVICE_VENDOR := EnGenius
427 DEVICE_MODEL := EAP2200
428 SOC := qcom-ipq4019
429 BLOCKSIZE := 128k
430 PAGESIZE := 2048
431 DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-engenius_eap2200 -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers
432 endef
433 TARGET_DEVICES += engenius_eap2200
434
435 define Device/engenius_emd1
436 $(call Device/FitImage)
437 DEVICE_VENDOR := EnGenius
438 DEVICE_MODEL := EMD1
439 DEVICE_DTS_CONFIG := config@4
440 SOC := qcom-ipq4018
441 IMAGE_SIZE := 30720k
442 IMAGES += factory.bin
443 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
444 IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size
445 DEVICE_PACKAGES := ipq-wifi-engenius_emd1
446 endef
447 TARGET_DEVICES += engenius_emd1
448
449 define Device/engenius_emr3500
450 $(call Device/FitImage)
451 DEVICE_VENDOR := EnGenius
452 DEVICE_MODEL := EMR3500
453 DEVICE_DTS_CONFIG := config@4
454 SOC := qcom-ipq4018
455 KERNEL_SIZE := 4096k
456 IMAGE_SIZE := 30720k
457 IMAGES += factory.bin
458 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
459 IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size
460 DEVICE_PACKAGES := ipq-wifi-engenius_emr3500
461 DEFAULT := n
462 endef
463 TARGET_DEVICES += engenius_emr3500
464
465 define Device/engenius_ens620ext
466 $(call Device/FitImage)
467 DEVICE_VENDOR := EnGenius
468 DEVICE_MODEL := ENS620EXT
469 SOC := qcom-ipq4018
470 DEVICE_DTS_CONFIG := config@4
471 BLOCKSIZE := 64k
472 PAGESIZE := 256
473 BOARD_NAME := ENS620EXT
474 VENDOR_ID := 0x0101
475 PRODUCT_ID := 0x79
476 PRODUCT_ID_NEW := 0xA4
477 DATECODE := 190507
478 FW_VER := 3.1.2
479 FW_VER_NEW := 3.5.6
480 CW_VER := 1.8.99
481 IMAGE_SIZE := 21312k
482 KERNEL_SIZE := 5120k
483 FILESYSTEMS := squashfs
484 IMAGES += factory_30.bin factory_35.bin
485 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size | append-metadata
486 IMAGE/factory_30.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size | SenaoFW $$$$(PRODUCT_ID) $$$$(FW_VER)
487 IMAGE/factory_35.bin := qsdk-ipq-factory-nor | check-size | SenaoFW $$$$(PRODUCT_ID_NEW) $$$$(FW_VER_NEW)
488 endef
489 TARGET_DEVICES += engenius_ens620ext
490
491 define Device/ezviz_cs-w3-wd1200g-eup
492 $(call Device/FitImage)
493 DEVICE_VENDOR := EZVIZ
494 DEVICE_MODEL := CS-W3-WD1200G
495 DEVICE_VARIANT := EUP
496 DEVICE_DTS_CONFIG := config@4
497 IMAGE_SIZE := 14848k
498 SOC := qcom-ipq4018
499 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \
500 append-metadata
501 DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers \
502 ipq-wifi-ezviz_cs-w3-wd1200g-eup
503 endef
504 TARGET_DEVICES += ezviz_cs-w3-wd1200g-eup
505
506 define Device/glinet_gl-ap1300
507 $(call Device/FitImage)
508 $(call Device/UbiFit)
509 DEVICE_VENDOR := GL.iNet
510 DEVICE_MODEL := GL-AP1300
511 SOC := qcom-ipq4018
512 DEVICE_DTS_CONFIG := config@ap.dk01.1-c2
513 BLOCKSIZE := 128k
514 PAGESIZE := 2048
515 IMAGE_SIZE := 131072k
516 KERNEL_INSTALL := 1
517 DEVICE_PACKAGES := ipq-wifi-glinet_gl-ap1300
518 endef
519 TARGET_DEVICES += glinet_gl-ap1300
520
521 define Device/glinet_gl-b1300
522 $(call Device/FitzImage)
523 DEVICE_VENDOR := GL.iNet
524 DEVICE_MODEL := GL-B1300
525 BOARD_NAME := gl-b1300
526 SOC := qcom-ipq4029
527 KERNEL_SIZE := 4096k
528 IMAGE_SIZE := 26624k
529 IMAGE/sysupgrade.bin := append-kernel |append-rootfs | pad-rootfs | append-metadata
530 endef
531 TARGET_DEVICES += glinet_gl-b1300
532
533 define Device/glinet_gl-b2200
534 $(call Device/FitzImage)
535 DEVICE_VENDOR := GL.iNet
536 DEVICE_MODEL := GL-B2200
537 SOC := qcom-ipq4019
538 DEVICE_DTS_CONFIG := config@ap.dk04.1-c3
539 KERNEL_INITRAMFS_SUFFIX := -recovery.itb
540 IMAGES := emmc.img.gz sysupgrade.bin
541 IMAGE/emmc.img.gz := qsdk-ipq-app-gpt |\
542 pad-to 1024k | append-kernel |\
543 pad-to 33792k | append-rootfs |\
544 append-metadata | gzip
545 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
546 DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-glinet_gl-b2200 \
547 kmod-fs-ext4 kmod-mmc kmod-spi-dev mkf2fs e2fsprogs kmod-fs-f2fs
548 endef
549 TARGET_DEVICES += glinet_gl-b2200
550
551 define Device/glinet_gl-s1300
552 $(call Device/FitzImage)
553 DEVICE_VENDOR := GL.iNet
554 DEVICE_MODEL := GL-S1300
555 SOC := qcom-ipq4029
556 KERNEL_SIZE := 4096k
557 IMAGE_SIZE := 26624k
558 IMAGES := sysupgrade.bin
559 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
560 DEVICE_PACKAGES := ipq-wifi-glinet_gl-s1300 kmod-fs-ext4 kmod-mmc kmod-spi-dev
561 endef
562 TARGET_DEVICES += glinet_gl-s1300
563
564 define Device/linksys_ea6350v3
565 # The Linksys EA6350v3 has a uboot bootloader that does not
566 # support either booting lzma kernel images nor booting UBI
567 # partitions. This uboot, however, supports raw kernel images and
568 # gzipped images.
569 #
570 # As for the time of writing this, the device will boot the kernel
571 # from a fixed address with a fixed length of 3MiB. Also, the
572 # device has a hard-coded kernel command line that requieres the
573 # rootfs and alt_rootfs to be in mtd11 and mtd13 respectively.
574 # Oh... and the kernel partition overlaps with the rootfs
575 # partition (the same for alt_kernel and alt_rootfs).
576 #
577 # If you are planing re-partitioning the device, you may want to
578 # keep those details in mind:
579 # 1. The kernel adresses you should honor are 0x00000000 and
580 # 0x02800000 respectively.
581 # 2. The kernel size (plus the dtb) cannot exceed 3.00MiB in size.
582 # 3. You can use 'zImage', but not a raw 'Image' packed with lzma.
583 # 4. The kernel command line from uboot is harcoded to boot with
584 # rootfs either in mtd11 or mtd13.
585 $(call Device/FitzImage)
586 DEVICE_VENDOR := Linksys
587 DEVICE_MODEL := EA6350
588 DEVICE_VARIANT := v3
589 SOC := qcom-ipq4018
590 BLOCKSIZE := 128k
591 PAGESIZE := 2048
592 KERNEL_SIZE := 3072k
593 IMAGE_SIZE := 37888k
594 UBINIZE_OPTS := -E 5
595 IMAGES += factory.bin
596 IMAGE/factory.bin := append-kernel | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA6350v3
597 endef
598 TARGET_DEVICES += linksys_ea6350v3
599
600 define Device/linksys_ea8300
601 $(call Device/FitzImage)
602 DEVICE_VENDOR := Linksys
603 DEVICE_MODEL := EA8300
604 SOC := qcom-ipq4019
605 KERNEL_SIZE := 3072k
606 IMAGE_SIZE := 87040k
607 BLOCKSIZE := 128k
608 PAGESIZE := 2048
609 UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF
610 IMAGES += factory.bin
611 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA8300
612 DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-linksys_ea8300 kmod-usb-ledtrig-usbport
613 endef
614 TARGET_DEVICES += linksys_ea8300
615
616 define Device/linksys_mr8300
617 $(call Device/FitzImage)
618 DEVICE_VENDOR := Linksys
619 DEVICE_MODEL := MR8300
620 SOC := qcom-ipq4019
621 KERNEL_SIZE := 3072k
622 IMAGE_SIZE := 87040k
623 BLOCKSIZE := 128k
624 PAGESIZE := 2048
625 UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF
626 IMAGES += factory.bin
627 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=MR8300
628 DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-linksys_mr8300-v0 kmod-usb-ledtrig-usbport
629 endef
630 TARGET_DEVICES += linksys_mr8300
631
632 define Device/luma_wrtq-329acn
633 $(call Device/FitImage)
634 DEVICE_VENDOR := Luma Home
635 DEVICE_MODEL := WRTQ-329ACN
636 SOC := qcom-ipq4018
637 DEVICE_PACKAGES := ipq-wifi-luma_wrtq-329acn kmod-ath3k kmod-eeprom-at24 kmod-i2c-gpio
638 IMAGE_SIZE := 76632k
639 BLOCKSIZE := 128k
640 PAGESIZE := 2048
641 endef
642 TARGET_DEVICES += luma_wrtq-329acn
643
644 define Device/meraki_mr33
645 $(call Device/FitImage)
646 DEVICE_VENDOR := Cisco Meraki
647 DEVICE_MODEL := MR33
648 SOC := qcom-ipq4029
649 BLOCKSIZE := 128k
650 PAGESIZE := 2048
651 DEVICE_PACKAGES := -swconfig ath10k-firmware-qca9887-ct
652 endef
653 TARGET_DEVICES += meraki_mr33
654
655 define Device/mobipromo_cm520-79f
656 $(call Device/FitzImage)
657 $(call Device/UbiFit)
658 DEVICE_VENDOR := MobiPromo
659 DEVICE_MODEL := CM520-79F
660 SOC := qcom-ipq4019
661 BLOCKSIZE := 128k
662 PAGESIZE := 2048
663 DEVICE_PACKAGES := ipq-wifi-mobipromo_cm520-79f kmod-usb-ledtrig-usbport
664 endef
665 TARGET_DEVICES += mobipromo_cm520-79f
666
667 define Device/netgear_ex61x0v2
668 $(call Device/DniImage)
669 DEVICE_VENDOR := NETGEAR
670 DEVICE_DTS_CONFIG := config@4
671 NETGEAR_BOARD_ID := EX6150v2series
672 NETGEAR_HW_ID := 29765285+16+0+128+2x2
673 IMAGE_SIZE := 14400k
674 SOC := qcom-ipq4018
675 endef
676
677 define Device/netgear_ex6100v2
678 $(call Device/netgear_ex61x0v2)
679 DEVICE_MODEL := EX6100
680 DEVICE_VARIANT := v2
681 endef
682 TARGET_DEVICES += netgear_ex6100v2
683
684 define Device/netgear_ex6150v2
685 $(call Device/netgear_ex61x0v2)
686 DEVICE_MODEL := EX6150
687 DEVICE_VARIANT := v2
688 endef
689 TARGET_DEVICES += netgear_ex6150v2
690
691 define Device/netgear_orbi
692 $(call Device/DniImage)
693 SOC := qcom-ipq4019
694 DEVICE_VENDOR := NETGEAR
695 IMAGE/factory.img := append-kernel | pad-offset 128k 64 | \
696 append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | \
697 append-rootfs | pad-rootfs | netgear-dni
698 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | \
699 sysupgrade-tar rootfs=$$$$@ | append-metadata
700 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct e2fsprogs kmod-fs-ext4 losetup
701 endef
702
703 define Device/netgear_rbx50
704 $(call Device/netgear_orbi)
705 NETGEAR_HW_ID := 29765352+0+4000+512+2x2+2x2+4x4
706 KERNEL_SIZE := 3932160
707 ROOTFS_SIZE := 32243712
708 IMAGE_SIZE := 36175872
709 endef
710
711 define Device/netgear_rbr50
712 $(call Device/netgear_rbx50)
713 DEVICE_MODEL := RBR50
714 DEVICE_VARIANT := v1
715 NETGEAR_BOARD_ID := RBR50
716 endef
717 TARGET_DEVICES += netgear_rbr50
718
719 define Device/netgear_rbs50
720 $(call Device/netgear_rbx50)
721 DEVICE_MODEL := RBS50
722 DEVICE_VARIANT := v1
723 NETGEAR_BOARD_ID := RBS50
724 endef
725 TARGET_DEVICES += netgear_rbs50
726
727 define Device/netgear_srx60
728 $(call Device/netgear_orbi)
729 NETGEAR_HW_ID := 29765352+0+4096+512+2x2+2x2+4x4
730 KERNEL_SIZE := 3932160
731 ROOTFS_SIZE := 32243712
732 IMAGE_SIZE := 36175872
733 endef
734
735 define Device/netgear_srr60
736 $(call Device/netgear_srx60)
737 DEVICE_MODEL := SRR60
738 NETGEAR_BOARD_ID := SRR60
739 endef
740 TARGET_DEVICES += netgear_srr60
741
742 define Device/netgear_srs60
743 $(call Device/netgear_srx60)
744 DEVICE_MODEL := SRS60
745 NETGEAR_BOARD_ID := SRS60
746 endef
747 TARGET_DEVICES += netgear_srs60
748
749 define Device/netgear_wac510
750 $(call Device/FitImage)
751 $(call Device/UbiFit)
752 DEVICE_VENDOR := Netgear
753 DEVICE_MODEL := WAC510
754 SOC := qcom-ipq4018
755 DEVICE_DTS_CONFIG := config@5
756 BLOCKSIZE := 128k
757 PAGESIZE := 2048
758 IMAGES += nand-factory.tar
759 IMAGE/nand-factory.tar := append-ubi | wac5xx-netgear-tar
760 DEVICE_PACKAGES := uboot-envtools
761 endef
762 TARGET_DEVICES += netgear_wac510
763
764 define Device/openmesh_a42
765 $(call Device/FitImageLzma)
766 DEVICE_VENDOR := OpenMesh
767 DEVICE_MODEL := A42
768 SOC := qcom-ipq4018
769 DEVICE_DTS_CONFIG := config@om.a42
770 BLOCKSIZE := 64k
771 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
772 IMAGE_SIZE := 15616k
773 IMAGES += factory.bin
774 IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A42
775 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
776 endef
777 TARGET_DEVICES += openmesh_a42
778
779 define Device/openmesh_a62
780 $(call Device/FitImageLzma)
781 DEVICE_VENDOR := OpenMesh
782 DEVICE_MODEL := A62
783 SOC := qcom-ipq4019
784 DEVICE_DTS_CONFIG := config@om.a62
785 BLOCKSIZE := 64k
786 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
787 IMAGE_SIZE := 15552k
788 IMAGES += factory.bin
789 IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A62
790 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
791 DEVICE_PACKAGES := ath10k-firmware-qca9888-ct
792 endef
793 TARGET_DEVICES += openmesh_a62
794
795 define Device/p2w_r619ac
796 $(call Device/FitzImage)
797 $(call Device/UbiFit)
798 DEVICE_VENDOR := P&W
799 DEVICE_MODEL := R619AC
800 SOC := qcom-ipq4019
801 DEVICE_DTS_CONFIG := config@10
802 BLOCKSIZE := 128k
803 PAGESIZE := 2048
804 DEVICE_PACKAGES := ipq-wifi-p2w_r619ac
805 endef
806
807 define Device/p2w_r619ac-64m
808 $(call Device/p2w_r619ac)
809 DEVICE_VARIANT := 64M NAND
810 IMAGES += nand-factory.bin
811 IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand
812 endef
813 TARGET_DEVICES += p2w_r619ac-64m
814
815 define Device/p2w_r619ac-128m
816 $(call Device/p2w_r619ac)
817 DEVICE_VARIANT := 128M NAND
818 endef
819 TARGET_DEVICES += p2w_r619ac-128m
820
821 define Device/plasmacloud_pa1200
822 $(call Device/FitImageLzma)
823 DEVICE_VENDOR := Plasma Cloud
824 DEVICE_MODEL := PA1200
825 SOC := qcom-ipq4018
826 DEVICE_DTS_CONFIG := config@pc.pa1200
827 BLOCKSIZE := 64k
828 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
829 IMAGE_SIZE := 15616k
830 IMAGES += factory.bin
831 IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA1200
832 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
833 DEVICE_PACKAGES := ipq-wifi-plasmacloud_pa1200
834 endef
835 TARGET_DEVICES += plasmacloud_pa1200
836
837 define Device/plasmacloud_pa2200
838 $(call Device/FitImageLzma)
839 DEVICE_VENDOR := Plasma Cloud
840 DEVICE_MODEL := PA2200
841 SOC := qcom-ipq4019
842 DEVICE_DTS_CONFIG := config@pc.pa2200
843 BLOCKSIZE := 64k
844 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
845 IMAGE_SIZE := 15552k
846 IMAGES += factory.bin
847 IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA2200
848 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
849 DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-plasmacloud_pa2200
850 endef
851 TARGET_DEVICES += plasmacloud_pa2200
852
853 define Device/qcom_ap-dk01.1-c1
854 DEVICE_VENDOR := Qualcomm Atheros
855 DEVICE_MODEL := AP-DK01.1
856 DEVICE_VARIANT := C1
857 BOARD_NAME := ap-dk01.1-c1
858 SOC := qcom-ipq4019
859 DEVICE_DTS := qcom-ipq4019-ap.dk01.1-c1
860 KERNEL_INSTALL := 1
861 KERNEL_SIZE := 4096k
862 IMAGE_SIZE := 26624k
863 $(call Device/FitImage)
864 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | append-metadata
865 DEFAULT := n
866 endef
867 TARGET_DEVICES += qcom_ap-dk01.1-c1
868
869 define Device/qcom_ap-dk04.1-c1
870 $(call Device/FitImage)
871 $(call Device/UbiFit)
872 DEVICE_VENDOR := Qualcomm Atheros
873 DEVICE_MODEL := AP-DK04.1
874 DEVICE_VARIANT := C1
875 SOC := qcom-ipq4019
876 DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1
877 KERNEL_INSTALL := 1
878 KERNEL_SIZE := 4048k
879 BLOCKSIZE := 128k
880 PAGESIZE := 2048
881 BOARD_NAME := ap-dk04.1-c1
882 DEFAULT := n
883 endef
884 TARGET_DEVICES += qcom_ap-dk04.1-c1
885
886 define Device/qxwlan_e2600ac-c1
887 $(call Device/FitImage)
888 DEVICE_VENDOR := Qxwlan
889 DEVICE_MODEL := E2600AC
890 DEVICE_VARIANT := C1
891 BOARD_NAME := e2600ac-c1
892 SOC := qcom-ipq4019
893 KERNEL_SIZE := 4096k
894 IMAGE_SIZE := 31232k
895 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
896 DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac
897 DEFAULT := n
898 endef
899 TARGET_DEVICES += qxwlan_e2600ac-c1
900
901 define Device/qxwlan_e2600ac-c2
902 $(call Device/FitImage)
903 $(call Device/UbiFit)
904 DEVICE_VENDOR := Qxwlan
905 DEVICE_MODEL := E2600AC
906 DEVICE_VARIANT := C2
907 SOC := qcom-ipq4019
908 KERNEL_INSTALL := 1
909 BLOCKSIZE := 128k
910 PAGESIZE := 2048
911 DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac
912 endef
913 TARGET_DEVICES += qxwlan_e2600ac-c2
914
915 define Device/teltonika_rutx10
916 $(call Device/FitImage)
917 $(call Device/UbiFit)
918 DEVICE_VENDOR := Teltonika
919 DEVICE_MODEL := RUTX10
920 SOC := qcom-ipq4018
921 DEVICE_DTS_CONFIG := config@5
922 KERNEL_INSTALL := 1
923 BLOCKSIZE := 128k
924 PAGESIZE := 2048
925 FILESYSTEMS := squashfs
926 IMAGE/nand-factory.ubi := append-ubi | qsdk-ipq-factory-nand | append-rutx-metadata
927 DEVICE_PACKAGES := ipq-wifi-teltonika_rutx kmod-bluetooth
928 endef
929 TARGET_DEVICES += teltonika_rutx10
930
931 define Device/unielec_u4019-32m
932 $(call Device/FitImage)
933 DEVICE_VENDOR := Unielec
934 DEVICE_MODEL := U4019
935 DEVICE_VARIANT := 32M
936 BOARD_NAME := u4019-32m
937 SOC := qcom-ipq4019
938 KERNEL_SIZE := 4096k
939 IMAGE_SIZE := 31232k
940 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
941 DEFAULT := n
942 endef
943 TARGET_DEVICES += unielec_u4019-32m
944
945 define Device/zyxel_nbg6617
946 $(call Device/FitImageLzma)
947 DEVICE_VENDOR := ZyXEL
948 DEVICE_MODEL := NBG6617
949 SOC := qcom-ipq4018
950 KERNEL_SIZE := 4096k
951 ROOTFS_SIZE := 24960k
952 RAS_BOARD := NBG6617
953 RAS_ROOTFS_SIZE := 19840k
954 RAS_VERSION := "$(VERSION_DIST) $(REVISION)"
955 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
956 IMAGES += factory.bin
957 # The ZyXEL firmware allows flashing thru the web-gui only when the rootfs is
958 # at least as large as the one of the initial firmware image (not the current
959 # one on the device). This only applies to the Web-UI, the bootlaoder ignores
960 # this minimum-size. However, the larger image can be flashed both ways.
961 IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k | check-size $$$$(ROOTFS_SIZE) | zyxel-ras-image separate-kernel
962 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | check-size $$$$(ROOTFS_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata
963 DEVICE_PACKAGES := kmod-usb-ledtrig-usbport
964 endef
965 TARGET_DEVICES += zyxel_nbg6617
966
967 define Device/zyxel_wre6606
968 $(call Device/FitImage)
969 DEVICE_VENDOR := ZyXEL
970 DEVICE_MODEL := WRE6606
971 DEVICE_DTS_CONFIG := config@4
972 SOC := qcom-ipq4018
973 IMAGE_SIZE := 13184k
974 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size | append-metadata
975 DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers
976 endef
977 TARGET_DEVICES += zyxel_wre6606