@cp $(BUILD_TOPDIR)/u-boot/tuboot.bin $(BUILD_TOPDIR)/bin/temp.bin
@make show_size
+tplink_wa830re_v2: export UBOOT_FILE_NAME=uboot_for_tp-link_tl-wa830re_v2
+tplink_wa830re_v2: export MAX_UBOOT_SIZE=64
+tplink_wa830re_v2: export COMPRESSED_UBOOT=1
+tplink_wa830re_v2: export ETH_CONFIG=_s27
+tplink_wa830re_v2:
+ @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) wa830re_v2_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
+
dlink_dir505: export UBOOT_FILE_NAME=uboot_for_d-link_dir-505
dlink_dir505: export MAX_UBOOT_SIZE=64
dlink_dir505: export COMPRESSED_UBOOT=1
@./mkconfig -a db12x mips mips db12x ar7240 ar7240
wr841n_v8_config : unconfig wasp_common_config
- @echo '======= Configuring for TP-Link TL-WR841N/D at:' `date` '======='
+ @echo '======= Configuring for TP-Link TL-WR841N/D v8 at:' `date` '======='
@echo "#define CONFIG_FOR_TPLINK_WR841N_V8 1" >> include/config.h
@echo "#define CONFIG_AP123 1" >> include/config.h
@echo "#define DDR2_32BIT_SUPPORT 1" >> include/config.h
@./mkconfig -a db12x mips mips db12x ar7240 ar7240
+wa830re_v2_config : unconfig wasp_common_config
+ @echo '======= Configuring for TP-Link TL-WA830RE v2 at:' `date` '======='
+ @echo "#define CONFIG_FOR_TPLINK_WA830RE_V2 1" >> include/config.h
+ @echo "#define CONFIG_AP123 1" >> include/config.h
+ @echo "#define DDR2_32BIT_SUPPORT 1" >> include/config.h
+ @echo "#define CFG_ATHRS27_PHY 1" >> include/config.h
+ @echo "#define CFG_AG7240_NMACS 2" >> include/config.h
+ @echo "#define GPIO_SYS_LED_BIT 14" >> include/config.h
+ @echo "#define GPIO_SYS_LED_ON 0" >> include/config.h
+ @echo "#define GPIO_LAN_LED_BIT 18" >> include/config.h
+ @echo "#define GPIO_LAN_LED_ON 0" >> include/config.h
+ @echo "#define GPIO_WLAN_LED_BIT 13" >> include/config.h
+ @echo "#define GPIO_WLAN_LED_ON 0" >> include/config.h
+ @echo "#define GPIO_QSS_LED_BIT 15" >> include/config.h
+ @echo "#define GPIO_QSS_LED_ON 0" >> include/config.h
+ @echo "#define GPIO_RST_BUTTON_BIT 17" >> include/config.h
+ @echo "#define GPIO_RST_BUTTON_IS_ACTIVE_LOW 1" >> include/config.h
+ @echo "#define DEFAULT_FLASH_SIZE_IN_MB 4" >> include/config.h
+ @echo "#define BOARD_CUSTOM_STRING \"AP123 (AR9341) U-Boot for TL-WA830RE v2\"" >> include/config.h
+
+ @./mkconfig -a db12x mips mips db12x ar7240 ar7240
+
#########################################################################
#########################################################################
#########################################################################
\r
gpio = ar7240_reg_rd(AR934X_GPIO_OUT);\r
\r
-#if defined(CONFIG_FOR_TPLINK_WDR3600_WDR43X0_V1)\r
- gpio ^= 1 << GPIO_SYS_LED_BIT;\r
-#elif defined(CONFIG_FOR_TPLINK_WR841N_V8)\r
+#if defined(CONFIG_FOR_TPLINK_WDR3600_WDR43X0_V1) || \\r
+ defined(CONFIG_FOR_TPLINK_WR841N_V8) || \\r
+ defined(CONFIG_FOR_TPLINK_WA830RE_V2)\r
gpio ^= 1 << GPIO_SYS_LED_BIT;\r
#else\r
#error "Custom GPIO in leg_toggle() not defined!"\r
SETBITVAL(gpio, GPIO_LAN3_LED_BIT, GPIO_LAN3_LED_ON);\r
SETBITVAL(gpio, GPIO_LAN4_LED_BIT, GPIO_LAN4_LED_ON);\r
SETBITVAL(gpio, GPIO_QSS_LED_BIT, GPIO_QSS_LED_ON);\r
+#elif defined(CONFIG_FOR_TPLINK_WA830RE_V2)\r
+ SETBITVAL(gpio, GPIO_SYS_LED_BIT, GPIO_SYS_LED_ON);\r
+ SETBITVAL(gpio, GPIO_LAN_LED_BIT, GPIO_LAN_LED_ON);\r
+ SETBITVAL(gpio, GPIO_WLAN_LED_BIT, GPIO_WLAN_LED_ON);\r
+ SETBITVAL(gpio, GPIO_QSS_LED_BIT, GPIO_QSS_LED_ON);\r
#else\r
#error "Custom GPIO in all_led_on() not defined!"\r
#endif\r
SETBITVAL(gpio, GPIO_LAN3_LED_BIT, !GPIO_LAN3_LED_ON);\r
SETBITVAL(gpio, GPIO_LAN4_LED_BIT, !GPIO_LAN4_LED_ON);\r
SETBITVAL(gpio, GPIO_QSS_LED_BIT, !GPIO_QSS_LED_ON);\r
+#elif defined(CONFIG_FOR_TPLINK_WA830RE_V2)\r
+ SETBITVAL(gpio, GPIO_SYS_LED_BIT, !GPIO_SYS_LED_ON);\r
+ SETBITVAL(gpio, GPIO_LAN_LED_BIT, !GPIO_LAN_LED_ON);\r
+ SETBITVAL(gpio, GPIO_WLAN_LED_BIT, !GPIO_WLAN_LED_ON);\r
+ SETBITVAL(gpio, GPIO_QSS_LED_BIT, !GPIO_QSS_LED_ON);\r
#else\r
#error "Custom GPIO in all_led_off() not defined!"\r
#endif\r
* 20 => LAN2
* 21 => LAN3
*
+ * 16 => Wi-Fi switch
* 17 => Reset button (already set as input)
*
* All used GPIOs are active LOW!
sw v1, 0(a1)
// Turn off GPIOs
- li a1, AR934X_GPIO_OUT
+ li a1, AR934X_GPIO_SET
+ li v1, 0x3CF000
+ sw v1, 0(a1)
+
+#elif defined(CONFIG_FOR_TPLINK_WA830RE_V2)
+ /*
+ * LED's/Reset GPIOs on WR841N/D v8:
+ *
+ * 13 => WLAN
+ * 14 => SYS
+ * 15 => QSS
+ * 18 => LAN
+ *
+ * 16 => Range Extender
+ * 17 => Reset button (already set as input)
+ *
+ * All used GPIOs are active LOW!
+ */
+
+ // GPIOs init
+ li a1, AR934X_GPIO_OE
lw v1, 0(a1)
- li v0, ~(0xFFC30FFF)
- or v1, v1, v0
+ li v0, 0xFFFB1FFF
+ and v1, v1, v0
+ sw v1, 0(a1)
+
+ // Set gpio function for GPIOs 13~15
+ li a1, AR934X_GPIO_OUT_FUNCTION3
+ lw v1, 0(a1)
+ li v0, 0xFF
+ and v1, v1, v0
+ sw v1, 0(a1)
+
+ // Turn off GPIOs
+ li a1, AR934X_GPIO_SET
+ li v1, 0x4E000
sw v1, 0(a1)
+
#endif
#endif /* #if defined(CONFIG_WASP_SUPPORT) */
* Default bootargs\r
*/\r
#undef CONFIG_BOOTARGS\r
+#if defined(CONFIG_FOR_TPLINK_WDR3600_WDR43X0_V1)\r
#define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init mtdparts=ath-nor0:256k(u-boot),64k(u-boot-env),6336k(rootfs),1408k(uImage),64k(mib0),64k(ART)"\r
+#else\r
+#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)"\r
+#endif\r
\r
/*\r
* Other env default values\r
#define CONFIG_NETCONSOLE\r
#define CONFIG_NETCONSOLE_PORT 6666\r
\r
-/* DDR init values */\r
-#define CONFIG_NR_DRAM_BANKS 2\r
-\r
/* DDR settings for WASP */\r
#define CFG_DDR_REFRESH_VAL 0x4270\r
#define CFG_DDR_CONFIG_VAL 0xc7bc8cd0\r