Signed-off-by: Cezary Jackiewicz <[email protected]> --- Index: target/linux/ar71xx/base-files/etc/uci-defaults/leds =================================================================== --- target/linux/ar71xx/base-files/etc/uci-defaults/leds (revision 34763) +++ target/linux/ar71xx/base-files/etc/uci-defaults/leds (working copy) @@ -118,6 +118,16 @@ ucidef_set_led_usbdev "usb" "USB" "tp-link:green:3g" "1-1" ;; +tl-mr3220-v2) + ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1" + ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x04" + ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08" + ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x10" + ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02" + ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt" + ucidef_set_led_usbdev "usb" "USB" "tp-link:green:3g" "1-1" + ;; + tl-wa901nd) ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0" ;; Index: target/linux/ar71xx/base-files/etc/diag.sh =================================================================== --- target/linux/ar71xx/base-files/etc/diag.sh (revision 34763) +++ target/linux/ar71xx/base-files/etc/diag.sh (working copy) @@ -126,6 +126,7 @@ status_led="tp-link:green:wps" ;; tl-mr3220 | \ + tl-mr3220-v2 | \ tl-mr3420 | \ tl-wa901nd | \ tl-wa901nd-v2 | \ Index: target/linux/ar71xx/base-files/lib/upgrade/platform.sh =================================================================== --- target/linux/ar71xx/base-files/lib/upgrade/platform.sh (revision 34763) +++ target/linux/ar71xx/base-files/lib/upgrade/platform.sh (working copy) @@ -151,6 +151,7 @@ tl-mr3020 | \ tl-mr3040 | \ tl-mr3220 | \ + tl-mr3220-v2 | \ tl-mr3420 | \ tl-wa7510n | \ tl-wa901nd | \ Index: target/linux/ar71xx/base-files/lib/ar71xx.sh =================================================================== --- target/linux/ar71xx/base-files/lib/ar71xx.sh (revision 34763) +++ target/linux/ar71xx/base-files/lib/ar71xx.sh (working copy) @@ -345,6 +345,9 @@ *TL-MR3220) name="tl-mr3220" ;; + *"TL-MR3220 v2") + name="tl-mr3220-v2" + ;; *TL-MR3420) name="tl-mr3420" ;; Index: target/linux/ar71xx/image/Makefile =================================================================== --- target/linux/ar71xx/image/Makefile (revision 34763) +++ target/linux/ar71xx/image/Makefile (working copy) @@ -879,7 +879,7 @@ $(eval $(call SingleProfile,TPLINKOLD,$(fs_squash),TLWR841NV15,tl-wr841nd-v1.5,TL-WR841N-v1.5,ttyS0,115200,0x08410002,2,4M)) -$(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLMR3220,tl-mr3220-v1,TL-MR3220,ttyS0,115200,0x32200001,1,4M)) +$(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLMR3220V1,tl-mr3220-v1,TL-MR3220,ttyS0,115200,0x32200001,1,4M)) $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLMR3420,tl-mr3420-v1,TL-MR3420,ttyS0,115200,0x34200001,1,4M)) $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWA701,tl-wa701n-v1,TL-WA901ND,ttyS0,115200,0x07010001,1,4M)) $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWA7510NV1,tl-wa7510n,TL-WA7510N,ttyS0,115200,0x75100001,1,4M)) @@ -903,6 +903,7 @@ $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR11U,tl-mr11u-v1,TL-MR11U,ttyATH0,115200,0x00110101,1,4Mlzma)) $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR3020,tl-mr3020-v1,TL-MR3020,ttyATH0,115200,0x30200001,1,4Mlzma)) $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR3040,tl-mr3040-v1,TL-MR3040,ttyATH0,115200,0x30400001,1,4Mlzma)) +$(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR3220V2,tl-mr3220-v2,TL-MR3220-v2,ttyATH0,115200,0x32200002,1,4Mlzma)) $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR703,tl-wr703n-v1,TL-WR703N,ttyATH0,115200,0x07030101,1,4Mlzma)) $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR740NV4,tl-wr740n-v4,TL-WR741ND-v4,ttyATH0,115200,0x07400004,1,4Mlzma)) $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR741NV4,tl-wr741nd-v4,TL-WR741ND-v4,ttyATH0,115200,0x07410004,1,4Mlzma)) @@ -949,6 +950,7 @@ $(eval $(call MultiProfile,AP121,AP121_2M AP121_4M)) $(eval $(call MultiProfile,EWDORIN, EWDORINAP EWDORINRT)) $(eval $(call MultiProfile,OPENMESH,OM2P MR600)) +$(eval $(call MultiProfile,TLMR3220,TLMR3220V1 TLMR3220V2)) $(eval $(call MultiProfile,TEW652BRP,TEW652BRP_FW TEW652BRP_RECOVERY)) $(eval $(call MultiProfile,TLWA801,TLWA801NV1)) $(eval $(call MultiProfile,TLWA901,TLWA901NV1 TLWA901NV2)) Index: target/linux/ar71xx/patches-3.6/610-MIPS-ath79-openwrt-machines.patch =================================================================== --- target/linux/ar71xx/patches-3.6/610-MIPS-ath79-openwrt-machines.patch (revision 34763) +++ target/linux/ar71xx/patches-3.6/610-MIPS-ath79-openwrt-machines.patch (working copy) @@ -1,6 +1,6 @@ --- a/arch/mips/ath79/machtypes.h +++ b/arch/mips/ath79/machtypes.h -@@ -16,20 +16,104 @@ +@@ -16,20 +16,105 @@ enum ath79_mach_type { ATH79_MACH_GENERIC = 0, @@ -60,6 +60,7 @@ + ATH79_MACH_TL_MR3020, /* TP-LINK TL-MR3020 */ + ATH79_MACH_TL_MR3040, /* TP-LINK TL-MR3040 */ + ATH79_MACH_TL_MR3220, /* TP-LINK TL-MR3220 */ ++ ATH79_MACH_TL_MR3220_V2, /* TP-LINK TL-MR3220 v2 */ + ATH79_MACH_TL_MR3420, /* TP-LINK TL-MR3420 */ + ATH79_MACH_TL_WA901ND, /* TP-LINK TL-WA901ND */ + ATH79_MACH_TL_WA901ND_V2, /* TP-LINK TL-WA901ND v2 */ Index: target/linux/ar71xx/patches-3.6/612-MIPS-ath79-TL-WA7510N-v1-support.patch =================================================================== --- target/linux/ar71xx/patches-3.6/612-MIPS-ath79-TL-WA7510N-v1-support.patch (revision 34763) +++ target/linux/ar71xx/patches-3.6/612-MIPS-ath79-TL-WA7510N-v1-support.patch (working copy) @@ -1,8 +1,8 @@ --- a/arch/mips/ath79/machtypes.h +++ b/arch/mips/ath79/machtypes.h @@ -74,6 +74,7 @@ enum ath79_mach_type { - ATH79_MACH_TL_MR3040, /* TP-LINK TL-MR3040 */ ATH79_MACH_TL_MR3220, /* TP-LINK TL-MR3220 */ + ATH79_MACH_TL_MR3220_v2, /* TP-LINK TL-MR3220 v2 */ ATH79_MACH_TL_MR3420, /* TP-LINK TL-MR3420 */ + ATH79_MACH_TL_WA7510N_V1, /* TP-LINK TL-WA7510N v1*/ ATH79_MACH_TL_WA901ND, /* TP-LINK TL-WA901ND */ Index: target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr741nd-v4.c =================================================================== --- target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr741nd-v4.c (revision 34763) +++ target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr741nd-v4.c (working copy) @@ -14,6 +14,7 @@ #include <asm/mach-ath79/ar71xx_regs.h> #include "common.h" +#include "dev-usb.h" #include "dev-eth.h" #include "dev-gpio-buttons.h" #include "dev-leds-gpio.h" @@ -31,7 +32,10 @@ #define TL_WR741NDV4_GPIO_LED_LAN2 15 #define TL_WR741NDV4_GPIO_LED_LAN3 16 #define TL_WR741NDV4_GPIO_LED_LAN4 17 +#define TL_MR3220V2_GPIO_USB_POWER 8 +#define TL_MR3220V2_GPIO_LED_3G 26 + #define TL_WR741NDV4_GPIO_LED_SYSTEM 27 #define TL_WR741NDV4_KEYS_POLL_INTERVAL 20 /* msecs */ @@ -100,7 +104,58 @@ } }; -static void __init tl_wr741ndv4_setup(void) +static struct gpio_led tl_mr3220v2_leds_gpio[] __initdata = { + { + .name = "tp-link:green:lan1", + .gpio = TL_WR741NDV4_GPIO_LED_LAN1, + .active_low = 0, + }, { + .name = "tp-link:green:lan2", + .gpio = TL_WR741NDV4_GPIO_LED_LAN2, + .active_low = 0, + }, { + .name = "tp-link:green:lan3", + .gpio = TL_WR741NDV4_GPIO_LED_LAN3, + .active_low = 0, + }, { + .name = "tp-link:green:lan4", + .gpio = TL_WR741NDV4_GPIO_LED_LAN4, + .active_low = 1, + }, { + .name = "tp-link:green:qss", + .gpio = TL_WR741NDV4_GPIO_LED_QSS, + .active_low = 0, + }, { + .name = "tp-link:green:system", + .gpio = TL_WR741NDV4_GPIO_LED_SYSTEM, + .active_low = 1, + }, { + .name = "tp-link:green:wan", + .gpio = TL_WR741NDV4_GPIO_LED_WAN, + .active_low = 0, + }, { + .name = "tp-link:green:wlan", + .gpio = TL_WR741NDV4_GPIO_LED_WLAN, + .active_low = 0, + }, { + .name = "tp-link:green:3g", + .gpio = TL_MR3220V2_GPIO_LED_3G, + .active_low = 0, + }, +}; + +static struct gpio_keys_button tl_mr3220v2_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = TL_WR741NDV4_KEYS_DEBOUNCE_INTERVAL, + .gpio = TL_WR741NDV4_GPIO_BTN_RESET, + .active_low = 0, + } +}; + +static void __init tl_ap121_setup(void) { u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); @@ -113,13 +168,7 @@ AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN | AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN); - ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr741ndv4_leds_gpio), - tl_wr741ndv4_leds_gpio); - ath79_register_gpio_keys_polled(1, TL_WR741NDV4_KEYS_POLL_INTERVAL, - ARRAY_SIZE(tl_wr741ndv4_gpio_keys), - tl_wr741ndv4_gpio_keys); - ath79_register_m25p80(&tl_wr741ndv4_flash_data); ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1); @@ -131,5 +180,36 @@ ath79_register_wmac(ee, mac); } +static void __init tl_wr741ndv4_setup(void) +{ + tl_ap121_setup(); + ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr741ndv4_leds_gpio), + tl_wr741ndv4_leds_gpio); + + ath79_register_gpio_keys_polled(1, TL_WR741NDV4_KEYS_POLL_INTERVAL, + ARRAY_SIZE(tl_wr741ndv4_gpio_keys), + tl_wr741ndv4_gpio_keys); +} + MIPS_MACHINE(ATH79_MACH_TL_WR741ND_V4, "TL-WR741ND-v4", "TP-LINK TL-WR741ND v4", tl_wr741ndv4_setup); + +static void __init tl_mr3220v2_setup(void) +{ + tl_ap121_setup(); + + gpio_request_one(TL_MR3220V2_GPIO_USB_POWER, + GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED, + "USB power"); + ath79_register_usb(); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_mr3220v2_leds_gpio), + tl_mr3220v2_leds_gpio); + + ath79_register_gpio_keys_polled(1, TL_WR741NDV4_KEYS_POLL_INTERVAL, + ARRAY_SIZE(tl_mr3220v2_gpio_keys), + tl_mr3220v2_gpio_keys); +} + +MIPS_MACHINE(ATH79_MACH_TL_MR3220_V2, "TL-MR3220-v2", + "TP-LINK TL-MR3220 v2", tl_mr3220v2_setup); Index: tools/firmware-utils/src/mktplinkfw.c =================================================================== --- tools/firmware-utils/src/mktplinkfw.c (revision 34763) +++ tools/firmware-utils/src/mktplinkfw.c (working copy) @@ -32,6 +32,7 @@ #define HEADER_VERSION_V1 0x01000000 #define HWID_TL_MR3020_V1 0x30200001 #define HWID_TL_MR3220_V1 0x32200001 +#define HWID_TL_MR3220_V2 0x32200002 #define HWID_TL_MR3420_V1 0x34200001 #define HWID_TL_WA701N_V1 0x07010001 #define HWID_TL_WA7510N_V1 0x75100001 @@ -190,6 +191,11 @@ .hw_rev = 1, .layout_id = "4M", }, { + .id = "TL-MR3220v2", + .hw_id = HWID_TL_MR3220_V2, + .hw_rev = 1, + .layout_id = "4Mlzma", + }, { .id = "TL-MR3420v1", .hw_id = HWID_TL_MR3420_V1, .hw_rev = 1,
-- Pozdrawiam, Cezary Jackiewicz _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
