kernel: bump 5.4 to 5.4.92
[openwrt/openwrt.git] / target / linux / ipq806x / image / Makefile
1 # Copyright (c) 2014 The Linux Foundation. All rights reserved.
2 #
3 include $(TOPDIR)/rules.mk
4 include $(INCLUDE_DIR)/image.mk
5
6 DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID
7 DEVICE_VARS += TPLINK_BOARD_ID
8
9 define Build/buffalo-rootfs-cksum
10 ( \
11 echo -ne "\x$$(od -A n -t u1 $@ | tr -s ' ' '\n' | \
12 $(STAGING_DIR_HOST)/bin/awk '{s+=$$0}END{printf "%x", 255-s%256}')"; \
13 ) >> $@
14 endef
15
16 define Build/edimax-header
17 $(eval edimax_model=$(word 1,$(1)))
18
19 $(STAGING_DIR_HOST)/bin/mkedimaximg \
20 -b -s CSYS -m $(edimax_model) \
21 -f 0x70000 -S 0x1200000 \
22 -i $@ -o $@.new
23 @mv $@.new $@
24 endef
25
26 define Device/Default
27 PROFILES := Default
28 KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
29 KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs
30 KERNEL_PREFIX := $$(IMAGE_PREFIX)
31 KERNEL_LOADADDR = 0x42208000
32 DEVICE_DTS = $$(SOC)-$(lastword $(subst _, ,$(1)))
33 IMAGES := sysupgrade.bin
34 IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata
35 IMAGE/sysupgrade.bin/squashfs :=
36 endef
37
38 define Device/LegacyImage
39 KERNEL_SUFFIX := -uImage
40 KERNEL = kernel-bin | append-dtb | uImage none
41 KERNEL_NAME := zImage
42 endef
43
44 define Device/FitImage
45 KERNEL_SUFFIX := -fit-uImage.itb
46 KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
47 KERNEL_NAME := Image
48 endef
49
50 define Device/FitImageLzma
51 KERNEL_SUFFIX := -fit-uImage.itb
52 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb
53 KERNEL_NAME := Image
54 endef
55
56 define Device/UbiFit
57 KERNEL_IN_UBI := 1
58 IMAGES := nand-factory.bin nand-sysupgrade.bin
59 IMAGE/nand-factory.bin := append-ubi
60 IMAGE/nand-sysupgrade.bin := sysupgrade-tar | append-metadata
61 endef
62
63 define Device/DniImage
64 KERNEL_SUFFIX := -uImage
65 KERNEL = kernel-bin | append-dtb | uImage none
66 KERNEL_NAME := zImage
67 NETGEAR_BOARD_ID :=
68 NETGEAR_HW_ID :=
69 UBINIZE_OPTS := -E 5
70 IMAGES += factory.img
71 IMAGE/factory.img := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-ubi | netgear-dni
72 IMAGE/sysupgrade.bin := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-uImage-fakehdr filesystem | sysupgrade-tar kernel=$$$$@ | append-metadata
73 endef
74
75 define Device/TpSafeImage
76 KERNEL_SUFFIX := -uImage
77 KERNEL = kernel-bin | append-dtb | uImage none
78 KERNEL_NAME := zImage
79 TPLINK_BOARD_ID :=
80 IMAGES += factory.bin
81 IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
82 IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | append-metadata
83 endef
84
85 define Device/ZyXELImage
86 KERNEL_SUFFIX := -uImage
87 KERNEL = kernel-bin | append-dtb | uImage none | pad-to $$(KERNEL_SIZE)
88 KERNEL_NAME := zImage
89 IMAGES += factory.bin
90 IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to $$$$(BLOCKSIZE) | zyxel-ras-image separate-kernel
91 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to $$$$(BLOCKSIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata
92 endef
93
94 define Device/asrock_g10
95 $(call Device/FitImage)
96 $(call Device/UbiFit)
97 SOC := qcom-ipq8064
98 DEVICE_VENDOR := ASRock
99 DEVICE_MODEL := G10
100 BLOCKSIZE := 128k
101 PAGESIZE := 2048
102 KERNEL_SIZE := 5332k
103 DEVICE_PACKAGES := kmod-i2c-gpio ath10k-firmware-qca99x0-ct
104 IMAGE/nand-factory.bin := append-ubi | edimax-header RN67
105 endef
106 TARGET_DEVICES += asrock_g10
107
108 define Device/buffalo_wxr-2533dhp
109 $(call Device/LegacyImage)
110 SOC := qcom-ipq8064
111 DEVICE_VENDOR := Buffalo
112 DEVICE_MODEL := WXR-2533DHP
113 BLOCKSIZE := 128k
114 PAGESIZE := 2048
115 IMAGE_SIZE := 65536k
116 KERNEL_IN_UBI := 1
117 IMAGE/sysupgrade.bin := append-rootfs | buffalo-rootfs-cksum | \
118 sysupgrade-tar rootfs=$$$$@ | append-metadata
119 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
120 endef
121 TARGET_DEVICES += buffalo_wxr-2533dhp
122
123 define Device/compex_wpq864
124 $(call Device/FitImage)
125 $(call Device/UbiFit)
126 DEVICE_VENDOR := Compex
127 DEVICE_MODEL := WPQ864
128 BLOCKSIZE := 128k
129 PAGESIZE := 2048
130 SOC := qcom-ipq8064
131 DEVICE_PACKAGES := kmod-gpio-beeper
132 endef
133 TARGET_DEVICES += compex_wpq864
134
135 define Device/edgecore_ecw5410
136 $(call Device/FitImage)
137 $(call Device/UbiFit)
138 DEVICE_VENDOR := Edgecore
139 DEVICE_MODEL := ECW5410
140 SOC := qcom-ipq8068
141 BLOCKSIZE := 128k
142 PAGESIZE := 2048
143 DEVICE_DTS_CONFIG := config@v2.0-ap160
144 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct ipq-wifi-edgecore_ecw5410
145 endef
146 TARGET_DEVICES += edgecore_ecw5410
147
148 define Device/linksys_ea7500-v1
149 $(call Device/LegacyImage)
150 DEVICE_VENDOR := Linksys
151 DEVICE_MODEL := EA7500
152 DEVICE_VARIANT := v1
153 SOC := qcom-ipq8064
154 PAGESIZE := 2048
155 BLOCKSIZE := 128k
156 KERNEL_SIZE := 3072k
157 KERNEL = kernel-bin | append-dtb | uImage none | append-uImage-fakehdr filesystem
158 UBINIZE_OPTS := -E 5
159 IMAGES := factory.bin sysupgrade.bin
160 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | pad-to $$$$(PAGESIZE)
161 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
162 endef
163 TARGET_DEVICES += linksys_ea7500-v1
164
165 define Device/linksys_ea8500
166 $(call Device/LegacyImage)
167 DEVICE_VENDOR := Linksys
168 DEVICE_MODEL := EA8500
169 SOC := qcom-ipq8064
170 PAGESIZE := 2048
171 BLOCKSIZE := 128k
172 KERNEL_SIZE := 3072k
173 KERNEL = kernel-bin | append-dtb | uImage none | append-uImage-fakehdr filesystem
174 BOARD_NAME := ea8500
175 SUPPORTED_DEVICES += ea8500
176 UBINIZE_OPTS := -E 5
177 IMAGES += factory.bin
178 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
179 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
180 endef
181 TARGET_DEVICES += linksys_ea8500
182
183 define Device/nec_wg2600hp
184 $(call Device/LegacyImage)
185 DEVICE_VENDOR := NEC
186 DEVICE_MODEL := Aterm WG2600HP
187 SOC := qcom-ipq8064
188 BLOCKSIZE := 64k
189 BOARD_NAME := wg2600hp
190 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
191 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
192 endef
193 TARGET_DEVICES += nec_wg2600hp
194
195 define Device/nec_wg2600hp3
196 $(call Device/LegacyImage)
197 DEVICE_VENDOR := NEC Platforms
198 DEVICE_MODEL := Aterm WG2600HP3
199 SOC := qcom-ipq8062
200 BLOCKSIZE := 64k
201 IMAGES := sysupgrade.bin
202 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
203 DEVICE_PACKAGES := -kmod-ata-ahci -kmod-ata-ahci-platform -kmod-usb-ohci -kmod-usb2 \
204 -kmod-usb-ledtrig-usbport -kmod-usb-phy-qcom-dwc3 -kmod-usb3 -kmod-usb-dwc3-qcom \
205 ath10k-firmware-qca9984-ct ipq-wifi-nec_wg2600hp3
206 endef
207 TARGET_DEVICES += nec_wg2600hp3
208
209 define Device/netgear_d7800
210 $(call Device/DniImage)
211 DEVICE_VENDOR := NETGEAR
212 DEVICE_MODEL := Nighthawk X4 D7800
213 SOC := qcom-ipq8064
214 KERNEL_SIZE := 4096k
215 NETGEAR_BOARD_ID := D7800
216 NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4
217 BLOCKSIZE := 128k
218 PAGESIZE := 2048
219 BOARD_NAME := d7800
220 SUPPORTED_DEVICES += d7800
221 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
222 endef
223 TARGET_DEVICES += netgear_d7800
224
225 define Device/netgear_r7500
226 $(call Device/DniImage)
227 DEVICE_VENDOR := NETGEAR
228 DEVICE_MODEL := Nighthawk X4 R7500
229 DEVICE_VARIANT := v1
230 SOC := qcom-ipq8064
231 KERNEL_SIZE := 4096k
232 NETGEAR_BOARD_ID := R7500
233 NETGEAR_HW_ID := 29764841+0+128+256+3x3+4x4
234 BLOCKSIZE := 128k
235 PAGESIZE := 2048
236 BOARD_NAME := r7500
237 SUPPORTED_DEVICES += r7500
238 DEVICE_PACKAGES := ath10k-firmware-qca988x-ct
239 endef
240 TARGET_DEVICES += netgear_r7500
241
242 define Device/netgear_r7500v2
243 $(call Device/DniImage)
244 DEVICE_VENDOR := NETGEAR
245 DEVICE_MODEL := Nighthawk X4 R7500
246 DEVICE_VARIANT := v2
247 SOC := qcom-ipq8064
248 KERNEL_SIZE := 4096k
249 NETGEAR_BOARD_ID := R7500v2
250 NETGEAR_HW_ID := 29764958+0+128+512+3x3+4x4
251 BLOCKSIZE := 128k
252 PAGESIZE := 2048
253 BOARD_NAME := r7500v2
254 SUPPORTED_DEVICES += r7500v2
255 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct ath10k-firmware-qca988x-ct
256 endef
257 TARGET_DEVICES += netgear_r7500v2
258
259 define Device/netgear_r7800
260 $(call Device/DniImage)
261 DEVICE_VENDOR := NETGEAR
262 DEVICE_MODEL := Nighthawk X4S R7800
263 SOC := qcom-ipq8065
264 KERNEL_SIZE := 4096k
265 NETGEAR_BOARD_ID := R7800
266 NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4+cascade
267 BLOCKSIZE := 128k
268 PAGESIZE := 2048
269 BOARD_NAME := r7800
270 SUPPORTED_DEVICES += r7800
271 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct
272 endef
273 TARGET_DEVICES += netgear_r7800
274
275 define Device/qcom_ipq8064-ap148
276 $(call Device/FitImage)
277 $(call Device/UbiFit)
278 DEVICE_VENDOR := Qualcomm
279 DEVICE_MODEL := AP148
280 DEVICE_VARIANT := standard
281 SOC := qcom-ipq8064
282 DEVICE_DTS := qcom-ipq8064-ap148
283 KERNEL_INSTALL := 1
284 BLOCKSIZE := 128k
285 PAGESIZE := 2048
286 BOARD_NAME := ap148
287 SUPPORTED_DEVICES += ap148
288 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
289 endef
290 TARGET_DEVICES += qcom_ipq8064-ap148
291
292 define Device/qcom_ipq8064-ap148-legacy
293 $(call Device/LegacyImage)
294 $(call Device/UbiFit)
295 DEVICE_VENDOR := Qualcomm
296 DEVICE_MODEL := AP148
297 DEVICE_VARIANT := legacy
298 SOC := qcom-ipq8064
299 DEVICE_DTS := qcom-ipq8064-ap148
300 BLOCKSIZE := 128k
301 PAGESIZE := 2048
302 BOARD_NAME := ap148
303 SUPPORTED_DEVICES := qcom,ipq8064-ap148 ap148
304 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
305 endef
306 TARGET_DEVICES += qcom_ipq8064-ap148-legacy
307
308 define Device/qcom_ipq8064-ap161
309 $(call Device/FitImage)
310 $(call Device/UbiFit)
311 DEVICE_VENDOR := Qualcomm
312 DEVICE_MODEL := AP161
313 SOC := qcom-ipq8064
314 DEVICE_DTS := qcom-ipq8064-ap161
315 KERNEL_INSTALL := 1
316 BLOCKSIZE := 128k
317 PAGESIZE := 2048
318 BOARD_NAME := ap161
319 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
320 endef
321 TARGET_DEVICES += qcom_ipq8064-ap161
322
323 define Device/qcom_ipq8064-db149
324 $(call Device/FitImage)
325 DEVICE_VENDOR := Qualcomm
326 DEVICE_MODEL := DB149
327 SOC := qcom-ipq8064
328 DEVICE_DTS := qcom-ipq8064-db149
329 KERNEL_INSTALL := 1
330 BOARD_NAME := db149
331 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
332 endef
333 TARGET_DEVICES += qcom_ipq8064-db149
334
335 define Device/tplink_ad7200
336 $(call Device/TpSafeImage)
337 DEVICE_VENDOR := TP-Link
338 DEVICE_MODEL := AD7200
339 DEVICE_VARIANT := v1/v2
340 DEVICE_ALT0_VENDOR := TP-Link
341 DEVICE_ALT0_MODEL := Talon AD7200
342 DEVICE_ALT0_VARIANT := v1/v2
343 SOC := qcom-ipq8064
344 BLOCKSIZE := 128k
345 PAGESIZE := 2048
346 TPLINK_BOARD_ID := AD7200
347 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct kmod-wil6210
348 endef
349 TARGET_DEVICES += tplink_ad7200
350
351 define Device/tplink_c2600
352 $(call Device/TpSafeImage)
353 DEVICE_VENDOR := TP-Link
354 DEVICE_MODEL := Archer C2600
355 DEVICE_VARIANT := v1
356 SOC := qcom-ipq8064
357 BLOCKSIZE := 128k
358 PAGESIZE := 2048
359 BOARD_NAME := c2600
360 SUPPORTED_DEVICES += c2600
361 TPLINK_BOARD_ID := C2600
362 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
363 endef
364 TARGET_DEVICES += tplink_c2600
365
366 define Device/tplink_vr2600v
367 DEVICE_VENDOR := TP-Link
368 DEVICE_MODEL := Archer VR2600v
369 DEVICE_VARIANT := v1
370 KERNEL_SUFFIX := -uImage
371 KERNEL = kernel-bin | append-dtb | uImage none
372 KERNEL_NAME := zImage
373 KERNEL_SIZE := 3072k
374 SOC := qcom-ipq8064
375 BLOCKSIZE := 128k
376 PAGESIZE := 2048
377 BOARD_NAME := vr2600v
378 SUPPORTED_DEVICES += vr2600v
379 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
380 IMAGE/sysupgrade.bin := pad-extra 512 | append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | append-metadata
381 endef
382 TARGET_DEVICES += tplink_vr2600v
383
384 define Device/ubnt_unifi-ac-hd
385 $(call Device/FitImageLzma)
386 DEVICE_VENDOR := Ubiquiti
387 DEVICE_MODEL := UniFi AC HD
388 SOC := qcom-ipq8064
389 BLOCKSIZE := 64k
390 IMAGE_SIZE := 14784k
391 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct
392 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | append-metadata | check-size
393 endef
394 TARGET_DEVICES += ubnt_unifi-ac-hd
395
396 define Device/zyxel_nbg6817
397 DEVICE_VENDOR := ZyXEL
398 DEVICE_MODEL := NBG6817
399 SOC := qcom-ipq8065
400 KERNEL_SIZE := 4096k
401 BLOCKSIZE := 64k
402 BOARD_NAME := nbg6817
403 RAS_BOARD := NBG6817
404 RAS_ROOTFS_SIZE := 20934k
405 RAS_VERSION := "V1.99(OWRT.9999)C0"
406 SUPPORTED_DEVICES += nbg6817
407 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct e2fsprogs kmod-fs-ext4 losetup
408 $(call Device/ZyXELImage)
409 endef
410 TARGET_DEVICES += zyxel_nbg6817
411
412 $(eval $(call BuildImage))