@cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all
@make --no-print-directory show_size
+villagetelco_mp2: export UBOOT_FILE_NAME=uboot_for_villagetelco_mp2
+villagetelco_mp2: export MAX_UBOOT_SIZE=192
+villagetelco_mp2: export DEVICE_VENDOR=villagetelco
+villagetelco_mp2:
+ @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) villagetelco_mp2_config
+ @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all
+ @make --no-print-directory show_size
+
gl-inet: export UBOOT_FILE_NAME=uboot_for_gl-inet
gl-inet: export MAX_UBOOT_SIZE=64
ifndef CONFIG_SKIP_LOWLEVEL_INIT
@./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
+villagetelco_mp2_config : unconfig hornet_common_config
+ @/bin/echo -e '\e[32m> Configuring for Village Telco Mesh Potato 2 at:' `date` '\e[0m'
+ @echo "#define CONFIG_FOR_MESH_POTATO_V2 1" >> include/config.h
+ @echo "#undef COMPRESSED_UBOOT" >> include/config.h
+ @echo "#define GPIO_WLAN_LED_BIT 0" >> include/config.h
+ @echo "#define GPIO_WLAN_LED_ON 1" >> include/config.h
+ @echo "#define GPIO_WAN_LED_BIT 17" >> include/config.h
+ @echo "#define GPIO_WAN_LED_ON 0" >> include/config.h
+ @echo "#define GPIO_LAN_LED_BIT 13" >> include/config.h
+ @echo "#define GPIO_LAN_LED_ON 0" >> include/config.h
+ @echo "#define GPIO_INTERNET_LED_BIT 28" >> include/config.h
+ @echo "#define GPIO_INTERNET_LED_ON 1" >> include/config.h
+ @echo "#define GPIO_RST_BUTTON_BIT 11" >> include/config.h
+ @echo "#define GPIO_RST_BUTTON_IS_ACTIVE_LOW 1" >> include/config.h
+ @echo "#define DEFAULT_FLASH_SIZE_IN_MB 16" >> include/config.h
+ @echo "#define WEBFAILSAFE_DISABLE_ART_UPGRADE 1" >> include/config.h
+ @echo "#define WEBFAILSAFE_DISABLE_UBOOT_UPGRADE 1" >> include/config.h
+ @echo "#define BOARD_CUSTOM_STRING \"AP121 (AR9331) U-Boot for Village Telco Mesh Potato 2\"" >> include/config.h
+
+ @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
+
gl-inet_config : unconfig hornet_common_config
@/bin/echo -e '\e[32m> Configuring for GL.iNet at:' `date` '\e[0m'
@echo "#define CONFIG_FOR_GL_INET 1" >> include/config.h
gpio ^= 1 << GPIO_SYS_LED_BIT;
#elif defined(CONFIG_FOR_8DEVICES_CARAMBOLA2)
gpio ^= 1 << GPIO_WLAN_LED_BIT;
-#elif defined(CONFIG_FOR_DRAGINO_V2)
+#elif defined(CONFIG_FOR_DRAGINO_V2) || defined(CONFIG_FOR_MESH_POTATO_V2)
gpio ^= 1 << GPIO_WLAN_LED_BIT;
#elif defined(CONFIG_FOR_GL_INET)
gpio ^= 1 << GPIO_WLAN_LED_BIT;
SETBITVAL(gpio, GPIO_LAN2_LED_BIT, GPIO_LAN2_LED_ON);
#elif defined(CONFIG_FOR_8DEVICES_CARAMBOLA2)
SETBITVAL(gpio, GPIO_WLAN_LED_BIT, GPIO_WLAN_LED_ON);
-#elif defined(CONFIG_FOR_DRAGINO_V2)
+#elif defined(CONFIG_FOR_DRAGINO_V2) || defined(CONFIG_FOR_MESH_POTATO_V2)
SETBITVAL(gpio, GPIO_WLAN_LED_BIT, GPIO_WLAN_LED_ON);
SETBITVAL(gpio, GPIO_WAN_LED_BIT, GPIO_WAN_LED_ON);
SETBITVAL(gpio, GPIO_LAN_LED_BIT, GPIO_LAN_LED_ON);
SETBITVAL(gpio, GPIO_LAN2_LED_BIT, !GPIO_LAN2_LED_ON);
#elif defined(CONFIG_FOR_8DEVICES_CARAMBOLA2)
SETBITVAL(gpio, GPIO_WLAN_LED_BIT, !GPIO_WLAN_LED_ON);
-#elif defined(CONFIG_FOR_DRAGINO_V2)
+#elif defined(CONFIG_FOR_DRAGINO_V2) || defined(CONFIG_FOR_MESH_POTATO_V2)
SETBITVAL(gpio, GPIO_WLAN_LED_BIT, !GPIO_WLAN_LED_ON);
SETBITVAL(gpio, GPIO_WAN_LED_BIT, !GPIO_WAN_LED_ON);
SETBITVAL(gpio, GPIO_LAN_LED_BIT, !GPIO_LAN_LED_ON);
//ar7240_reg_wr (AR7240_GPIO_FUNC, (ar7240_reg_rd(AR7240_GPIO_FUNC) & 0xffe7e07f));
#elif defined(CONFIG_FOR_8DEVICES_CARAMBOLA2)
// TODO: check GPIO config for C2
-#elif defined(CONFIG_FOR_DRAGINO_V2)
+#elif defined(CONFIG_FOR_DRAGINO_V2) || defined(CONFIG_FOR_MESH_POTATO_V2)
/* LED's GPIOs on MR3220v2:
*
#if !defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) && \
!defined(CONFIG_FOR_DLINK_DIR505_A1) && \
- !defined(CONFIG_FOR_DRAGINO_V2)
+ !defined(CONFIG_FOR_DRAGINO_V2) && \
+ !defined(CONFIG_FOR_MESH_POTATO_V2)
void fake_image_header(image_header_t *hdr, tplink_image_header_t *tpl_hdr){
memset(hdr, 0, sizeof(image_header_t));
strncpy((char *)hdr->ih_name, (char *)tpl_hdr->signiture_1, IH_NMLEN);
}
-#endif /* if !defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) && !defined(CONFIG_FOR_DLINK_DIR505_A1) && !defined(CONFIG_FOR_DRAGINO_V2) */
+#endif /* if !defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) && !defined(CONFIG_FOR_DLINK_DIR505_A1) && !defined(CONFIG_FOR_DRAGINO_V2) && !defined(CONFIG_FOR_MESH_POTATO_V2) */
int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
ulong addr, data, len;
image_header_t *hdr = &header;
#if !defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) && \
!defined(CONFIG_FOR_DLINK_DIR505_A1) && \
- !defined(CONFIG_FOR_DRAGINO_V2)
+ !defined(CONFIG_FOR_DRAGINO_V2) && \
+ !defined(CONFIG_FOR_MESH_POTATO_V2)
tplink_image_header_t *fileTag;
#endif
#if defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) || \
defined(CONFIG_FOR_DLINK_DIR505_A1) || \
- defined(CONFIG_FOR_DRAGINO_V2)
+ defined(CONFIG_FOR_DRAGINO_V2) || \
+ defined(CONFIG_FOR_MESH_POTATO_V2)
memmove(&header, (char *)addr, sizeof(image_header_t));
print_image_hdr(hdr);
#if defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) || \
defined(CONFIG_FOR_DLINK_DIR505_A1) || \
- defined(CONFIG_FOR_DRAGINO_V2)
+ defined(CONFIG_FOR_DRAGINO_V2) || \
+ defined(CONFIG_FOR_MESH_POTATO_V2)
static void print_type(image_header_t *hdr){
char *os, *arch, *type, *comp;
print_size(ntohl(hdr->kernelLen), "\n");
printf(" Load address: 0x%08X\n Entry point: 0x%08X\n\n", ntohl(hdr->kernelTextAddr), ntohl(hdr->kernelEntryPoint));
}
-#endif /* defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) || defined(CONFIG_FOR_DLINK_DIR505_A1) || defined(CONFIG_FOR_DRAGINO_V2) */
+#endif /* defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) || defined(CONFIG_FOR_DLINK_DIR505_A1) || defined(CONFIG_FOR_DRAGINO_V2) || defined(CONFIG_FOR_MESH_POTATO_V2) */
#if (CONFIG_COMMANDS & CFG_CMD_BOOTD)
int do_bootd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
#endif /* if defined(CONFIG_NETCONSOLE) */
#if defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) || \
- defined(CONFIG_FOR_DRAGINO_V2)
+ defined(CONFIG_FOR_DRAGINO_V2) || \
+ defined(CONFIG_FOR_MESH_POTATO_V2)
/*
* Erase environment sector
*/
}
U_BOOT_CMD(defenv, 1, 0, do_default_env, "reset environment variables to their default values\n", NULL);
-#endif /* if defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) || defined(CONFIG_FOR_DRAGINO_V2) */
+#endif /* if defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) || defined(CONFIG_FOR_DRAGINO_V2) || defined(CONFIG_FOR_MESH_POTATO_V2) */
#if defined(PLL_IN_FLASH_MAGIC_OFFSET)
*/
#if !defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) && \
!defined(CONFIG_FOR_DLINK_DIR505_A1) && \
- !defined(CONFIG_FOR_DRAGINO_V2)
+ !defined(CONFIG_FOR_DRAGINO_V2) && \
+ !defined(CONFIG_FOR_MESH_POTATO_V2)
#include "tpLinuxTag.h"
#endif
/* common/cmd_bootm.c */
#if defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) || \
defined(CONFIG_FOR_DLINK_DIR505_A1) || \
- defined(CONFIG_FOR_DRAGINO_V2)
+ defined(CONFIG_FOR_DRAGINO_V2) || \
+ defined(CONFIG_FOR_MESH_POTATO_V2)
void print_image_hdr(image_header_t *hdr);
#else
void print_image_hdr(tplink_image_header_t *hdr);
#define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),16000k(firmware),64k(ART)"
-#elif defined(CONFIG_FOR_DRAGINO_V2)
+#elif defined(CONFIG_FOR_DRAGINO_V2) || \
+ defined(CONFIG_FOR_MESH_POTATO_V2)
#define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init mtdparts=ar7240-nor0:192k(u-boot),64k(u-boot-env),16064k(firmware),64k(ART)"
#elif defined(CONFIG_FOR_8DEVICES_CARAMBOLA2)
#define CFG_LOAD_ADDR 0x9F050000
#define UPDATE_SCRIPT_FW_ADDR "0x9F050000"
-#elif defined(CONFIG_FOR_DRAGINO_V2)
+#elif defined(CONFIG_FOR_DRAGINO_V2) || \
+ defined(CONFIG_FOR_MESH_POTATO_V2)
#define CFG_LOAD_ADDR 0x9F040000
#define UPDATE_SCRIPT_FW_ADDR "0x9F040000"
#else
#define CONFIG_BOOTCOMMAND "bootm 0x9F080000"
#elif defined(CONFIG_FOR_8DEVICES_CARAMBOLA2)
#define CONFIG_BOOTCOMMAND "bootm 0x9F050000"
-#elif defined(CONFIG_FOR_DRAGINO_V2)
+#elif defined(CONFIG_FOR_DRAGINO_V2) || \
+ defined(CONFIG_FOR_MESH_POTATO_V2)
#define CONFIG_BOOTCOMMAND "bootm 0x9F040000"
#else
#define CONFIG_BOOTCOMMAND "bootm 0x9F020000"
/*
* Dragino 2 uses different prompt
*/
-#if defined(CONFIG_FOR_DRAGINO_V2)
+#if defined(CONFIG_FOR_DRAGINO_V2) || \
+ defined(CONFIG_FOR_MESH_POTATO_V2)
#if defined(CFG_PROMPT)
#undef CFG_PROMPT
#endif
* Address and size of Primary Environment Sector
*/
#if defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) || \
- defined(CONFIG_FOR_DRAGINO_V2)
+ defined(CONFIG_FOR_DRAGINO_V2) || \
+ defined(CONFIG_FOR_MESH_POTATO_V2)
#define CFG_ENV_IS_IN_FLASH 1
#undef CFG_ENV_IS_NOWHERE
#else
#define CFG_ENV_IS_NOWHERE 1
#endif
-#if defined(CONFIG_FOR_DRAGINO_V2)
+#if defined(CONFIG_FOR_DRAGINO_V2) || \
+ defined(CONFIG_FOR_MESH_POTATO_V2)
#define CFG_ENV_ADDR 0x9F030000
#define CFG_ENV_SIZE 0x8000
#define CFG_ENV_SECT_SIZE 0x10000
CFG_CMD_IMI)
#elif defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) || \
- defined(CONFIG_FOR_DRAGINO_V2)
+ defined(CONFIG_FOR_DRAGINO_V2) || \
+ defined(CONFIG_FOR_MESH_POTATO_V2)
#define CONFIG_COMMANDS (CFG_CMD_MEMORY | \
CFG_CMD_DHCP | \
#elif defined(CONFIG_FOR_8DEVICES_CARAMBOLA2)
#define WEBFAILSAFE_UPLOAD_UBOOT_SIZE_IN_BYTES (256 * 1024)
#define UPDATE_SCRIPT_UBOOT_SIZE_IN_BYTES "0x40000"
-#elif defined(CONFIG_FOR_DRAGINO_V2)
+#elif defined(CONFIG_FOR_DRAGINO_V2) || \
+ defined(CONFIG_FOR_MESH_POTATO_V2)
#define WEBFAILSAFE_UPLOAD_UBOOT_SIZE_IN_BYTES (192 * 1024)
#define UPDATE_SCRIPT_UBOOT_SIZE_IN_BYTES "0x30000"
#else
#define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS WEBFAILSAFE_UPLOAD_UBOOT_ADDRESS + 0x80000
#elif defined(CONFIG_FOR_8DEVICES_CARAMBOLA2)
#define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS WEBFAILSAFE_UPLOAD_UBOOT_ADDRESS + 0x50000
-#elif defined(CONFIG_FOR_DRAGINO_V2)
+#elif defined(CONFIG_FOR_DRAGINO_V2) || \
+ defined(CONFIG_FOR_MESH_POTATO_V2)
#define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS WEBFAILSAFE_UPLOAD_UBOOT_ADDRESS + 0x40000
#else
#define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS WEBFAILSAFE_UPLOAD_UBOOT_ADDRESS + 0x20000
#elif defined(CONFIG_FOR_8DEVICES_CARAMBOLA2)
// Carambola 2: 256k(U-Boot),64k(U-Boot env),64k(ART)
#define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (384 * 1024)
-#elif defined(CONFIG_FOR_DRAGINO_V2)
+#elif defined(CONFIG_FOR_DRAGINO_V2) || \
+ defined(CONFIG_FOR_MESH_POTATO_V2)
// Dragino 2: 192k(U-Boot),64k(U-Boot env),64k(ART)
#define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (320 * 1024)
#elif defined(CONFIG_FOR_GS_OOLITE_V1_DEV)
//#define OFFSET_MAC_ADDRESS 0x000004
//#define OFFSET_MAC_ADDRESS2 0x000016
#elif defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) || \
- defined(CONFIG_FOR_DRAGINO_V2)
+ defined(CONFIG_FOR_DRAGINO_V2) || \
+ defined(CONFIG_FOR_MESH_POTATO_V2)
// Carambola 2 and Dragino 2 have two MAC addresses at the beginning of ART partition
#define OFFSET_MAC_DATA_BLOCK 0xFF0000
#define OFFSET_MAC_DATA_BLOCK_LENGTH 0x010000
!defined(CONFIG_FOR_DLINK_DIR505_A1) && \
!defined(CONFIG_FOR_GS_OOLITE_V1_DEV) && \
!defined(CONFIG_FOR_DRAGINO_V2) && \
+ !defined(CONFIG_FOR_MESH_POTATO_V2) && \
!defined(CONFIG_FOR_GL_INET)
#define OFFSET_ROUTER_MODEL 0x00FD00
#endif
#define PLL_IN_FLASH_DATA_BLOCK_OFFSET 0x00040000
#define PLL_IN_FLASH_DATA_BLOCK_LENGTH 0x00010000
#define PLL_IN_FLASH_MAGIC_OFFSET 0x0000FFF0 // last 16 bytes
-#elif defined(CONFIG_FOR_DRAGINO_V2)
+#elif defined(CONFIG_FOR_DRAGINO_V2) || \
+ defined(CONFIG_FOR_MESH_POTATO_V2)
/*
* We will store PLL and CLOCK registers
* configuration at the end of environment
wasp_set_cca();
#endif
-#if defined(CONFIG_FOR_DRAGINO_V2)
+#if defined(CONFIG_FOR_DRAGINO_V2) || defined(CONFIG_FOR_MESH_POTATO_V2)
// Restore WAN/LAN LEDs (BIT 3 and 7 in GPIO_FUNCTION_1)
ar7240_reg_wr(AR7240_GPIO_FUNC, (ar7240_reg_rd(AR7240_GPIO_FUNC) | 0x88));
#endif