ipq40xx: disable kernel-padding for DNI image
[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/UbiFit
30 KERNEL_IN_UBI := 1
31 IMAGES := nand-factory.ubi nand-sysupgrade.bin
32 IMAGE/nand-factory.ubi := append-ubi
33 IMAGE/nand-sysupgrade.bin := sysupgrade-tar | append-metadata
34 endef
35
36 define Device/DniImage
37 KERNEL_SUFFIX := -fit-uImage.itb
38 KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
39 KERNEL_NAME := Image
40 NETGEAR_BOARD_ID :=
41 NETGEAR_HW_ID :=
42 IMAGES := factory.img sysupgrade.bin
43 IMAGE/factory.img := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | append-rootfs | pad-rootfs | netgear-dni
44 IMAGE/sysupgrade.bin := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | append-rootfs | pad-rootfs | append-metadata
45 endef
46 DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID
47
48
49 define Device/8dev_jalapeno
50 $(call Device/FitImage)
51 $(call Device/UbiFit)
52 DEVICE_DTS := qcom-ipq4018-jalapeno
53 BLOCKSIZE := 128k
54 PAGESIZE := 2048
55 DEVICE_TITLE := 8devices Jalapeno
56 endef
57 TARGET_DEVICES += 8dev_jalapeno
58
59 define Device/asus_rt-ac58u
60 $(call Device/FitImageLzma)
61 DEVICE_DTS := qcom-ipq4018-rt-ac58u
62 BLOCKSIZE := 128k
63 PAGESIZE := 2048
64 DTB_SIZE := 65536
65 DEVICE_TITLE := Asus RT-AC58U
66 IMAGE_SIZE := 20439364
67 FILESYSTEMS := squashfs
68 # Someone - in their infinite wisdom - decided to put the firmware
69 # version in front of the image name \03\00\00\04 => Version 3.0.0.4
70 # Since u-boot works with strings we either need another fixup step
71 # to add a version... or we are very careful not to add '\0' into that
72 # string and call it a day.... Yeah, we do the latter!
73 UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC58U')
74 IMAGES := sysupgrade.bin
75 DEVICE_PACKAGES := kmod-usb-ledtrig-usbport
76 endef
77 TARGET_DEVICES += asus_rt-ac58u
78
79 define Device/avm_fritzbox-4040
80 $(call Device/FitImageLzma)
81 DEVICE_DTS := qcom-ipq4018-fritz4040
82 BOARD_NAME := fritz4040
83 DEVICE_TITLE := AVM Fritz!Box 4040
84 IMAGE_SIZE := 29753344
85 UBOOT_PATH := $$(BIN_DIR)/u-boot-fritz4040/uboot-fritz4040.bin
86 UBOOT_PARTITION_SIZE := 524288
87 IMAGES = eva.bin sysupgrade.bin
88 IMAGE/eva.bin := append-uboot | pad-to $$$$(UBOOT_PARTITION_SIZE) | append-kernel | append-rootfs | pad-rootfs
89 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
90 DEVICE_PACKAGES := fritz-tffs fritz-caldata u-boot-fritz4040
91 endef
92 TARGET_DEVICES += avm_fritzbox-4040
93
94 define Device/compex_wpj428
95 $(call Device/FitImage)
96 DEVICE_DTS := qcom-ipq4028-wpj428
97 DEVICE_DTS_CONFIG := config@4
98 BLOCKSIZE := 64k
99 DEVICE_TITLE := Compex WPJ428
100 IMAGE_SIZE := 31232k
101 KERNEL_SIZE := 4096k
102 IMAGES = sysupgrade.bin
103 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
104 DEVICE_PACKAGES := kmod-gpio-beeper
105 endef
106 TARGET_DEVICES += compex_wpj428
107
108 define Device/engenius_eap1300
109 $(call Device/FitImage)
110 DEVICE_TITLE := EnGenius EAP1300
111 DEVICE_DTS_CONFIG := config@4
112 BOARD_NAME := eap1300
113 DEVICE_DTS := qcom-ipq4018-eap1300
114 KERNEL_SIZE := 5120k
115 IMAGE_SIZE := 25344k
116 IMAGES := sysupgrade.bin
117 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
118 DEVICE_PACKAGES := ipq-wifi-engenius_eap1300
119 endef
120 TARGET_DEVICES += engenius_eap1300
121
122 define Device/glinet_gl-b1300
123 $(call Device/FitImage)
124 DEVICE_TITLE := GL.iNet GL-B1300
125 BOARD_NAME := gl-b1300
126 DEVICE_DTS := qcom-ipq4029-gl-b1300
127 KERNEL_SIZE := 4096k
128 IMAGE_SIZE := 26624k
129 IMAGES := sysupgrade.bin
130 IMAGE/sysupgrade.bin := append-kernel |append-rootfs | pad-rootfs | append-metadata
131 endef
132 TARGET_DEVICES += glinet_gl-b1300
133
134 define Device/meraki_mr33
135 $(call Device/FitImage)
136 DEVICE_DTS := qcom-ipq4029-mr33
137 BLOCKSIZE := 131072
138 PAGESIZE := 2048
139 DEVICE_TITLE := Cisco Meraki MR33
140 IMAGES = sysupgrade.bin
141 DEVICE_PACKAGES := -swconfig ath10k-firmware-qca9887-ct
142 endef
143 TARGET_DEVICES += meraki_mr33
144
145 define Device/netgear_ex61x0v2
146 $(call Device/DniImage)
147 DEVICE_DTS_CONFIG := config@4
148 NETGEAR_BOARD_ID := EX6150v2series
149 NETGEAR_HW_ID := 29765285+16+0+128+2x2
150 endef
151
152 define Device/netgear_ex6100v2
153 $(call Device/netgear_ex61x0v2)
154 DEVICE_DTS := qcom-ipq4018-ex6100v2
155 DEVICE_TITLE := Netgear EX6100v2
156 endef
157 TARGET_DEVICES += netgear_ex6100v2
158
159 define Device/netgear_ex6150v2
160 $(call Device/netgear_ex61x0v2)
161 DEVICE_DTS := qcom-ipq4018-ex6150v2
162 DEVICE_TITLE := Netgear EX6150v2
163 endef
164 TARGET_DEVICES += netgear_ex6150v2
165
166 define Device/openmesh_a42
167 $(call Device/FitImageLzma)
168 DEVICE_DTS := qcom-ipq4018-a42
169 DEVICE_DTS_CONFIG := config@om.a42
170 BLOCKSIZE := 64k
171 DEVICE_TITLE := OpenMesh A42
172 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
173 IMAGE_SIZE := 15616k
174 IMAGES = factory.bin sysupgrade.bin
175 IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A42
176 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
177 DEVICE_PACKAGES := uboot-envtools
178 endef
179 TARGET_DEVICES += openmesh_a42
180
181 define Device/openmesh_a62
182 $(call Device/FitImageLzma)
183 DEVICE_DTS := qcom-ipq4019-a62
184 DEVICE_DTS_CONFIG := config@om.a62
185 BLOCKSIZE := 64k
186 DEVICE_TITLE := OpenMesh A62
187 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
188 IMAGE_SIZE := 15552k
189 IMAGES = factory.bin sysupgrade.bin
190 IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A62
191 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
192 DEVICE_PACKAGES := ath10k-firmware-qca9888-ct uboot-envtools
193 endef
194
195 TARGET_DEVICES += openmesh_a62
196
197 define Device/qcom_ap-dk01.1-c1
198 DEVICE_TITLE := QCA AP-DK01.1-C1
199 BOARD_NAME := ap-dk01.1-c1
200 DEVICE_DTS := qcom-ipq4019-ap.dk01.1-c1
201 KERNEL_INSTALL := 1
202 KERNEL_SIZE := 4096k
203 IMAGE_SIZE := 26624k
204 $(call Device/FitImage)
205 IMAGES := sysupgrade.bin
206 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-rootfs | pad-rootfs | append-metadata
207 endef
208 TARGET_DEVICES += qcom_ap-dk01.1-c1
209
210 define Device/qcom_ap-dk04.1-c1
211 $(call Device/FitImage)
212 $(call Device/UbiFit)
213 DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1
214 KERNEL_INSTALL := 1
215 KERNEL_SIZE := 4048k
216 BLOCKSIZE := 128k
217 PAGESIZE := 2048
218 BOARD_NAME := ap-dk04.1-c1
219 DEVICE_TITLE := QCA AP-DK04.1-C1
220 endef
221 TARGET_DEVICES += qcom_ap-dk04.1-c1
222
223 define Device/zyxel_nbg6617
224 $(call Device/FitImageLzma)
225 DEVICE_DTS := qcom-ipq4018-nbg6617
226 DEVICE_TITLE := ZyXEL NBG6617
227 ROOTFS_SIZE := 24960k
228 RAS_BOARD := NBG6617
229 RAS_ROOTFS_SIZE := 19840k
230 RAS_VERSION := "$(VERSION_DIST) $(REVISION)"
231 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
232 IMAGES := sysupgrade.bin factory.bin
233 # The ZyXEL firmware allows flashing thru the web-gui only when the rootfs is
234 # at least as large as the one of the initial firmware image (not the current
235 # one on the device). This only applies to the Web-UI, the bootlaoder ignores
236 # this minimum-size. However, the larger image can be flashed both ways.
237 IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k | check-size $$$$(ROOTFS_SIZE) | zyxel-ras-image separate-kernel
238 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | check-size $$$$(ROOTFS_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata
239 DEVICE_PACKAGES := uboot-envtools
240 endef
241 TARGET_DEVICES += zyxel_nbg6617
242
243 define Device/zyxel_wre6606
244 $(call Device/FitImage)
245 DEVICE_TITLE := ZyXEL WRE6606
246 DEVICE_DTS_CONFIG := config@4
247 DEVICE_DTS := qcom-ipq4018-wre6606
248 IMAGES := sysupgrade.bin
249 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
250 endef
251 TARGET_DEVICES += zyxel_wre6606
252
253 $(eval $(call BuildImage))