Add support for YunCore CPE870 (AR9341 based)
authorPiotr Dymacz <pepe2k@gmail.com>
Sun, 25 Sep 2016 21:22:54 +0000 (23:22 +0200)
committerPiotr Dymacz <pepe2k@gmail.com>
Sun, 25 Sep 2016 21:22:54 +0000 (23:22 +0200)
Makefile
README.md
READMEPL.md
u-boot/Makefile
u-boot/include/configs/db12x.h

index c91b21990559c46626de73b6ffd8d1b2adf20bab..76299a0cb1549371294f3f6bb8949345c2646f8b 100644 (file)
--- 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)
 
index 8f823f16c35371fd8141a7522d81733120408220..ec72005228f890ea270055c67f951b8f53575081 100644 (file)
--- 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.*
index bc5ee8d9377289f916d9fcddc47867b18fc7ee1b..06b88bfd82e487a3ab53e9531a3329430d8c4249 100644 (file)
@@ -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.*  
index 648690bb3ecb934c4a988b5293d3a636e6777302..3178c4a7f496587a64762ca52a91efef86d385f4 100644 (file)
@@ -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)
index f65f443fdf7c72db86eb60cc3d894a0cd12979f4..29e739428a1b701c09b74406216286e08c1d4e1d 100644 (file)
        #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
 
 /*
                                "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 "\
  * 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)
 
 /*
  * 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
 
 /*
  * ===========================
  * 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
 
 /*
  * ========================
     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
  * 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
 
 /*
  * ===================