From eab5d933baf84116699cf099036d859cb4f39580 Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Mon, 7 Nov 2016 17:32:01 +0100 Subject: [PATCH] Add support for YunCore CPE830 (QCA9531 based) CPE830 is a clone of AP90Q, with different type of antenna (panel) and additional 4 LEDs for WiFi signal level indication. --- Makefile | 3 ++- README.md | 2 ++ READMEPL.md | 2 ++ u-boot/Makefile | 7 +++++ u-boot/cpu/mips/ar7240/qca_gpio_init.S | 5 ++-- u-boot/include/configs/ap143.h | 36 +++++++++++++++++++------- 6 files changed, 43 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 76299a0..389f9bb 100644 --- a/Makefile +++ b/Makefile @@ -245,7 +245,8 @@ village-telco_mesh-potato_v2: wallys_dr531: @$(call build,192,1,ETH_CONFIG=_s27) -yuncore_ap90q: +yuncore_ap90q \ +yuncore_cpe830: @$(call build,256,1,ETH_CONFIG=_s27) yuncore_cpe870: diff --git a/README.md b/README.md index d7218b5..4c58b70 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ Currently supported devices: - Comfast CF-E320N v2 - Comfast CF-E520N/CF-E530N - YunCore AP90Q + - YunCore CPE830 I tested this modification on most of these devices, with OpenWrt and OFW firmware. If you are not sure about the version of your device, please contact with me **before** you try to make an upgrade. Changing bootloader to a wrong version will probably damage your router and you will need special hardware to fix it, so please, **be very careful**. @@ -144,6 +145,7 @@ More information about supported devices: | Comfast CF-E320N v2 | QCA9531 | 16 MiB | 64 MiB DDR2 | 64 KiB, LZMA | RO | | Comfast CF-E520N/CF-E530N | QCA9531 | 8 MiB | 32 MiB DDR2 | 64 KiB, LZMA | RO | | YunCore AP90Q | QCA9531 | 16 MiB | 128 MiB DDR2 | 256 KiB | R/W | +| YunCore CPE830 | QCA9531 | 16 MiB | 64 MiB DDR2 | 256 KiB | R/W | | YunCore CPE870 | AR9341 | 8 MiB | 64 MiB DDR2 | 64 KiB, LZMA | R/W | *(LZMA) - U-Boot binary image is compressed with LZMA.* diff --git a/READMEPL.md b/READMEPL.md index 6c60b98..6651887 100644 --- a/READMEPL.md +++ b/READMEPL.md @@ -102,6 +102,7 @@ Lista obecnie wspieranych urządzeń: - Comfast CF-E320N v2 - Comfast CF-E520N/CF-E530N - YunCore AP90Q + - YunCore CPE830 Przetestowałem swoją modyfikację na większości z wymienionych powyżej urządzeń, z obrazami OpenWrt i oficjalnym firmware producenta. Jeżeli nie jesteś pewien wersji sprzętowej swojego urządzenia, proszę skontaktuj się ze mną **zanim** dokonasz wymiany obrazu bootloadera. Zmiana na niewłaściwą wersję najprawdopodobniej doprowadzi do uszkodzenia Twojego urządzenia i jedyną możliwością jego ponownego uruchomienia będzie przeprogramowanie kości FLASH w zewnętrznym programatorze. @@ -141,6 +142,7 @@ Dodatkowe informacje o wspieranych urządzeniach: | Comfast CF-E320N v2 | QCA9531 | 16 MiB | 64 MiB DDR2 | 64 KiB, LZMA | RO | | Comfast CF-E520N/CF-E530N | QCA9531 | 8 MiB | 32 MiB DDR2 | 64 KiB, LZMA | RO | | YunCore AP90Q | QCA9531 | 16 MiB | 128 MiB DDR2 | 256 KiB | R/W | +| YunCore CPE830 | QCA9531 | 16 MiB | 64 MiB DDR2 | 256 KiB | R/W | | YunCore CPE870 | AR9341 | 8 MiB | 64 MiB DDR2 | 64 KiB, LZMA | R/W | *(LZMA) - obraz binarny U-Boot został dodatkowo skompresowany przy pomocy LZMA.* diff --git a/u-boot/Makefile b/u-boot/Makefile index 3178c4a..585367e 100644 --- a/u-boot/Makefile +++ b/u-boot/Makefile @@ -604,6 +604,13 @@ yuncore_ap90q: qca953x_common @$(call define_add,CFG_ATH_GMAC_NMACS,2) @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240 +yuncore_cpe830: qca953x_common + @$(call config_init,YunCore CPE830,cpe830,16,17,1,QCA_QCA953X_SOC) + @$(call define_add,CONFIG_FOR_YUNCORE_CPE830,1) + @$(call define_add,CFG_ATHRS27_PHY,1) + @$(call define_add,CFG_ATH_GMAC_NMACS,2) + @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240 + yuncore_cpe870: ar934x_common @$(call config_init,YunCore CPE870,cpe870,8,16,1,QCA_AR9341_SOC) @$(call define_add,CONFIG_FOR_YUNCORE_CPE870,1) diff --git a/u-boot/cpu/mips/ar7240/qca_gpio_init.S b/u-boot/cpu/mips/ar7240/qca_gpio_init.S index 5b2c01b..9b617e4 100644 --- a/u-boot/cpu/mips/ar7240/qca_gpio_init.S +++ b/u-boot/cpu/mips/ar7240/qca_gpio_init.S @@ -622,7 +622,7 @@ gpio_setup: */ /* - * YunCore AP90Q has on PCB, on button reset + * Some YunCore have on PCB, on button reset * line (GPIO17) a huge capacitor (~10u)... * which means that before the voltage level * rises to VCC, our O/C recovery mode reads @@ -632,7 +632,8 @@ gpio_setup: * * FIXME! */ -#if defined(CONFIG_FOR_YUNCORE_AP90Q) +#if defined(CONFIG_FOR_YUNCORE_AP90Q) ||\ + defined(CONFIG_FOR_YUNCORE_CPE830) li t8, 0 li t9, 0x7530 diff --git a/u-boot/include/configs/ap143.h b/u-boot/include/configs/ap143.h index 21f8e91..c2cbf5e 100644 --- a/u-boot/include/configs/ap143.h +++ b/u-boot/include/configs/ap143.h @@ -90,6 +90,15 @@ #define CONFIG_QCA_GPIO_MASK_IN GPIO17 #define CONFIG_QCA_GPIO_MASK_OUT_INIT_H CONFIG_QCA_GPIO_MASK_LED_ACT_L +#elif defined(CONFIG_FOR_YUNCORE_CPE830) + + #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO0 | GPIO1 | GPIO2 |\ + GPIO3 | GPIO4 | GPIO12 |\ + GPIO16 + #define CONFIG_QCA_GPIO_MASK_OUT CONFIG_QCA_GPIO_MASK_LED_ACT_L + #define CONFIG_QCA_GPIO_MASK_IN GPIO17 + #define CONFIG_QCA_GPIO_MASK_OUT_INIT_H CONFIG_QCA_GPIO_MASK_LED_ACT_L + #elif defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526) #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO4 | GPIO11 | GPIO12 |\ @@ -141,7 +150,8 @@ "rootfstype=jffs2 init=/sbin/init "\ "mtdparts=ath-nor0:256k(u-boot),64k(u-boot-env),6336k(rootfs),1408k" -#elif defined(CONFIG_FOR_YUNCORE_AP90Q) ||\ +#elif defined(CONFIG_FOR_YUNCORE_AP90Q) ||\ + defined(CONFIG_FOR_YUNCORE_CPE830) ||\ defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526) #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 "\ @@ -167,7 +177,8 @@ #define CFG_LOAD_ADDR 0x9F020000 #elif defined(CONFIG_FOR_WALLYS_DR531) #define CFG_LOAD_ADDR 0x9F050000 -#elif defined(CONFIG_FOR_YUNCORE_AP90Q) ||\ +#elif defined(CONFIG_FOR_YUNCORE_AP90Q) ||\ + defined(CONFIG_FOR_YUNCORE_CPE830) ||\ defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526) #define CFG_LOAD_ADDR 0x9FE80000 #endif @@ -198,7 +209,8 @@ #define CFG_ENV_ADDR 0x9F030000 #define CFG_ENV_SIZE 0xF800 #define CFG_ENV_SECT_SIZE 0x10000 -#elif defined(CONFIG_FOR_YUNCORE_AP90Q) ||\ +#elif defined(CONFIG_FOR_YUNCORE_AP90Q) ||\ + defined(CONFIG_FOR_YUNCORE_CPE830) ||\ defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526) #define CFG_ENV_ADDR 0x9F040000 #define CFG_ENV_SIZE 0xFC00 @@ -240,7 +252,8 @@ #define OFFSET_MAC_DATA_BLOCK 0x030000 #define OFFSET_MAC_DATA_BLOCK_LENGTH 0x010000 #define OFFSET_MAC_ADDRESS 0x00F810 -#elif defined(CONFIG_FOR_YUNCORE_AP90Q) ||\ +#elif defined(CONFIG_FOR_YUNCORE_AP90Q) ||\ + defined(CONFIG_FOR_YUNCORE_CPE830) ||\ defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526) #define OFFSET_MAC_DATA_BLOCK 0xFF0000 #define OFFSET_MAC_DATA_BLOCK_LENGTH 0x010000 @@ -271,7 +284,8 @@ * HTTP recovery configuration * =========================== */ -#if defined(CONFIG_FOR_YUNCORE_AP90Q) ||\ +#if defined(CONFIG_FOR_YUNCORE_AP90Q) ||\ + defined(CONFIG_FOR_YUNCORE_CPE830) ||\ defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526) #define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS CFG_FLASH_BASE + 0x50000 #else @@ -289,8 +303,9 @@ defined(CONFIG_FOR_TPLINK_WR841N_V11) ||\ defined(CONFIG_FOR_TPLINK_WR841N_V9) #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (192 * 1024) -#elif defined(CONFIG_FOR_WALLYS_DR531) ||\ - defined(CONFIG_FOR_YUNCORE_AP90Q) ||\ +#elif defined(CONFIG_FOR_WALLYS_DR531) ||\ + defined(CONFIG_FOR_YUNCORE_AP90Q) ||\ + defined(CONFIG_FOR_YUNCORE_CPE830) ||\ defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526) #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (384 * 1024) #endif @@ -326,7 +341,8 @@ #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET 0x30000 #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE 0x10000 -#elif defined(CONFIG_FOR_YUNCORE_AP90Q) ||\ +#elif defined(CONFIG_FOR_YUNCORE_AP90Q) ||\ + defined(CONFIG_FOR_YUNCORE_CPE830) ||\ defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526) #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET 0x40000 @@ -345,11 +361,13 @@ !defined(CONFIG_FOR_COMFAST_CF_E530N) &&\ !defined(CONFIG_FOR_WALLYS_DR531) &&\ !defined(CONFIG_FOR_YUNCORE_AP90Q) &&\ + !defined(CONFIG_FOR_YUNCORE_CPE830) &&\ !defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526) #define CONFIG_UPG_UBOOT_SIZE_BACKUP_HEX 0x20000 #endif -#if defined(CONFIG_FOR_YUNCORE_AP90Q) ||\ +#if defined(CONFIG_FOR_YUNCORE_AP90Q) ||\ + defined(CONFIG_FOR_YUNCORE_CPE830) ||\ defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526) #define CONFIG_UPG_SCRIPTS_FW_ADDR_HEX 0x9F050000 #endif -- 2.25.1