smopro

Untitled

Mar 14th, 2020
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.21 KB | None | 0 0
  1. diff --git a/Makefile b/Makefile
  2. index 2d314a7..6c64c53 100644
  3. --- a/Makefile
  4. +++ b/Makefile
  5. @@ -272,7 +272,8 @@ comfast_cf-e520n \
  6.  comfast_cf-e530n:
  7.     @$(call build,64,1,ETH_CONFIG=_s27)
  8.  
  9. -d-link_dir-505_a1:
  10. +d-link_dir-505_a1 \
  11. +zsun_sd100:
  12.     @$(call build,64,1)
  13.  
  14.  dragino_ms14:
  15. diff --git a/u-boot/Makefile b/u-boot/Makefile
  16. index 1c02897..e4a8fcc 100644
  17. --- a/u-boot/Makefile
  18. +++ b/u-boot/Makefile
  19. @@ -852,6 +852,11 @@ zbtlink_zbt-we1526: qca953x_common
  20.     @$(call define_add,CFG_ATH_GMAC_NMACS,2)
  21.     @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
  22.  
  23. +zsun_sd100: ar933x_common
  24. +   @$(call config_init,Zsun SD100,sd100,16,22,0,QCA_AR9331_SOC)
  25. +   @$(call define_add,CONFIG_FOR_ZSUN_SD100,1)
  26. +   @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
  27. +
  28.  # =============
  29.  # CLEAN TARGETS
  30.  # =============
  31. diff --git a/u-boot/include/configs/ap121.h b/u-boot/include/configs/ap121.h
  32. index fac001f..8dc3a01 100644
  33. --- a/u-boot/include/configs/ap121.h
  34. +++ b/u-boot/include/configs/ap121.h
  35. @@ -156,6 +156,11 @@
  36.  
  37.     #define CONFIG_QCA_GPIO_MASK_LED_ACT_L  GPIO27
  38.  
  39. +#elif defined(CONFIG_FOR_ZSUN_SD100)
  40. +   #define CONFIG_QCA_GPIO_MASK_LED_ACT_H  GPIO0
  41. +   #define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO18
  42. +   #define CONFIG_QCA_GPIO_MASK_OUT_INIT_L GPIO21
  43. +
  44.  #endif
  45.  
  46.  /*
  47. @@ -243,6 +248,12 @@
  48.                 "rootfstype=squashfs init=/sbin/init "\
  49.                 "mtdparts=ar7240-nor0:128k(u-boot),64k(u-boot-env),16128k(firmware),64k(art)"
  50.  
  51. +#elif defined(CONFIG_FOR_ZSUN_SD100)
  52. +
  53. +   #define CONFIG_BOOTARGS "console=ttyATH0,115200 root=31:04 "\
  54. +               "rootfstype=squashfs,jffs2 noinitrd "\
  55. +               "mtdparts=spi0.0:64k(u-boot)ro,64k(u-boot-env)ro,16128k(firmware),64k(nvram)ro,64k(art)ro"
  56. +
  57.  #endif
  58.  
  59.  /*
  60. @@ -330,6 +341,11 @@
  61.     #define CFG_ENV_SIZE        0x8000
  62.     #define CFG_ENV_SECT_SIZE   0x10000
  63.  
  64. +#elif defined(CONFIG_FOR_ZSUN_SD100)
  65. +
  66. +   #define CFG_ENV_ADDR        0x9F010000
  67. +   #define CFG_ENV_SIZE        0x10000
  68. +
  69.  #else
  70.  
  71.     #define CFG_ENV_ADDR        0x9F01EC00
  72. @@ -359,7 +375,8 @@
  73.      defined(CONFIG_FOR_ALFA_NETWORK_TUBE2H)    ||\
  74.      defined(CONFIG_FOR_CREATCOMM_D3321)        ||\
  75.      defined(CONFIG_FOR_DRAGINO_MS14)           ||\
  76. -    defined(CONFIG_FOR_VILLAGE_TELCO_MP2)
  77. +    defined(CONFIG_FOR_VILLAGE_TELCO_MP2)      ||\
  78. +    defined(CONFIG_FOR_ZSUN_SD100)
  79.  
  80.     #define OFFSET_MAC_DATA_BLOCK       0xFF0000
  81.     #define OFFSET_MAC_DATA_BLOCK_LENGTH    0x010000
  82. @@ -427,7 +444,8 @@
  83.      !defined(CONFIG_FOR_HAK5_PACKET_SQUIRREL)        &&\
  84.      !defined(CONFIG_FOR_HAK5_WIFI_PINEAPPLE_NANO)    &&\
  85.      !defined(CONFIG_FOR_UNWIRED_DEVICES_UNWIRED_ONE) &&\
  86. -    !defined(CONFIG_FOR_VILLAGE_TELCO_MP2)
  87. +    !defined(CONFIG_FOR_VILLAGE_TELCO_MP2)           &&\
  88. +    !defined(CONFIG_FOR_ZSUN_SD100)
  89.  
  90.     #define OFFSET_ROUTER_MODEL 0xFD00
  91.  
  92. @@ -481,6 +499,35 @@
  93.  
  94.  #endif
  95.  
  96. +/* Zsun SD100 is limited to 64 KB only and has a custom recovery script */
  97. +#if defined(CONFIG_FOR_ZSUN_SD100)
  98. +
  99. +   #undef CONFIG_CMD_HTTPD
  100. +
  101. +
  102. +#endif
  103. +
  104.  /*
  105.   * ===========================
  106.   * HTTP recovery configuration
  107. @@ -528,6 +575,10 @@
  108.  
  109.     #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES    (256 * 1024)
  110.  
  111. +#elif defined(CONFIG_FOR_ZSUN_SD100)
  112. +
  113. +   #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES    (256 * 1024)
  114. +
  115.  #else
  116.  
  117.     #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES    (256 * 1024)
  118. @@ -587,7 +638,8 @@
  119.      !defined(CONFIG_FOR_GLINET_GL_USB150)            &&\
  120.      !defined(CONFIG_FOR_HAK5_WIFI_PINEAPPLE_NANO)    &&\
  121.      !defined(CONFIG_FOR_UNWIRED_DEVICES_UNWIRED_ONE) &&\
  122. -    !defined(CONFIG_FOR_VILLAGE_TELCO_MP2)
  123. +    !defined(CONFIG_FOR_VILLAGE_TELCO_MP2)           &&\
  124. +    !defined(CONFIG_FOR_ZSUN_SD100)
  125.  
  126.     #define CONFIG_UPG_SCRIPTS_UBOOT_SIZE_BCKP_HEX  0x20000
  127.  
  128. diff --git a/u-boot/include/env_scripts.h b/u-boot/include/env_scripts.h
  129. index ddd0232..06049a9 100644
  130. --- a/u-boot/include/env_scripts.h
  131. +++ b/u-boot/include/env_scripts.h
  132. @@ -140,7 +140,8 @@
  133.         "elif itest $cnt < 5; then "
  134.     #endif
  135.  
  136. -   #define CONFIG_ENV_BTN_RECOVERY_SCRIPT  \
  137. +   #if !defined(CONFIG_ENV_BTN_RECOVERY_SCRIPT)
  138. +       #define CONFIG_ENV_BTN_RECOVERY_SCRIPT  \
  139.         "recovery=" \
  140.         "if button; then " \
  141.             "sleep 600;" \
  142. @@ -182,6 +183,7 @@
  143.             "fi;" \
  144.             "setenv cnt;" \
  145.         "fi\0"
  146. +   #endif
  147.  
  148.  #endif /* CONFIG_BTN_RECOVERY_SCRIPT && CONFIG_GPIO_RESET_BTN */
Advertisement
Add Comment
Please, Sign In to add comment