From: Piotr Dymacz Date: Tue, 2 Jan 2018 16:54:30 +0000 (+0100) Subject: Add support for ALFA Network N5Q (AR9344 based) X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1776cb1d7caa377855aa889b3934ca71997c042d;p=oweals%2Fu-boot_mod.git Add support for ALFA Network N5Q (AR9344 based) --- diff --git a/Makefile b/Makefile index 2962b9c..fdeb44a 100644 --- 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) diff --git a/README.md b/README.md index 1bb7cd2..3cfed26 100644 --- 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 | diff --git a/u-boot/Makefile b/u-boot/Makefile index 78febec..a11808b 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_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) diff --git a/u-boot/include/configs/db12x.h b/u-boot/include/configs/db12x.h index 3664d7b..7f11b04 100644 --- a/u-boot/include/configs/db12x.h +++ b/u-boot/include/configs/db12x.h @@ -21,7 +21,14 @@ * 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 @@ -85,7 +92,13 @@ * 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 "\ @@ -125,7 +138,11 @@ * 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 @@ -150,7 +167,12 @@ * 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 @@ -190,8 +212,14 @@ * 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 @@ -244,8 +272,18 @@ #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) @@ -270,7 +308,12 @@ */ #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 @@ -295,7 +338,8 @@ * 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)