ar71xx: add support for COMFAST CF-E320N v2 and CF-E520N/CF-E530N
[openwrt/staging/yousong.git] / target / linux / ar71xx / image / generic.mk
1 define Device/bsb
2 DEVICE_TITLE := Smart Electronics Black Swift board
3 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
4 BOARDNAME = BSB
5 IMAGE_SIZE = 16000k
6 CONSOLE = ttyATH0,115200
7 MTDPARTS = spi0.0:128k(u-boot)ro,64k(u-boot-env)ro,16128k(firmware),64k(art)ro
8 endef
9 TARGET_DEVICES += bsb
10
11 define Device/carambola2
12 DEVICE_TITLE := Carambola2 board from 8Devices
13 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
14 BOARDNAME = CARAMBOLA2
15 IMAGE_SIZE = 16000k
16 CONSOLE = ttyATH0,115200
17 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
18 endef
19 TARGET_DEVICES += carambola2
20
21 define Device/cf-e316n-v2
22 DEVICE_TITLE := COMFAST CF-E316N v2
23 BOARDNAME = CF-E316N-V2
24 IMAGE_SIZE = 16192k
25 CONSOLE = ttyS0,115200
26 MTDPARTS = spi0.0:64k(u-boot)ro,64k(art)ro,16192k(firmware),64k(art-backup)ro
27 endef
28 TARGET_DEVICES += cf-e316n-v2
29
30 define Device/cf-e320n-v2
31 $(Device/cf-e316n-v2)
32 DEVICE_TITLE := COMFAST CF-E320N v2
33 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
34 BOARDNAME = CF-E320N-V2
35 endef
36 TARGET_DEVICES += cf-e320n-v2
37
38 define Device/cf-e520n
39 DEVICE_TITLE := COMFAST CF-E520N
40 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
41 BOARDNAME = CF-E520N
42 IMAGE_SIZE = 8000k
43 CONSOLE = ttyS0,115200
44 MTDPARTS = spi0.0:64k(u-boot)ro,64k(art)ro,8000k(firmware),64k(art-backup)ro
45 endef
46 TARGET_DEVICES += cf-e520n
47
48 define Device/cf-e530n
49 $(Device/cf-e520n)
50 DEVICE_TITLE := COMFAST CF-E530N
51 BOARDNAME = CF-E530N
52 endef
53 TARGET_DEVICES += cf-e530n
54
55 define Device/domywifi-dw33d
56 DEVICE_TITLE := DomyWifi DW33D
57 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage kmod-ledtrig-usbdev kmod-ath10k
58 BOARDNAME = DW33D
59 IMAGE_SIZE = 16000k
60 CONSOLE = ttyS0,115200
61 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware);ar934x-nfc:96m(rootfs_data),32m(backup)ro
62 IMAGE/sysupgrade.bin = append-rootfs | pad-rootfs | pad-to 14528k | append-kernel | check-size $$$$(IMAGE_SIZE)
63 endef
64 TARGET_DEVICES += domywifi-dw33d
65
66 define Device/dragino2
67 BOARDNAME := DRAGINO2
68 CONSOLE := ttyATH0,115200
69 DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport
70 DEVICE_TITLE := Dragino 2 (MS14)
71 IMAGE_SIZE := 16000k
72 MTDPARTS := spi0.0:256k(u-boot)ro,16000k(firmware),64k(config)ro,64k(art)ro
73 endef
74 TARGET_DEVICES += dragino2
75
76 define Device/weio
77 DEVICE_TITLE := WeIO
78 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
79 BOARDNAME = WEIO
80 IMAGE_SIZE = 16000k
81 CONSOLE = ttyATH0,115200
82 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
83 endef
84 TARGET_DEVICES += weio
85
86 define Device/gl-ar150
87 DEVICE_TITLE := GL AR150
88 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
89 BOARDNAME = GL-AR150
90 IMAGE_SIZE = 16000k
91 CONSOLE = ttyATH0,115200
92 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
93 endef
94 TARGET_DEVICES += gl-ar150
95
96 define Device/gl-ar300
97 DEVICE_TITLE := GL AR300
98 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
99 BOARDNAME = GL-AR300
100 IMAGE_SIZE = 16000k
101 CONSOLE = ttyS0,115200
102 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
103 endef
104 TARGET_DEVICES += gl-ar300
105
106 define Device/gl-ar300m
107 DEVICE_TITLE := GL AR300M
108 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 uboot-envtools
109 BOARDNAME = GL-AR300M
110 IMAGE_SIZE = 16000k
111 CONSOLE = ttyS0,115200
112 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
113 endef
114 TARGET_DEVICES += gl-ar300m
115
116 define Device/gl-domino
117 DEVICE_TITLE := GL Domino Pi
118 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
119 BOARDNAME = DOMINO
120 IMAGE_SIZE = 16000k
121 CONSOLE = ttyATH0,115200
122 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
123 endef
124 TARGET_DEVICES += gl-domino
125
126 define Device/gl-mifi
127 DEVICE_TITLE := GL MIFI
128 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
129 BOARDNAME = GL-MIFI
130 IMAGE_SIZE = 16000k
131 CONSOLE = ttyATH0,115200
132 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
133 endef
134 TARGET_DEVICES += gl-mifi
135
136 define Device/mr12
137 DEVICE_TITLE := Meraki MR12
138 DEVICE_PACKAGES := kmod-spi-gpio
139 BOARDNAME = MR12
140 IMAGE_SIZE = 15680k
141 MTDPARTS = spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2240k(kernel),64k(mac),128k(art)ro,15680k@0x80000(firmware)
142 IMAGE/kernel.bin = append-kernel
143 IMAGE/rootfs.bin = append-rootfs | pad-rootfs
144 IMAGE/sysupgrade.bin = append-rootfs | pad-rootfs | pad-to 13440k | append-kernel | check-size $$$$(IMAGE_SIZE)
145 IMAGES := kernel.bin rootfs.bin sysupgrade.bin
146 endef
147 TARGET_DEVICES += mr12
148
149 define Device/mr16
150 DEVICE_TITLE := Meraki MR16
151 DEVICE_PACKAGES := kmod-spi-gpio
152 BOARDNAME = MR16
153 IMAGE_SIZE = 15680k
154 MTDPARTS = spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2240k(kernel),64k(mac),128k(art)ro,15680k@0x80000(firmware)
155 IMAGE/kernel.bin = append-kernel
156 IMAGE/rootfs.bin = append-rootfs | pad-rootfs
157 IMAGE/sysupgrade.bin = append-rootfs | pad-rootfs | pad-to 13440k | append-kernel | check-size $$$$(IMAGE_SIZE)
158 IMAGES := kernel.bin rootfs.bin sysupgrade.bin
159 endef
160 TARGET_DEVICES += mr16
161
162 define Device/dr531
163 DEVICE_TITLE := Wallys DR531
164 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
165 BOARDNAME = DR531
166 IMAGE_SIZE = 7808k
167 MTDPARTS = spi0.0:192k(u-boot)ro,64k(u-boot-env),64k(partition-table)ro,7808k(firmware),64k(art)ro
168 endef
169 TARGET_DEVICES += dr531
170
171 define Device/wndr3700
172 DEVICE_TITLE := NETGEAR WNDR3700
173 DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-wndr3700-usb
174 BOARDNAME = WNDR3700
175 NETGEAR_KERNEL_MAGIC = 0x33373030
176 NETGEAR_BOARD_ID = WNDR3700
177 IMAGE_SIZE = 7680k
178 MTDPARTS = spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,7680k(firmware),64k(art)ro
179 IMAGES := sysupgrade.bin factory.img factory-NA.img
180 KERNEL := kernel-bin | patch-cmdline | lzma -d20 | netgear-uImage lzma
181 IMAGE/default = append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | append-rootfs | pad-rootfs
182 IMAGE/sysupgrade.bin = $$(IMAGE/default) | check-size $$$$(IMAGE_SIZE)
183 IMAGE/factory.img = $$(IMAGE/default) | netgear-dni | check-size $$$$(IMAGE_SIZE)
184 IMAGE/factory-NA.img = $$(IMAGE/default) | netgear-dni NA | check-size $$$$(IMAGE_SIZE)
185 endef
186
187 define Device/wndr3700v2
188 $(Device/wndr3700)
189 DEVICE_TITLE := NETGEAR WNDR3700 v2
190 NETGEAR_BOARD_ID = WNDR3700v2
191 NETGEAR_KERNEL_MAGIC = 0x33373031
192 NETGEAR_HW_ID = 29763654+16+64
193 IMAGE_SIZE = 15872k
194 MTDPARTS = spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,15872k(firmware),64k(art)ro
195 IMAGES := sysupgrade.bin factory.img
196 endef
197
198 define Device/wndr3800
199 $(Device/wndr3700v2)
200 DEVICE_TITLE := NETGEAR WNDR3800
201 NETGEAR_BOARD_ID = WNDR3800
202 NETGEAR_HW_ID = 29763654+16+128
203 endef
204
205 define Device/wndr3800ch
206 $(Device/wndr3800)
207 DEVICE_TITLE := NETGEAR WNDR3800 (Ch)
208 NETGEAR_BOARD_ID = WNDR3800CH
209 endef
210
211 define Device/wndrmac
212 $(Device/wndr3700v2)
213 DEVICE_TITLE := NETGEAR WNDRMAC
214 NETGEAR_BOARD_ID = WNDRMAC
215 endef
216
217 define Device/wndrmacv2
218 $(Device/wndr3800)
219 DEVICE_TITLE := NETGEAR WNDRMAC v2
220 NETGEAR_BOARD_ID = WNDRMACv2
221 endef
222
223 TARGET_DEVICES += wndr3700 wndr3700v2 wndr3800 wndr3800ch wndrmac wndrmacv2
224
225 define Device/cap324
226 DEVICE_TITLE := PowerCloud CAP324 Cloud AP
227 DEVICE_PACKAGES := uboot-envtools
228 BOARDNAME := CAP324
229 DEVICE_PROFILE := CAP324
230 IMAGE_SIZE = 15296k
231 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,15296k(firmware),640k(certs),64k(nvram),64k(art)ro
232 endef
233
234 TARGET_DEVICES += cap324
235
236 define Device/cap324-nocloud
237 DEVICE_TITLE := PowerCloud CAP324 Cloud AP (No-Cloud)
238 DEVICE_PACKAGES := uboot-envtools
239 BOARDNAME := CAP324
240 DEVICE_PROFILE := CAP324
241 IMAGE_SIZE = 16000k
242 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
243 endef
244
245 TARGET_DEVICES += cap324-nocloud
246
247 define Device/cr3000
248 DEVICE_TITLE := PowerCloud CR3000 Cloud Router
249 DEVICE_PACKAGES := uboot-envtools
250 BOARDNAME := CR3000
251 DEVICE_PROFILE := CR3000
252 IMAGE_SIZE = 7104k
253 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7104k(firmware),640k(certs),64k(nvram),64k(art)ro
254 endef
255
256 TARGET_DEVICES += cr3000
257
258 define Device/cr3000-nocloud
259 DEVICE_TITLE := PowerCloud CR3000 (No-Cloud)
260 DEVICE_PACKAGES := uboot-envtools
261 BOARDNAME := CR3000
262 DEVICE_PROFILE := CR3000
263 IMAGE_SIZE = 7808k
264 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7808k(firmware),64k(art)ro
265 endef
266
267 TARGET_DEVICES += cr3000-nocloud
268
269 define Device/cr5000
270 DEVICE_TITLE := PowerCloud CR5000 Cloud Router
271 DEVICE_PACKAGES := uboot-envtools kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport kmod-usb-core
272 BOARDNAME := CR5000
273 DEVICE_PROFILE := CR5000
274 IMAGE_SIZE = 7104k
275 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7104k(firmware),640k(certs),64k(nvram),64k(art)ro
276 endef
277
278 TARGET_DEVICES += cr5000
279
280 define Device/cr5000-nocloud
281 DEVICE_TITLE := PowerCloud CR5000 (No-Cloud)
282 DEVICE_PACKAGES := uboot-envtools kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport kmod-usb-core
283 BOARDNAME := CR5000
284 DEVICE_PROFILE := CR5000
285 IMAGE_SIZE = 7808k
286 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7808k(firmware),64k(art)ro
287 endef
288
289 TARGET_DEVICES += cr5000-nocloud
290
291 define Device/antminer-s1
292 $(Device/tplink-8mlzma)
293 DEVICE_TITLE := Antminer-S1
294 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-crypto-manager kmod-i2c-gpio-custom kmod-usb-hid
295 BOARDNAME := ANTMINER-S1
296 DEVICE_PROFILE := ANTMINERS1
297 TPLINK_HWID := 0x04440101
298 CONSOLE := ttyATH0,115200
299 endef
300
301 define Device/antminer-s3
302 $(Device/tplink-8mlzma)
303 DEVICE_TITLE := Antminer-S3
304 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-crypto-manager kmod-i2c-gpio-custom kmod-usb-hid
305 BOARDNAME := ANTMINER-S3
306 DEVICE_PROFILE := ANTMINERS3
307 TPLINK_HWID := 0x04440301
308 CONSOLE := ttyATH0,115200
309 endef
310
311 define Device/antrouter-r1
312 $(Device/tplink-8mlzma)
313 DEVICE_TITLE := Antrouter-R1
314 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
315 BOARDNAME := ANTROUTER-R1
316 DEVICE_PROFILE := ANTROUTERR1
317 TPLINK_HWID := 0x44440101
318 CONSOLE := ttyATH0,115200
319 endef
320
321 define Device/el-m150
322 $(Device/tplink-8mlzma)
323 DEVICE_TITLE := EasyLink EL-M150
324 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
325 BOARDNAME := EL-M150
326 DEVICE_PROFILE := ELM150
327 TPLINK_HWID := 0x01500101
328 CONSOLE := ttyATH0,115200
329 endef
330
331 define Device/el-mini
332 $(Device/tplink-8mlzma)
333 DEVICE_TITLE := EasyLink EL-MINI
334 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
335 BOARDNAME := EL-MINI
336 DEVICE_PROFILE := ELMINI
337 TPLINK_HWID := 0x01530001
338 CONSOLE := ttyATH0,115200
339 endef
340 TARGET_DEVICES += antminer-s1 antminer-s3 antrouter-r1 el-m150 el-mini
341
342 define Device/gl-inet-6408A-v1
343 $(Device/tplink-8mlzma)
344 DEVICE_TITLE := GL.iNet 6408
345 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
346 BOARDNAME := GL-INET
347 DEVICE_PROFILE := GLINET
348 TPLINK_HWID := 0x08000001
349 CONSOLE := ttyATH0,115200
350 endef
351
352 define Device/gl-inet-6416A-v1
353 $(Device/tplink-16mlzma)
354 DEVICE_TITLE := GL.iNet 6416
355 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
356 BOARDNAME := GL-INET
357 DEVICE_PROFILE := GLINET
358 TPLINK_HWID := 0x08000001
359 CONSOLE := ttyATH0,115200
360 endef
361 TARGET_DEVICES += gl-inet-6408A-v1 gl-inet-6416A-v1
362
363 define Device/jwap230
364 DEVICE_TITLE := jjPlus JWAP230
365 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
366 BOARDNAME = JWAP230
367 IMAGE_SIZE = 16000k
368 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
369 endef
370 TARGET_DEVICES += jwap230
371
372 define Device/rnx-n360rt
373 $(Device/tplink-4m)
374 DEVICE_TITLE := Rosewill RNX-N360RT
375 BOARDNAME := TL-WR941ND
376 DEVICE_PROFILE := RNXN360RT
377 TPLINK_HWID := 0x09410002
378 TPLINK_HWREV := 0x00420001
379 endef
380 TARGET_DEVICES += rnx-n360rt
381
382 define Device/mc-mac1200r
383 $(Device/tplink-8mlzma)
384 DEVICE_TITLE := MERCURY MAC1200R
385 DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x
386 BOARDNAME := MC-MAC1200R
387 DEVICE_PROFILE := MAC1200R
388 TPLINK_HWID := 0x12000001
389 endef
390 TARGET_DEVICES += mc-mac1200r
391
392 define Device/minibox-v1
393 $(Device/tplink-16mlzma)
394 DEVICE_TITLE := Gainstrong MiniBox V1.0
395 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
396 BOARDNAME := MINIBOX-V1
397 DEVICE_PROFILE := MINIBOXV1
398 TPLINK_HWID := 0x3C000201
399 CONSOLE := ttyATH0,115200
400 endef
401 TARGET_DEVICES += minibox-v1
402
403 define Device/omy-g1
404 $(Device/tplink-16mlzma)
405 DEVICE_TITLE := OMYlink OMY-G1
406 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
407 BOARDNAME := OMY-G1
408 DEVICE_PROFILE := OMYG1
409 TPLINK_HWID := 0x06660101
410 endef
411
412 define Device/omy-x1
413 $(Device/tplink-8mlzma)
414 DEVICE_TITLE := OMYlink OMY-X1
415 BOARDNAME := OMY-X1
416 DEVICE_PROFILE := OMYX1
417 TPLINK_HWID := 0x06660201
418 endef
419 TARGET_DEVICES += omy-g1 omy-x1
420
421 define Device/onion-omega
422 $(Device/tplink-16mlzma)
423 DEVICE_TITLE := Onion Omega
424 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage kmod-i2c-core kmod-i2c-gpio-custom kmod-spi-bitbang kmod-spi-dev kmod-spi-gpio kmod-spi-gpio-custom kmod-usb-serial
425 BOARDNAME := ONION-OMEGA
426 DEVICE_PROFILE := OMEGA
427 TPLINK_HWID := 0x04700001
428 CONSOLE := ttyATH0,115200
429 endef
430 TARGET_DEVICES += onion-omega
431
432 define Device/smart-300
433 $(Device/tplink-8mlzma)
434 DEVICE_TITLE := NC-LINK SMART-300
435 BOARDNAME := SMART-300
436 DEVICE_PROFILE := SMART-300
437 TPLINK_HWID := 0x93410001
438 endef
439 TARGET_DEVICES += smart-300
440
441 define Device/som9331
442 $(Device/tplink-8mlzma)
443 DEVICE_TITLE := OpenEmbed SOM9331
444 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage kmod-i2c-core kmod-i2c-gpio-custom kmod-spi-bitbang kmod-spi-dev kmod-spi-gpio kmod-spi-gpio-custom kmod-usb-serial
445 BOARDNAME := SOM9331
446 DEVICE_PROFILE := SOM9331
447 TPLINK_HWID := 0x04800054
448 CONSOLE := ttyATH0,115200
449 endef
450 TARGET_DEVICES += som9331
451
452 define Device/tellstick-znet-lite
453 $(Device/tplink-16mlzma)
454 DEVICE_TITLE := TellStick ZNet Lite
455 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-acm kmod-usb-serial kmod-usb-serial-pl2303
456 BOARDNAME := TELLSTICK-ZNET-LITE
457 DEVICE_PROFILE := TELLSTICKZNETLITE
458 TPLINK_HWID := 0x00726001
459 CONSOLE := ttyATH0,115200
460 endef
461 TARGET_DEVICES += tellstick-znet-lite
462
463 define Device/oolite
464 $(Device/tplink-16mlzma)
465 DEVICE_TITLE := Gainstrong OOLITE
466 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
467 BOARDNAME := GS-OOLITE
468 DEVICE_PROFILE := OOLITE
469 TPLINK_HWID := 0x3C000101
470 CONSOLE := ttyATH0,115200
471 endef
472 TARGET_DEVICES += oolite
473
474
475 define Device/NBG6616
476 DEVICE_TITLE := ZyXEL NBG6616
477 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-rtc-pcf8563 kmod-ath10k ath10k-firmware-qca988x
478 BOARDNAME = NBG6616
479 KERNEL_SIZE = 2048k
480 IMAGE_SIZE = 15323k
481 MTDPARTS = spi0.0:192k(u-boot)ro,64k(env)ro,64k(RFdata)ro,384k(zyxel_rfsd),384k(romd),64k(header),2048k(kernel),13184k(rootfs),15232k@0x120000(firmware)
482 CMDLINE += mem=128M
483 IMAGES := sysupgrade.bin
484 KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma | jffs2 boot/vmlinux.lzma.uImage
485 IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
486 # We cannot currently build a factory image. It is the sysupgrade image
487 # prefixed with a header (which is actually written into the MTD device).
488 # The header is 2kiB and is filled with 0xff. The format seems to be:
489 # 2 bytes: 0x0000
490 # 2 bytes: checksum of the data partition (big endian)
491 # 4 bytes: length of the contained image file (big endian)
492 # 32 bytes: Firmware Version string (NUL terminated, 0xff padded)
493 # 2 bytes: 0x0000
494 # 2 bytes: checksum over the header partition (big endian)
495 # 32 bytes: Model (e.g. "NBG6616", NUL termiated, 0xff padded)
496 # rest: 0xff padding
497 #
498 # The checksums are calculated by adding up all bytes and if a 16bit
499 # overflow occurs, one is added and the sum is masked to 16 bit:
500 # csum = csum + databyte; if (csum > 0xffff) { csum += 1; csum &= 0xffff };
501 # Should the file have an odd number of bytes then the byte len-0x800 is
502 # used additionally.
503 # The checksum for the header is calcualted over the first 2048 bytes with
504 # the firmware checksum as the placeholder during calculation.
505 #
506 # The header is padded with 0xff to the erase block size of the device.
507 endef
508
509 TARGET_DEVICES += NBG6616
510
511 define Device/c-55
512 DEVICE_TITLE := AirTight Networks C-55
513 DEVICE_PACKAGES := kmod-ath9k
514 BOARDNAME = C-55
515 KERNEL_SIZE = 2048k
516 IMAGE_SIZE = 15872k
517 MTDPARTS = spi0.0:256k(u-boot)ro,128k(u-boot-env)ro,2048k(kernel),13824k(rootfs),13824k(opt)ro,2624k(failsafe)ro,64k(art)ro,15872k@0x60000(firmware)
518 IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
519 endef
520
521 TARGET_DEVICES += c-55
522
523
524 define Build/uImageHiWiFi
525 # Field ih_name needs to start with "tw150v1"
526 mkimage -A $(LINUX_KARCH) \
527 -O linux -T kernel \
528 -C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
529 -n 'tw150v1 $(call toupper,$(LINUX_KARCH)) LEDE Linux-$(LINUX_VERSION)' -d $@ $@.new
530 @mv $@.new $@
531 endef
532
533 define Device/hiwifi-hc6361
534 DEVICE_TITLE := HiWiFi HC6361
535 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage \
536 kmod-fs-ext4 kmod-nls-iso8859-1 e2fsprogs
537 BOARDNAME := HiWiFi-HC6361
538 DEVICE_PROFILE := HIWIFI_HC6361
539 IMAGE_SIZE := 16128k
540 KERNEL := kernel-bin | patch-cmdline | lzma | uImageHiWiFi lzma
541 CONSOLE := ttyATH0,115200
542 MTDPARTS := spi0.0:64k(u-boot)ro,64k(bdinfo)ro,16128k(firmware),64k(backup)ro,64k(art)ro
543 endef
544 TARGET_DEVICES += hiwifi-hc6361
545
546
547 define Build/seama
548 $(STAGING_DIR_HOST)/bin/seama -i $@ $(if $(1),$(1),-m "dev=/dev/mtdblock/1" -m "type=firmware")
549 mv $@.seama $@
550 endef
551
552 define Build/seama-seal
553 $(call Build/seama,-s $@.seama $(1))
554 endef
555
556 define Device/seama
557 CONSOLE := ttyS0,115200
558 LOADER_TYPE := bin
559 BLOCKSIZE := 64k
560 KERNEL := kernel-bin | patch-cmdline | relocate-kernel | lzma
561 KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | seama
562 KERNEL_INITRAMFS_SUFFIX = $$(KERNEL_SUFFIX).seama
563 IMAGES := sysupgrade.bin factory.bin
564
565 # 64 bytes offset:
566 # - 28 bytes seama_header
567 # - 36 bytes of META data (4-bytes aligned)
568 IMAGE/default := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs
569 IMAGE/sysupgrade.bin := \
570 $$(IMAGE/default) | seama | pad-rootfs | \
571 check-size $$$$(IMAGE_SIZE)
572 IMAGE/factory.bin := \
573 $$(IMAGE/default) | seama | pad-rootfs | \
574 seama-seal -m "signature=$$$$(SEAMA_SIGNATURE)" | \
575 check-size $$$$(IMAGE_SIZE)
576 SEAMA_SIGNATURE :=
577 DEVICE_VARS += SEAMA_SIGNATURE
578 endef
579
580 define Device/dir-869-a1
581 $(Device/seama)
582 DEVICE_TITLE := D-Link DIR-869 rev. A1
583 DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x
584 BOARDNAME = DIR-869-A1
585 IMAGE_SIZE = 15872k
586 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(devdata)ro,64k(devconf)ro,15872k(firmware),64k(radiocfg)ro
587 SEAMA_SIGNATURE := wrgac54_dlink.2015_dir869
588 IMAGE/factory.bin := \
589 $$(IMAGE/default) | pad-rootfs -x 64 | \
590 seama | seama-seal -m "signature=$$$$(SEAMA_SIGNATURE)" | \
591 check-size $$$$(IMAGE_SIZE)
592 endef
593
594 define Device/mynet-n600
595 $(Device/seama)
596 DEVICE_TITLE := Western Digital My Net N600
597 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
598 BOARDNAME = MYNET-N600
599 IMAGE_SIZE = 15808k
600 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(devdata)ro,64k(devconf)ro,15872k(firmware),64k(radiocfg)ro
601 SEAMA_SIGNATURE := wrgnd16_wd_db600
602 endef
603
604 define Device/mynet-n750
605 $(Device/seama)
606 DEVICE_TITLE := Western Digital My Net N750
607 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
608 BOARDNAME = MYNET-N750
609 IMAGE_SIZE = 15808k
610 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(devdata)ro,64k(devconf)ro,15872k(firmware),64k(radiocfg)ro
611 SEAMA_SIGNATURE := wrgnd13_wd_av
612 endef
613
614 define Device/qihoo-c301
615 $(Device/seama)
616 DEVICE_TITLE := Qihoo C301
617 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x
618 BOARDNAME = QIHOO-C301
619 IMAGE_SIZE = 15744k
620 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env),64k(devdata),64k(devconf),15744k(firmware),64k(warm_start),64k(action_image_config),64k(radiocfg)ro;spi0.1:15360k(upgrade2),1024k(privatedata)
621 SEAMA_SIGNATURE := wrgac26_qihoo360_360rg
622 endef
623
624 TARGET_DEVICES += dir-869-a1 mynet-n600 mynet-n750 qihoo-c301
625
626 define Build/mkwrggimg
627 $(STAGING_DIR_HOST)/bin/mkwrggimg -b \
628 -i $@ -o $@.imghdr -d /dev/mtdblock/1 \
629 -m $(BOARDNAME) -s $(DAP_SIGNATURE) \
630 -v LEDE -B $(REVISION)
631 mv $@.imghdr $@
632 endef
633
634 define Build/wrgg-pad-rootfs
635 $(STAGING_DIR_HOST)/bin/padjffs2 $(IMAGE_ROOTFS) -c 64 >>$@
636 endef
637
638 define Device/dap-2695-a1
639 DEVICE_TITLE := D-Link DAP-2695 rev. A1
640 DEVICE_PACKAGES := ath10k-firmware-qca988x kmod-ath10k uboot-envtools
641 BOARDNAME = DAP-2695-A1
642 IMAGES := factory.img sysupgrade.bin
643 IMAGE_SIZE = 15360k
644 IMAGE/factory.img = append-kernel | pad-offset 65536 160 | append-rootfs | wrgg-pad-rootfs | mkwrggimg | check-size $$$$(IMAGE_SIZE)
645 IMAGE/sysupgrade.bin = append-kernel | pad-offset 65536 160 | mkwrggimg | append-rootfs | wrgg-pad-rootfs | check-size $$$$(IMAGE_SIZE)
646 KERNEL := kernel-bin | patch-cmdline | relocate-kernel | lzma
647 KERNEL_INITRAMFS := $$(KERNEL) | mkwrggimg
648 MTDPARTS = spi0.0:256k(bootloader)ro,64k(bdcfg)ro,64k(rgdb)ro,64k(langpack)ro,15360k(firmware),448k(captival)ro,64k(certificate)ro,64k(radiocfg)ro
649 DAP_SIGNATURE := wapac02_dkbs_dap2695
650 DEVICE_VARS += DAP_SIGNATURE
651 endef
652
653 TARGET_DEVICES += dap-2695-a1
654
655 define Build/mkbuffaloimg
656 $(STAGING_DIR_HOST)/bin/mkbuffaloimg -B $(BOARDNAME) \
657 -R $$(($(subst k, * 1024,$(ROOTFS_SIZE)))) \
658 -K $$(($(subst k, * 1024,$(KERNEL_SIZE)))) \
659 -i $@ -o $@.new
660 mv $@.new $@
661 endef
662
663 define Device/bhr-4grv2
664 DEVICE_TITLE := Buffalo BHR-4GRV2
665 BOARDNAME := BHR-4GRV2
666 ROOTFS_SIZE := 14528k
667 KERNEL_SIZE := 1472k
668 IMAGE_SIZE := 16000k
669 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware)
670 IMAGES := sysupgrade.bin factory.bin
671 IMAGE/sysupgrade.bin = append-rootfs | pad-rootfs | pad-to $$$$(ROOTFS_SIZE) | append-kernel | check-size $$$$(IMAGE_SIZE)
672 IMAGE/factory.bin = append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | mkbuffaloimg
673 endef
674 TARGET_DEVICES += bhr-4grv2