lantiq: only call Image/Prepare/Profile for defined profiles
[openwrt/openwrt.git] / target / linux / lantiq / image / Makefile
1 #
2 # Copyright (C) 2010-2016 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 # boards missing since devicetree update
9 #EASY50712 ARV3527P
10
11 JFFS2_BLOCKSIZE = 64k 128k 256k
12
13 KERNEL_LOADADDR = 0x80002000
14 KERNEL_ENTRY = 0x80002000
15
16 include $(TOPDIR)/rules.mk
17 include $(INCLUDE_DIR)/image.mk
18
19 LOADER_MAKE := $(NO_TRACE_MAKE) -C lzma-loader KDIR=$(KDIR)
20
21 define Image/BuildLoader/Template
22 -rm -rf $(KDIR)/lzma-loader
23 $(LOADER_MAKE) LOADER=loader$(2)-$(1).bin\
24 LZMA_TEXT_START=0x80a00000 \
25 LOADADDR=0x80002000 \
26 LOADER_DATA="$(KDIR)/vmlinux$(2)-$(1).lzma" BOARD="$(1)" \
27 compile loader.bin
28 endef
29
30
31 define CompressLzma
32 $(STAGING_DIR_HOST)/bin/lzma e $(1) $(2)
33 endef
34
35 define PatchKernelLzma
36 cp $(KDIR)/vmlinux$(2) $(KDIR)/vmlinux$(2)-$(1)
37 $(LINUX_DIR)/scripts/dtc/dtc -O dtb -o $(KDIR)/$(1).dtb ../dts/$(1).dts
38 cat $(KDIR)/vmlinux$(2)-$(1) $(KDIR)/$(1).dtb > $(KDIR)/vmlinux$(2)-$(1).tmp
39 $(call CompressLzma,$(KDIR)/vmlinux$(2)-$(1).tmp,$(KDIR)/vmlinux$(2)-$(1).lzma)
40 endef
41
42 define MkImageLzma
43 mkimage -A mips -O linux -T kernel -a 0x80002000 -C lzma \
44 -e 0x80002000 -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
45 -d $(KDIR)/vmlinux$(2)-$(1).lzma $(KDIR)/uImage-$(1)$(2)
46 endef
47
48 define MkImageEVA
49 lzma2eva 0x80002000 0x80002000 $(KDIR)/vmlinux$(2)-$(1).lzma $(KDIR)/$(1)$(2).eva.prealign
50 dd if=$(KDIR)/$(1)$(2).eva.prealign of=$(KDIR)/$(1)$(2).eva.align.64k bs=64k conv=sync
51 dd if=$(KDIR)/$(1)$(2).eva.prealign of=$(KDIR)/$(1)$(2).eva.align.128k bs=128k conv=sync
52 cat ./eva.dummy.squashfs >> $(KDIR)/$(1)$(2).eva.align.64k
53 endef
54
55 define Image/Build/squashfs
56 cat $(KDIR)/uImage-$(2) $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image
57 $(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image)
58 endef
59
60 define Image/BuildNAND/squashfs
61
62 ifneq ($($(PROFILE)_UBI_OPTS),)
63 $(call prepare_generic_squashfs,$(KDIR)/root.$(1))
64 $(call Image/Build/UbinizeImage,$(PROFILE),,squashfs,$($(PROFILE)_UBI_OPTS))
65 $(call Image/Build/SysupgradeNAND,$(PROFILE),$(1),$(KDIR)/uImage-$(PROFILE))
66 endif
67 endef
68
69 DGN3500_SKERNEL=0x50000
70 DGN3500_SKERNEL_DECIMAL=327680
71 define Image/BuildDGN3500/squashfs
72 dd if=/dev/zero of=$(BIN_DIR)/$(IMG_PREFIX)-pad bs=$(DGN3500_SKERNEL_DECIMAL) count=1
73 cat $(BIN_DIR)/$(IMG_PREFIX)-pad $(KDIR)/uImage-$(2) $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.img
74 rm -r $(BIN_DIR)/$(IMG_PREFIX)-pad
75 dd if=/dev/zero ibs=16M count=1 | tr "\000" "\377" > $(BIN_DIR)/$(IMG_PREFIX)-pwf
76 cp $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.img $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadNA.img
77 dgn3500sum $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadNA.img $(DGN3500_SKERNEL) NA
78 $(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadNA.img)
79 cp $(BIN_DIR)/$(IMG_PREFIX)-pwf $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-NA.img
80 dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadNA.img of=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-NA.img conv=notrunc
81 dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadNA.img of=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-sysupgrade-NA.image bs=$(DGN3500_SKERNEL_DECIMAL) skip=1
82 rm -r $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadNA.img
83 mv $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.img $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadWW.img
84 dgn3500sum $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadWW.img $(DGN3500_SKERNEL) WW
85 $(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadWW.img)
86 mv $(BIN_DIR)/$(IMG_PREFIX)-pwf $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-WW.img
87 dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadWW.img of=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-WW.img conv=notrunc
88 dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadWW.img of=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-sysupgrade-WW.image bs=$(DGN3500_SKERNEL_DECIMAL) skip=1
89 rm -r $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadWW.img
90 endef
91
92 define Image/BuildDGN3500B/squashfs
93 dd if=/dev/zero of=$(BIN_DIR)/$(IMG_PREFIX)-pad bs=327680 count=1
94 cat $(BIN_DIR)/$(IMG_PREFIX)-pad $(KDIR)/uImage-$(2) $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.img
95 rm -r $(BIN_DIR)/$(IMG_PREFIX)-pad
96 dd if=/dev/zero ibs=16M count=1 | tr "\000" "\377" > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory.img
97 dgn3500sum $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.img $(DGN3500_SKERNEL) DE
98 $(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.img)
99 dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.img of=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory.img conv=notrunc
100 dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.img of=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-sysupgrade.image bs=$(DGN3500_SKERNEL_DECIMAL) skip=1
101 rm -r $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.img
102 dgn3500sum $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-sysupgrade.image $(DGN3500_SKERNEL) DE
103 endef
104
105
106 define Image/BuildEVA/squashfs
107 cat $(KDIR)/$(2).eva.align.64k $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image.eva
108 $(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image.eva)
109 endef
110
111 define Image/BuildEVA/ubifs
112
113 ifneq ($($(PROFILE)_UBIFS_OPTS),)
114 $(CP) $(KDIR)/root.ubifs $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-rootfs.ubifs
115 endif
116 endef
117
118 define Image/BuildEVA/ubi
119
120 ifneq ($($(PROFILE)_UBI_OPTS),)
121 $(CP) $(KDIR)/root.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-rootfs.ubi
122 $(CP) $(KDIR)/root-overlay.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-rootfs-overlay.ubi
123 endif
124 endef
125
126 define Image/BuildLoader/squashfs
127 dd if=$(KDIR)/loader-$(2).bin of=$(KDIR)/loader-$(2).bin.padded bs=3072k conv=sync
128 cat $(KDIR)/loader-$(2).bin.padded $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image
129 $(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image)
130 endef
131
132 define Image/BuildEVA/jffs2-128k
133 cat $(KDIR)/$(2).eva.align.128k $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image.eva
134 endef
135
136 define Image/Build/jffs2-64k
137 dd if=$(KDIR)/uImage-$(2) of=$(KDIR)/uImage-$(2)-$(1) bs=64k conv=sync
138 cat $(KDIR)/uImage-$(2)-$(1) $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image
139 endef
140
141 define Image/Build/jffs2-128k
142 dd if=$(KDIR)/uImage-$(2) of=$(KDIR)/uImage-$(2)-$(1) bs=128k conv=sync
143 cat $(KDIR)/uImage-$(2)-$(1) $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image
144 endef
145
146 define Image/Build/jffs2-256k
147 dd if=$(KDIR)/uImage-$(2) of=$(KDIR)/uImage-$(2)-$(1) bs=256k conv=sync
148 cat $(KDIR)/uImage-$(2)-$(1) $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image
149 endef
150
151 define Image/Build/ubifs
152
153 ifneq ($($(PROFILE)_UBIFS_OPTS),)
154 $(CP) $(KDIR)/root.ubifs $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-rootfs.ubifs
155 endif
156 endef
157
158 define Image/Build/ubi
159
160 ifneq ($($(PROFILE)_UBI_OPTS),)
161 $(CP) $(KDIR)/root.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-rootfs.ubi
162 $(CP) $(KDIR)/root-overlay.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-rootfs-overlay.ubi
163 endif
164 endef
165
166
167 define Image/BuildNAND/ubifs
168
169 ifneq ($($(PROFILE)_UBIFS_OPTS),)
170 ifneq ($($(PROFILE)_UBI_OPTS),)
171 $(call Image/Build/UbinizeImage,$(PROFILE),,ubifs,$($(PROFILE)_UBI_OPTS))
172 $(call Image/Build/SysupgradeNAND,$(PROFILE),$(1),$(KDIR)/uImage-$(PROFILE))
173 endif
174 endif
175 endef
176
177
178 define Image/InstallKernel/Template
179
180 ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_KERNEL),)
181 $(INSTALL_DIR) $(TARGET_DIR)/boot
182
183 ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_UIMAGE),)
184 $(CP) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-uImage $(TARGET_DIR)/boot/
185 ln -sf $(IMG_PREFIX)-$(1)-uImage $(TARGET_DIR)/boot/uImage
186 endif
187
188 ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_ZIMAGE),)
189 $(CP) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-zImage $(TARGET_DIR)/boot/
190 ln -sf $(IMG_PREFIX)-$(1)-zImage $(TARGET_DIR)/boot/zImage
191 endif
192 endif
193
194 ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_DTB),)
195 $(INSTALL_DIR) $(TARGET_DIR)/boot
196
197 ifneq ($(1),)
198 $(CP) $(KDIR)/$(1).dtb $(TARGET_DIR)/boot/
199 endif
200 endif
201 endef
202
203 define Image/BuildKernel/Template
204 $(call PatchKernelLzma,$(1))
205 $(call MkImageLzma,$(1))
206 $(CP) $(KDIR)/uImage-$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-uImage
207 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
208 $(call PatchKernelLzma,$(1),-initramfs)
209 $(call MkImageLzma,$(1),-initramfs)
210 $(CP) $(KDIR)/uImage-$(1)-initramfs $(BIN_DIR)/$(IMG_PREFIX)-$(1)-uImage-initramfs
211 endif
212 endef
213
214 define Image/BuildKernelLoader/Template
215 $(CP) $(KDIR)/loader-$(1).bin $(BIN_DIR)/$(IMG_PREFIX)-$(1)-vmlinux-loader
216 $(CP) $(KDIR)/vmlinux-$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-vmlinux
217 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
218 $(CP) $(KDIR)/loader-initramfs-$(1).bin $(BIN_DIR)/$(IMG_PREFIX)-$(1)-vmlinux-initramfs-loader
219 $(CP) $(KDIR)/vmlinux-initramfs-$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-vmlinux-initramfs
220 endif
221 endef
222
223 define Image/Prepare/Profile
224 $(call PatchKernelLzma,$(1))
225 $(call Image/BuildLoader/Template,$(1))
226 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
227 $(call PatchKernelLzma,$(1),-initramfs)
228 $(call Image/BuildLoader/Template,$(1),-initramfs)
229 endif
230 endef
231
232 define Image/BuildKernelEVA/Template
233 $(call PatchKernelLzma,$(1))
234 $(call MkImageEVA,$(1))
235 $(CP) $(KDIR)/$(1).eva.align.64k $(BIN_DIR)/$(IMG_PREFIX)-$(1).eva.align.64k
236 $(CP) $(KDIR)/$(1).eva.align.128k $(BIN_DIR)/$(IMG_PREFIX)-$(1).eva.align.128k
237 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
238 $(call PatchKernelLzma,$(1),-initramfs)
239 $(call MkImageEVA,$(1),-initramfs)
240 $(CP) $(KDIR)/$(1)-initramfs.eva.align.64k $(BIN_DIR)/$(IMG_PREFIX)-$(1)-initramfs.eva.align.64k
241 $(CP) $(KDIR)/$(1)-initramfs.eva.align.128k $(BIN_DIR)/$(IMG_PREFIX)-$(1)-initramfs.eva.align.128k
242 endif
243 endef
244
245
246 ### Kernel scripts ###
247 define Build/append-dtb
248 $(call Image/BuildDTB,../dts/$(DEVICE_DTS).dts,$@.dtb)
249 cat $@.dtb >> $@
250 endef
251
252 define Build/mkbrncmdline
253 mkbrncmdline -i $@ -o $@.new BRN-BOOT
254 mv $@.new $@
255 endef
256
257 define Build/mkbrnimg
258 mkbrnimg -s $(SIGNATURE) -m $(MAGIC) -p $(CRC32_POLY) -o $@ $(word 1,$^) $(word 2,$^)
259 endef
260
261 # Shared device definition: applies to every defined device
262 define Device/Default
263 PROFILES = Default $$(DEVICE_PROFILE)
264 KERNEL_DEPENDS = $$(wildcard ../dts/$$(DEVICE_DTS).dts)
265 KERNEL_INITRAMFS_NAME = $$(KERNEL_NAME)-initramfs
266 KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
267 KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma
268 FILESYSTEMS := squashfs
269 DEVICE_PROFILE :=
270 DEVICE_DTS :=
271 IMAGE_SIZE :=
272 IMAGES := sysupgrade.bin
273 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
274 endef
275 DEVICE_VARS += DEVICE_PROFILE DEVICE_DTS IMAGE_SIZE
276
277 define Device/lantiqBrnImage
278 KERNEL := kernel-bin | append-dtb | mkbrncmdline | lzma-no-dict
279 IMAGES := factory.bin
280 IMAGE/factory.bin := mkbrnimg | check-size $$$$(IMAGE_SIZE)
281 endef
282 DEVICE_VARS += SIGNATURE MAGIC CRC32_POLY
283
284 ifeq ($(SUBTARGET),xway)
285
286 # Danube
287 BTHOMEHUBV2B_UBIFS_OPTS:="-m 512 -e 15872 -c 1959"
288 BTHOMEHUBV2B_UBI_OPTS:="-m 512 -p 16KiB -s 256"
289
290 Image/BuildKernel/Profile/BTHOMEHUBV2B=$(call Image/BuildKernel/Template,BTHOMEHUBV2B)
291 Image/Build/Profile/BTHOMEHUBV2B=$(call Image/BuildNAND/$(1),$(1),BTHOMEHUBV2B)
292
293 define Device/EASY50712
294 DEVICE_PROFILE := EASY50712
295 IMAGE_SIZE := 3776k
296 DEVICE_DTS := EASY50712
297 DEVICE_TITLE := Lantiq Danube - EASY50712
298 endef
299 TARGET_DEVICES += EASY50712
300
301 define Device/ACMP252
302 DEVICE_PROFILE := ACMP252
303 IMAGE_SIZE := 14848k
304 DEVICE_DTS := ACMP252
305 DEVICE_TITLE := AudioCodes MediaPack MP-252
306 DEVICE_PACKAGES := kmod-rt2x00-pci wpad-mini \
307 kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
308 kmod-ltq-adsl-danube-fw-a kmod-ltq-ptm-danube \
309 ltq-adsl-app
310 endef
311 TARGET_DEVICES += ACMP252
312
313 define Device/ARV4510PW
314 DEVICE_PROFILE := ARV4510PW
315 IMAGE_SIZE := 15616k
316 DEVICE_DTS := ARV4510PW
317 DEVICE_TITLE := Wippies, Elisa - ARV4510PW
318 DEVICE_PACKAGES := kmod-ledtrig-usbdev kmod-usb2-pci kmod-usb-uhci \
319 kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
320 kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
321 ltq-adsl-app ppp-mod-pppoa \
322 kmod-ltq-tapi kmod-ltq-vmmc \
323 kmod-rt2800-pci kmod-ath5k wpad-mini \
324 swconfig
325 endef
326 TARGET_DEVICES += ARV4510PW
327
328 define Device/ARV4525PW
329 DEVICE_PROFILE := ARV4525PW
330 IMAGE_SIZE := 3776k
331 DEVICE_DTS := ARV4525PW
332 DEVICE_TITLE := Speedport W502V Typ A - ARV4525PW
333 DEVICE_PACKAGES := kmod-ath5k wpad-mini \
334 kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
335 kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
336 ltq-adsl-app ppp-mod-pppoa
337 endef
338 TARGET_DEVICES += ARV4525PW
339
340 define Device/ARV7525PW
341 DEVICE_PROFILE := ARV7525PW
342 IMAGE_SIZE := 3776k
343 DEVICE_DTS := ARV7525PW
344 DEVICE_TITLE := Speedport W303V Typ A - ARV7525PW
345 DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini \
346 kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
347 kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
348 ltq-adsl-app ppp-mod-pppoa
349 endef
350 TARGET_DEVICES += ARV7525PW
351
352 define Device/ARV4518PWR01
353 DEVICE_PROFILE := ARV4518PWR01
354 IMAGE_SIZE := 3776k
355 DEVICE_DTS := ARV4518PWR01
356 DEVICE_TITLE := ARV4518PWR01
357 DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
358 kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
359 kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
360 ltq-adsl-app ppp-mod-pppoa \
361 kmod-ath5k wpad-mini \
362 swconfig
363 endef
364 TARGET_DEVICES += ARV4518PWR01
365
366 define Device/ARV4518PWR01A
367 DEVICE_PROFILE := ARV4518PWR01A
368 IMAGE_SIZE := 3776k
369 DEVICE_DTS := ARV4518PWR01A
370 DEVICE_TITLE := ARV4518PWR01A
371 DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
372 kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
373 kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
374 ltq-adsl-app ppp-mod-pppoa \
375 kmod-ath5k wpad-mini \
376 swconfig
377 endef
378 TARGET_DEVICES += ARV4518PWR01A
379
380 define Device/ARV4519PW
381 DEVICE_PROFILE := ARV4519PW
382 IMAGE_SIZE := 3776k
383 DEVICE_DTS := ARV4519PW
384 DEVICE_TITLE := Vodafone, Pirelli - ARV4519PW
385 DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
386 kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
387 kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
388 ltq-adsl-app ppp-mod-pppoa \
389 swconfig
390 endef
391 TARGET_DEVICES += ARV4519PW
392
393 define Device/ARV4520PW
394 DEVICE_PROFILE := ARV4520PW
395 IMAGE_SIZE := 3648k
396 DEVICE_DTS := ARV4520PW
397 DEVICE_TITLE := Easybox 800, WAV-281 - ARV4520PW
398 DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
399 kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
400 kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
401 ltq-adsl-app ppp-mod-pppoa \
402 kmod-rt61-pci wpad-mini \
403 swconfig
404 endef
405 TARGET_DEVICES += ARV4520PW
406
407 define Device/ARV452CQW
408 DEVICE_PROFILE := ARV452CQW
409 IMAGE_SIZE := 3776k
410 DEVICE_DTS := ARV452CQW
411 DEVICE_TITLE := Easybox 801 - ARV452CQW
412 DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
413 kmod-ath5k wpad-mini \
414 kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
415 kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
416 ltq-adsl-app ppp-mod-pppoa \
417 swconfig
418 endef
419 TARGET_DEVICES += ARV452CQW
420
421 define Device/ARV7510PW22
422 DEVICE_PROFILE := ARV7510PW22
423 IMAGE_SIZE := 31232k
424 DEVICE_DTS := ARV7510PW22
425 DEVICE_TITLE := Astoria - ARV7510PW22
426 DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
427 kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
428 kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
429 ltq-adsl-app ppp-mod-pppoa \
430 kmod-ltq-tapi kmod-ltq-vmmc \
431 kmod-rt2800-pci wpad-mini \
432 kmod-usb-uhci kmod-usb2 kmod-usb2-pci \
433 swconfig
434 endef
435 TARGET_DEVICES += ARV7510PW22
436
437 define Device/ARV7518PW
438 DEVICE_PROFILE := ARV7518PW
439 IMAGE_SIZE := 7872k
440 DEVICE_DTS := ARV7518PW
441 DEVICE_TITLE := Astoria - ARV7518PW
442 DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
443 kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
444 kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
445 ltq-adsl-app ppp-mod-pppoa \
446 kmod-ath9k wpad-mini \
447 swconfig
448 endef
449 TARGET_DEVICES += ARV7518PW
450
451 define Device/ARV7519PW
452 DEVICE_PROFILE := ARV7519PW
453 IMAGE_SIZE := 15488k
454 DEVICE_DTS := ARV7519PW
455 DEVICE_TITLE := Astoria - ARV7519PW
456 DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
457 kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
458 kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
459 ltq-adsl-app ppp-mod-pppoa \
460 kmod-rt2800-pci wpad-mini \
461 swconfig
462 endef
463 TARGET_DEVICES += ARV7519PW
464
465 define Device/ARV752DPW
466 DEVICE_PROFILE := ARV752DPW
467 IMAGE_SIZE := 7872k
468 DEVICE_DTS := ARV752DPW
469 DEVICE_TITLE := Easybox 802 - ARV752DPW
470 DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
471 kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
472 kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
473 ltq-adsl-app ppp-mod-pppoa \
474 kmod-ltq-tapi kmod-ltq-vmmc \
475 kmod-rt2800-pci wpad-mini \
476 swconfig
477 endef
478 TARGET_DEVICES += ARV752DPW
479
480 define Device/ARV752DPW22
481 DEVICE_PROFILE := ARV752DPW22
482 IMAGE_SIZE := 7616k
483 DEVICE_DTS := ARV752DPW22
484 DEVICE_TITLE := Easybox 803 - ARV752DPW22
485 DEVICE_PACKAGES := kmod-usb2-pci kmod-usb-uhci kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
486 kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
487 kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
488 ltq-adsl-app ppp-mod-pppoa \
489 kmod-ltq-tapi kmod-ltq-vmmc \
490 kmod-rt2800-pci wpad-mini \
491 swconfig
492 endef
493 TARGET_DEVICES += ARV752DPW22
494
495 define Device/ARV8539PW22
496 DEVICE_PROFILE := ARV8539PW22
497 IMAGE_SIZE := 7616k
498 DEVICE_DTS := ARV8539PW22
499 DEVICE_TITLE := Speedport W504V Typ A - ARV8539PW22
500 DEVICE_PACKAGES := kmod-ltq-hcd-danube \
501 kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
502 kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
503 ltq-adsl-app ppp-mod-pppoa \
504 kmod-ath9k wpad-mini \
505 swconfig
506 endef
507 TARGET_DEVICES += ARV8539PW22
508
509 define Device/GIGASX76X
510 DEVICE_PROFILE := GIGASX76X
511 IMAGE_SIZE := 7680k
512 DEVICE_DTS := GIGASX76X
513 DEVICE_TITLE := Gigaset sx76x
514 DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
515 kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
516 kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
517 ltq-adsl-app ppp-mod-pppoe \
518 kmod-ath5k wpad-mini \
519 swconfig
520 endef
521 TARGET_DEVICES += GIGASX76X
522
523
524
525 # AR9
526 BTHOMEHUBV3A_UBIFS_OPTS:="-m 512 -e 15872 -c 1959"
527 BTHOMEHUBV3A_UBI_OPTS:="-m 512 -p 16KiB -s 256"
528
529 Image/BuildKernel/Profile/BTHOMEHUBV3A=$(call Image/BuildKernel/Template,BTHOMEHUBV3A)
530 Image/Build/Profile/BTHOMEHUBV3A=$(call Image/BuildNAND/$(1),$(1),BTHOMEHUBV3A)
531
532 Image/BuildKernel/Profile/DGN3500=$(call Image/BuildKernel/Template,DGN3500)
533 Image/Build/Profile/DGN3500=$(call Image/BuildDGN3500/$(1),$(1),DGN3500)
534
535 Image/BuildKernel/Profile/DGN3500B=$(call Image/BuildKernel/Template,DGN3500B)
536 Image/Build/Profile/DGN3500B=$(call Image/BuildDGN3500B/$(1),$(1),DGN3500B)
537
538 define Device/WBMRA
539 DEVICE_PROFILE := WBMRA
540 IMAGE_SIZE := 31488k
541 DEVICE_DTS := WBMR
542 DEVICE_TITLE := Buffalo WBMR-HP-G300H (A) - WBMR
543 DEVICE_PACKAGES := kmod-usb-dwc2 kmod-ledtrig-usbdev \
544 kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
545 kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \
546 ltq-adsl-app ppp-mod-pppoa \
547 kmod-ath9k wpad hostapd-utils \
548 swconfig
549 endef
550 TARGET_DEVICES += WBMRA
551
552 define Device/WBMRB
553 DEVICE_PROFILE := WBMRB
554 IMAGE_SIZE := 31488k
555 DEVICE_DTS := WBMR
556 DEVICE_TITLE := Buffalo WBMR-HP-G300H (B) - WBMR
557 DEVICE_PACKAGES := kmod-usb-dwc2 kmod-ledtrig-usbdev \
558 kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
559 kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
560 ltq-adsl-app ppp-mod-pppoa \
561 kmod-ath9k wpad hostapd-utils \
562 swconfig
563 endef
564 TARGET_DEVICES += WBMRB
565
566
567 Image/BuildKernel/Profile/FRITZ7320=$(call Image/BuildKernelEVA/Template,FRITZ7320)
568 Image/Build/Profile/FRITZ7320=$(call Image/BuildEVA/$(1),$(1),FRITZ7320)
569
570 define Device/GR7000
571 DEVICE_PROFILE := GR7000
572 IMAGE_SIZE := 7808k
573 DEVICE_DTS := GR7000
574 DEVICE_TITLE := Aztech GR7000
575 DEVICE_PACKAGES := kmod-ltq-deu-ar9 kmod-usb-dwc2 swconfig
576 endef
577 TARGET_DEVICES += GR7000
578
579 define Device/H201L
580 DEVICE_PROFILE := H201L
581 IMAGE_SIZE := 7808k
582 DEVICE_DTS := H201L
583 DEVICE_TITLE := ZTE H201L - H201L
584 DEVICE_PACKAGES := kmod-ath9k-htc wpad-mini \
585 kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
586 kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
587 ltq-adsl-app ppp-mod-pppoe \
588 kmod-ltq-deu-ar9 kmod-usb-dwc2 \
589 kmod-ltq-tapi kmod-ltq-vmmc \
590 swconfig
591 endef
592 TARGET_DEVICES += H201L
593
594 define Device/P2601HNFX
595 DEVICE_PROFILE := P2601HNFX
596 IMAGE_SIZE := 15616k
597 DEVICE_DTS := P2601HNFX
598 DEVICE_TITLE := ZyXEL P-2601HN-Fx
599 DEVICE_PACKAGES := kmod-rt2800-usb wpad-mini \
600 kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
601 kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
602 ltq-adsl-app ppp-mod-pppoe \
603 kmod-ltq-deu-ar9 kmod-usb-dwc2 \
604 swconfig
605 endef
606 TARGET_DEVICES += P2601HNFX
607
608
609 endif
610
611
612 ifeq ($(SUBTARGET),xrx200)
613
614 # VR9
615 P2812HNUF1_UBIFS_OPTS:="-m 2048 -e 126KiB -c 4096"
616 P2812HNUF1_UBI_OPTS:="-m 2048 -p 128KiB -s 512"
617
618 Image/BuildKernel/Profile/P2812HNUF1=$(call Image/BuildKernel/Template,P2812HNUF1)
619 Image/Build/Profile/P2812HNUF1=$(call Image/BuildNAND/$(1),$(1),P2812HNUF1)
620
621 P2812HNUF3_UBIFS_OPTS:="-m 2048 -e 126KiB -c 4096"
622 P2812HNUF3_UBI_OPTS:="-m 2048 -p 128KiB -s 512"
623
624 Image/BuildKernel/Profile/P2812HNUF3=$(call Image/BuildKernel/Template,P2812HNUF3)
625 Image/Build/Profile/P2812HNUF3=$(call Image/BuildNAND/$(1),$(1),P2812HNUF3)
626
627 define Device/ARV7519RW22
628 DEVICE_PROFILE := ARV7519RW22
629 IMAGE_SIZE := 31232k
630 DEVICE_DTS := ARV7519RW22
631 DEVICE_TITLE := Livebox Astoria ARV7519RW22
632 DEVICE_PACKAGES := kmod-usb-dwc2
633 endef
634 TARGET_DEVICES += ARV7519RW22
635
636
637 BTHOMEHUBV5A_UBIFS_OPTS:="-m 2048 -e 126KiB -c 4096"
638 BTHOMEHUBV5A_UBI_OPTS:="-m 2048 -p 128KiB -s 512"
639
640 Image/BuildKernel/Profile/BTHOMEHUBV5A=$(call Image/BuildKernel/Template,BTHOMEHUBV5A)
641 Image/Build/Profile/BTHOMEHUBV5A=$(call Image/BuildNAND/$(1),$(1),BTHOMEHUBV5A)
642
643 define Device/EASY80920NAND
644 DEVICE_PROFILE := EASY80920NAND
645 IMAGE_SIZE := 64512k
646 DEVICE_DTS := EASY80920NAND
647 DEVICE_TITLE := Lantiq VR9 - EASY80920NAND
648 DEVICE_PACKAGES := kmod-ath9k wpad-mini kmod-usb-dwc2
649 endef
650 TARGET_DEVICES += EASY80920NAND
651
652 define Device/EASY80920NOR
653 DEVICE_PROFILE := EASY80920NOR
654 IMAGE_SIZE := 7936k
655 DEVICE_DTS := EASY80920NOR
656 DEVICE_TITLE := Lantiq VR9 - EASY80920NOR
657 DEVICE_PACKAGES := kmod-ath9k wpad-mini kmod-usb-dwc2
658 endef
659 TARGET_DEVICES += EASY80920NOR
660
661
662 FRITZ3370_UBIFS_OPTS:="-m 2048 -e 126KiB -c 4096"
663 FRITZ3370_UBI_OPTS:="-m 2048 -p 128KiB -s 512"
664
665 Image/BuildKernel/Profile/FRITZ3370=$(call Image/BuildKernelEVA/Template,FRITZ3370)
666 Image/Build/Profile/FRITZ3370=$(call Image/BuildEVA/$(1),$(1),FRITZ3370)
667
668 Image/BuildKernel/Profile/VG3503J=$(call Image/BuildKernelLoader/Template,VG3503J)
669 Image/Build/Profile/VG3503J=$(call Image/BuildLoader/$(1),$(1),VG3503J)
670
671 include tp-link.mk
672
673 define Device/VGV7510KW22NOR
674 DEVICE_PROFILE := VGV7510KW22NOR
675 IMAGE_SIZE := 15232k
676 DEVICE_DTS := VGV7510KW22NOR
677 DEVICE_TITLE := o2 Box 6431 / Arcadyan VGV7510KW22 (NOR)
678 DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2
679 endef
680 TARGET_DEVICES += VGV7510KW22NOR
681
682 define Device/VGV7510KW22BRN
683 $(Device/lantiqBrnImage)
684 DEVICE_PROFILE := VGV7510KW22BRN
685 DEVICE_DTS := VGV7510KW22BRN
686 IMAGE_SIZE := 7168k
687 SIGNATURE := 5D00008000
688 MAGIC := 0x12345678
689 CRC32_POLY := 0x2083b8ed
690 DEVICE_TITLE := o2 Box 6431 / Arcadyan VGV7510KW22 (BRN)
691 DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2
692 endef
693 TARGET_DEVICES += VGV7510KW22BRN
694
695 define Device/VGV7519NOR
696 DEVICE_PROFILE := VGV7519NOR
697 IMAGE_SIZE := 15360k
698 DEVICE_DTS := VGV7519NOR
699 DEVICE_TITLE := Experiabox 8 VGV7519
700 DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2
701 endef
702 TARGET_DEVICES += VGV7519NOR
703
704 define Device/VGV7519BRN
705 $(Device/lantiqBrnImage)
706 DEVICE_PROFILE := VGV7519BRN
707 DEVICE_DTS := VGV7519BRN
708 IMAGE_SIZE := 7168k
709 SIGNATURE := 5D00008000
710 MAGIC := 0x12345678
711 CRC32_POLY := 0x2083b8ed
712 DEVICE_TITLE := Experiabox 8 VGV7519 (BRN)
713 DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2
714 endef
715 TARGET_DEVICES += VGV7519BRN
716
717 define Image/Prepare
718 $(if $(Image/Build/Profile/$(PROFILE)),$(call Image/Prepare/Profile,$(PROFILE)))
719 endef
720
721 endif
722
723 define Image/BuildKernel
724 $(call Image/BuildKernel/Profile/$(PROFILE))
725 endef
726
727 define Image/InstallKernel
728 $(call Image/InstallKernel/Template/$(PROFILE))
729 endef
730
731 define Image/Build
732 $(call Image/Build/Profile/$(PROFILE),$(1))
733 endef
734
735 $(eval $(call BuildImage))