Add support for ALFA NETWORK AP121F (AR9331 based)
authorPiotr Dymacz <pepe2k@gmail.com>
Wed, 12 Jul 2017 08:08:39 +0000 (10:08 +0200)
committerPiotr Dymacz <pepe2k@gmail.com>
Tue, 15 Aug 2017 17:35:59 +0000 (19:35 +0200)
Makefile
README.md
u-boot/Makefile
u-boot/include/configs/ap121.h

index 3225825eea2e96191e34ecb50e0e8ded116141f7..8f9a67792d906212ab766ea29577fce486a1a9b9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -249,6 +249,9 @@ creatcomm-technology_d3321 \
 gl-innovations_gl-ar150:
        @$(call build,256,1)
 
+alfa-network_ap121f:
+       @$(call build,192,1)
+
 comfast_cf-e314n \
 comfast_cf-e320n_v2 \
 comfast_cf-e520n \
index cb993aef862a16ff643c4817edb2f1350966c546..9a69098c6e193bc89711a9ce485a2456c577061f 100644 (file)
--- a/README.md
+++ b/README.md
@@ -63,6 +63,7 @@ Currently supported devices:
 
 - **Atheros AR9331**:
   - 8devices Carambola 2 (for version with development board, [photos in my gallery](http://galeria.tech-blog.pl/8devices_Carambola_2/))
+  - ALFA NETWORK AP121F
   - ALFA NETWORK Hornet-UB/Hornet-UB-64 (aka Hornet-UB x2)
   - Black Swift
   - CreatComm Technology D3321
@@ -123,6 +124,7 @@ More information about supported devices:
 | Model | SoC | FLASH | RAM | U-Boot image | U-Boot env |
 |:--- | :--- | ---: | ---: | ---: | ---: |
 | [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 |
 | [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 6e37f56b0ef69b4fbba1edac7dc0364866a75364..751f49133029cb7a22473a006ec990dc86f9b48b 100644 (file)
@@ -396,6 +396,11 @@ lsdk_kernel:
        @$(call define_add,CONFIG_FOR_8DEVICES_CARAMBOLA2,1)
        @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
 
+alfa-network_ap121f: ar933x_common
+       @$(call config_init,ALFA NETWORK AP121F,ap121f,16,12,1,QCA_AR933X_SOC)
+       @$(call define_add,CONFIG_FOR_ALFA_NETWORK_AP121F,1)
+       @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
+
 alfa-network_hornet-ub: ar933x_common
        @$(call config_init,ALFA NETWORK Hornet-UB,hornet-ub,8,12,1,QCA_AR933X_SOC)
        @$(call define_add,CONFIG_FOR_ALFA_NETWORK_HORNET_UB,1)
index 864755035f48d544f8ae05f7369ec533ab639998..4758f8751329845b267bfc1483f972439fb74700 100644 (file)
        #define CONFIG_QCA_GPIO_MASK_OUT_INIT_H CONFIG_QCA_GPIO_MASK_LED_ACT_L
        #define CONFIG_QCA_GPIO_MASK_OUT_INIT_L CONFIG_QCA_GPIO_MASK_LED_ACT_H
 
+#elif defined(CONFIG_FOR_ALFA_NETWORK_AP121F)
+
+       #define CONFIG_QCA_GPIO_MASK_LED_ACT_H  GPIO0
+       #define CONFIG_QCA_GPIO_MASK_LED_ACT_L  GPIO17
+       #define CONFIG_QCA_GPIO_MASK_OUT        GPIO26 | GPIO27 |\
+                                               CONFIG_QCA_GPIO_MASK_LED_ACT_L |\
+                                               CONFIG_QCA_GPIO_MASK_LED_ACT_H
+       #define CONFIG_QCA_GPIO_MASK_IN         GPIO12 | GPIO21
+       #define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO26 |\
+                                               CONFIG_QCA_GPIO_MASK_LED_ACT_L
+       #define CONFIG_QCA_GPIO_MASK_OUT_INIT_L GPIO27 |\
+                                               CONFIG_QCA_GPIO_MASK_LED_ACT_H
+
 #elif defined(CONFIG_FOR_ALFA_NETWORK_HORNET_UB)
 
        #define CONFIG_QCA_GPIO_MASK_LED_ACT_H  GPIO0  | GPIO1 | GPIO13
                                "rootfstype=squashfs init=/sbin/init "\
                                "mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),16000k(firmware),64k(art)"
 
+#elif defined(CONFIG_FOR_ALFA_NETWORK_AP121F)
+
+       #define CONFIG_BOOTARGS "board=AP121F console=ttyATH0,115200 "\
+                               "rootfstype=squashfs,jffs2 noinitrd "\
+                               "mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env),64k(art)ro,-(firmware)"
+
 #elif defined(CONFIG_FOR_ALFA_NETWORK_HORNET_UB)
 
        #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 "\
  * =============================
  */
 #if defined(CONFIG_FOR_8DEVICES_CARAMBOLA2)    ||\
+    defined(CONFIG_FOR_ALFA_NETWORK_AP121F)    ||\
     defined(CONFIG_FOR_ALFA_NETWORK_HORNET_UB) ||\
     defined(CONFIG_FOR_CREATCOMM_D3321)        ||\
     defined(CONFIG_FOR_GL_AR150)
        #define CFG_ENV_ADDR            0x9F040000
        #define CFG_ENV_SIZE            0x8000
        #define CFG_ENV_SECT_SIZE       0x10000
+#elif defined(CONFIG_FOR_ALFA_NETWORK_AP121F)
+       #define CFG_ENV_ADDR            0x9F030000
+       #define CFG_ENV_SIZE            0x10000
 #elif defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
        #define CFG_ENV_ADDR            0x9F020000
        #define CFG_ENV_SIZE            0x8000
        #define OFFSET_MAC_DATA_BLOCK_LENGTH    0x010000
        #define OFFSET_MAC_ADDRESS              0x000000
        #define OFFSET_MAC_ADDRESS2             0x000006
+#elif defined(CONFIG_FOR_ALFA_NETWORK_AP121F)
+       #define OFFSET_MAC_DATA_BLOCK           0x40000
+       #define OFFSET_MAC_DATA_BLOCK_LENGTH    0x10000
+       #define OFFSET_MAC_ADDRESS              0x00000
 #elif defined(CONFIG_FOR_BLACK_SWIFT_BOARD) ||\
       defined(CONFIG_FOR_GL_AR150)
        #define OFFSET_MAC_DATA_BLOCK           0xFF0000
 #endif
 
 #if !defined(CONFIG_FOR_8DEVICES_CARAMBOLA2)    &&\
+    !defined(CONFIG_FOR_ALFA_NETWORK_AP121F)    &&\
     !defined(CONFIG_FOR_ALFA_NETWORK_HORNET_UB) &&\
     !defined(CONFIG_FOR_BLACK_SWIFT_BOARD)      &&\
     !defined(CONFIG_FOR_CREATCOMM_D3321)        &&\
  */
 #define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS      CFG_LOAD_ADDR
 
-#if defined(CONFIG_FOR_DLINK_DIR505_A1)
+#if defined(CONFIG_FOR_ALFA_NETWORK_AP121F)
+       #define WEBFAILSAFE_UPLOAD_ART_ADDRESS  (CFG_FLASH_BASE + 0x40000)
+#elif defined(CONFIG_FOR_DLINK_DIR505_A1)
        #define WEBFAILSAFE_UPLOAD_ART_ADDRESS  (CFG_FLASH_BASE + 0x10000)
 #endif
 
 #if defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) ||\
     defined(CONFIG_FOR_GL_AR150)
        #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES        (384 * 1024)
+#elif defined(CONFIG_FOR_ALFA_NETWORK_AP121F) ||\
+      defined(CONFIG_FOR_DRAGINO_V2)          ||\
+      defined(CONFIG_FOR_MESH_POTATO_V2)
+       #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES        (320 * 1024)
 #elif defined(CONFIG_FOR_ALFA_NETWORK_HORNET_UB)
        #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES        (448 * 1024)
 #elif defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
        #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES        (1856 * 1024)
 #elif defined(CONFIG_FOR_DLINK_DIR505_A1)
        #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES        (512 * 1024)
-#elif defined(CONFIG_FOR_DRAGINO_V2) ||\
-      defined(CONFIG_FOR_MESH_POTATO_V2)
-       #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES        (320 * 1024)
 #elif defined(CONFIG_FOR_GS_OOLITE_V1_DEV)
        #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES        (192 * 1024)
 #else
 #define CONFIG_QCA_PLL QCA_PLL_PRESET_400_400_200
 
 #if defined(CONFIG_FOR_8DEVICES_CARAMBOLA2)    ||\
+    defined(CONFIG_FOR_ALFA_NETWORK_AP121F)    ||\
     defined(CONFIG_FOR_ALFA_NETWORK_HORNET_UB) ||\
     defined(CONFIG_FOR_CREATCOMM_D3321)        ||\
     defined(CONFIG_FOR_GL_AR150)
  * ==================================
  */
 #if !defined(CONFIG_FOR_8DEVICES_CARAMBOLA2)    &&\
+    !defined(CONFIG_FOR_ALFA_NETWORK_AP121F)    &&\
     !defined(CONFIG_FOR_ALFA_NETWORK_HORNET_UB) &&\
     !defined(CONFIG_FOR_BLACK_SWIFT_BOARD)      &&\
     !defined(CONFIG_FOR_CREATCOMM_D3321)        &&\