Add support for Wallys DR531 (QCA9531 v2)
authorPiotr Dymacz <pepe2k@gmail.com>
Tue, 14 Jun 2016 19:24:52 +0000 (21:24 +0200)
committerPiotr Dymacz <pepe2k@gmail.com>
Tue, 14 Jun 2016 19:24:52 +0000 (21:24 +0200)
Makefile
u-boot/Makefile
u-boot/include/configs/ap143.h

index fe518d4eab4c97b438623fe6b5f52f195a57b7d3..c1610be19e6b319fe465e6cb5e703f63019714ab 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -257,6 +257,17 @@ gl-inet:
        @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all
        @make --no-print-directory show_size
 
+wallys_dr531:  export UBOOT_FILE_NAME=uboot_for_wallys_dr531
+wallys_dr531:  export CONFIG_MAX_UBOOT_SIZE_KB=192
+ifndef CONFIG_SKIP_LOWLEVEL_INIT
+wallys_dr531:  export COMPRESSED_UBOOT=1
+endif
+wallys_dr531:  export ETH_CONFIG=_s27
+wallys_dr531:
+       @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) dr531_config
+       @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all
+       @make --no-print-directory show_size
+
 ifdef CONFIG_SKIP_LOWLEVEL_INIT
   ifdef DISABLE_CONSOLE_OUTPUT
 show_size:     export UBOOT_FILE_NAME_SUFFIX=__SILENT-CONSOLE__RAM
index 384e75fb6670a1dfc2bf0c676aad0b8ede15bf96..9b07ac795c70ba07edf6243b1da4f9854590e776 100644 (file)
@@ -599,6 +599,19 @@ ap143_common_config : common_config
        @echo "#define CONFIG_ATHEROS                       1" >> include/config.h
        @echo "#define CONFIG_MACH_QCA953x                  1" >> include/config.h
 
+dr531_config : unconfig ap143_common_config
+       @/bin/echo -e '\e[32m> Configuring for Wallys DR531 at:' `date` '\e[0m'
+       @echo "#define SOC_TYPE               QCA_QCA953X_SOC" >> include/config.h
+       @echo "#define CONFIG_FOR_WALLYS_DR531              1" >> include/config.h
+       @echo "#define CFG_ATHRS27_PHY                      1" >> include/config.h
+       @echo "#define CFG_ATH_GMAC_NMACS                   2" >> include/config.h
+       @echo "#define CONFIG_DEFAULT_FLASH_SIZE_IN_MB      8" >> include/config.h
+       @echo "#define CONFIG_GPIO_RESET_BTN               17" >> include/config.h
+       @echo "#define CONFIG_GPIO_RESET_BTN_ACTIVE_LOW     1" >> include/config.h
+       @echo "#define CONFIG_BOARD_CUSTOM_STRING           \"Wallys DR531\"" >> include/config.h
+
+       @./mkconfig -a ap143 mips mips ap143 ar7240 ar7240
+
 wr820n_CN_config : unconfig ap143_common_config
        @/bin/echo -e '\e[32m> Configuring for TP-Link TL-WR820N CN at:' `date` '\e[0m'
        @echo "#define SOC_TYPE               QCA_QCA953X_SOC" >> include/config.h
index b25e9c905b60546789425de4512d249adba6928c..b99c816b7057159ab8b5ad61b0f0491711f7bd39 100644 (file)
        /* Initial states */
        #define CONFIG_QCA_GPIO_MASK_OUTPUTS_INIT_HI    CONFIG_QCA_GPIO_MASK_LEDS_ACTIVE_LO
 
+#elif defined(CONFIG_FOR_WALLYS_DR531)
+       /* LEDs */
+       #define CONFIG_QCA_GPIO_MASK_LEDS_ACTIVE_LO             (GPIO11 | GPIO12 | GPIO13 | GPIO14 |\
+                                                                                                        GPIO15 | GPIO16)
+
+       /* Outputs, inputs */
+       #define CONFIG_QCA_GPIO_MASK_OUTPUTS                    CONFIG_QCA_GPIO_MASK_LEDS_ACTIVE_LO
+       #define CONFIG_QCA_GPIO_MASK_INPUTS                             GPIO17
+
+       /* Initial states */
+       #define CONFIG_QCA_GPIO_MASK_OUTPUTS_INIT_HI    CONFIG_QCA_GPIO_MASK_LEDS_ACTIVE_LO
+
 #endif
 
 /*
 #elif defined(CONFIG_FOR_TPLINK_WR841N_V9) ||\
          defined(CONFIG_FOR_TPLINK_WR802N)
        #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init mtdparts=ath-nor0:128k(u-boot),1024k(kernel),2816k(rootfs),64k(config),64k(art)"
+#elif defined(CONFIG_FOR_WALLYS_DR531)
+       #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 rootfstype=jffs2 init=/sbin/init mtdparts=ath-nor0:256k(u-boot),64k(u-boot-env),6336k(rootfs),1408k"
 #endif
 
 /*
        #define CFG_LOAD_ADDR                    0x9F020000
        #define UPDATE_SCRIPT_FW_ADDR   "0x9F020000"
        #define CONFIG_BOOTCOMMAND              "bootm 0x9F020000"
+#elif defined(CONFIG_FOR_WALLYS_DR531)
+       #define CFG_LOAD_ADDR                    0x9F050000
+       #define UPDATE_SCRIPT_FW_ADDR   "0x9F050000"
+       #define CONFIG_BOOTCOMMAND              "bootm 0x9F050000"
 #endif
 
 #define CONFIG_IPADDR                  192.168.1.1
        defined(CONFIG_FOR_TPLINK_WR802N)    ||\
        defined(CONFIG_FOR_TPLINK_WR841N_V9)
        #define CONFIG_QCA_PLL          QCA_PLL_PRESET_550_400_200
+#elif defined(CONFIG_FOR_WALLYS_DR531)
+       #define CONFIG_QCA_PLL          QCA_PLL_PRESET_650_400_200
 #endif
 
 /*
        #define CFG_ENV_ADDR            0x9F01EC00
        #define CFG_ENV_SIZE            0x1000
        #define CFG_ENV_SECT_SIZE       0x10000
+#elif defined(CONFIG_FOR_WALLYS_DR531)
+       #define CFG_ENV_ADDR            0x9F030000
+       #define CFG_ENV_SIZE            0xF800
+       #define CFG_ENV_SECT_SIZE       0x10000
 #endif
 
 /*
                                                         CFG_CMD_ITEST  | \
                                                         CFG_CMD_ENV    | \
                                                         CFG_CMD_LOADB)
+
+#elif defined(CONFIG_FOR_WALLYS_DR531)
+
+       #define CONFIG_COMMANDS (CFG_CMD_MEMORY | \
+                                                        CFG_CMD_DHCP   | \
+                                                        CFG_CMD_PING   | \
+                                                        CFG_CMD_FLASH  | \
+                                                        CFG_CMD_NET    | \
+                                                        CFG_CMD_RUN    | \
+                                                        CFG_CMD_DATE   | \
+                                                        CFG_CMD_SNTP   | \
+                                                        CFG_CMD_ECHO   | \
+                                                        CFG_CMD_BOOTD  | \
+                                                        CFG_CMD_ITEST  | \
+                                                        CFG_CMD_IMI    | \
+                                                        CFG_CMD_ENV    | \
+                                                        CFG_CMD_LOADB)
+
 #endif
 
 // Enable NetConsole and custom NetConsole port
        defined(CONFIG_FOR_TPLINK_WR802N)    ||\
        defined(CONFIG_FOR_TPLINK_WR841N_V9)
        #define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS               WEBFAILSAFE_UPLOAD_UBOOT_ADDRESS + 0x20000
+#elif defined(CONFIG_FOR_WALLYS_DR531)
+       #define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS               WEBFAILSAFE_UPLOAD_UBOOT_ADDRESS + 0x50000
 #endif
 
 // U-Boot partition size
        defined(CONFIG_FOR_TPLINK_WR841N_V9)
        #define UPDATE_SCRIPT_UBOOT_SIZE_IN_BYTES                       "0x1EC00"
        #define UPDATE_SCRIPT_UBOOT_BACKUP_SIZE_IN_BYTES        "0x20000"
+#elif defined(CONFIG_FOR_WALLYS_DR531)
+       #define UPDATE_SCRIPT_UBOOT_SIZE_IN_BYTES                       "0x30000"
+       #define UPDATE_SCRIPT_UBOOT_BACKUP_SIZE_IN_BYTES        UPDATE_SCRIPT_UBOOT_SIZE_IN_BYTES
 #endif
 
 // ART partition size
        defined(CONFIG_FOR_TPLINK_WR802N)    ||\
        defined(CONFIG_FOR_TPLINK_WR841N_V9)
        #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES        (192 * 1024)
+#elif defined(CONFIG_FOR_WALLYS_DR531)
+       // Wallys DR531: 192k(U-Boot),64k(U-Boot env),64k(partition-table),64k(ART)
+       #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES        (384 * 1024)
 #endif
 
 // progress state info
 #define CONFIG_PCI 1
 #if defined(CONFIG_FOR_TPLINK_WR820N_CN) ||\
        defined(CONFIG_FOR_TPLINK_WR802N)    ||\
-       defined(CONFIG_FOR_TPLINK_WR841N_V9)
+       defined(CONFIG_FOR_TPLINK_WR841N_V9) ||\
+       defined(CONFIG_FOR_WALLYS_DR531)
        #define WLANCAL                                 0x9fff1000
        #define BOARDCAL                                0x9fff0000
 #endif
        #define OFFSET_MAC_ADDRESS                              0x00FC00
        #define OFFSET_ROUTER_MODEL                             0x00FD00
        #define OFFSET_PIN_NUMBER                               0x00FE00
+#elif defined(CONFIG_FOR_WALLYS_DR531)
+       #define OFFSET_MAC_DATA_BLOCK                   0x030000
+       #define OFFSET_MAC_DATA_BLOCK_LENGTH    0x010000
+       #define OFFSET_MAC_ADDRESS                              0x00F810
 #endif
 
 /*
        #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET    0x00010000
        #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE              0x00010000
 
+#elif defined(CONFIG_FOR_WALLYS_DR531)
+       #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET    0x00030000
+       #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE              0x00010000
 #endif
 
 #if defined(CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET)