ipq40xx: add support for AVM FRITZ!Repeater 1200
[openwrt/openwrt.git] / target / linux / ipq40xx / image / Makefile
1 include $(TOPDIR)/rules.mk
2 include $(INCLUDE_DIR)/image.mk
3
4 DEVICE_VARS += RAS_BOARD RAS_ROOTFS_SIZE RAS_VERSION
5
6 define Device/Default
7 PROFILES := Default
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 :=
15 endef
16
17 define Device/FitImage
18 KERNEL_SUFFIX := -fit-uImage.itb
19 KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
20 KERNEL_NAME := Image
21 endef
22
23 define Device/FitImageLzma
24 KERNEL_SUFFIX := -fit-uImage.itb
25 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb
26 KERNEL_NAME := Image
27 endef
28
29 define Device/FitzImage
30 KERNEL_SUFFIX := -fit-zImage.itb
31 KERNEL = kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb
32 KERNEL_NAME := zImage
33 endef
34
35 define Device/UbiFit
36 KERNEL_IN_UBI := 1
37 IMAGES := nand-factory.ubi nand-sysupgrade.bin
38 IMAGE/nand-factory.ubi := append-ubi
39 IMAGE/nand-sysupgrade.bin := sysupgrade-tar | append-metadata
40 endef
41
42 define Device/DniImage
43 KERNEL_SUFFIX := -fit-uImage.itb
44 KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
45 KERNEL_NAME := Image
46 NETGEAR_BOARD_ID :=
47 NETGEAR_HW_ID :=
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
51 endef
52 DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID
53
54 define Build/SenaoFW
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 \
58 -e $@ \
59 -o $@.new
60 @cp $@.new $@
61 endef
62
63 define Device/8dev_jalapeno
64 $(call Device/FitImage)
65 $(call Device/UbiFit)
66 DEVICE_DTS := qcom-ipq4018-jalapeno
67 BLOCKSIZE := 128k
68 PAGESIZE := 2048
69 DEVICE_TITLE := 8devices Jalapeno
70 endef
71 TARGET_DEVICES += 8dev_jalapeno
72
73 define Device/alfa-network_ap120c-ac
74 $(call Device/FitImage)
75 $(call Device/UbiFit)
76 DEVICE_TITLE := ALFA Network AP120C-AC
77 DEVICE_DTS := qcom-ipq4018-ap120c-ac
78 DEVICE_PACKAGES := ipq-wifi-alfa-network_ap120c-ac kmod-usb-acm \
79 kmod-tpm-i2c-atmel uboot-envtools
80 BLOCKSIZE := 128k
81 PAGESIZE := 2048
82 IMAGE_SIZE := 65536k
83 IMAGES := nand-factory.bin nand-sysupgrade.bin
84 IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand
85 endef
86 TARGET_DEVICES += alfa-network_ap120c-ac
87
88 define Device/asus_map-ac2200
89 $(call Device/FitImageLzma)
90 DEVICE_DTS := qcom-ipq4019-map-ac2200
91 DEVICE_TITLE := ASUS Lyra MAP-AC2200
92 IMAGES := sysupgrade.bin
93 DEVICE_PACKAGES := ipq-wifi-asus_map-ac2200 ath10k-firmware-qca9888-ct kmod-ath3k
94 endef
95 TARGET_DEVICES += asus_map-ac2200
96
97 define Device/asus_rt-ac58u
98 $(call Device/FitImageLzma)
99 DEVICE_DTS := qcom-ipq4018-rt-ac58u
100 BLOCKSIZE := 128k
101 PAGESIZE := 2048
102 DTB_SIZE := 65536
103 DEVICE_TITLE := Asus RT-AC58U
104 IMAGE_SIZE := 20439364
105 FILESYSTEMS := squashfs
106 # Someone - in their infinite wisdom - decided to put the firmware
107 # version in front of the image name \03\00\00\04 => Version 3.0.0.4
108 # Since u-boot works with strings we either need another fixup step
109 # to add a version... or we are very careful not to add '\0' into that
110 # string and call it a day.... Yeah, we do the latter!
111 UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC58U')
112 IMAGES := sysupgrade.bin
113 DEVICE_PACKAGES := kmod-usb-ledtrig-usbport
114 endef
115 TARGET_DEVICES += asus_rt-ac58u
116
117 define Device/avm_fritzbox-4040
118 $(call Device/FitImageLzma)
119 DEVICE_DTS := qcom-ipq4018-fritz4040
120 BOARD_NAME := fritz4040
121 DEVICE_TITLE := AVM Fritz!Box 4040
122 IMAGE_SIZE := 29753344
123 UBOOT_PATH := $(STAGING_DIR_IMAGE)/uboot-fritz4040.bin
124 UBOOT_PARTITION_SIZE := 524288
125 IMAGES = eva.bin sysupgrade.bin
126 IMAGE/eva.bin := append-uboot | pad-to $$$$(UBOOT_PARTITION_SIZE) | append-kernel | append-rootfs | pad-rootfs
127 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
128 DEVICE_PACKAGES := fritz-tffs fritz-caldata
129 endef
130 TARGET_DEVICES += avm_fritzbox-4040
131
132 define Device/avm_fritzbox-7530
133 $(call Device/FitImageLzma)
134 DEVICE_DTS := qcom-ipq4019-fritzbox-7530
135 DEVICE_TITLE := AVM Fritz!Box 7530
136 DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand ipq-wifi-avm_fritzbox-7530
137 IMAGES := sysupgrade.bin
138 endef
139 TARGET_DEVICES += avm_fritzbox-7530
140
141 define Device/avm_fritzrepeater-1200
142 $(call Device/FitImageLzma)
143 DEVICE_DTS := qcom-ipq4019-fritzrepeater-1200
144 DEVICE_TITLE := AVM FRITZ!Repeater 1200
145 DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand ipq-wifi-avm_fritzrepeater-1200
146 IMAGES := sysupgrade.bin
147 endef
148 TARGET_DEVICES += avm_fritzrepeater-1200
149
150 define Device/avm_fritzrepeater-3000
151 $(call Device/FitImageLzma)
152 DEVICE_DTS := qcom-ipq4019-fritzrepeater-3000
153 DEVICE_TITLE := AVM Fritz!Repeater 3000
154 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct fritz-caldata fritz-tffs-nand ipq-wifi-avm_fritzrepeater-3000
155 IMAGES := sysupgrade.bin
156 endef
157 TARGET_DEVICES += avm_fritzrepeater-3000
158
159 define Device/compex_wpj428
160 $(call Device/FitImage)
161 DEVICE_DTS := qcom-ipq4028-wpj428
162 DEVICE_DTS_CONFIG := config@4
163 BLOCKSIZE := 64k
164 DEVICE_TITLE := Compex WPJ428
165 IMAGE_SIZE := 31232k
166 KERNEL_SIZE := 4096k
167 IMAGES = sysupgrade.bin
168 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
169 DEVICE_PACKAGES := kmod-gpio-beeper
170 endef
171 TARGET_DEVICES += compex_wpj428
172
173 define Device/engenius_eap1300
174 $(call Device/FitImage)
175 DEVICE_TITLE := EnGenius EAP1300
176 DEVICE_DTS_CONFIG := config@4
177 BOARD_NAME := eap1300
178 DEVICE_DTS := qcom-ipq4018-eap1300
179 KERNEL_SIZE := 5120k
180 IMAGE_SIZE := 25344k
181 IMAGES := sysupgrade.bin
182 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
183 DEVICE_PACKAGES := ipq-wifi-engenius_eap1300
184 endef
185 TARGET_DEVICES += engenius_eap1300
186
187 define Device/engenius_ens620ext
188 $(call Device/FitImage)
189 DEVICE_DTS := qcom-ipq4018-ens620ext
190 DEVICE_DTS_CONFIG := config@4
191 BLOCKSIZE := 64k
192 PAGESIZE := 256
193 DEVICE_TITLE := EnGenius ENS620EXT
194 BOARD_NAME := ENS620EXT
195 VENDOR_ID := 0x0101
196 PRODUCT_ID := 0x79
197 PRODUCT_ID_NEW := 0xA4
198 DATECODE := 190507
199 FW_VER := 3.1.2
200 FW_VER_NEW := 3.5.6
201 CW_VER := 1.8.99
202 IMAGE_SIZE := 21823488
203 KERNEL_SIZE := 5120k
204 FILESYSTEMS := squashfs
205 IMAGES := sysupgrade.bin factory_30.bin factory_35.bin
206 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | append-metadata
207 IMAGE/factory_30.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | SenaoFW $$$$(PRODUCT_ID) $$$$(FW_VER)
208 IMAGE/factory_35.bin := qsdk-ipq-factory-nor | check-size $$$$(IMAGE_SIZE) | SenaoFW $$$$(PRODUCT_ID_NEW) $$$$(FW_VER_NEW)
209 DEVICE_PACKAGES := ipq-wifi-engenius_ens620ext
210 endef
211 TARGET_DEVICES += engenius_ens620ext
212
213 define Device/glinet_gl-b1300
214 $(call Device/FitImage)
215 DEVICE_TITLE := GL.iNet GL-B1300
216 BOARD_NAME := gl-b1300
217 DEVICE_DTS := qcom-ipq4029-gl-b1300
218 KERNEL_SIZE := 4096k
219 IMAGE_SIZE := 26624k
220 IMAGES := sysupgrade.bin
221 IMAGE/sysupgrade.bin := append-kernel |append-rootfs | pad-rootfs | append-metadata
222 endef
223 TARGET_DEVICES += glinet_gl-b1300
224
225 define Device/linksys_ea6350v3
226 # The Linksys EA6350v3 has a uboot bootloader that does not
227 # support either booting lzma kernel images nor booting UBI
228 # partitions. This uboot, however, supports raw kernel images and
229 # gzipped images.
230 #
231 # As for the time of writing this, the device will boot the kernel
232 # from a fixed address with a fixed length of 3MiB. Also, the
233 # device has a hard-coded kernel command line that requieres the
234 # rootfs and alt_rootfs to be in mtd11 and mtd13 respectively.
235 # Oh... and the kernel partition overlaps with the rootfs
236 # partition (the same for alt_kernel and alt_rootfs).
237 #
238 # If you are planing re-partitioning the device, you may want to
239 # keep those details in mind:
240 # 1. The kernel adresses you should honor are 0x00000000 and
241 # 0x02800000 respectively.
242 # 2. The kernel size (plus the dtb) cannot exceed 3.00MiB in size.
243 # 3. You can use 'zImage', but not a raw 'Image' packed with lzma.
244 # 4. The kernel command line from uboot is harcoded to boot with
245 # rootfs either in mtd11 or mtd13.
246 $(call Device/FitzImage)
247 DEVICE_TITLE := Linksys EA6350v3
248 DEVICE_DTS := qcom-ipq4018-ea6350v3
249 BLOCKSIZE := 128k
250 PAGESIZE := 2048
251 KERNEL_SIZE := 3145728
252 IMAGE_SIZE := 38797312
253 UBINIZE_OPTS := -E 5
254 IMAGES := factory.bin sysupgrade.bin
255 IMAGE/factory.bin := append-kernel | append-uImage-fakehdr filesystem | pad-to $$$${KERNEL_SIZE} | append-ubi | linksys-image type=EA6350v3
256 DEVICE_PACKAGES := ipq-wifi-linksys_ea6350v3 uboot-envtools
257 endef
258 TARGET_DEVICES += linksys_ea6350v3
259
260 define Device/linksys_ea8300
261 $(call Device/FitzImage)
262 DEVICE_TITLE := Linksys EA8300 (Dallas)
263 DEVICE_DTS := qcom-ipq4019-linksys_ea8300
264 KERNEL_SIZE := 3072k
265 IMAGE_SIZE := 87040k
266 BLOCKSIZE := 128k
267 PAGESIZE := 2048
268 UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF
269 IMAGES := sysupgrade.bin factory.bin
270 IMAGE/factory.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-ubi | linksys-image type=EA8300
271 DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9888-ct ipq-wifi-linksys_ea8300 kmod-usb-ledtrig-usbport
272 endef
273 TARGET_DEVICES += linksys_ea8300
274
275 define Device/meraki_mr33
276 $(call Device/FitImage)
277 DEVICE_DTS := qcom-ipq4029-mr33
278 BLOCKSIZE := 131072
279 PAGESIZE := 2048
280 DEVICE_TITLE := Cisco Meraki MR33
281 IMAGES = sysupgrade.bin
282 DEVICE_PACKAGES := -swconfig ath10k-firmware-qca9887-ct
283 endef
284 TARGET_DEVICES += meraki_mr33
285
286 define Device/netgear_ex61x0v2
287 $(call Device/DniImage)
288 DEVICE_DTS_CONFIG := config@4
289 NETGEAR_BOARD_ID := EX6150v2series
290 NETGEAR_HW_ID := 29765285+16+0+128+2x2
291 endef
292
293 define Device/netgear_ex6100v2
294 $(call Device/netgear_ex61x0v2)
295 DEVICE_DTS := qcom-ipq4018-ex6100v2
296 DEVICE_TITLE := Netgear EX6100v2
297 endef
298 TARGET_DEVICES += netgear_ex6100v2
299
300 define Device/netgear_ex6150v2
301 $(call Device/netgear_ex61x0v2)
302 DEVICE_DTS := qcom-ipq4018-ex6150v2
303 DEVICE_TITLE := Netgear EX6150v2
304 endef
305 TARGET_DEVICES += netgear_ex6150v2
306
307 define Device/openmesh_a42
308 $(call Device/FitImageLzma)
309 DEVICE_DTS := qcom-ipq4018-a42
310 DEVICE_DTS_CONFIG := config@om.a42
311 BLOCKSIZE := 64k
312 DEVICE_TITLE := OpenMesh A42
313 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
314 IMAGE_SIZE := 15616k
315 IMAGES = factory.bin sysupgrade.bin
316 IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A42
317 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
318 DEVICE_PACKAGES := uboot-envtools
319 endef
320 TARGET_DEVICES += openmesh_a42
321
322 define Device/openmesh_a62
323 $(call Device/FitImageLzma)
324 DEVICE_DTS := qcom-ipq4019-a62
325 DEVICE_DTS_CONFIG := config@om.a62
326 BLOCKSIZE := 64k
327 DEVICE_TITLE := OpenMesh A62
328 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
329 IMAGE_SIZE := 15552k
330 IMAGES = factory.bin sysupgrade.bin
331 IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A62
332 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
333 DEVICE_PACKAGES := ath10k-firmware-qca9888-ct uboot-envtools
334 endef
335
336 TARGET_DEVICES += openmesh_a62
337
338 define Device/qcom_ap-dk01.1-c1
339 DEVICE_TITLE := QCA AP-DK01.1-C1
340 BOARD_NAME := ap-dk01.1-c1
341 DEVICE_DTS := qcom-ipq4019-ap.dk01.1-c1
342 KERNEL_INSTALL := 1
343 KERNEL_SIZE := 4096k
344 IMAGE_SIZE := 26624k
345 $(call Device/FitImage)
346 IMAGES := sysupgrade.bin
347 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-rootfs | pad-rootfs | append-metadata
348 endef
349 TARGET_DEVICES += qcom_ap-dk01.1-c1
350
351 define Device/qcom_ap-dk04.1-c1
352 $(call Device/FitImage)
353 $(call Device/UbiFit)
354 DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1
355 KERNEL_INSTALL := 1
356 KERNEL_SIZE := 4048k
357 BLOCKSIZE := 128k
358 PAGESIZE := 2048
359 BOARD_NAME := ap-dk04.1-c1
360 DEVICE_TITLE := QCA AP-DK04.1-C1
361 endef
362 TARGET_DEVICES += qcom_ap-dk04.1-c1
363
364 define Device/qxwlan_e2600ac-c1
365 $(call Device/FitImage)
366 DEVICE_TITLE := Qxwlan E2600AC-C1 (nor flash)
367 BOARD_NAME := e2600ac-c1
368 DEVICE_DTS := qcom-ipq4019-qxwlan-e2600ac-c1
369 KERNEL_SIZE := 4096k
370 IMAGE_SIZE := 31232k
371 IMAGES := sysupgrade.bin
372 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
373 DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac
374 endef
375 TARGET_DEVICES += qxwlan_e2600ac-c1
376
377 define Device/qxwlan_e2600ac-c2
378 $(call Device/FitImage)
379 $(call Device/UbiFit)
380 DEVICE_DTS := qcom-ipq4019-qxwlan-e2600ac-c2
381 KERNEL_INSTALL := 1
382 BLOCKSIZE := 128k
383 PAGESIZE := 2048
384 DEVICE_TITLE := Qxwlan E2600AC-C2 (nornand flash)
385 DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac
386 endef
387 TARGET_DEVICES += qxwlan_e2600ac-c2
388
389 define Device/zyxel_nbg6617
390 $(call Device/FitImageLzma)
391 DEVICE_DTS := qcom-ipq4018-nbg6617
392 DEVICE_TITLE := ZyXEL NBG6617
393 ROOTFS_SIZE := 24960k
394 RAS_BOARD := NBG6617
395 RAS_ROOTFS_SIZE := 19840k
396 RAS_VERSION := "$(VERSION_DIST) $(REVISION)"
397 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
398 IMAGES := sysupgrade.bin factory.bin
399 # The ZyXEL firmware allows flashing thru the web-gui only when the rootfs is
400 # at least as large as the one of the initial firmware image (not the current
401 # one on the device). This only applies to the Web-UI, the bootlaoder ignores
402 # this minimum-size. However, the larger image can be flashed both ways.
403 IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k | check-size $$$$(ROOTFS_SIZE) | zyxel-ras-image separate-kernel
404 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | check-size $$$$(ROOTFS_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata
405 DEVICE_PACKAGES := uboot-envtools kmod-usb-ledtrig-usbport
406 endef
407 TARGET_DEVICES += zyxel_nbg6617
408
409 define Device/zyxel_wre6606
410 $(call Device/FitImage)
411 DEVICE_TITLE := ZyXEL WRE6606
412 DEVICE_DTS_CONFIG := config@4
413 DEVICE_DTS := qcom-ipq4018-wre6606
414 IMAGES := sysupgrade.bin
415 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
416 endef
417 TARGET_DEVICES += zyxel_wre6606
418
419 $(eval $(call BuildImage))