From 2e0361c1a90c3eecf17c828d0509b0d281d0e739 Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Wed, 12 Jul 2017 10:08:39 +0200 Subject: [PATCH] Add support for ALFA NETWORK AP121F (AR9331 based) --- Makefile | 3 +++ README.md | 2 ++ u-boot/Makefile | 5 +++++ u-boot/include/configs/ap121.h | 41 ++++++++++++++++++++++++++++++---- 4 files changed, 47 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 3225825..8f9a677 100644 --- 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 \ diff --git a/README.md b/README.md index cb993ae..9a69098 100644 --- 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 | diff --git a/u-boot/Makefile b/u-boot/Makefile index 6e37f56..751f491 100644 --- a/u-boot/Makefile +++ b/u-boot/Makefile @@ -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) diff --git a/u-boot/include/configs/ap121.h b/u-boot/include/configs/ap121.h index 8647550..4758f87 100644 --- a/u-boot/include/configs/ap121.h +++ b/u-boot/include/configs/ap121.h @@ -31,6 +31,19 @@ #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 @@ -200,6 +213,12 @@ "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 "\ @@ -271,6 +290,7 @@ * ============================= */ #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) @@ -304,6 +324,9 @@ #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 @@ -348,6 +371,10 @@ #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 @@ -374,6 +401,7 @@ #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) &&\ @@ -431,7 +459,9 @@ */ #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 @@ -439,6 +469,10 @@ #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) @@ -447,9 +481,6 @@ #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 @@ -464,6 +495,7 @@ #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) @@ -496,6 +528,7 @@ * ================================== */ #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) &&\ -- 2.25.1