31468fd75858ea94b5540cf07cccee8300c399aa
[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
55 define Device/8dev_jalapeno
56 $(call Device/FitImage)
57 $(call Device/UbiFit)
58 DEVICE_DTS := qcom-ipq4018-jalapeno
59 BLOCKSIZE := 128k
60 PAGESIZE := 2048
61 DEVICE_TITLE := 8devices Jalapeno
62 endef
63 TARGET_DEVICES += 8dev_jalapeno
64
65 define Device/asus_map-ac2200
66 $(call Device/FitImageLzma)
67 DEVICE_DTS := qcom-ipq4019-map-ac2200
68 DEVICE_TITLE := ASUS Lyra MAP-AC2200
69 IMAGES := sysupgrade.bin
70 DEVICE_PACKAGES := ipq-wifi-asus_map-ac2200 ath10k-firmware-qca9888-ct kmod-ath3k
71 endef
72 TARGET_DEVICES += asus_map-ac2200
73
74 define Device/asus_rt-ac58u
75 $(call Device/FitImageLzma)
76 DEVICE_DTS := qcom-ipq4018-rt-ac58u
77 BLOCKSIZE := 128k
78 PAGESIZE := 2048
79 DTB_SIZE := 65536
80 DEVICE_TITLE := Asus RT-AC58U
81 IMAGE_SIZE := 20439364
82 FILESYSTEMS := squashfs
83 # Someone - in their infinite wisdom - decided to put the firmware
84 # version in front of the image name \03\00\00\04 => Version 3.0.0.4
85 # Since u-boot works with strings we either need another fixup step
86 # to add a version... or we are very careful not to add '\0' into that
87 # string and call it a day.... Yeah, we do the latter!
88 UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC58U')
89 IMAGES := sysupgrade.bin
90 DEVICE_PACKAGES := kmod-usb-ledtrig-usbport
91 endef
92 TARGET_DEVICES += asus_rt-ac58u
93
94 define Device/avm_fritzbox-4040
95 $(call Device/FitImageLzma)
96 DEVICE_DTS := qcom-ipq4018-fritz4040
97 BOARD_NAME := fritz4040
98 DEVICE_TITLE := AVM Fritz!Box 4040
99 IMAGE_SIZE := 29753344
100 UBOOT_PATH := $(STAGING_DIR_IMAGE)/uboot-fritz4040.bin
101 UBOOT_PARTITION_SIZE := 524288
102 IMAGES = eva.bin sysupgrade.bin
103 IMAGE/eva.bin := append-uboot | pad-to $$$$(UBOOT_PARTITION_SIZE) | append-kernel | append-rootfs | pad-rootfs
104 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
105 DEVICE_PACKAGES := fritz-tffs fritz-caldata
106 endef
107 TARGET_DEVICES += avm_fritzbox-4040
108
109 define Device/compex_wpj428
110 $(call Device/FitImage)
111 DEVICE_DTS := qcom-ipq4028-wpj428
112 DEVICE_DTS_CONFIG := config@4
113 BLOCKSIZE := 64k
114 DEVICE_TITLE := Compex WPJ428
115 IMAGE_SIZE := 31232k
116 KERNEL_SIZE := 4096k
117 IMAGES = sysupgrade.bin
118 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
119 DEVICE_PACKAGES := kmod-gpio-beeper
120 endef
121 TARGET_DEVICES += compex_wpj428
122
123 define Device/engenius_eap1300
124 $(call Device/FitImage)
125 DEVICE_TITLE := EnGenius EAP1300
126 DEVICE_DTS_CONFIG := config@4
127 BOARD_NAME := eap1300
128 DEVICE_DTS := qcom-ipq4018-eap1300
129 KERNEL_SIZE := 5120k
130 IMAGE_SIZE := 25344k
131 IMAGES := sysupgrade.bin
132 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
133 DEVICE_PACKAGES := ipq-wifi-engenius_eap1300
134 endef
135 TARGET_DEVICES += engenius_eap1300
136
137 define Device/glinet_gl-b1300
138 $(call Device/FitImage)
139 DEVICE_TITLE := GL.iNet GL-B1300
140 BOARD_NAME := gl-b1300
141 DEVICE_DTS := qcom-ipq4029-gl-b1300
142 KERNEL_SIZE := 4096k
143 IMAGE_SIZE := 26624k
144 IMAGES := sysupgrade.bin
145 IMAGE/sysupgrade.bin := append-kernel |append-rootfs | pad-rootfs | append-metadata
146 endef
147 TARGET_DEVICES += glinet_gl-b1300
148
149 define Device/linksys_ea6350v3
150 # The Linksys EA6350v3 has a uboot bootloader that does not
151 # support either booting lzma kernel images nor booting UBI
152 # partitions. This uboot, however, supports raw kernel images and
153 # gzipped images.
154 #
155 # As for the time of writing this, the device will boot the kernel
156 # from a fixed address with a fixed length of 3MiB. Also, the
157 # device has a hard-coded kernel command line that requieres the
158 # rootfs and alt_rootfs to be in mtd11 and mtd13 respectively.
159 # Oh... and the kernel partition overlaps with the rootfs
160 # partition (the same for alt_kernel and alt_rootfs).
161 #
162 # If you are planing re-partitioning the device, you may want to
163 # keep those details in mind:
164 # 1. The kernel adresses you should honor are 0x00000000 and
165 # 0x02800000 respectively.
166 # 2. The kernel size (plus the dtb) cannot exceed 3.00MiB in size.
167 # 3. You can use 'zImage', but not a raw 'Image' packed with lzma.
168 # 4. The kernel command line from uboot is harcoded to boot with
169 # rootfs either in mtd11 or mtd13.
170 $(call Device/FitzImage)
171 DEVICE_TITLE := Linksys EA6350v3
172 DEVICE_DTS := qcom-ipq4018-ea6350v3
173 BLOCKSIZE := 128k
174 PAGESIZE := 2048
175 KERNEL_SIZE := 3145728
176 IMAGE_SIZE := 38797312
177 UBINIZE_OPTS := -E 5
178 IMAGES := factory.bin sysupgrade.bin
179 IMAGE/factory.bin := append-kernel | append-uImage-fakehdr filesystem | pad-to $$$${KERNEL_SIZE} | append-ubi | linksys-image type=EA6350v3
180 DEVICE_PACKAGES := ipq-wifi-linksys_ea6350v3 uboot-envtools
181 endef
182 TARGET_DEVICES += linksys_ea6350v3
183
184 define Device/meraki_mr33
185 $(call Device/FitImage)
186 DEVICE_DTS := qcom-ipq4029-mr33
187 BLOCKSIZE := 131072
188 PAGESIZE := 2048
189 DEVICE_TITLE := Cisco Meraki MR33
190 IMAGES = sysupgrade.bin
191 DEVICE_PACKAGES := -swconfig ath10k-firmware-qca9887-ct
192 endef
193 TARGET_DEVICES += meraki_mr33
194
195 define Device/netgear_ex61x0v2
196 $(call Device/DniImage)
197 DEVICE_DTS_CONFIG := config@4
198 NETGEAR_BOARD_ID := EX6150v2series
199 NETGEAR_HW_ID := 29765285+16+0+128+2x2
200 endef
201
202 define Device/netgear_ex6100v2
203 $(call Device/netgear_ex61x0v2)
204 DEVICE_DTS := qcom-ipq4018-ex6100v2
205 DEVICE_TITLE := Netgear EX6100v2
206 endef
207 TARGET_DEVICES += netgear_ex6100v2
208
209 define Device/netgear_ex6150v2
210 $(call Device/netgear_ex61x0v2)
211 DEVICE_DTS := qcom-ipq4018-ex6150v2
212 DEVICE_TITLE := Netgear EX6150v2
213 endef
214 TARGET_DEVICES += netgear_ex6150v2
215
216 define Device/openmesh_a42
217 $(call Device/FitImageLzma)
218 DEVICE_DTS := qcom-ipq4018-a42
219 DEVICE_DTS_CONFIG := config@om.a42
220 BLOCKSIZE := 64k
221 DEVICE_TITLE := OpenMesh A42
222 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
223 IMAGE_SIZE := 15616k
224 IMAGES = factory.bin sysupgrade.bin
225 IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A42
226 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
227 DEVICE_PACKAGES := uboot-envtools
228 endef
229 TARGET_DEVICES += openmesh_a42
230
231 define Device/openmesh_a62
232 $(call Device/FitImageLzma)
233 DEVICE_DTS := qcom-ipq4019-a62
234 DEVICE_DTS_CONFIG := config@om.a62
235 BLOCKSIZE := 64k
236 DEVICE_TITLE := OpenMesh A62
237 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
238 IMAGE_SIZE := 15552k
239 IMAGES = factory.bin sysupgrade.bin
240 IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A62
241 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
242 DEVICE_PACKAGES := ath10k-firmware-qca9888-ct uboot-envtools
243 endef
244
245 TARGET_DEVICES += openmesh_a62
246
247 define Device/qcom_ap-dk01.1-c1
248 DEVICE_TITLE := QCA AP-DK01.1-C1
249 BOARD_NAME := ap-dk01.1-c1
250 DEVICE_DTS := qcom-ipq4019-ap.dk01.1-c1
251 KERNEL_INSTALL := 1
252 KERNEL_SIZE := 4096k
253 IMAGE_SIZE := 26624k
254 $(call Device/FitImage)
255 IMAGES := sysupgrade.bin
256 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-rootfs | pad-rootfs | append-metadata
257 endef
258 TARGET_DEVICES += qcom_ap-dk01.1-c1
259
260 define Device/qcom_ap-dk04.1-c1
261 $(call Device/FitImage)
262 $(call Device/UbiFit)
263 DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1
264 KERNEL_INSTALL := 1
265 KERNEL_SIZE := 4048k
266 BLOCKSIZE := 128k
267 PAGESIZE := 2048
268 BOARD_NAME := ap-dk04.1-c1
269 DEVICE_TITLE := QCA AP-DK04.1-C1
270 endef
271 TARGET_DEVICES += qcom_ap-dk04.1-c1
272
273 define Device/zyxel_nbg6617
274 $(call Device/FitImageLzma)
275 DEVICE_DTS := qcom-ipq4018-nbg6617
276 DEVICE_TITLE := ZyXEL NBG6617
277 ROOTFS_SIZE := 24960k
278 RAS_BOARD := NBG6617
279 RAS_ROOTFS_SIZE := 19840k
280 RAS_VERSION := "$(VERSION_DIST) $(REVISION)"
281 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
282 IMAGES := sysupgrade.bin factory.bin
283 # The ZyXEL firmware allows flashing thru the web-gui only when the rootfs is
284 # at least as large as the one of the initial firmware image (not the current
285 # one on the device). This only applies to the Web-UI, the bootlaoder ignores
286 # this minimum-size. However, the larger image can be flashed both ways.
287 IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k | check-size $$$$(ROOTFS_SIZE) | zyxel-ras-image separate-kernel
288 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | check-size $$$$(ROOTFS_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata
289 DEVICE_PACKAGES := uboot-envtools kmod-usb-ledtrig-usbport
290 endef
291 TARGET_DEVICES += zyxel_nbg6617
292
293 define Device/zyxel_wre6606
294 $(call Device/FitImage)
295 DEVICE_TITLE := ZyXEL WRE6606
296 DEVICE_DTS_CONFIG := config@4
297 DEVICE_DTS := qcom-ipq4018-wre6606
298 IMAGES := sysupgrade.bin
299 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
300 endef
301 TARGET_DEVICES += zyxel_wre6606
302
303 $(eval $(call BuildImage))