Add support for GL.iNet GL-AR300M Lite (QCA9531 based)
authorPiotr Dymacz <pepe2k@gmail.com>
Wed, 3 Jan 2018 21:35:44 +0000 (22:35 +0100)
committerPiotr Dymacz <pepe2k@gmail.com>
Mon, 15 Jan 2018 13:40:06 +0000 (14:40 +0100)
Makefile
README.md
u-boot/Makefile
u-boot/include/configs/ap143.h

index 312e89a48fe57d5e8df6d097718d50258492eb7d..8a9b2d30ee60bc225d23bbe2a3c175c0f28b3b8e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -271,6 +271,7 @@ dragino_ms14:
 
 engenius_ens202ext \
 gl-inet_gl-ar300 \
+gl-inet_gl-ar300m-lite \
 gl-inet_gl-ar750 \
 p2w_cpe505n \
 p2w_r602n \
index c92616a5f73c476a22839c355e94c1fd6bf96784..96092bba8c59526bd4d3851de1c00cc57428341f 100644 (file)
--- a/README.md
+++ b/README.md
@@ -108,6 +108,7 @@ Currently supported devices:
   - Comfast CF-E314N
   - Comfast CF-E320N v2
   - Comfast CF-E520N/CF-E530N
+  - GL.iNet GL-AR300M Lite
   - GL.iNet GL-AR750
   - P&W CPE505N
   - P&W R602N
@@ -147,6 +148,7 @@ More information about supported devices:
 | [GL.iNet 64xxA](http://wiki.openwrt.org/toh/gl-inet/gl-inet) | AR9331 | 8/16 MiB | 64 MiB DDR1 | 64 KiB | RO |
 | GL.iNet GL-AR150 | AR9331 | 16 MiB | 64 MiB DDR2 | 256 KiB | R/W |
 | GL.iNet GL-AR300 | AR9344 | 16 MiB | 128 MiB DDR2 | 256 KiB | R/W |
+| GL.iNet GL-AR300M Lite | QCA9531 | 16 MiB | 128 MiB DDR2 | 256 KiB | R/W |
 | GL.iNet GL-AR750 | QCA9531 | 16 MiB | 128 MiB DDR2 | 256 KiB | R/W |
 | GL.iNet GL-USB150 | AR9331 | 16 MiB | 64 MiB DDR2 | 256 KiB | R/W |
 | GS-Oolite/Elink EL-M150 module | AR9331 | 4/8/16 MiB | 64 MiB DDR2 | 64 KiB, LZMA | RO |
index 2e63cc7ca3cee7c54bed24441deebeaec2509cd7..20e47e8a2eb32dabb2426ac37cc8444d920732fc 100644 (file)
@@ -486,6 +486,14 @@ gl-inet_gl-ar300: ar934x_common
        @$(call define_add,CFG_AG7240_NMACS,2)
        @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
 
+gl-inet_gl-ar300m-lite: qca953x_common
+       @$(call config_init,GL.iNet GL-AR300M Lite,gl-ar300m-lite,16,3,1,QCA_QCA9531_SOC)
+       @$(call define_add,CONFIG_FOR_GLINET_GL_AR300M_LITE,1)
+       @$(call define_add,CFG_ATHRS27_PHY,1)
+       @$(call define_add,CFG_ATH_GMAC_NMACS,2)
+       @$(call define_add,CONFIG_PCI,1)
+       @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
+
 gl-inet_gl-ar750: qca953x_common
        @$(call config_init,GL.iNet GL-AR750,gl-ar750,16,3,1,QCA_QCA9531_SOC)
        @$(call define_add,CONFIG_FOR_GLINET_GL_AR750,1)
index a44a2b9c65072bc8323f34dbb9c4d4493c0726d7..9ee9fd6bcbd980a2301f6957cc6592db273ede55 100644 (file)
 
        #define CONFIG_QCA_GPIO_MASK_LED_ACT_L  GPIO11
 
+#elif defined(CONFIG_FOR_GLINET_GL_AR300M_LITE)
+
+       #define CONFIG_QCA_GPIO_MASK_LED_ACT_L  GPIO13 | GPIO14
+       #define CONFIG_QCA_GPIO_MASK_IN         GPIO0 | GPIO1 | GPIO16 | GPIO17
+       #define CONFIG_QCA_GPIO_MASK_OUT_INIT_L GPIO12
+
 #elif defined(CONFIG_FOR_GLINET_GL_AR750)
 
        #define CONFIG_QCA_GPIO_MASK_LED_ACT_L  GPIO13 | GPIO14
                                "rootfstype=jffs2 init=/sbin/init "\
                                "mtdparts=ath-nor0:64k(u-boot),64k(art),1536k(uImage),6464k(rootfs),64k(mib0)"
 
+#elif defined(CONFIG_FOR_GLINET_GL_AR300M_LITE)
+
+       #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 "\
+                               "rootfstype=squashfs init=/sbin/init "\
+                               "mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro"
+
 #elif defined(CONFIG_FOR_GLINET_GL_AR750)
 
        #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:03 "\
 
        #define CFG_LOAD_ADDR   0x9F020000
 
-#elif defined(CONFIG_FOR_GLINET_GL_AR750)
-
-       #define CFG_LOAD_ADDR   0x9F060000
-
-#elif defined(CONFIG_FOR_P2W_CPE505N)    ||\
-      defined(CONFIG_FOR_P2W_R602N)      ||\
-      defined(CONFIG_FOR_WALLYS_DR531)   ||\
-      defined(CONFIG_FOR_YUNCORE_AP90Q)  ||\
-      defined(CONFIG_FOR_YUNCORE_CPE830) ||\
+#elif defined(CONFIG_FOR_GLINET_GL_AR300M_LITE) ||\
+      defined(CONFIG_FOR_P2W_CPE505N)           ||\
+      defined(CONFIG_FOR_P2W_R602N)             ||\
+      defined(CONFIG_FOR_WALLYS_DR531)          ||\
+      defined(CONFIG_FOR_YUNCORE_AP90Q)         ||\
+      defined(CONFIG_FOR_YUNCORE_CPE830)        ||\
       defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526)
 
        #define CFG_LOAD_ADDR   0x9F050000
 
+#elif defined(CONFIG_FOR_GLINET_GL_AR750)
+
+       #define CFG_LOAD_ADDR   0x9F060000
+
 #endif
 
 #if defined(CONFIG_FOR_P2W_CPE505N)    ||\
        #define CFG_ENV_SIZE            0x7C00
        #define CFG_ENV_SECT_SIZE       0x10000
 
-#elif defined(CONFIG_FOR_GLINET_GL_AR750)
+#elif defined(CONFIG_FOR_GLINET_GL_AR300M_LITE) ||\
+      defined(CONFIG_FOR_GLINET_GL_AR750)
 
        #define CFG_ENV_ADDR            0x9F040000
        #define CFG_ENV_SIZE            0x10000
        #define OFFSET_MAC_DATA_BLOCK_LENGTH    0x10000
        #define OFFSET_MAC_ADDRESS              0x00000
 
-#elif defined(CONFIG_FOR_GLINET_GL_AR750)
-
-       #define OFFSET_MAC_DATA_BLOCK           0x50000
-       #define OFFSET_MAC_DATA_BLOCK_LENGTH    0x10000
-       #define OFFSET_MAC_ADDRESS              0x00000
-
-#elif defined(CONFIG_FOR_P2W_CPE505N)    ||\
-      defined(CONFIG_FOR_P2W_R602N)      ||\
-      defined(CONFIG_FOR_YUNCORE_AP90Q)  ||\
-      defined(CONFIG_FOR_YUNCORE_CPE830) ||\
+#elif defined(CONFIG_FOR_GLINET_GL_AR300M_LITE) ||\
+      defined(CONFIG_FOR_P2W_CPE505N)           ||\
+      defined(CONFIG_FOR_P2W_R602N)             ||\
+      defined(CONFIG_FOR_YUNCORE_AP90Q)         ||\
+      defined(CONFIG_FOR_YUNCORE_CPE830)        ||\
       defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526)
 
        #define OFFSET_MAC_DATA_BLOCK           0xFF0000
        #define OFFSET_MAC_DATA_BLOCK_LENGTH    0x010000
        #define OFFSET_MAC_ADDRESS              0x000000
 
+#elif defined(CONFIG_FOR_GLINET_GL_AR750)
+
+       #define OFFSET_MAC_DATA_BLOCK           0x50000
+       #define OFFSET_MAC_DATA_BLOCK_LENGTH    0x10000
+       #define OFFSET_MAC_ADDRESS              0x00000
+
 #elif defined(CONFIG_FOR_TPLINK_MR22U_V1)     ||\
       defined(CONFIG_FOR_TPLINK_MR3420_V3)    ||\
       defined(CONFIG_FOR_TPLINK_MR6400_V1V2)  ||\
 
        #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES        (192 * 1024)
 
-#elif defined(CONFIG_FOR_GLINET_GL_AR750) ||\
-      defined(CONFIG_FOR_P2W_CPE505N)     ||\
-      defined(CONFIG_FOR_P2W_R602N)       ||\
-      defined(CONFIG_FOR_WALLYS_DR531)    ||\
-      defined(CONFIG_FOR_YUNCORE_AP90Q)   ||\
-      defined(CONFIG_FOR_YUNCORE_CPE830)  ||\
+#elif defined(CONFIG_FOR_GLINET_GL_AR300M_LITE) ||\
+      defined(CONFIG_FOR_GLINET_GL_AR750)       ||\
+      defined(CONFIG_FOR_P2W_CPE505N)           ||\
+      defined(CONFIG_FOR_P2W_R602N)             ||\
+      defined(CONFIG_FOR_WALLYS_DR531)          ||\
+      defined(CONFIG_FOR_YUNCORE_AP90Q)         ||\
+      defined(CONFIG_FOR_YUNCORE_CPE830)        ||\
       defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526)
 
        #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES        (384 * 1024)
        #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET    0x10000
        #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE      0x10000
 
+#elif defined(CONFIG_FOR_GLINET_GL_AR300M_LITE)
+
+       #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET    0xFF0000
+       #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE      0x010000
+
 #elif defined(CONFIG_FOR_GLINET_GL_AR750)
 
        #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET    0x50000
  * For upgrade scripts in environment
  * ==================================
  */
-#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_GLINET_GL_AR750)     &&\
-    !defined(CONFIG_FOR_P2W_CPE505N)         &&\
-    !defined(CONFIG_FOR_P2W_R602N)           &&\
-    !defined(CONFIG_FOR_WALLYS_DR531)        &&\
-    !defined(CONFIG_FOR_YUNCORE_AP90Q)       &&\
-    !defined(CONFIG_FOR_YUNCORE_CPE830)      &&\
+#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_GLINET_GL_AR300M_LITE) &&\
+    !defined(CONFIG_FOR_GLINET_GL_AR750)       &&\
+    !defined(CONFIG_FOR_P2W_CPE505N)           &&\
+    !defined(CONFIG_FOR_P2W_R602N)             &&\
+    !defined(CONFIG_FOR_WALLYS_DR531)          &&\
+    !defined(CONFIG_FOR_YUNCORE_AP90Q)         &&\
+    !defined(CONFIG_FOR_YUNCORE_CPE830)        &&\
     !defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526)
 
        #define CONFIG_UPG_UBOOT_SIZE_BACKUP_HEX        0x20000