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