aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/image/tp-link.mk
blob: a3af519efe33c4bfd0f6e95e2858738ef245f352 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT TPLINK_HEADER_VERSION TPLINK_BOARD_NAME

# combine kernel and rootfs into one image
# mktplinkfw <type> <optional extra arguments to mktplinkfw binary>
# <type> is "sysupgrade" or "factory"
#
# -a align the rootfs start on an <align> bytes boundary
# -j add jffs2 end-of-filesystem markers
# -s strip padding from end of the image
# -X reserve <size> bytes in the firmware image (hexval prefixed with 0x)
define Build/mktplinkfw
	-$(STAGING_DIR_HOST)/bin/mktplinkfw \
		-H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) -N OpenWrt -V $(REVISION) \
		-m $(TPLINK_HEADER_VERSION) \
		-k $(word 1,$^) \
		-r $@ \
		-o $@.new \
		-j -X 0x40000 \
		-a $(call rootfs_align,$(FILESYSTEM)) \
		$(wordlist 2,$(words $(1)),$(1)) \
		$(if $(findstring sysupgrade,$(word 1,$(1))),-s) && mv $@.new $@ || rm -f $@
endef

# mktplinkfw-initramfs <optional extra arguments to mktplinkfw binary>
#
# -c combined image
define Build/mktplinkfw-initramfs
	$(STAGING_DIR_HOST)/bin/mktplinkfw \
		-H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) -N OpenWrt -V $(REVISION) $(1) \
		-m $(TPLINK_HEADER_VERSION) \
		-k $@ \
		-o $@.new \
		-s -S \
		-c
	@mv $@.new $@
endef

define Build/tplink-safeloader
       -$(STAGING_DIR_HOST)/bin/tplink-safeloader \
		-B $(TPLINK_BOARD_NAME) \
		-V $(REVISION) \
		-k $(word 1,$^) \
		-r $@ \
		-o $@.new \
		-j \
		$(wordlist 2,$(words $(1)),$(1)) \
		$(if $(findstring sysupgrade,$(word 1,$(1))),-S) && mv $@.new $@ || rm -f $@
endef

define Device/tplink
  TPLINK_HWREV := 0x1
  TPLINK_HEADER_VERSION := 1
  LOADER_TYPE := gz
  KERNEL := kernel-bin | patch-cmdline | lzma
  KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | mktplinkfw-initramfs
  IMAGES := sysupgrade.bin factory.bin
  IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade
  IMAGE/factory.bin := append-rootfs | mktplinkfw factory
endef

define Device/tplink-nolzma
$(Device/tplink)
  LOADER_FLASH_OFFS := 0x22000
  COMPILE := loader-$(1).gz
  COMPILE/loader-$(1).gz := loader-okli-compile
  KERNEL := copy-file $(KDIR)/vmlinux.bin.lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1)
  KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux-initramfs.bin.lzma | loader-kernel-cmdline | mktplinkfw-initramfs
endef

define Device/tplink-4m
$(Device/tplink-nolzma)
  TPLINK_FLASHLAYOUT := 4M
  IMAGE_SIZE := 3904k
endef

define Device/tplink-8m
$(Device/tplink-nolzma)
  TPLINK_FLASHLAYOUT := 8M
  IMAGE_SIZE := 7936k
endef

define Device/tplink-4mlzma
$(Device/tplink)
  TPLINK_FLASHLAYOUT := 4Mlzma
  IMAGE_SIZE := 3904k
endef

define Device/tplink-8mlzma
$(Device/tplink)
  TPLINK_FLASHLAYOUT := 8Mlzma
  IMAGE_SIZE := 7936k
endef

define Device/tplink-16mlzma
$(Device/tplink)
  TPLINK_FLASHLAYOUT := 16Mlzma
  IMAGE_SIZE := 15872k
endef

define Device/cpe210-220
  MTDPARTS := spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k@0x40000(firmware)
  IMAGE_SIZE := 7680k
  BOARDNAME := CPE210
  TPLINK_BOARD_NAME := CPE510
  DEVICE_PROFILE := CPE510
  LOADER_TYPE := elf
  KERNEL := kernel-bin | patch-cmdline | lzma | loader-kernel
  IMAGES := sysupgrade.bin factory.bin
  IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade
  IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
endef

define Device/cpe510-520
$(Device/cpe210-220)
  BOARDNAME := CPE510
endef
TARGET_DEVICES += cpe210-220 cpe510-520

define Device/tl-wdr4300-v1
$(Device/tplink-8mlzma)
  BOARDNAME = TL-WDR4300
  DEVICE_PROFILE = TLWDR4300
  TPLINK_HWID := 0x43000001
endef

define Device/tl-wdr3500-v1
$(Device/tl-wdr4300-v1)
  BOARDNAME = TL-WDR3500
  TPLINK_HWID := 0x35000001
endef

define Device/tl-wdr3600-v1
$(Device/tl-wdr4300-v1)
  TPLINK_HWID := 0x36000001
endef

define Device/tl-wdr4300-v1-il
$(Device/tl-wdr4300-v1)
  TPLINK_HWID := 0x43008001
endef

define Device/tl-wdr4310-v1
$(Device/tl-wdr4300-v1)
  TPLINK_HWID := 0x43100001
endef

define Device/mw4530r-v1
$(Device/tl-wdr4300-v1)
  TPLINK_HWID := 0x45300001
endef
TARGET_DEVICES += tl-wdr3500-v1 tl-wdr3600-v1 tl-wdr4300-v1 tl-wdr4300-v1-il tl-wdr4310-v1 mw4530r-v1

define Device/tl-wdr6500-v2
$(Device/tplink-8mlzma)
  KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma
  KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | uImage lzma | mktplinkfw-initramfs
  BOARDNAME = TL-WDR6500-v2
  DEVICE_PROFILE = TLWDR6500V2
  TPLINK_HWID := 0x65000002
  TPLINK_HEADER_VERSION := 2
endef
TARGET_DEVICES += tl-wdr6500-v2

define Device/tl-wdr3320-v2
$(Device/tplink-4mlzma)
  BOARDNAME = TL-WDR3320-v2
  DEVICE_PROFILE = TLWDR3320V2
  TPLINK_HWID := 0x33200002
  TPLINK_HEADER_VERSION := 2
endef
TARGET_DEVICES += tl-wdr3320-v2

define Device/archer-c5-v1
    $(Device/tplink-16mlzma)
    BOARDNAME := ARCHER-C5
    DEVICE_PROFILE := ARCHERC7
    TPLINK_HWID := 0xc5000001
endef

define Device/archer-c7-v1
    $(Device/tplink-8mlzma)
    BOARDNAME := ARCHER-C7
    DEVICE_PROFILE := ARCHERC7
    TPLINK_HWID := 0x75000001
endef

define Device/archer-c7-v2
    $(Device/tplink-16mlzma)
    BOARDNAME := ARCHER-C7-V2
    DEVICE_PROFILE := ARCHERC7
    TPLINK_HWID := 0xc7000002
    IMAGE/factory.bin := append-rootfs | mktplinkfw factory -C US
endef

define Device/tl-wdr7500-v3
    $(Device/tplink-8mlzma)
    BOARDNAME := ARCHER-C7
    DEVICE_PROFILE := ARCHERC7
    TPLINK_HWID := 0x75000003
endef
TARGET_DEVICES += archer-c5-v1 archer-c7-v1 archer-c7-v2 tl-wdr7500-v3

define Device/tl-mr10u-v1
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-MR10U
    DEVICE_PROFILE := TLMR10U
    TPLINK_HWID := 0x00100101
    CONSOLE := ttyATH0,115200
endef

define Device/tl-mr11u-v1
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-MR11U
    DEVICE_PROFILE := TLMR11U
    TPLINK_HWID := 0x00110101
    CONSOLE := ttyATH0,115200
endef

define Device/tl-mr11u-v2
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-MR11U
    DEVICE_PROFILE := TLMR11U
    TPLINK_HWID := 0x00110102
    CONSOLE := ttyATH0,115200
endef

define Device/tl-mr12u-v1
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-MR13U
    DEVICE_PROFILE := TLMR12U
    TPLINK_HWID := 0x00120101
    CONSOLE := ttyATH0,115200
endef

define Device/tl-mr13u-v1
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-MR13U
    DEVICE_PROFILE := TLMR13U
    TPLINK_HWID := 0x00130101
    CONSOLE := ttyATH0,115200
endef
TARGET_DEVICES += tl-mr10u-v1 tl-mr11u-v1 tl-mr11u-v2 tl-mr12u-v1 tl-mr13u-v1

define Device/tl-mr3020-v1
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-MR3020
    DEVICE_PROFILE := TLMR3020
    TPLINK_HWID := 0x30200001
    CONSOLE := ttyATH0,115200
endef

define Device/tl-mr3040-v1
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-MR3040
    DEVICE_PROFILE := TLMR3040
    TPLINK_HWID := 0x30400001
    CONSOLE := ttyATH0,115200
endef

define Device/tl-mr3040-v2
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-MR3040-v2
    DEVICE_PROFILE := TLMR3040
    TPLINK_HWID := 0x30400002
    CONSOLE := ttyATH0,115200
endef

define Device/tl-mr3220-v1
    $(Device/tplink-4m)
    BOARDNAME := TL-MR3220
    DEVICE_PROFILE := TLMR3220
    TPLINK_HWID := 0x32200001
endef

define Device/tl-mr3220-v2
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-MR3220-v2
    DEVICE_PROFILE := TLMR3220
    TPLINK_HWID := 0x32200002
    CONSOLE := ttyATH0,115200
endef

define Device/tl-mr3420-v1
    $(Device/tplink-4m)
    BOARDNAME := TL-MR3420
    DEVICE_PROFILE := TLMR3420
    TPLINK_HWID := 0x34200001
endef

define Device/tl-mr3420-v2
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-MR3420-v2
    DEVICE_PROFILE := TLMR3420
    TPLINK_HWID := 0x34200002
endef
TARGET_DEVICES += tl-mr3020-v1 tl-mr3040-v1 tl-mr3040-v2 tl-mr3220-v1 tl-mr3220-v2 tl-mr3420-v1 tl-mr3420-v2

define Device/tl-wr703n-v1
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WR703N
    DEVICE_PROFILE := TLWR703
    TPLINK_HWID := 0x07030101
    CONSOLE := ttyATH0,115200
endef

define Device/tl-wr710n-v1
    $(Device/tplink-8mlzma)
    BOARDNAME := TL-WR710N
    DEVICE_PROFILE := TLWR710
    TPLINK_HWID := 0x07100001
    CONSOLE := ttyATH0,115200
endef

define Device/tl-wr710n-v2
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WR710N
    DEVICE_PROFILE := TLWR710
    TPLINK_HWID := 0x07100002
    CONSOLE := ttyATH0,115200
endef

define Device/tl-wr710n-v2.1
    $(Device/tplink-8mlzma)
    BOARDNAME := TL-WR710N
    DEVICE_PROFILE := TLWR710
    TPLINK_HWID := 0x07100002
    TPLINK_HWREV := 0x00000002
    CONSOLE := ttyATH0,115200
endef

define Device/tl-wr720n-v3
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WR720N-v3
    DEVICE_PROFILE := TLWR720
    TPLINK_HWID := 0x07200103
    CONSOLE := ttyATH0,115200
endef

define Device/tl-wr720n-v4
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WR720N-v3
    DEVICE_PROFILE := TLWR720
    TPLINK_HWID := 0x07200104
    CONSOLE := ttyATH0,115200
endef
TARGET_DEVICES += tl-wr703n-v1 tl-wr710n-v1 tl-wr710n-v2 tl-wr710n-v2.1 tl-wr720n-v3 tl-wr720n-v4

define Device/tl-wr740n-v1
    $(Device/tplink-4m)
    BOARDNAME := TL-WR741ND
    DEVICE_PROFILE := TLWR740
    TPLINK_HWID := 0x07400001
endef

define Device/tl-wr740n-v3
    $(Device/tplink-4m)
    BOARDNAME := TL-WR741ND
    DEVICE_PROFILE := TLWR740
    TPLINK_HWID := 0x07400003
endef

define Device/tl-wr740n-v4
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WR741ND-v4
    DEVICE_PROFILE := TLWR740
    TPLINK_HWID := 0x07400004
    CONSOLE := ttyATH0,115200
endef

define Device/tl-wr740n-v5
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WR741ND-v4
    DEVICE_PROFILE := TLWR740
    TPLINK_HWID := 0x07400005
    CONSOLE := ttyATH0,115200
endef

define Device/tl-wr740n-v6
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WR841N-v9
    DEVICE_PROFILE := TLWR740
    TPLINK_HWID := 0x07400006
endef

define Device/tl-wr741nd-v1
    $(Device/tplink-4m)
    BOARDNAME := TL-WR741ND
    DEVICE_PROFILE := TLWR741
    TPLINK_HWID := 0x07410001
endef

define Device/tl-wr741nd-v2
    $(Device/tplink-4m)
    BOARDNAME := TL-WR741ND
    DEVICE_PROFILE := TLWR741
    TPLINK_HWID := 0x07410001
endef

define Device/tl-wr741nd-v4
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WR741ND-v4
    DEVICE_PROFILE := TLWR741
    TPLINK_HWID := 0x07410004
    CONSOLE := ttyATH0,115200
endef

define Device/tl-wr741nd-v5
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WR741ND-v4
    DEVICE_PROFILE := TLWR741
    TPLINK_HWID := 0x07400005
    CONSOLE := ttyATH0,115200
endef

define Device/tl-wr810n
    $(Device/tplink-8mlzma)
    BOARDNAME := TL-WR810N
    DEVICE_PROFILE := TLWR810
    TPLINK_HWID := 0x08100001
endef
TARGET_DEVICES += tl-wr810n

define Device/tl-wr743nd-v1
    $(Device/tplink-4m)
    BOARDNAME := TL-WR741ND
    DEVICE_PROFILE := TLWR743
    TPLINK_HWID := 0x07430001
endef

define Device/tl-wr743nd-v2
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WR741ND-v4
    DEVICE_PROFILE := TLWR743
    TPLINK_HWID := 0x07430002
    CONSOLE := ttyATH0,115200
endef
TARGET_DEVICES += tl-wr740n-v1 tl-wr740n-v3 tl-wr740n-v4 tl-wr740n-v5 tl-wr740n-v6 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr741nd-v5 tl-wr743nd-v1 tl-wr743nd-v2

define Device/tl-wr841-v1.5
    $(Device/tplink-4m)
    BOARDNAME := TL-WR841N-v1.5
    DEVICE_PROFILE := TLWR841
    TPLINK_HWID := 0x08410002
    TPLINK_HWREV := 2
endef

define Device/tl-wr841-v3
    $(Device/tplink-4m)
    BOARDNAME := TL-WR941ND
    DEVICE_PROFILE := TLWR841
    TPLINK_HWID := 0x08410003
    TPLINK_HWREV := 3
endef

define Device/tl-wr841-v5
    $(Device/tplink-4m)
    BOARDNAME := TL-WR741ND
    DEVICE_PROFILE := TLWR841
    TPLINK_HWID := 0x08410005
endef

define Device/tl-wr841-v7
    $(Device/tplink-4m)
    BOARDNAME := TL-WR841N-v7
    DEVICE_PROFILE := TLWR841
    TPLINK_HWID := 0x08410007
endef

define Device/tl-wr841-v8
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WR841N-v8
    DEVICE_PROFILE := TLWR841
    TPLINK_HWID := 0x08410008
endef

define Device/tl-wr841-v9
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WR841N-v9
    DEVICE_PROFILE := TLWR841
    TPLINK_HWID := 0x08410009
endef

define Device/tl-wr841-v10
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WR841N-v9
    DEVICE_PROFILE := TLWR841
    TPLINK_HWID := 0x08410010
endef

define Device/tl-wr841-v11
   $(Device/tplink-4mlzma)
   BOARDNAME := TL-WR841N-v9
   DEVICE_PROFILE := TLWR841
   TPLINK_HWID := 0x08410011
endef

define Device/tl-wr842n-v1
    $(Device/tplink-8m)
    BOARDNAME := TL-MR3420
    DEVICE_PROFILE := TLWR842
    TPLINK_HWID := 0x08420001
endef

define Device/tl-wr842n-v2
    $(Device/tplink-8mlzma)
    BOARDNAME := TL-WR842N-v2
    DEVICE_PROFILE := TLWR842
    TPLINK_HWID := 0x8420002
endef

define Device/tl-wr842n-v3
    $(Device/tplink-16mlzma)
    BOARDNAME := TL-WR842N-v3
    DEVICE_PROFILE := TLWR842
    TPLINK_HWID := 0x08420003
endef

define Device/tl-wr843nd-v1
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WR841N-v8
    DEVICE_PROFILE := TLWR843
    TPLINK_HWID := 0x08430001
endef

define Device/tl-wr847n-v8
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WR841N-v8
    DEVICE_PROFILE := TLWR841
    TPLINK_HWID := 0x08470008
endef
TARGET_DEVICES += tl-wr841-v1.5 tl-wr841-v3 tl-wr841-v5 tl-wr841-v7 tl-wr841-v8 tl-wr841-v9 tl-wr841-v10 tl-wr841-v11 tl-wr842n-v1 tl-wr842n-v2 tl-wr842n-v3 tl-wr843nd-v1 tl-wr847n-v8

define Device/tl-wr941nd-v2
    $(Device/tplink-4m)
    BOARDNAME := TL-WR941ND
    DEVICE_PROFILE := TLWR941
    TPLINK_HWID := 0x09410002
    TPLINK_HWREV := 2
endef

define Device/tl-wr941nd-v3
    $(Device/tplink-4m)
    BOARDNAME := TL-WR941ND
    DEVICE_PROFILE := TLWR941
    TPLINK_HWID := 0x09410002
    TPLINK_HWREV := 2
endef

define Device/tl-wr941nd-v4
    $(Device/tplink-4m)
    BOARDNAME := TL-WR741ND
    DEVICE_PROFILE := TLWR941
    TPLINK_HWID := 0x09410004
endef

define Device/tl-wr941nd-v5
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WR941ND-v5
    DEVICE_PROFILE := TLWR941
    TPLINK_HWID := 0x09410005
endef

define Device/tl-wr941nd-v6
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WR941ND-v6
    DEVICE_PROFILE := TLWR941
    TPLINK_HWID := 0x09410006
endef

# Chinese version (unlike European) is similar to the TL-WDR3500
define Device/tl-wr941nd-v6-cn
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WDR3500
    DEVICE_PROFILE := TLWR941
    TPLINK_HWID := 0x09410006
endef
TARGET_DEVICES += tl-wr941nd-v2 tl-wr941nd-v3 tl-wr941nd-v4 tl-wr941nd-v5 tl-wr941nd-v6 tl-wr941nd-v6-cn

define Device/tl-wr1041n-v2
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WR1041N-v2
    DEVICE_PROFILE := TLWR1041
    TPLINK_HWID := 0x10410002
endef
TARGET_DEVICES += tl-wr1041n-v2

define Device/tl-wr1043nd-v1
    $(Device/tplink-8m)
    BOARDNAME := TL-WR1043ND
    DEVICE_PROFILE := TLWR1043
    TPLINK_HWID := 0x10430001
endef

define Device/tl-wr1043nd-v2
    $(Device/tplink-8mlzma)
    BOARDNAME := TL-WR1043ND-v2
    DEVICE_PROFILE := TLWR1043
    TPLINK_HWID := 0x10430002
endef

define Device/tl-wr1043nd-v3
    $(Device/tplink-8mlzma)
    BOARDNAME := TL-WR1043ND-v2
    DEVICE_PROFILE := TLWR1043
    TPLINK_HWID := 0x10430003
endef
TARGET_DEVICES += tl-wr1043nd-v1 tl-wr1043nd-v2 tl-wr1043nd-v3

define Device/tl-wr2543-v1
    $(Device/tplink-8mlzma)
    BOARDNAME := TL-WR2543N
    DEVICE_PROFILE := TLWR2543
    TPLINK_HWID := 0x25430001
    IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade -v 3.13.99
    IMAGE/factory.bin := append-rootfs | mktplinkfw factory -v 3.13.99
endef
TARGET_DEVICES += tl-wr2543-v1

define Device/tl-wdr4900-v2
    $(Device/tplink-8mlzma)
    BOARDNAME := TL-WDR4900-v2
    DEVICE_PROFILE := TLWDR4900V2
    TPLINK_HWID := 0x49000002
endef
TARGET_DEVICES += tl-wdr4900-v2

define Device/tl-wa701nd-v1
    $(Device/tplink-4m)
    BOARDNAME := TL-WA901ND
    DEVICE_PROFILE := TLWA701
    TPLINK_HWID := 0x07010001
endef

define Device/tl-wa701nd-v2
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WA701ND-v2
    DEVICE_PROFILE := TLWA701
    TPLINK_HWID := 0x07010002
    CONSOLE := ttyATH0,115200
endef

define Device/tl-wa730re-v1
    $(Device/tplink-4m)
    BOARDNAME := TL-WA901ND
    DEVICE_PROFILE := TLWA730RE
    TPLINK_HWID := 0x07300001
endef

define Device/tl-wa750re-v1
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WA750RE
    DEVICE_PROFILE := TLWA750
    TPLINK_HWID := 0x07500001
endef

define Device/tl-wa7510n
    $(Device/tplink-4m)
    BOARDNAME := TL-WA7510N
    DEVICE_PROFILE := TLWA7510
    TPLINK_HWID := 0x75100001
endef
TARGET_DEVICES += tl-wa701nd-v1 tl-wa701nd-v2 tl-wa730re-v1 tl-wa750re-v1 tl-wa7510n

define Device/tl-wa801nd-v1
    $(Device/tplink-4m)
    BOARDNAME := TL-WA901ND
    DEVICE_PROFILE := TLWA801
    TPLINK_HWID := 0x08010001
endef

define Device/tl-wa801nd-v2
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WA801ND-v2
    DEVICE_PROFILE := TLWA801
    TPLINK_HWID := 0x08010002
endef

define Device/tl-wa801nd-v3
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WA801ND-v3
    DEVICE_PROFILE := TLWA801
    TPLINK_HWID := 0x08010003
endef

define Device/tl-wa830re-v1
    $(Device/tplink-4m)
    BOARDNAME := TL-WA901ND
    DEVICE_PROFILE := TLWA830
    TPLINK_HWID := 0x08300010
endef

define Device/tl-wa830re-v2
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WA830RE-v2
    DEVICE_PROFILE := TLWA830
    TPLINK_HWID := 0x08300002
endef

define Device/tl-wa850re-v1
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WA850RE
    DEVICE_PROFILE := TLWA850
    TPLINK_HWID := 0x08500001
endef

define Device/tl-wa860re-v1
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WA860RE
    DEVICE_PROFILE := TLWA860
    TPLINK_HWID := 0x08600001
endef
TARGET_DEVICES += tl-wa801nd-v1 tl-wa801nd-v2 tl-wa801nd-v3 tl-wa830re-v1 tl-wa830re-v2 tl-wa850re-v1 tl-wa860re-v1

define Device/tl-wa901nd-v1
    $(Device/tplink-4m)
    BOARDNAME := TL-WA901ND
    DEVICE_PROFILE := TLWA901
    TPLINK_HWID := 0x09010001
endef

define Device/tl-wa901nd-v2
    $(Device/tplink-4m)
    BOARDNAME := TL-WA901ND-v2
    DEVICE_PROFILE := TLWA901
    TPLINK_HWID := 0x09010002
endef

define Device/tl-wa901nd-v3
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WA901ND-v3
    DEVICE_PROFILE := TLWA901
    TPLINK_HWID := 0x09010003
endef

define Device/tl-wa901nd-v4
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WA901ND-v4
    DEVICE_PROFILE := TLWA901
    TPLINK_HWID := 0x09010004
endef

TARGET_DEVICES += tl-wa901nd-v1 tl-wa901nd-v2 tl-wa901nd-v3 tl-wa901nd-v4

define Device/tl-wa7210n-v2
    $(Device/tplink-4mlzma)
    BOARDNAME := TL-WA7210N-v2
    DEVICE_PROFILE := TLWA7210
    TPLINK_HWID := 0x72100002
    CONSOLE := ttyATH0,115200
endef
TARGET_DEVICES += tl-wa7210n-v2