From: Piotr Dymacz Date: Sun, 25 Sep 2016 21:22:54 +0000 (+0200) Subject: Add support for YunCore CPE870 (AR9341 based) X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3fb87f47a54d45b87828b080fb1bfe06ba07c7c8;p=oweals%2Fu-boot_mod.git Add support for YunCore CPE870 (AR9341 based) --- diff --git a/Makefile b/Makefile index c91b219..76299a0 100644 --- a/Makefile +++ b/Makefile @@ -248,6 +248,9 @@ wallys_dr531: yuncore_ap90q: @$(call build,256,1,ETH_CONFIG=_s27) +yuncore_cpe870: + @$(call build,64,1,ETH_CONFIG=_s27) + zbtlink_zbt-we1526: @$(call build,256,1,ETH_CONFIG=_s27) diff --git a/README.md b/README.md index 8f823f1..ec72005 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ Currently supported devices: - TP-Link TL-WR841N/D v8 - TP-Link TL-WA830RE v2 - TP-Link TL-WA801ND v2 + - YunCore CPE870 - **Atheros AR9344**: - TP-Link TL-WDR3600 v1 @@ -143,6 +144,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 CPE870 | AR9341 | 8 MiB | 64 MiB DDR2 | 64 KiB, LZMA | R/W | *(LZMA) - U-Boot binary image is compressed with LZMA.* *(R/W) - environment exists in separate FLASH block which allows you to save it and keep after power down.* diff --git a/READMEPL.md b/READMEPL.md index bc5ee8d..06b88bf 100644 --- a/READMEPL.md +++ b/READMEPL.md @@ -85,6 +85,7 @@ Lista obecnie wspieranych urządzeń: - TP-Link TL-WR841N/D v8 - TP-Link TL-WA830RE v2 - TP-Link TL-WA801ND v2 + - YunCore CPE870 - **Atheros AR9344**: - TP-Link TL-WDR3600 v1 @@ -140,6 +141,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 CPE870 | AR9341 | 8 MiB | 64 MiB DDR2 | 64 KiB, LZMA | R/W | *(LZMA) - obraz binarny U-Boot został dodatkowo skompresowany przy pomocy LZMA.* *(R/W) - zmienne środowiskowe przechowywane są w osobnym bloku FLASH, co pozwala na ich zachowanie po odłączeniu zasilaniu.* diff --git a/u-boot/Makefile b/u-boot/Makefile index 648690b..3178c4a 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_cpe870: ar934x_common + @$(call config_init,YunCore CPE870,cpe870,8,16,1,QCA_AR9341_SOC) + @$(call define_add,CONFIG_FOR_YUNCORE_CPE870,1) + @$(call define_add,CFG_ATHRS27_PHY,1) + @$(call define_add,CFG_AG7240_NMACS,2) + @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240 + zbtlink_zbt-we1526: qca953x_common @$(call config_init,Zbtlink ZBT-WE1526,zbt-we1526,16,17,1,QCA_QCA953X_SOC) @$(call define_add,CONFIG_FOR_ZBTLINK_ZBT_WE1526,1) diff --git a/u-boot/include/configs/db12x.h b/u-boot/include/configs/db12x.h index f65f443..29e7394 100644 --- a/u-boot/include/configs/db12x.h +++ b/u-boot/include/configs/db12x.h @@ -72,6 +72,15 @@ #define CONFIG_QCA_GPIO_MASK_IN GPIO16 | GPIO17 #define CONFIG_QCA_GPIO_MASK_OUT_INIT_H CONFIG_QCA_GPIO_MASK_LED_ACT_L +#elif defined(CONFIG_FOR_YUNCORE_CPE870) + + #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO0 | GPIO1 | GPIO2 |\ + GPIO3 | GPIO13 | GPIO19 |\ + GPIO20 + #define CONFIG_QCA_GPIO_MASK_OUT CONFIG_QCA_GPIO_MASK_LED_ACT_L + #define CONFIG_QCA_GPIO_MASK_IN GPIO16 + #define CONFIG_QCA_GPIO_MASK_OUT_INIT_H CONFIG_QCA_GPIO_MASK_LED_ACT_L + #endif /* @@ -87,6 +96,13 @@ "rootfstype=squashfs init=/sbin/init "\ "mtdparts=ath-nor0:256k(u-boot),64k(u-boot-env),6336k(rootfs),1408k(uImage),64k(mib0),64k(art)" +#elif defined(CONFIG_FOR_YUNCORE_CPE870) + + #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 "\ + "rootfstype=squashfs,jffs2 init=/sbin/init "\ + "mtdparts=ath-nor0:64k(u-boot),64k(u-boot-env),6528k(rootfs),1408K(uImage)"\ + ",7936k@0x20000(firmware),64k(NVRAM),64k(ART),8128k@0x00000(firmware2)" + #else #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 "\ @@ -100,7 +116,12 @@ * Load address and boot command * ============================= */ -#define CFG_LOAD_ADDR 0x9F020000 +#if defined(CONFIG_FOR_YUNCORE_CPE870) + #define CFG_LOAD_ADDR 0x9F680000 +#else + #define CFG_LOAD_ADDR 0x9F020000 +#endif + #define CONFIG_BOOTCOMMAND "bootm " MK_STR(CFG_LOAD_ADDR) /* @@ -108,9 +129,15 @@ * Environment configuration * ========================= */ -#define CFG_ENV_ADDR 0x9F01EC00 -#define CFG_ENV_SIZE 0x1000 -#define CFG_ENV_SECT_SIZE 0x10000 +#if defined(CONFIG_FOR_YUNCORE_CPE870) + #define CFG_ENV_ADDR 0x9F020000 + #define CFG_ENV_SIZE 0xFC00 + #define CFG_ENV_SECT_SIZE 0x10000 +#else + #define CFG_ENV_ADDR 0x9F01EC00 + #define CFG_ENV_SIZE 0x1000 + #define CFG_ENV_SECT_SIZE 0x10000 +#endif /* * =========================== @@ -126,21 +153,52 @@ * MAC address/es, model and WPS pin offsets in FLASH * ================================================== */ -#define OFFSET_MAC_DATA_BLOCK 0x010000 -#define OFFSET_MAC_DATA_BLOCK_LENGTH 0x010000 -#define OFFSET_MAC_ADDRESS 0x00FC00 -#define OFFSET_ROUTER_MODEL 0x00FD00 -#define OFFSET_PIN_NUMBER 0x00FE00 +#if defined(CONFIG_FOR_YUNCORE_CPE870) + #define OFFSET_MAC_DATA_BLOCK 0xFF0000 + #define OFFSET_MAC_DATA_BLOCK_LENGTH 0x010000 + #define OFFSET_MAC_ADDRESS 0x000000 +#else + #define OFFSET_MAC_DATA_BLOCK 0x010000 + #define OFFSET_MAC_DATA_BLOCK_LENGTH 0x010000 + #define OFFSET_MAC_ADDRESS 0x00FC00 + #define OFFSET_ROUTER_MODEL 0x00FD00 + #define OFFSET_PIN_NUMBER 0x00FE00 +#endif + +/* + * ========================= + * Custom changes per device + * ========================= + */ + +/* + * YunCore CPE870 is limited to 64 KB only, + * disable some commands + */ +#if defined(CONFIG_FOR_YUNCORE_CPE870) + #undef CONFIG_CMD_DHCP + #undef CONFIG_CMD_LOADB + #undef CONFIG_CMD_SNTP + #undef CONFIG_CMD_IMI +#endif /* * =========================== * HTTP recovery configuration * =========================== */ -#define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS CFG_LOAD_ADDR +#if defined(CONFIG_FOR_YUNCORE_CPE870) + #define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS CFG_FLASH_BASE + 0x20000 +#else + #define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS CFG_LOAD_ADDR +#endif /* Firmware size limit */ -#define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (192 * 1024) +#if defined(CONFIG_FOR_YUNCORE_CPE870) + #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (256 * 1024) +#else + #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (192 * 1024) +#endif /* * ======================== @@ -155,7 +213,8 @@ defined(CONFIG_FOR_TPLINK_WDR3600_V1) ||\ defined(CONFIG_FOR_TPLINK_WDR43X0_V1) ||\ defined(CONFIG_FOR_TPLINK_WDR3500_V1) ||\ - defined(CONFIG_FOR_TPLINK_WR841N_V8) + defined(CONFIG_FOR_TPLINK_WR841N_V8) ||\ + defined(CONFIG_FOR_YUNCORE_CPE870) #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET 0x10000 #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE 0x10000 @@ -167,7 +226,13 @@ * For upgrade scripts in environment * ================================== */ -#define CONFIG_UPG_UBOOT_SIZE_BACKUP_HEX 0x20000 +#if !defined(CONFIG_FOR_YUNCORE_CPE870) + #define CONFIG_UPG_UBOOT_SIZE_BACKUP_HEX 0x20000 +#endif + +#if defined(CONFIG_FOR_YUNCORE_CPE870) + #define CONFIG_UPG_SCRIPTS_FW_ADDR_HEX 0x9F020000 +#endif /* * ===================