Add support for ALFA Network N5Q (AR9344 based)
authorPiotr Dymacz <pepe2k@gmail.com>
Tue, 2 Jan 2018 16:54:30 +0000 (17:54 +0100)
committerPiotr Dymacz <pepe2k@gmail.com>
Sun, 4 Feb 2018 15:19:55 +0000 (16:19 +0100)
Makefile
README.md
u-boot/Makefile
u-boot/include/configs/db12x.h

index 2962b9c22368836d4a25d182a250a1c8841cd337..fdeb44a4299e59ac9f5dc27120bee96c883f1262 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -257,6 +257,7 @@ gl-inet_gl-usb150:
 alfa-network_ap121f:
        @$(call build,192,1)
 
+alfa-network_n5q \
 alfa-network_r36a:
        @$(call build,384,1,ETH_CONFIG=_s27)
 
index 1bb7cd201e3932ade5845d7d7ce9cf662aa10d8c..3cfed266d75ea3822a5d016b8b7a6d48d6d809f4 100644 (file)
--- a/README.md
+++ b/README.md
@@ -99,6 +99,7 @@ Currently supported devices:
   - TP-Link TL-WR1041N v2
 
 - **Atheros AR9344**:
+  - ALFA Network N5Q
   - GL.iNet GL-AR300
   - TP-Link TL-WDR3500 v1
   - TP-Link TL-WDR3600 v1
@@ -137,6 +138,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 N5Q | AR9344 | 16 MiB | 64 MiB DDR2 | 384 KiB, LZMA | 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 |
index 78febecd69a5a427f92ab1a993ea91ce830aa2f4..a11808be00a6486a16c47baef4dd7997a469274c 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_n5q: ar934x_common
+       @$(call config_init,ALFA Network N5Q,n5q,16,11,1,QCA_AR9344_SOC)
+       @$(call define_add,CONFIG_FOR_ALFA_NETWORK_N5Q,1)
+       @$(call define_add,CFG_ATHRS27_PHY,1)
+       @$(call define_add,CFG_AG7240_NMACS,2)
+       @$(MKCONFIG) -a db12x mips mips db12x 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)
index 3664d7beab11ef69558a6cc0a4803abfc85dbc36..7f11b04de2ba5e6784672e64314cc80f0ebbcc26 100644 (file)
  * GPIO configuration
  * ==================
  */
-#if defined(CONFIG_FOR_ENGENIUS_ENS202EXT)
+#if defined(CONFIG_FOR_ALFA_NETWORK_N5Q)
+
+       #define CONFIG_QCA_GPIO_MASK_LED_ACT_L  GPIO0 | GPIO1  | GPIO2  |\
+                                               GPIO3 | GPIO12 | GPIO18 |\
+                                               GPIO19
+       #define CONFIG_QCA_GPIO_MASK_OUT_INIT_L GPIO16 | GPIO17
+
+#elif defined(CONFIG_FOR_ENGENIUS_ENS202EXT)
 
        #define CONFIG_QCA_GPIO_MASK_LED_ACT_L  GPIO0  | GPIO14 | GPIO16 |\
                                                GPIO17 | GPIO18
  * Default bootargs
  * ================
  */
-#if defined(CONFIG_FOR_ENGENIUS_ENS202EXT)
+#if defined(CONFIG_FOR_ALFA_NETWORK_N5Q)
+
+       #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_ENGENIUS_ENS202EXT)
 
        #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:04 "\
                                "rootfstype=squashfs init=/etc/preinit "\
  * Load address and boot command
  * =============================
  */
-#if defined(CONFIG_FOR_ENGENIUS_ENS202EXT)
+#if defined(CONFIG_FOR_ALFA_NETWORK_N5Q)
+
+       #define CFG_LOAD_ADDR           0x9F080000
+
+#elif defined(CONFIG_FOR_ENGENIUS_ENS202EXT)
 
        #define CFG_LOAD_ADDR           0x9F0A0000
 
  * Environment configuration
  * =========================
  */
-#if defined(CONFIG_FOR_ENGENIUS_ENS202EXT)
+#if defined(CONFIG_FOR_ALFA_NETWORK_N5Q)
+
+       #define CFG_ENV_ADDR            0x9F060000
+       #define CFG_ENV_SIZE            0x10000
+
+#elif defined(CONFIG_FOR_ENGENIUS_ENS202EXT)
 
        #define CFG_ENV_ADDR            0x9F040000
        #define CFG_ENV_SIZE            0x10000
  * MAC address/es, model and WPS pin offsets in FLASH
  * ==================================================
  */
-#if defined(CONFIG_FOR_GLINET_GL_AR300) ||\
-    defined(CONFIG_FOR_YUNCORE_CPE870)
+#if defined(CONFIG_FOR_ALFA_NETWORK_N5Q)
+
+       #define OFFSET_MAC_DATA_BLOCK           0x70000
+       #define OFFSET_MAC_DATA_BLOCK_LENGTH    0x10000
+       #define OFFSET_MAC_ADDRESS              0x00000
+
+#elif defined(CONFIG_FOR_GLINET_GL_AR300) ||\
+      defined(CONFIG_FOR_YUNCORE_CPE870)
 
        #define OFFSET_MAC_DATA_BLOCK           0xFF0000
        #define OFFSET_MAC_DATA_BLOCK_LENGTH    0x010000
 
 #endif
 
+#if defined(CONFIG_FOR_ALFA_NETWORK_N5Q)
+
+       #define WEBFAILSAFE_UPLOAD_ART_ADDRESS  (CFG_FLASH_BASE + 0x70000)
+
+#endif
+
 /* Firmware size limit */
-#if defined(CONFIG_FOR_ENGENIUS_ENS202EXT)
+#if defined(CONFIG_FOR_ALFA_NETWORK_N5Q)
+
+       #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES        (512 * 1024)
+
+#elif defined(CONFIG_FOR_ENGENIUS_ENS202EXT)
 
        #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES        (2752 * 1024)
 
  */
 #define CONFIG_QCA_PLL QCA_PLL_PRESET_550_400_200
 
-#if defined(CONFIG_FOR_GLINET_GL_AR300)
+#if defined(CONFIG_FOR_ALFA_NETWORK_N5Q)
+
+       #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET    0x70000
+       #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE      0x10000
+
+#elif defined(CONFIG_FOR_GLINET_GL_AR300)
 
        #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET    0x40000
        #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE      0x10000
  * For upgrade scripts in environment
  * ==================================
  */
-#if !defined(CONFIG_FOR_ENGENIUS_ENS202EXT) &&\
+#if !defined(CONFIG_FOR_ALFA_NETWORK_N5Q)   &&\
+    !defined(CONFIG_FOR_ENGENIUS_ENS202EXT) &&\
     !defined(CONFIG_FOR_GLINET_GL_AR300)    &&\
     !defined(CONFIG_FOR_YUNCORE_CPE870)