ipq40xx: Add support for Linksys EA8300 (Dallas)
[openwrt/staging/dedeckeh.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-3000
142 $(call Device/FitImageLzma)
143 DEVICE_DTS := qcom-ipq4019-fritzrepeater-3000
144 DEVICE_TITLE := AVM Fritz!Repeater 3000
145 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct fritz-caldata fritz-tffs-nand ipq-wifi-avm_fritzrepeater-3000
146 IMAGES := sysupgrade.bin
147 endef
148 TARGET_DEVICES += avm_fritzrepeater-3000
149
150 define Device/compex_wpj428
151 $(call Device/FitImage)
152 DEVICE_DTS := qcom-ipq4028-wpj428
153 DEVICE_DTS_CONFIG := config@4
154 BLOCKSIZE := 64k
155 DEVICE_TITLE := Compex WPJ428
156 IMAGE_SIZE := 31232k
157 KERNEL_SIZE := 4096k
158 IMAGES = sysupgrade.bin
159 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
160 DEVICE_PACKAGES := kmod-gpio-beeper
161 endef
162 TARGET_DEVICES += compex_wpj428
163
164 define Device/engenius_eap1300
165 $(call Device/FitImage)
166 DEVICE_TITLE := EnGenius EAP1300
167 DEVICE_DTS_CONFIG := config@4
168 BOARD_NAME := eap1300
169 DEVICE_DTS := qcom-ipq4018-eap1300
170 KERNEL_SIZE := 5120k
171 IMAGE_SIZE := 25344k
172 IMAGES := sysupgrade.bin
173 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
174 DEVICE_PACKAGES := ipq-wifi-engenius_eap1300
175 endef
176 TARGET_DEVICES += engenius_eap1300
177
178 define Device/engenius_ens620ext
179 $(call Device/FitImage)
180 DEVICE_DTS := qcom-ipq4018-ens620ext
181 DEVICE_DTS_CONFIG := config@4
182 BLOCKSIZE := 64k
183 PAGESIZE := 256
184 DEVICE_TITLE := EnGenius ENS620EXT
185 BOARD_NAME := ENS620EXT
186 VENDOR_ID := 0x0101
187 PRODUCT_ID := 0x79
188 PRODUCT_ID_NEW := 0xA4
189 DATECODE := 190507
190 FW_VER := 3.1.2
191 FW_VER_NEW := 3.5.6
192 CW_VER := 1.8.99
193 IMAGE_SIZE := 21823488
194 KERNEL_SIZE := 5120k
195 FILESYSTEMS := squashfs
196 IMAGES := sysupgrade.bin factory_30.bin factory_35.bin
197 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | append-metadata
198 IMAGE/factory_30.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | SenaoFW $$$$(PRODUCT_ID) $$$$(FW_VER)
199 IMAGE/factory_35.bin := qsdk-ipq-factory-nor | check-size $$$$(IMAGE_SIZE) | SenaoFW $$$$(PRODUCT_ID_NEW) $$$$(FW_VER_NEW)
200 DEVICE_PACKAGES := ipq-wifi-engenius_ens620ext
201 endef
202 TARGET_DEVICES += engenius_ens620ext
203
204 define Device/glinet_gl-b1300
205 $(call Device/FitImage)
206 DEVICE_TITLE := GL.iNet GL-B1300
207 BOARD_NAME := gl-b1300
208 DEVICE_DTS := qcom-ipq4029-gl-b1300
209 KERNEL_SIZE := 4096k
210 IMAGE_SIZE := 26624k
211 IMAGES := sysupgrade.bin
212 IMAGE/sysupgrade.bin := append-kernel |append-rootfs | pad-rootfs | append-metadata
213 endef
214 TARGET_DEVICES += glinet_gl-b1300
215
216 define Device/linksys_ea6350v3
217 # The Linksys EA6350v3 has a uboot bootloader that does not
218 # support either booting lzma kernel images nor booting UBI
219 # partitions. This uboot, however, supports raw kernel images and
220 # gzipped images.
221 #
222 # As for the time of writing this, the device will boot the kernel
223 # from a fixed address with a fixed length of 3MiB. Also, the
224 # device has a hard-coded kernel command line that requieres the
225 # rootfs and alt_rootfs to be in mtd11 and mtd13 respectively.
226 # Oh... and the kernel partition overlaps with the rootfs
227 # partition (the same for alt_kernel and alt_rootfs).
228 #
229 # If you are planing re-partitioning the device, you may want to
230 # keep those details in mind:
231 # 1. The kernel adresses you should honor are 0x00000000 and
232 # 0x02800000 respectively.
233 # 2. The kernel size (plus the dtb) cannot exceed 3.00MiB in size.
234 # 3. You can use 'zImage', but not a raw 'Image' packed with lzma.
235 # 4. The kernel command line from uboot is harcoded to boot with
236 # rootfs either in mtd11 or mtd13.
237 $(call Device/FitzImage)
238 DEVICE_TITLE := Linksys EA6350v3
239 DEVICE_DTS := qcom-ipq4018-ea6350v3
240 BLOCKSIZE := 128k
241 PAGESIZE := 2048
242 KERNEL_SIZE := 3145728
243 IMAGE_SIZE := 38797312
244 UBINIZE_OPTS := -E 5
245 IMAGES := factory.bin sysupgrade.bin
246 IMAGE/factory.bin := append-kernel | append-uImage-fakehdr filesystem | pad-to $$$${KERNEL_SIZE} | append-ubi | linksys-image type=EA6350v3
247 DEVICE_PACKAGES := ipq-wifi-linksys_ea6350v3 uboot-envtools
248 endef
249 TARGET_DEVICES += linksys_ea6350v3
250
251 define Device/linksys_ea8300
252 $(call Device/FitzImage)
253 DEVICE_TITLE := Linksys EA8300 (Dallas)
254 DEVICE_DTS := qcom-ipq4019-linksys_ea8300
255 KERNEL_SIZE := 3072k
256 IMAGE_SIZE := 87040k
257 BLOCKSIZE := 128k
258 PAGESIZE := 2048
259 UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF
260 IMAGES := sysupgrade.bin factory.bin
261 IMAGE/factory.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-ubi | linksys-image type=EA8300
262 DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9888-ct ipq-wifi-linksys_ea8300 kmod-usb-ledtrig-usbport
263 endef
264 TARGET_DEVICES += linksys_ea8300
265
266 define Device/meraki_mr33
267 $(call Device/FitImage)
268 DEVICE_DTS := qcom-ipq4029-mr33
269 BLOCKSIZE := 131072
270 PAGESIZE := 2048
271 DEVICE_TITLE := Cisco Meraki MR33
272 IMAGES = sysupgrade.bin
273 DEVICE_PACKAGES := -swconfig ath10k-firmware-qca9887-ct
274 endef
275 TARGET_DEVICES += meraki_mr33
276
277 define Device/netgear_ex61x0v2
278 $(call Device/DniImage)
279 DEVICE_DTS_CONFIG := config@4
280 NETGEAR_BOARD_ID := EX6150v2series
281 NETGEAR_HW_ID := 29765285+16+0+128+2x2
282 endef
283
284 define Device/netgear_ex6100v2
285 $(call Device/netgear_ex61x0v2)
286 DEVICE_DTS := qcom-ipq4018-ex6100v2
287 DEVICE_TITLE := Netgear EX6100v2
288 endef
289 TARGET_DEVICES += netgear_ex6100v2
290
291 define Device/netgear_ex6150v2
292 $(call Device/netgear_ex61x0v2)
293 DEVICE_DTS := qcom-ipq4018-ex6150v2
294 DEVICE_TITLE := Netgear EX6150v2
295 endef
296 TARGET_DEVICES += netgear_ex6150v2
297
298 define Device/openmesh_a42
299 $(call Device/FitImageLzma)
300 DEVICE_DTS := qcom-ipq4018-a42
301 DEVICE_DTS_CONFIG := config@om.a42
302 BLOCKSIZE := 64k
303 DEVICE_TITLE := OpenMesh A42
304 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
305 IMAGE_SIZE := 15616k
306 IMAGES = factory.bin sysupgrade.bin
307 IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A42
308 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
309 DEVICE_PACKAGES := uboot-envtools
310 endef
311 TARGET_DEVICES += openmesh_a42
312
313 define Device/openmesh_a62
314 $(call Device/FitImageLzma)
315 DEVICE_DTS := qcom-ipq4019-a62
316 DEVICE_DTS_CONFIG := config@om.a62
317 BLOCKSIZE := 64k
318 DEVICE_TITLE := OpenMesh A62
319 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
320 IMAGE_SIZE := 15552k
321 IMAGES = factory.bin sysupgrade.bin
322 IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A62
323 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
324 DEVICE_PACKAGES := ath10k-firmware-qca9888-ct uboot-envtools
325 endef
326
327 TARGET_DEVICES += openmesh_a62
328
329 define Device/qcom_ap-dk01.1-c1
330 DEVICE_TITLE := QCA AP-DK01.1-C1
331 BOARD_NAME := ap-dk01.1-c1
332 DEVICE_DTS := qcom-ipq4019-ap.dk01.1-c1
333 KERNEL_INSTALL := 1
334 KERNEL_SIZE := 4096k
335 IMAGE_SIZE := 26624k
336 $(call Device/FitImage)
337 IMAGES := sysupgrade.bin
338 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-rootfs | pad-rootfs | append-metadata
339 endef
340 TARGET_DEVICES += qcom_ap-dk01.1-c1
341
342 define Device/qcom_ap-dk04.1-c1
343 $(call Device/FitImage)
344 $(call Device/UbiFit)
345 DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1
346 KERNEL_INSTALL := 1
347 KERNEL_SIZE := 4048k
348 BLOCKSIZE := 128k
349 PAGESIZE := 2048
350 BOARD_NAME := ap-dk04.1-c1
351 DEVICE_TITLE := QCA AP-DK04.1-C1
352 endef
353 TARGET_DEVICES += qcom_ap-dk04.1-c1
354
355 define Device/qxwlan_e2600ac-c1
356 $(call Device/FitImage)
357 DEVICE_TITLE := Qxwlan E2600AC-C1 (nor flash)
358 BOARD_NAME := e2600ac-c1
359 DEVICE_DTS := qcom-ipq4019-qxwlan-e2600ac-c1
360 KERNEL_SIZE := 4096k
361 IMAGE_SIZE := 31232k
362 IMAGES := sysupgrade.bin
363 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
364 DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac
365 endef
366 TARGET_DEVICES += qxwlan_e2600ac-c1
367
368 define Device/qxwlan_e2600ac-c2
369 $(call Device/FitImage)
370 $(call Device/UbiFit)
371 DEVICE_DTS := qcom-ipq4019-qxwlan-e2600ac-c2
372 KERNEL_INSTALL := 1
373 BLOCKSIZE := 128k
374 PAGESIZE := 2048
375 DEVICE_TITLE := Qxwlan E2600AC-C2 (nornand flash)
376 DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac
377 endef
378 TARGET_DEVICES += qxwlan_e2600ac-c2
379
380 define Device/zyxel_nbg6617
381 $(call Device/FitImageLzma)
382 DEVICE_DTS := qcom-ipq4018-nbg6617
383 DEVICE_TITLE := ZyXEL NBG6617
384 ROOTFS_SIZE := 24960k
385 RAS_BOARD := NBG6617
386 RAS_ROOTFS_SIZE := 19840k
387 RAS_VERSION := "$(VERSION_DIST) $(REVISION)"
388 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
389 IMAGES := sysupgrade.bin factory.bin
390 # The ZyXEL firmware allows flashing thru the web-gui only when the rootfs is
391 # at least as large as the one of the initial firmware image (not the current
392 # one on the device). This only applies to the Web-UI, the bootlaoder ignores
393 # this minimum-size. However, the larger image can be flashed both ways.
394 IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k | check-size $$$$(ROOTFS_SIZE) | zyxel-ras-image separate-kernel
395 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | check-size $$$$(ROOTFS_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata
396 DEVICE_PACKAGES := uboot-envtools kmod-usb-ledtrig-usbport
397 endef
398 TARGET_DEVICES += zyxel_nbg6617
399
400 define Device/zyxel_wre6606
401 $(call Device/FitImage)
402 DEVICE_TITLE := ZyXEL WRE6606
403 DEVICE_DTS_CONFIG := config@4
404 DEVICE_DTS := qcom-ipq4018-wre6606
405 IMAGES := sysupgrade.bin
406 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
407 endef
408 TARGET_DEVICES += zyxel_wre6606
409
410 $(eval $(call BuildImage))