Add support for ALFA Network R36A (QCA9531 based)
authorPiotr Dymacz <pepe2k@gmail.com>
Tue, 11 Jul 2017 19:59:35 +0000 (21:59 +0200)
committerPiotr Dymacz <pepe2k@gmail.com>
Sun, 4 Feb 2018 15:19:52 +0000 (16:19 +0100)
Makefile
README.md
u-boot/Makefile
u-boot/include/configs/ap143.h

index 8a9b2d30ee60bc225d23bbe2a3c175c0f28b3b8e..2962b9c22368836d4a25d182a250a1c8841cd337 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -257,6 +257,9 @@ gl-inet_gl-usb150:
 alfa-network_ap121f:
        @$(call build,192,1)
 
+alfa-network_r36a:
+       @$(call build,384,1,ETH_CONFIG=_s27)
+
 comfast_cf-e314n \
 comfast_cf-e320n_v2 \
 comfast_cf-e520n \
index 96092bba8c59526bd4d3851de1c00cc57428341f..1bb7cd201e3932ade5845d7d7ce9cf662aa10d8c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -105,6 +105,7 @@ Currently supported devices:
   - TP-Link TL-WDR43x0 v1
 
 - **Qualcomm Atheros QCA953x**:
+  - ALFA Network R36A
   - Comfast CF-E314N
   - Comfast CF-E320N v2
   - Comfast CF-E520N/CF-E530N
@@ -136,6 +137,7 @@ More information about supported devices:
 | [8devices Carambola 2](http://8devices.com/carambola-2) | AR9331 | 16 MiB | 64 MiB DDR2 | 256 KiB | R/W |
 | ALFA Network AP121F | AR9331 | 16 MiB | 64 MiB DDR1 | 192 KiB, LZMA | R/W |
 | [ALFA Network Hornet-UB](https://wiki.openwrt.org/toh/alfa.network/hornet-ub) | AR9331 | 8/16 MiB | 32/64 MiB DDR1 | 256 KiB | R/W |
+| ALFA Network R36A | QCA9531 | 16 MiB | 64 MiB DDR2 | 384 KiB, LZMA | R/W |
 | ALFA Network Tube2H | AR9331 | 8/16 MiB | 32/64 MiB DDR1 | 256 KiB | R/W |
 | [Black Swift](http://www.black-swift.com) | AR9331 | 16 MiB | 64 MiB DDR2 | 128 KiB, LZMA | R/W |
 | Comfast CF-E314N | QCA9531 | 16 MiB | 64 MiB DDR2 | 64 KiB, LZMA | RO |
index 20e47e8a2eb32dabb2426ac37cc8444d920732fc..78febecd69a5a427f92ab1a993ea91ce830aa2f4 100644 (file)
@@ -406,6 +406,13 @@ alfa-network_hornet-ub: ar933x_common
        @$(call define_add,CONFIG_FOR_ALFA_NETWORK_HORNET_UB,1)
        @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
 
+alfa-network_r36a: qca953x_common
+       @$(call config_init,ALFA Network R36A,r36a,16,2,1,QCA_QCA9531_SOC)
+       @$(call define_add,CONFIG_FOR_ALFA_NETWORK_R36A,1)
+       @$(call define_add,CFG_ATHRS27_PHY,1)
+       @$(call define_add,CFG_ATH_GMAC_NMACS,2)
+       @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
+
 alfa-network_tube2h: ar933x_common
        @$(call config_init,ALFA Network Tube2H,tube2h,8,12,1,QCA_AR9331_SOC)
        @$(call define_add,CONFIG_FOR_ALFA_NETWORK_TUBE2H,1)
index 9ee9fd6bcbd980a2301f6957cc6592db273ede55..0eb7bb259959bc74541073e8ec032bbb2b90f3b6 100644 (file)
  * GPIO configuration
  * ==================
  */
-#if defined(CONFIG_FOR_COMFAST_CF_E314N)
+#if defined(CONFIG_FOR_ALFA_NETWORK_R36A)
+
+       #define CONFIG_QCA_GPIO_MASK_LED_ACT_L  GPIO4  | GPIO12 | GPIO14 |\
+                                               GPIO15 | GPIO16
+       #define CONFIG_QCA_GPIO_MASK_IN         GPIO17
+       #define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO3
+       #define CONFIG_QCA_GPIO_MASK_OUT_INIT_L GPIO0 | GPIO1
+
+#elif defined(CONFIG_FOR_COMFAST_CF_E314N)
 
        #define CONFIG_QCA_GPIO_MASK_LED_ACT_H  GPIO4  | GPIO11 | GPIO14 |\
                                                GPIO15 | GPIO16
  * Default bootargs
  * ================
  */
-#if defined(CONFIG_FOR_COMFAST_CF_E314N) ||\
-    defined(CONFIG_FOR_COMFAST_CF_E320N_V2)
+#if defined(CONFIG_FOR_ALFA_NETWORK_R36A)
+
+       #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:03 "\
+                               "rootfstype=jffs2,squashfs init=/sbin/init "\
+                               "mtdparts=ath-nor0:448k(u-boot),64k(art),1280k(kernel),14528k(rootfs),64k(config)"
+
+#elif defined(CONFIG_FOR_COMFAST_CF_E314N) ||\
+      defined(CONFIG_FOR_COMFAST_CF_E320N_V2)
 
        #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:03 "\
                                "rootfstype=jffs2 init=/sbin/init "\
  * Load address and boot command
  * =============================
  */
-#if defined(CONFIG_FOR_COMFAST_CF_E314N)    ||\
-    defined(CONFIG_FOR_COMFAST_CF_E320N_V2) ||\
-    defined(CONFIG_FOR_COMFAST_CF_E520N)    ||\
-    defined(CONFIG_FOR_COMFAST_CF_E530N)    ||\
-    defined(CONFIG_FOR_TPLINK_MR22U_V1)     ||\
-    defined(CONFIG_FOR_TPLINK_MR3420_V3)    ||\
-    defined(CONFIG_FOR_TPLINK_MR6400_V1V2)  ||\
-    defined(CONFIG_FOR_TPLINK_WA850RE_V2)   ||\
-    defined(CONFIG_FOR_TPLINK_WR802N_V1)    ||\
-    defined(CONFIG_FOR_TPLINK_WR810N_V1)    ||\
-    defined(CONFIG_FOR_TPLINK_WR810N_V2)    ||\
-    defined(CONFIG_FOR_TPLINK_WR820N_V1_CN) ||\
-    defined(CONFIG_FOR_TPLINK_WR841N_V10)   ||\
-    defined(CONFIG_FOR_TPLINK_WR841N_V11)   ||\
-    defined(CONFIG_FOR_TPLINK_WR841N_V9)    ||\
-    defined(CONFIG_FOR_TPLINK_WR842N_V3)    ||\
-    defined(CONFIG_FOR_TPLINK_WR902AC_V1)
+#if defined(CONFIG_FOR_ALFA_NETWORK_R36A)
+
+       #define CFG_LOAD_ADDR   0x9F080000
+
+#elif defined(CONFIG_FOR_COMFAST_CF_E314N)    ||\
+      defined(CONFIG_FOR_COMFAST_CF_E320N_V2) ||\
+      defined(CONFIG_FOR_COMFAST_CF_E520N)    ||\
+      defined(CONFIG_FOR_COMFAST_CF_E530N)    ||\
+      defined(CONFIG_FOR_TPLINK_MR22U_V1)     ||\
+      defined(CONFIG_FOR_TPLINK_MR3420_V3)    ||\
+      defined(CONFIG_FOR_TPLINK_MR6400_V1V2)  ||\
+      defined(CONFIG_FOR_TPLINK_WA850RE_V2)   ||\
+      defined(CONFIG_FOR_TPLINK_WR802N_V1)    ||\
+      defined(CONFIG_FOR_TPLINK_WR810N_V1)    ||\
+      defined(CONFIG_FOR_TPLINK_WR810N_V2)    ||\
+      defined(CONFIG_FOR_TPLINK_WR820N_V1_CN) ||\
+      defined(CONFIG_FOR_TPLINK_WR841N_V10)   ||\
+      defined(CONFIG_FOR_TPLINK_WR841N_V11)   ||\
+      defined(CONFIG_FOR_TPLINK_WR841N_V9)    ||\
+      defined(CONFIG_FOR_TPLINK_WR842N_V3)    ||\
+      defined(CONFIG_FOR_TPLINK_WR902AC_V1)
 
        #define CFG_LOAD_ADDR   0x9F020000
 
  * Environment configuration
  * =========================
  */
-#if defined(CONFIG_FOR_COMFAST_CF_E314N)    ||\
-    defined(CONFIG_FOR_COMFAST_CF_E320N_V2) ||\
-    defined(CONFIG_FOR_COMFAST_CF_E520N)    ||\
-    defined(CONFIG_FOR_COMFAST_CF_E530N)
+#if defined(CONFIG_FOR_ALFA_NETWORK_R36A)
+
+       #define CFG_ENV_ADDR            0x9F060000
+       #define CFG_ENV_SIZE            0x10000
+
+#elif defined(CONFIG_FOR_COMFAST_CF_E314N)    ||\
+      defined(CONFIG_FOR_COMFAST_CF_E320N_V2) ||\
+      defined(CONFIG_FOR_COMFAST_CF_E520N)    ||\
+      defined(CONFIG_FOR_COMFAST_CF_E530N)
 
        #define CFG_ENV_ADDR            0x9F018000
        #define CFG_ENV_SIZE            0x7C00
  * MAC address/es, model and WPS pin offsets in FLASH
  * ==================================================
  */
-#if defined(CONFIG_FOR_COMFAST_CF_E314N)    ||\
-    defined(CONFIG_FOR_COMFAST_CF_E320N_V2) ||\
-    defined(CONFIG_FOR_COMFAST_CF_E520N)    ||\
-    defined(CONFIG_FOR_COMFAST_CF_E530N)
+#if defined(CONFIG_FOR_ALFA_NETWORK_R36A)
+
+       #define OFFSET_MAC_DATA_BLOCK           0x70000
+       #define OFFSET_MAC_DATA_BLOCK_LENGTH    0x10000
+       #define OFFSET_MAC_ADDRESS              0x00000
+
+#elif defined(CONFIG_FOR_COMFAST_CF_E314N)    ||\
+      defined(CONFIG_FOR_COMFAST_CF_E320N_V2) ||\
+      defined(CONFIG_FOR_COMFAST_CF_E520N)    ||\
+      defined(CONFIG_FOR_COMFAST_CF_E530N)
 
        #define OFFSET_MAC_DATA_BLOCK           0x10000
        #define OFFSET_MAC_DATA_BLOCK_LENGTH    0x10000
  */
 #define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS      CFG_LOAD_ADDR
 
-#if defined(CONFIG_FOR_COMFAST_CF_E314N)    ||\
-    defined(CONFIG_FOR_COMFAST_CF_E320N_V2) ||\
-    defined(CONFIG_FOR_COMFAST_CF_E520N)    ||\
-    defined(CONFIG_FOR_COMFAST_CF_E530N)
+#if defined(CONFIG_FOR_ALFA_NETWORK_R36A)
+
+       #define WEBFAILSAFE_UPLOAD_ART_ADDRESS  (CFG_FLASH_BASE + 0x70000)
+
+#elif defined(CONFIG_FOR_COMFAST_CF_E314N)    ||\
+      defined(CONFIG_FOR_COMFAST_CF_E320N_V2) ||\
+      defined(CONFIG_FOR_COMFAST_CF_E520N)    ||\
+      defined(CONFIG_FOR_COMFAST_CF_E530N)
 
        #define WEBFAILSAFE_UPLOAD_ART_ADDRESS  (CFG_FLASH_BASE + 0x10000)
 
 #endif
 
 /* Firmware size limit */
-#if defined(CONFIG_FOR_COMFAST_CF_E314N)    ||\
-    defined(CONFIG_FOR_COMFAST_CF_E320N_V2) ||\
-    defined(CONFIG_FOR_COMFAST_CF_E520N)    ||\
-    defined(CONFIG_FOR_COMFAST_CF_E530N)    ||\
-    defined(CONFIG_FOR_TPLINK_MR22U_V1)     ||\
-    defined(CONFIG_FOR_TPLINK_MR3420_V3)    ||\
-    defined(CONFIG_FOR_TPLINK_MR6400_V1V2)  ||\
-    defined(CONFIG_FOR_TPLINK_WR802N_V1)    ||\
-    defined(CONFIG_FOR_TPLINK_WR810N_V1)    ||\
-    defined(CONFIG_FOR_TPLINK_WR810N_V2)    ||\
-    defined(CONFIG_FOR_TPLINK_WR820N_V1_CN) ||\
-    defined(CONFIG_FOR_TPLINK_WR841N_V10)   ||\
-    defined(CONFIG_FOR_TPLINK_WR841N_V11)   ||\
-    defined(CONFIG_FOR_TPLINK_WR841N_V9)    ||\
-    defined(CONFIG_FOR_TPLINK_WR842N_V3)
+#if defined(CONFIG_FOR_ALFA_NETWORK_R36A)
+
+       #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES        (512 * 1024)
+
+#elif defined(CONFIG_FOR_COMFAST_CF_E314N)    ||\
+      defined(CONFIG_FOR_COMFAST_CF_E320N_V2) ||\
+      defined(CONFIG_FOR_COMFAST_CF_E520N)    ||\
+      defined(CONFIG_FOR_COMFAST_CF_E530N)    ||\
+      defined(CONFIG_FOR_TPLINK_MR22U_V1)     ||\
+      defined(CONFIG_FOR_TPLINK_MR3420_V3)    ||\
+      defined(CONFIG_FOR_TPLINK_MR6400_V1V2)  ||\
+      defined(CONFIG_FOR_TPLINK_WR802N_V1)    ||\
+      defined(CONFIG_FOR_TPLINK_WR810N_V1)    ||\
+      defined(CONFIG_FOR_TPLINK_WR810N_V2)    ||\
+      defined(CONFIG_FOR_TPLINK_WR820N_V1_CN) ||\
+      defined(CONFIG_FOR_TPLINK_WR841N_V10)   ||\
+      defined(CONFIG_FOR_TPLINK_WR841N_V11)   ||\
+      defined(CONFIG_FOR_TPLINK_WR841N_V9)    ||\
+      defined(CONFIG_FOR_TPLINK_WR842N_V3)
 
        #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES        (192 * 1024)
 
 
 #endif
 
-#if defined(CONFIG_FOR_COMFAST_CF_E314N)    ||\
-    defined(CONFIG_FOR_COMFAST_CF_E320N_V2) ||\
-    defined(CONFIG_FOR_COMFAST_CF_E520N)    ||\
-    defined(CONFIG_FOR_COMFAST_CF_E530N)    ||\
-    defined(CONFIG_FOR_TPLINK_MR22U_V1)     ||\
-    defined(CONFIG_FOR_TPLINK_MR3420_V3)    ||\
-    defined(CONFIG_FOR_TPLINK_MR6400_V1V2)  ||\
-    defined(CONFIG_FOR_TPLINK_WA850RE_V2)   ||\
-    defined(CONFIG_FOR_TPLINK_WR802N_V1)    ||\
-    defined(CONFIG_FOR_TPLINK_WR810N_V1)    ||\
-    defined(CONFIG_FOR_TPLINK_WR810N_V2)    ||\
-    defined(CONFIG_FOR_TPLINK_WR820N_V1_CN) ||\
-    defined(CONFIG_FOR_TPLINK_WR841N_V10)   ||\
-    defined(CONFIG_FOR_TPLINK_WR841N_V11)   ||\
-    defined(CONFIG_FOR_TPLINK_WR841N_V9)    ||\
-    defined(CONFIG_FOR_TPLINK_WR842N_V3)    ||\
-    defined(CONFIG_FOR_TPLINK_WR902AC_V1)
+
+#if defined(CONFIG_FOR_ALFA_NETWORK_R36A)
+
+       #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET    0x70000
+       #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE      0x10000
+
+#elif defined(CONFIG_FOR_COMFAST_CF_E314N)    ||\
+      defined(CONFIG_FOR_COMFAST_CF_E320N_V2) ||\
+      defined(CONFIG_FOR_COMFAST_CF_E520N)    ||\
+      defined(CONFIG_FOR_COMFAST_CF_E530N)    ||\
+      defined(CONFIG_FOR_TPLINK_MR22U_V1)     ||\
+      defined(CONFIG_FOR_TPLINK_MR3420_V3)    ||\
+      defined(CONFIG_FOR_TPLINK_MR6400_V1V2)  ||\
+      defined(CONFIG_FOR_TPLINK_WA850RE_V2)   ||\
+      defined(CONFIG_FOR_TPLINK_WR802N_V1)    ||\
+      defined(CONFIG_FOR_TPLINK_WR810N_V1)    ||\
+      defined(CONFIG_FOR_TPLINK_WR810N_V2)    ||\
+      defined(CONFIG_FOR_TPLINK_WR820N_V1_CN) ||\
+      defined(CONFIG_FOR_TPLINK_WR841N_V10)   ||\
+      defined(CONFIG_FOR_TPLINK_WR841N_V11)   ||\
+      defined(CONFIG_FOR_TPLINK_WR841N_V9)    ||\
+      defined(CONFIG_FOR_TPLINK_WR842N_V3)    ||\
+      defined(CONFIG_FOR_TPLINK_WR902AC_V1)
 
        #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET    0x10000
        #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE      0x10000
  * For upgrade scripts in environment
  * ==================================
  */
-#if !defined(CONFIG_FOR_COMFAST_CF_E314N)      &&\
+#if !defined(CONFIG_FOR_ALFA_NETWORK_R36A)     &&\
+    !defined(CONFIG_FOR_COMFAST_CF_E314N)      &&\
     !defined(CONFIG_FOR_COMFAST_CF_E320N_V2)   &&\
     !defined(CONFIG_FOR_COMFAST_CF_E520N)      &&\
     !defined(CONFIG_FOR_COMFAST_CF_E530N)      &&\