ipq806x: Sort occurrences of boardame alphabetically
[openwrt/staging/chunkeey.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 UBIFS_OPTS = -m 2048 -e 124KiB -c 4096 -U -F
7
8 define Image/Prepare
9 $(CP) $(LINUX_DIR)/vmlinux $(KDIR)/vmlinux-unstripped.elf
10 endef
11
12 define Image/BuildKernel
13 $(CP) $(KDIR)/vmlinux-unstripped.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf
14 endef
15
16 define Image/Build/squashfs
17 cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-raw
18 $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
19 endef
20
21 define Image/Build
22 $(call Image/Build/$(1),$(1))
23 dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(1)-root.img bs=2k conv=sync
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 SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
33 IMAGE/sysupgrade.tar = sysupgrade-tar | append-metadata
34 endef
35
36 define Device/LegacyImage
37 KERNEL_SUFFIX := -uImage
38 KERNEL = kernel-bin | append-dtb | uImage none
39 KERNEL_NAME := zImage
40 endef
41
42 define Device/FitImage
43 KERNEL_SUFFIX := -fit-uImage.itb
44 KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
45 KERNEL_NAME := Image
46 endef
47
48 define Device/FitImageLzma
49 KERNEL_SUFFIX := -fit-uImage.itb
50 KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb
51 KERNEL_NAME := Image
52 endef
53
54 define Device/UbiFit
55 KERNEL_IN_UBI := 1
56 IMAGES := nand-factory.ubi nand-sysupgrade.tar
57 IMAGE/nand-factory.ubi := append-ubi
58 IMAGE/nand-sysupgrade.tar := sysupgrade-tar | append-metadata
59 endef
60
61 define Device/DniImage
62 PROFILES += $$(DEVICE_NAME)
63 FILESYSTEMS := squashfs
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 sysupgrade.tar
71 IMAGE/factory.img := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-uImage-fakeroot-hdr | pad-to $$$$(KERNEL_SIZE) | append-ubi | netgear-dni
72 IMAGE/sysupgrade.tar := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-uImage-fakeroot-hdr | sysupgrade-tar kernel=$$$$@ | append-metadata
73 endef
74 DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID
75
76 define Device/TpSafeImage
77 PROFILES += $$(DEVICE_NAME)
78 FILESYSTEMS := squashfs
79 KERNEL_SUFFIX := -uImage
80 KERNEL = kernel-bin | append-dtb | uImage none
81 KERNEL_NAME := zImage
82 TPLINK_BOARD_ID :=
83 IMAGES := factory.bin sysupgrade.bin
84 IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
85 IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | append-metadata
86 endef
87 DEVICE_VARS += TPLINK_BOARD_ID
88
89 define Device/ZyXELImage
90 PROFILES += $$(DEVICE_NAME)
91 FILESYSTEMS := squashfs
92 KERNEL_SUFFIX := -uImage
93 KERNEL = kernel-bin | append-dtb | uImage none | pad-to $${KERNEL_SIZE}
94 KERNEL_NAME := zImage
95 IMAGES := sysupgrade.tar mmcblk0p5-rootfs.bin mmcblk0p4-kernel.bin
96 IMAGE/sysupgrade.tar/squashfs := append-rootfs | pad-to $$$${BLOCKSIZE} | sysupgrade-tar rootfs=$$$$@ | append-metadata
97 IMAGE/mmcblk0p5-rootfs.bin := append-rootfs | pad-rootfs | pad-to $$$${BLOCKSIZE}
98 IMAGE/mmcblk0p4-kernel.bin := append-kernel
99 endef
100
101 define Device/avm_fritzbox-4040
102 $(call Device/FitImageLzma)
103 DEVICE_DTS := qcom-ipq4019-fritz4040
104 KERNEL_LOADADDR := 0x80208000
105 BLOCKSIZE := 4k
106 PAGESIZE := 256
107 BOARD_NAME := fritz4040
108 DEVICE_TITLE := AVM Fritz!Box 4040
109 IMAGE_SIZE := 29753344
110 IMAGES = sysupgrade.bin
111 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
112 DEVICE_PACKAGES := kmod-usb-phy-qcom-ipq4019 ipq-wifi-fritz4040 fritz-tffs fritz-caldata u-boot-fritz4040
113 endef
114 TARGET_DEVICES += avm_fritzbox-4040
115
116 define Device/linksys_ea8500
117 $(call Device/LegacyImage)
118 DEVICE_DTS := qcom-ipq8064-ea8500
119 PAGESIZE := 2048
120 BLOCKSIZE := 128k
121 KERNEL_SIZE := 3072k
122 FILESYSTEMS := squashfs
123 KERNEL = kernel-bin | append-dtb | uImage none | append-uImage-fakeroot-hdr
124 PROFILES += $$(DEVICE_NAME)
125 BOARD_NAME := ea8500
126 SUPPORTED_DEVICES += ea8500
127 UBINIZE_OPTS := -E 5
128 IMAGES := factory.bin sysupgrade.tar
129 IMAGE/factory.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-ubi
130 DEVICE_TITLE := Linksys EA8500
131 DEVICE_PACKAGES := ath10k-firmware-qca99x0
132 endef
133 TARGET_DEVICES += linksys_ea8500
134
135 define Device/netgear_d7800
136 $(call Device/DniImage)
137 DEVICE_DTS := qcom-ipq8064-d7800
138 KERNEL_SIZE := 2097152
139 NETGEAR_BOARD_ID := D7800
140 NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4
141 BLOCKSIZE := 128k
142 PAGESIZE := 2048
143 BOARD_NAME := d7800
144 SUPPORTED_DEVICES += d7800
145 DEVICE_TITLE := Netgear Nighthawk X4 D7800
146 DEVICE_PACKAGES := ath10k-firmware-qca99x0
147 endef
148 TARGET_DEVICES += netgear_d7800
149
150 define Device/netgear_r7500
151 $(call Device/DniImage)
152 DEVICE_DTS := qcom-ipq8064-r7500
153 KERNEL_SIZE := 2097152
154 NETGEAR_BOARD_ID := R7500
155 NETGEAR_HW_ID := 29764841+0+128+256+3x3+4x4
156 BLOCKSIZE := 128k
157 PAGESIZE := 2048
158 BOARD_NAME := r7500
159 SUPPORTED_DEVICES += r7500
160 DEVICE_TITLE := Netgear Nighthawk X4 R7500
161 DEVICE_PACKAGES := ath10k-firmware-qca988x
162 endef
163 TARGET_DEVICES += netgear_r7500
164
165 define Device/netgear_r7500v2
166 $(call Device/DniImage)
167 DEVICE_DTS := qcom-ipq8064-r7500v2
168 KERNEL_SIZE := 2097152
169 NETGEAR_BOARD_ID := R7500v2
170 NETGEAR_HW_ID := 29764958+0+128+512+3x3+4x4
171 BLOCKSIZE := 128k
172 PAGESIZE := 2048
173 BOARD_NAME := r7500v2
174 SUPPORTED_DEVICES += r7500v2
175 DEVICE_TITLE := Netgear Nighthawk X4 R7500v2
176 DEVICE_PACKAGES := ath10k-firmware-qca99x0 ath10k-firmware-qca988x
177 endef
178 TARGET_DEVICES += netgear_r7500v2
179
180 define Device/netgear_r7800
181 $(call Device/DniImage)
182 DEVICE_DTS := qcom-ipq8065-r7800
183 KERNEL_SIZE := 2097152
184 NETGEAR_BOARD_ID := R7800
185 NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4+cascade
186 BLOCKSIZE := 128k
187 PAGESIZE := 2048
188 BOARD_NAME := r7800
189 SUPPORTED_DEVICES += r7800
190 DEVICE_TITLE := Netgear Nighthawk X4S R7800
191 DEVICE_PACKAGES := ath10k-firmware-qca9984
192 endef
193 TARGET_DEVICES += netgear_r7800
194
195 define Device/qcom_ap-dk01.1-c1
196 PROFILES += $$(DEVICE_NAME)
197 DEVICE_TITLE := QCA AP-DK01.1-C1
198 BOARD_NAME := ap-dk01.1-c1
199 DEVICE_DTS := qcom-ipq4019-ap.dk01.1-c1
200 KERNEL_LOADADDR := 0x80208000
201 KERNEL_INSTALL := 1
202 KERNEL_SIZE := 4096k
203 IMAGE_SIZE := 26624k
204 FILESYSTEMS := squashfs
205 $(call Device/FitImage)
206 IMAGES := sysupgrade.bin
207 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-rootfs | pad-rootfs | append-metadata
208 DEVICE_PACKAGES := ath10k-firmware-qca4019
209 endef
210 TARGET_DEVICES += qcom_ap-dk01.1-c1
211
212 define Device/qcom_ap-dk04.1-c1
213 $(call Device/FitImage)
214 $(call Device/UbiFit)
215 DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1
216 KERNEL_LOADADDR := 0x80208000
217 KERNEL_INSTALL := 1
218 KERNEL_SIZE := 4048k
219 BLOCKSIZE := 128k
220 PAGESIZE := 2048
221 BOARD_NAME := ap-dk04.1-c1
222 DEVICE_TITLE := QCA AP-DK04.1-C1
223 endef
224 TARGET_DEVICES += qcom_ap-dk04.1-c1
225
226 define Device/qcom_ipq8064-ap148
227 $(call Device/FitImage)
228 $(call Device/UbiFit)
229 DEVICE_DTS := qcom-ipq8064-ap148
230 KERNEL_INSTALL := 1
231 BLOCKSIZE := 128k
232 PAGESIZE := 2048
233 BOARD_NAME := ap148
234 SUPPORTED_DEVICES += ap148
235 DEVICE_TITLE := Qualcomm AP148
236 DEVICE_PACKAGES := ath10k-firmware-qca99x0
237 endef
238 TARGET_DEVICES += qcom_ipq8064-ap148
239
240 define Device/qcom_ipq8064-ap148-legacy
241 $(call Device/LegacyImage)
242 $(call Device/UbiFit)
243 DEVICE_DTS := qcom-ipq8064-ap148
244 BLOCKSIZE := 128k
245 PAGESIZE := 2048
246 BOARD_NAME := ap148
247 SUPPORTED_DEVICES := qcom,ipq8064-ap148 ap148
248 DEVICE_TITLE := Qualcomm AP148 (legacy)
249 DEVICE_PACKAGES := ath10k-firmware-qca99x0
250 endef
251 TARGET_DEVICES += qcom_ipq8064-ap148-legacy
252
253 define Device/qcom_ipq8064-db149
254 $(call Device/FitImage)
255 DEVICE_DTS := qcom-ipq8064-db149
256 KERNEL_INSTALL := 1
257 BOARD_NAME := db149
258 DEVICE_TITLE := Qualcomm DB149
259 DEVICE_PACKAGES := ath10k-firmware-qca99x0
260 endef
261 TARGET_DEVICES += qcom_ipq8064-db149
262
263 define Device/tplink_c2600
264 $(call Device/TpSafeImage)
265 DEVICE_DTS := qcom-ipq8064-c2600
266 BLOCKSIZE := 128k
267 PAGESIZE := 2048
268 BOARD_NAME := c2600
269 SUPPORTED_DEVICES += c2600
270 TPLINK_BOARD_ID := C2600
271 DEVICE_TITLE := TP-Link Archer C2600
272 DEVICE_PACKAGES := ath10k-firmware-qca99x0
273 endef
274 TARGET_DEVICES += tplink_c2600
275
276 define Device/tplink_vr2600v
277 PROFILES += $$(DEVICE_NAME)
278 FILESYSTEMS := squashfs
279 KERNEL_SUFFIX := -uImage
280 KERNEL = kernel-bin | append-dtb | uImage none
281 KERNEL_NAME := zImage
282 KERNEL_SIZE := 2097152
283 DEVICE_DTS := qcom-ipq8064-vr2600v
284 BLOCKSIZE := 128k
285 PAGESIZE := 2048
286 BOARD_NAME := vr2600v
287 SUPPORTED_DEVICES += vr2600v
288 DEVICE_TITLE := TP-Link Archer VR2600v
289 DEVICE_PACKAGES := ath10k-firmware-qca99x0
290 IMAGES := sysupgrade.bin
291 IMAGE/sysupgrade.bin := pad-extra 512 | append-kernel | pad-to $$$${KERNEL_SIZE} | append-rootfs | pad-rootfs | append-metadata
292 endef
293 TARGET_DEVICES += tplink_vr2600v
294
295 define Device/zyxel_nbg6817
296 DEVICE_DTS := qcom-ipq8065-nbg6817
297 KERNEL_SIZE := 4096k
298 BLOCKSIZE := 64k
299 BOARD_NAME := nbg6817
300 SUPPORTED_DEVICES += nbg6817
301 DEVICE_TITLE := ZyXEL NBG6817
302 DEVICE_PACKAGES := ath10k-firmware-qca9984 e2fsprogs kmod-fs-ext4 losetup
303 $(call Device/ZyXELImage)
304 endef
305 TARGET_DEVICES += zyxel_nbg6817
306
307 $(eval $(call BuildImage))