From: Zhiqiang Wang Date: Thu, 29 Aug 2013 20:10:49 +0000 (-0400) Subject: add support for tl-mr13u X-Git-Tag: 2014-11-19~59^2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b83ad04582b48c14bba398e38c18aa012f937d86;p=oweals%2Fu-boot_mod.git add support for tl-mr13u --- diff --git a/Makefile b/Makefile index 0017a4b..21ff475 100755 --- a/Makefile +++ b/Makefile @@ -59,7 +59,14 @@ tplink_mr10u: @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all @cp $(BUILD_TOPDIR)/u-boot/tuboot.bin $(BUILD_TOPDIR)/bin/temp.bin @make show_size - +tplink_mr13u: export UBOOT_FILE_NAME=uboot_for_tp-link_tl-mr13u +tplink_mr13u: export MAX_UBOOT_SIZE=64 +tplink_mr13u: export COMPRESSED_UBOOT=1 +tplink_mr13u: + @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) mr13u_config + @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all + @cp $(BUILD_TOPDIR)/u-boot/tuboot.bin $(BUILD_TOPDIR)/bin/temp.bin + @make show_size tplink_wr740n_v4: export UBOOT_FILE_NAME=uboot_for_tp-link_tl-wr740n_v4 tplink_wr740n_v4: export MAX_UBOOT_SIZE=64 tplink_wr740n_v4: export COMPRESSED_UBOOT=1 diff --git a/u-boot/Makefile b/u-boot/Makefile index ec5309e..60155b3 100755 --- a/u-boot/Makefile +++ b/u-boot/Makefile @@ -365,6 +365,18 @@ mr10u_config : unconfig hornet_common_config @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240 +mr13u_config : unconfig hornet_common_config + @echo '======= Configuring for TP-Link TL-MR13U at:' `date` '=======' + @echo "#define CONFIG_FOR_TPLINK_MR13U_V1 1" >> include/config.h + @echo "#define GPIO_SYS_LED_BIT 27" >> include/config.h + @echo "#define GPIO_SYS_LED_ON 0" >> include/config.h + @echo "#define GPIO_RST_BUTTON_BIT 11" >> include/config.h + @echo "#define DEFAULT_FLASH_SIZE_IN_MB 4" >> include/config.h + @echo "#define BOARD_CUSTOM_STRING \"AP121 (AR9331) U-Boot for TL-MR13U\"" >> include/config.h + + @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240 + + wr740n_v4_config : unconfig hornet_common_config @echo '======= Configuring for TP-Link TL-WR740N v4 at:' `date` '=======' @echo "#define CONFIG_FOR_TPLINK_WR740N_V4 1" >> include/config.h diff --git a/u-boot/board/ar7240/ap121/ap121.c b/u-boot/board/ar7240/ap121/ap121.c index 5ed9454..612d735 100755 --- a/u-boot/board/ar7240/ap121/ap121.c +++ b/u-boot/board/ar7240/ap121/ap121.c @@ -25,7 +25,7 @@ void led_toggle(void){ gpio ^= 1 << GPIO_SYS_LED_BIT; #elif defined(CONFIG_FOR_TPLINK_MR3040_V1V2) gpio ^= 1 << GPIO_INTERNET_LED_BIT; -#elif defined(CONFIG_FOR_TPLINK_MR10U_V1) +#elif defined(CONFIG_FOR_TPLINK_MR10U_V1) || defined(CONFIG_FOR_TPLINK_MR13U_V1) gpio ^= 1 << GPIO_SYS_LED_BIT; #elif defined(CONFIG_FOR_TPLINK_WR740N_V4) || defined(CONFIG_FOR_TPLINK_MR3220_V2) gpio ^= 1 << GPIO_SYS_LED_BIT; @@ -56,7 +56,7 @@ void all_led_on(void){ SETBITVAL(gpio, GPIO_INTERNET_LED_BIT, GPIO_INTERNET_LED_ON); SETBITVAL(gpio, GPIO_WLAN_LED_BIT, GPIO_WLAN_LED_ON); SETBITVAL(gpio, GPIO_ETH_LED_BIT, GPIO_ETH_LED_ON); -#elif defined(CONFIG_FOR_TPLINK_MR10U_V1) +#elif defined(CONFIG_FOR_TPLINK_MR10U_V1) || defined(CONFIG_FOR_TPLINK_MR13U_V1) SETBITVAL(gpio, GPIO_SYS_LED_BIT, GPIO_SYS_LED_ON); #elif defined(CONFIG_FOR_TPLINK_WR740N_V4) || defined(CONFIG_FOR_TPLINK_MR3220_V2) SETBITVAL(gpio, GPIO_SYS_LED_BIT, GPIO_SYS_LED_ON); @@ -98,7 +98,7 @@ void all_led_off(void){ SETBITVAL(gpio, GPIO_INTERNET_LED_BIT, !GPIO_INTERNET_LED_ON); SETBITVAL(gpio, GPIO_WLAN_LED_BIT, !GPIO_WLAN_LED_ON); SETBITVAL(gpio, GPIO_ETH_LED_BIT, !GPIO_ETH_LED_ON); -#elif defined(CONFIG_FOR_TPLINK_MR10U_V1) +#elif defined(CONFIG_FOR_TPLINK_MR10U_V1) || defined(CONFIG_FOR_TPLINK_MR13U_V1) SETBITVAL(gpio, GPIO_SYS_LED_BIT, !GPIO_SYS_LED_ON); #elif defined(CONFIG_FOR_TPLINK_WR740N_V4) || defined(CONFIG_FOR_TPLINK_MR3220_V2) SETBITVAL(gpio, GPIO_SYS_LED_BIT, !GPIO_SYS_LED_ON); @@ -224,7 +224,7 @@ void gpio_config(void){ /* Disable clock obs, added by zcf, 20110509 */ //ar7240_reg_wr (AR7240_GPIO_FUNC, (ar7240_reg_rd(AR7240_GPIO_FUNC) & 0xffe7e07f)); -#elif defined(CONFIG_FOR_TPLINK_MR10U_V1) +#elif defined(CONFIG_FOR_TPLINK_MR10U_V1) || defined(CONFIG_FOR_TPLINK_MR13U_V1) /* LED's GPIOs on MR10U: * diff --git a/u-boot/include/configs/ap121.h b/u-boot/include/configs/ap121.h index 7ade401..4d07c89 100755 --- a/u-boot/include/configs/ap121.h +++ b/u-boot/include/configs/ap121.h @@ -40,7 +40,8 @@ defined(CONFIG_FOR_TPLINK_MR3040_V1V2) || \ defined(CONFIG_FOR_TPLINK_MR10U_V1) || \ defined(CONFIG_FOR_TPLINK_WR740N_V4) || \ - defined(CONFIG_FOR_TPLINK_MR3220_V2) + defined(CONFIG_FOR_TPLINK_MR3220_V2) || \ + defined(CONFIG_FOR_TPLINK_MR13U_V1) #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init mtdparts=ar7240-nor0:128k(u-boot),1024k(kernel),2816k(rootfs),64k(config),64k(ART)"