From: Piotr Dymacz Date: Tue, 11 Jul 2017 19:59:35 +0000 (+0200) Subject: Add support for ALFA Network R36A (QCA9531 based) X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1a66556359cd5fc7c8d76434abc0405f71f55fc3;p=oweals%2Fu-boot_mod.git Add support for ALFA Network R36A (QCA9531 based) --- diff --git a/Makefile b/Makefile index 8a9b2d3..2962b9c 100644 --- 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 \ diff --git a/README.md b/README.md index 96092bb..1bb7cd2 100644 --- 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 | diff --git a/u-boot/Makefile b/u-boot/Makefile index 20e47e8..78febec 100644 --- a/u-boot/Makefile +++ b/u-boot/Makefile @@ -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) diff --git a/u-boot/include/configs/ap143.h b/u-boot/include/configs/ap143.h index 9ee9fd6..0eb7bb2 100644 --- a/u-boot/include/configs/ap143.h +++ b/u-boot/include/configs/ap143.h @@ -21,7 +21,15 @@ * 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 @@ -162,8 +170,14 @@ * 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 "\ @@ -244,23 +258,27 @@ * 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 @@ -299,10 +317,15 @@ * 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 @@ -365,10 +388,16 @@ * 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 @@ -458,10 +487,14 @@ */ #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) @@ -472,21 +505,25 @@ #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) @@ -530,23 +567,29 @@ #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 @@ -582,7 +625,8 @@ * 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) &&\