cf71cb30b84690e3e5e5512659d9903720c82983
[openwrt/openwrt.git] / target / linux / ath79 / image / generic.mk
1 include ./common-buffalo.mk
2 include ./common-netgear.mk
3
4 DEVICE_VARS += ADDPATTERN_ID ADDPATTERN_VERSION
5
6 define Build/cybertan-trx
7 @echo -n '' > $@-empty.bin
8 -$(STAGING_DIR_HOST)/bin/trx -o $@.new \
9 -f $(IMAGE_KERNEL) -F $@-empty.bin \
10 -x 32 -a 0x10000 -x -32 -f $@
11 -mv "$@.new" "$@"
12 -rm $@-empty.bin
13 endef
14
15 define Build/addpattern
16 -$(STAGING_DIR_HOST)/bin/addpattern -B $(ADDPATTERN_ID) \
17 -v v$(ADDPATTERN_VERSION) -i $@ -o $@.new
18 -mv "$@.new" "$@"
19 endef
20
21 define Build/elecom-header
22 $(eval fw_size=$(word 1,$(1)))
23 $(eval edimax_model=$(word 2,$(1)))
24 $(eval product=$(word 3,$(1)))
25 $(eval factory_bin=$(word 4,$(1)))
26 if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(fw_size)" ]; then \
27 $(CP) $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) $(factory_bin); \
28 $(STAGING_DIR_HOST)/bin/mkedimaximg \
29 -b -s CSYS -m $(edimax_model) \
30 -f 0x70000 -S 0x01100000 \
31 -i $(factory_bin) -o $(factory_bin).new; \
32 mv $(factory_bin).new $(factory_bin); \
33 ( \
34 echo -n -e "ELECOM\x00\x00$(product)" | dd bs=40 count=1 conv=sync; \
35 echo -n "0.00" | dd bs=16 count=1 conv=sync; \
36 dd if=$(factory_bin); \
37 ) > $(factory_bin).new; \
38 mv $(factory_bin).new $(factory_bin); \
39 $(CP) $(factory_bin) $(BIN_DIR)/; \
40 else \
41 echo "WARNING: initramfs kernel image too big, cannot generate factory image" >&2; \
42 fi
43
44 endef
45
46 define Device/avm_fritz300e
47 ATH_SOC := ar7242
48 DEVICE_TITLE := AVM FRITZ!WLAN Repeater 300E
49 KERNEL := kernel-bin | append-dtb | lzma | eva-image
50 KERNEL_INITRAMFS := $$(KERNEL)
51 IMAGE_SIZE := 15232k
52 IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | \
53 append-squashfs-fakeroot-be | pad-to 256 | \
54 append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
55 DEVICE_PACKAGES := fritz-tffs rssileds -swconfig
56 endef
57 TARGET_DEVICES += avm_fritz300e
58
59 define Device/avm_fritz4020
60 ATH_SOC := qca9561
61 DEVICE_TITLE := AVM FRITZ!Box 4020
62 IMAGE_SIZE := 15232k
63 KERNEL := kernel-bin | append-dtb | lzma | eva-image
64 KERNEL_INITRAMFS := $$(KERNEL)
65 IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | \
66 append-squashfs-fakeroot-be | pad-to 256 | \
67 append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
68 DEVICE_PACKAGES := fritz-tffs
69 endef
70 TARGET_DEVICES += avm_fritz4020
71
72 define Device/buffalo_bhr-4grv
73 ATH_SOC := ar7242
74 DEVICE_TITLE := Buffalo BHR-4GRV
75 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
76 IMAGE_SIZE := 32256k
77 IMAGES += factory.bin tftp.bin
78 IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
79 IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc BHR-4GRV 1.99 | buffalo-tag BHR-4GRV 3
80 IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header
81 SUPPORTED_DEVICES += wzr-hp-g450h
82 endef
83 TARGET_DEVICES += buffalo_bhr-4grv
84
85 define Device/buffalo_bhr-4grv2
86 ATH_SOC := qca9557
87 DEVICE_TITLE := Buffalo BHR-4GRV2
88 IMAGE_SIZE := 16000k
89 endef
90 TARGET_DEVICES += buffalo_bhr-4grv2
91
92 define Device/buffalo_wzr-hp-ag300h
93 ATH_SOC := ar7161
94 DEVICE_TITLE := Buffalo WZR-HP-AG300H
95 IMAGE_SIZE := 32256k
96 IMAGES += factory.bin tftp.bin
97 IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
98 IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc WZR-HP-AG300H 1.99 | buffalo-tag WZR-HP-AG300H 3
99 IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header
100 DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-reset kmod-owl-loader
101 SUPPORTED_DEVICES += wzr-hp-ag300h
102 endef
103 TARGET_DEVICES += buffalo_wzr-hp-ag300h
104
105 define Device/buffalo_wzr-hp-g302h-a1a0
106 ATH_SOC := ar7242
107 DEVICE_TITLE := Buffalo WZR-HP-G302H A1A0
108 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
109 IMAGE_SIZE := 32128k
110 IMAGES += factory.bin tftp.bin
111 IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
112 IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc WZR-HP-G302H 1.99 | buffalo-tag WZR-HP-G302H 4
113 IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header
114 SUPPORTED_DEVICES += wzr-hp-g300nh2
115 endef
116 TARGET_DEVICES += buffalo_wzr-hp-g302h-a1a0
117
118 define Device/buffalo_wzr-hp-g450h
119 ATH_SOC := ar7242
120 DEVICE_TITLE := Buffalo WZR-HP-G450H/WZR-450HP
121 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
122 IMAGE_SIZE := 32256k
123 IMAGES += factory.bin tftp.bin
124 IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
125 IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc WZR-HP-G450H 1.99 | buffalo-tag WZR-HP-G450H 3
126 IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header
127 SUPPORTED_DEVICES += wzr-hp-g450h
128 endef
129 TARGET_DEVICES += buffalo_wzr-hp-g450h
130
131 define Device/dlink_dir-825-b1
132 ATH_SOC := ar7161
133 DEVICE_TITLE := D-LINK DIR-825 B1
134 IMAGE_SIZE := 6208k
135 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
136 DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-reset kmod-owl-loader
137 SUPPORTED_DEVICES += dir-825-b1
138 endef
139 TARGET_DEVICES += dlink_dir-825-b1
140
141 define Device/dlink_dir-825-c1
142 ATH_SOC := ar9344
143 DEVICE_TITLE := D-LINK DIR-825 C1
144 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-reset kmod-owl-loader
145 SUPPORTED_DEVICES += dir-825-c1
146 IMAGE_SIZE := 15936k
147 IMAGES := factory.bin sysupgrade.bin
148 IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs
149 IMAGE/factory.bin := $$(IMAGE/default) | cameo-factory $$$$(IMAGE_SIZE) 00DB120AR9344-RT-101214-00 | check-size $$$$(IMAGE_SIZE)
150 IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | check-size $$$$(IMAGE_SIZE)
151 endef
152 TARGET_DEVICES += dlink_dir-825-c1
153
154 define Device/dlink_dir-835-a1
155 ATH_SOC := ar9344
156 DEVICE_TITLE := D-LINK DIR-835 A1
157 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-leds-reset kmod-owl-loader
158 SUPPORTED_DEVICES += dir-835-a1
159 IMAGE_SIZE := 15936k
160 IMAGES := factory.bin sysupgrade.bin
161 IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs
162 IMAGE/factory.bin := $$(IMAGE/default) | cameo-factory $$$$(IMAGE_SIZE) 00DB120AR9344-RT-101214-00 | check-size $$$$(IMAGE_SIZE)
163 IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | check-size $$$$(IMAGE_SIZE)
164 endef
165 TARGET_DEVICES += dlink_dir-835-a1
166
167 define Device/elecom_wrc-300ghbk2-i
168 ATH_SOC := qca9563
169 DEVICE_TITLE := ELECOM WRC-300GHBK2-I
170 IMAGE_SIZE := 7616k
171 KERNEL_INITRAMFS := $$(KERNEL) | pad-to 2 | \
172 elecom-header 7798706 RN51 WRC-300GHBK2-I \
173 $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.bin
174 endef
175 TARGET_DEVICES += elecom_wrc-300ghbk2-i
176
177 define Device/embeddedwireless_dorin
178 ATH_SOC := ar9331
179 DEVICE_TITLE := Embedded Wireless Dorin
180 DEVICE_PACKAGES := kmod-usb-chipidea2
181 IMAGE_SIZE := 16000k
182 endef
183 TARGET_DEVICES += embeddedwireless_dorin
184
185 define Device/etactica_eg200
186 ATH_SOC := ar9331
187 DEVICE_TITLE := eTactica EG200
188 DEVICE_PACKAGES := kmod-usb-chipidea2 kmod-ledtrig-oneshot \
189 kmod-usb-serial kmod-usb-serial-ftdi kmod-usb-storage kmod-fs-ext4
190 SUPPORTED_DEVICES += rme-eg200
191 endef
192 TARGET_DEVICES += etactica_eg200
193
194 define Device/glinet_ar150
195 ATH_SOC := ar9330
196 DEVICE_TITLE := GL.iNet GL-AR150
197 DEVICE_PACKAGES := kmod-usb-chipidea2
198 IMAGE_SIZE := 16000k
199 SUPPORTED_DEVICES += gl-ar150
200 endef
201 TARGET_DEVICES += glinet_ar150
202
203 define Device/glinet_ar300m-nor
204 ATH_SOC := qca9531
205 DEVICE_TITLE := GL.iNet GL-AR300M
206 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
207 IMAGE_SIZE := 16000k
208 SUPPORTED_DEVICES += gl-ar300m
209 endef
210 TARGET_DEVICES += glinet_ar300m-nor
211
212 define Device/glinet_gl-x750
213 ATH_SOC := qca9531
214 DEVICE_TITLE := GL.iNet GL-X750
215 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ath10k ath10k-firmware-qca9887
216 IMAGE_SIZE := 16000k
217 endef
218 TARGET_DEVICES += glinet_gl-x750
219
220 define Device/iodata_etg3-r
221 ATH_SOC := ar9342
222 DEVICE_TITLE := I-O DATA ETG3-R
223 IMAGE_SIZE := 7680k
224 endef
225 TARGET_DEVICES += iodata_etg3-r
226
227 define Device/iodata_wn-ac1167dgr
228 ATH_SOC := qca9557
229 DEVICE_TITLE := I-O DATA WN-AC1167DGR
230 IMAGE_SIZE := 14656k
231 IMAGES += factory.bin
232 IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
233 append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | \
234 senao-header -r 0x30a -p 0x61 -t 2
235 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct
236 endef
237 TARGET_DEVICES += iodata_wn-ac1167dgr
238
239 define Device/iodata_wn-ac1600dgr2
240 ATH_SOC := qca9557
241 DEVICE_TITLE := I-O DATA WN-AC1600DGR2
242 IMAGE_SIZE := 14656k
243 IMAGES += factory.bin
244 IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
245 append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | \
246 senao-header -r 0x30a -p 0x60 -t 2 -v 200
247 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct
248 endef
249 TARGET_DEVICES += iodata_wn-ac1600dgr2
250
251 define Device/iodata_wn-ag300dgr
252 ATH_SOC := ar1022
253 DEVICE_TITLE := I-O DATA WN-AG300DGR
254 IMAGE_SIZE := 15424k
255 IMAGES += factory.bin
256 IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
257 append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | \
258 senao-header -r 0x30a -p 0x47 -t 2
259 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
260 endef
261 TARGET_DEVICES += iodata_wn-ag300dgr
262
263 define Device/ocedo_koala
264 ATH_SOC := qca9558
265 DEVICE_TITLE := OCEDO Koala
266 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
267 SUPPORTED_DEVICES += koala
268 IMAGE_SIZE := 7424k
269 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
270 endef
271 TARGET_DEVICES += ocedo_koala
272
273 define Device/ocedo_raccoon
274 ATH_SOC := ar9344
275 DEVICE_TITLE := OCEDO Raccoon
276 IMAGE_SIZE := 7424k
277 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
278 endef
279 TARGET_DEVICES += ocedo_raccoon
280
281 define Device/openmesh_om5p-ac-v2
282 ATH_SOC := qca9558
283 DEVICE_TITLE := OpenMesh OM5P-AC v2
284 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct om-watchdog
285 IMAGE_SIZE := 7808k
286 SUPPORTED_DEVICES += om5p-acv2
287 endef
288 TARGET_DEVICES += openmesh_om5p-ac-v2
289
290 define Device/pcs_cap324
291 ATH_SOC := ar9344
292 DEVICE_TITLE := PowerCloud Systems CAP324
293 IMAGE_SIZE := 16000k
294 SUPPORTED_DEVICES += cap324
295 endef
296 TARGET_DEVICES += pcs_cap324
297
298 define Device/pcs_cr3000
299 ATH_SOC := ar9341
300 DEVICE_TITLE := PowerCloud Systems CR3000
301 IMAGE_SIZE := 7808k
302 SUPPORTED_DEVICES += cr3000
303 endef
304 TARGET_DEVICES += pcs_cr3000
305
306 define Device/pcs_cr5000
307 ATH_SOC := ar9344
308 DEVICE_TITLE := PowerCloud Systems CR5000
309 DEVICE_PACKAGES := kmod-usb2 kmod-usb-core
310 IMAGE_SIZE := 7808k
311 SUPPORTED_DEVICES += cr5000
312 endef
313 TARGET_DEVICES += pcs_cr5000
314
315 define Device/netgear_wndr3x00
316 ATH_SOC := ar7161
317 KERNEL := kernel-bin | append-dtb | lzma -d20 | netgear-uImage lzma
318 IMAGES += factory.img
319 IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | append-rootfs | pad-rootfs
320 IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | check-size $$$$(IMAGE_SIZE)
321 IMAGE/factory.img := $$(IMAGE/default) | netgear-dni | check-size $$$$(IMAGE_SIZE)
322 DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-reset kmod-owl-loader
323 endef
324
325 define Device/netgear_wndr3700
326 $(Device/netgear_wndr3x00)
327 DEVICE_TITLE := NETGEAR WNDR3700
328 NETGEAR_KERNEL_MAGIC := 0x33373030
329 NETGEAR_BOARD_ID := WNDR3700
330 IMAGE_SIZE := 7680k
331 IMAGES += factory-NA.img
332 IMAGE/factory-NA.img := $$(IMAGE/default) | netgear-dni NA | check-size $$$$(IMAGE_SIZE)
333 SUPPORTED_DEVICES += wndr3700
334 endef
335 TARGET_DEVICES += netgear_wndr3700
336
337 define Device/netgear_wndr3700v2
338 $(Device/netgear_wndr3x00)
339 DEVICE_TITLE := NETGEAR WNDR3700v2
340 NETGEAR_KERNEL_MAGIC := 0x33373031
341 NETGEAR_BOARD_ID := WNDR3700v2
342 NETGEAR_HW_ID := 29763654+16+64
343 IMAGE_SIZE := 15872k
344 SUPPORTED_DEVICES += wndr3700v2
345 endef
346 TARGET_DEVICES += netgear_wndr3700v2
347
348 define Device/pisen_wmm003n
349 $(Device/tplink-8mlzma)
350 ATH_SOC := ar9331
351 DEVICE_TITLE := Pisen WMM003N (Cloud Easy Power)
352 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-chipidea2
353 TPLINK_HWID := 0x07030101
354 endef
355 TARGET_DEVICES += pisen_wmm003n
356
357 define Device/netgear_wndr3800
358 $(Device/netgear_wndr3x00)
359 DEVICE_TITLE := NETGEAR WNDR3800
360 NETGEAR_KERNEL_MAGIC := 0x33373031
361 NETGEAR_BOARD_ID := WNDR3800
362 NETGEAR_HW_ID := 29763654+16+128
363 IMAGE_SIZE := 15872k
364 SUPPORTED_DEVICES += wndr3800
365 endef
366 TARGET_DEVICES += netgear_wndr3800
367
368 define Device/phicomm_k2t
369 ATH_SOC := qca9563
370 DEVICE_TITLE := Phicomm K2T
371 IMAGE_SIZE := 15744k
372 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
373 DEVICE_PACKAGES := kmod-leds-reset kmod-ath10k-ct ath10k-firmware-qca9888-ct
374 endef
375 TARGET_DEVICES += phicomm_k2t
376
377 define Device/rosinson_wr818
378 ATH_SOC := qca9563
379 DEVICE_TITLE := ROSINSON WR818
380 IMAGE_SIZE := 15872k
381 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
382 endef
383 TARGET_DEVICES += rosinson_wr818
384
385 define Device/wd_mynet-wifi-rangeextender
386 ATH_SOC := ar9344
387 DEVICE_TITLE := Western Digital My Net Wi-Fi Range Extender
388 DEVICE_PACKAGES := rssileds nvram -swconfig
389 IMAGE_SIZE := 7808k
390 ADDPATTERN_ID := mynet-rext
391 ADDPATTERN_VERSION := 1.00.01
392 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | cybertan-trx | \
393 addpattern | append-metadata
394 SUPPORTED_DEVICES += mynet-rext
395 endef
396 TARGET_DEVICES += wd_mynet-wifi-rangeextender
397
398 define Device/winchannel_wb2000
399 ATH_SOC := ar9344
400 DEVICE_TITLE := Winchannel WB2000
401 IMAGE_SIZE := 15872k
402 DEVICE_PACKAGES := kmod-i2c-core kmod-i2c-gpio kmod-rtc-ds1307 kmod-usb2 kmod-usb-ledtrig-usbport
403 endef
404 TARGET_DEVICES += winchannel_wb2000