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