0066-tools-tplink-safeloader-split-CPE210-from-CPE510-profile.patch 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Thu, 9 Jun 2016 05:03:35 +0200
  3. Subject: tools/tplink-safeloader: split CPE210 from CPE510 profile
  4. The CPE210 was still described for the OEM upgrade as compatible,
  5. even the wireless configuration isn't compatible anymore between
  6. both series (2ghz and 5ghz).
  7. Update the CPE210 image profile to use the new profile.
  8. Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
  9. Backport of LEDE 824147960569f2c1cd22140c9074c62c3df911a5
  10. diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
  11. index 75083f9b698ba8a438256209a34369eb626a3b3d..bb2bb94e04ee8f59db62907ace49952061b411dc 100644
  12. --- a/target/linux/ar71xx/image/Makefile
  13. +++ b/target/linux/ar71xx/image/Makefile
  14. @@ -2111,7 +2111,7 @@ $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V2,tl-wr1043nd-v2,TL-WR10
  15. $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V3,tl-wr1043nd-v3,TL-WR1043ND-v2,ttyS0,115200,0x10430003,1,8M))
  16. $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR2543,tl-wr2543-v1,TL-WR2543N,ttyS0,115200,0x25430001,1,8Mlzma,-v 3.13.99))
  17. -$(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE210_220,cpe210-220,CPE210,ttyS0,115200,$$(cpe510_mtdlayout),CPE510))
  18. +$(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE210_220,cpe210-220,CPE210,ttyS0,115200,$$(cpe510_mtdlayout),CPE210))
  19. $(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510_520,cpe510-520,CPE510,ttyS0,115200,$$(cpe510_mtdlayout),CPE510))
  20. $(eval $(call SingleProfile,UAPPRO,64k,UAPPRO,ubnt-uap-pro,UAP-PRO,ttyS0,115200,BZ,BZ,ar934x))
  21. diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c
  22. index 2e204aa2335e55515a60a1f5c08ca1b499eb9287..4938f74eecd122265072390e1c6b8cadb09844d0 100644
  23. --- a/tools/firmware-utils/src/tplink-safeloader.c
  24. +++ b/tools/firmware-utils/src/tplink-safeloader.c
  25. @@ -163,6 +163,15 @@ static const struct flash_partition_entry c2600_partitions[] = {
  26. };
  27. /**
  28. + The support list for CPE210/220
  29. +*/
  30. +static const char cpe210_support_list[] =
  31. + "SupportList:\r\n"
  32. + "CPE210(TP-LINK|UN|N300-2):1.0\r\n"
  33. + "CPE210(TP-LINK|UN|N300-2):1.1\r\n"
  34. + "CPE220(TP-LINK|UN|N300-2):1.0\r\n"
  35. + "CPE220(TP-LINK|UN|N300-2):1.1\r\n";
  36. +/**
  37. The support list for CPE210/220/510/520
  38. */
  39. static const char cpe510_support_list[] =
  40. @@ -170,11 +179,7 @@ static const char cpe510_support_list[] =
  41. "CPE510(TP-LINK|UN|N300-5):1.0\r\n"
  42. "CPE510(TP-LINK|UN|N300-5):1.1\r\n"
  43. "CPE520(TP-LINK|UN|N300-5):1.0\r\n"
  44. - "CPE520(TP-LINK|UN|N300-5):1.1\r\n"
  45. - "CPE210(TP-LINK|UN|N300-2):1.0\r\n"
  46. - "CPE210(TP-LINK|UN|N300-2):1.1\r\n"
  47. - "CPE220(TP-LINK|UN|N300-2):1.0\r\n"
  48. - "CPE220(TP-LINK|UN|N300-2):1.1\r\n";
  49. + "CPE520(TP-LINK|UN|N300-5):1.1\r\n";
  50. /**
  51. The support list for C2600
  52. @@ -511,12 +516,18 @@ static void * generate_sysupgrade_image_c2600(const struct flash_partition_entry
  53. }
  54. /** Generates an image for CPE210/220/510/520 and writes it to a file */
  55. -static void do_cpe510(const char *output, const char *kernel_image, const char *rootfs_image, uint32_t rev, bool add_jffs2_eof, bool sysupgrade) {
  56. +static void do_cpe(const char *output,
  57. + const char *kernel_image,
  58. + const char *rootfs_image,
  59. + uint32_t rev,
  60. + bool add_jffs2_eof,
  61. + bool sysupgrade,
  62. + const char *support_list) {
  63. struct image_partition_entry parts[6] = {};
  64. parts[0] = make_partition_table(cpe510_partitions);
  65. parts[1] = make_soft_version(rev);
  66. - parts[2] = make_support_list(cpe510_support_list,false);
  67. + parts[2] = make_support_list(support_list, false);
  68. parts[3] = read_file("os-image", kernel_image, false);
  69. parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof);
  70. @@ -549,7 +560,7 @@ static void do_c2600(const char *output, const char *kernel_image, const char *r
  71. parts[0] = make_partition_table(c2600_partitions);
  72. parts[1] = make_soft_version(rev);
  73. - parts[2] = make_support_list(c2600_support_list,true);
  74. + parts[2] = make_support_list(c2600_support_list, true);
  75. parts[3] = read_file("os-image", kernel_image, false);
  76. parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof);
  77. @@ -656,8 +667,10 @@ int main(int argc, char *argv[]) {
  78. if (!output)
  79. error(1, 0, "no output filename has been specified");
  80. - if (strcmp(board, "CPE510") == 0)
  81. - do_cpe510(output, kernel_image, rootfs_image, rev, add_jffs2_eof, sysupgrade);
  82. + if (strcmp(board, "CPE210") == 0)
  83. + do_cpe(output, kernel_image, rootfs_image, rev, add_jffs2_eof, sysupgrade, cpe210_support_list);
  84. + else if (strcmp(board, "CPE510") == 0)
  85. + do_cpe(output, kernel_image, rootfs_image, rev, add_jffs2_eof, sysupgrade, cpe510_support_list);
  86. else if (strcmp(board, "C2600") == 0)
  87. do_c2600(output, kernel_image, rootfs_image, rev, add_jffs2_eof, sysupgrade);
  88. else