From c4d0a3a0fb8485cc6924c2a04b82970b973a8432 Mon Sep 17 00:00:00 2001 From: Imre Kaloz Date: Wed, 23 Jul 2014 12:47:25 +0000 Subject: [PATCH] [ar71xx]: add support for the archer c5 Signed-off-by: Imre Kaloz SVN-Revision: 41814 --- target/linux/ar71xx/base-files/etc/diag.sh | 1 + .../base-files/etc/uci-defaults/01_leds | 1 + .../base-files/etc/uci-defaults/02_network | 1 + target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 +++ .../lib/preinit/05_set_preinit_iface_ar71xx | 1 + .../lib/preinit/81_load_ath10k_board_bin | 1 + .../ar71xx/base-files/lib/upgrade/platform.sh | 1 + .../files/arch/mips/ath79/mach-archer-c7.c | 11 +++++++++- .../linux/ar71xx/generic/profiles/tp-link.mk | 4 ++-- target/linux/ar71xx/image/Makefile | 3 ++- .../724-MIPS-ath79-archer_c5-support.patch | 21 +++++++++++++++++++ 11 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 target/linux/ar71xx/patches-3.10/724-MIPS-ath79-archer_c5-support.patch diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index 487a325368..2984777d9d 100755 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -207,6 +207,7 @@ get_status_led() { tl-wr941nd) status_led="tp-link:green:system" ;; + archer-c5 | \ archer-c7 | \ tl-wdr4900-v2 | \ tl-mr10u | \ diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds index 7c86b05931..a93b5faeed 100755 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds @@ -283,6 +283,7 @@ tl-wdr4300) ucidef_set_led_wlan "wlan2g" "WLAN2G" "tp-link:blue:wlan2g" "phy0tpt" ;; +archer-c5|\ archer-c7|\ tl-wdr4900-v2) ucidef_set_led_usbdev "usb1" "USB1" "tp-link:green:usb1" "1-1" diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network index 2ab1d0b636..c9ee86769a 100755 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network @@ -53,6 +53,7 @@ tl-wr1043nd-v2) ucidef_add_switch_vlan "switch0" "2" "5 6" ;; +archer-c5 |\ archer-c7 |\ tl-wdr4900-v2) ucidef_set_interfaces_lan_wan "eth1" "eth0" diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index 70f74829ca..a067604df9 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -277,6 +277,9 @@ ar71xx_board_detect() { *AP83) name="ap83" ;; + *"Archer C5") + name="archer-c5" + ;; *"Archer C7") name="archer-c7" ;; diff --git a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx index 47b008242d..10651fccd4 100644 --- a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx +++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx @@ -13,6 +13,7 @@ set_preinit_iface() { ap135-020 |\ ap136-020 |\ ap83 |\ + archer-c5 |\ archer-c7 |\ dir-505-a1 |\ gl-inet |\ diff --git a/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin b/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin index 14e1913536..a28932f824 100644 --- a/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin +++ b/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin @@ -11,6 +11,7 @@ do_load_ath10k_board_bin() { bs=1 skip=20480 count=2116 \ of=/tmp/ath10k-board.bin ;; + archer-c5 | \ archer-c7) local mac mac=$(macaddr_add $(cat /sys/class/net/eth1/address) -2) diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index de831b2eae..ced42ed044 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -251,6 +251,7 @@ platform_check_image() { return 1 ;; + archer-c5 | \ archer-c7 | \ el-m150 | \ el-mini | \ diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7.c index 01719eb5b5..fc1251303e 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7.c @@ -1,8 +1,9 @@ /* - * TP-LINK Archer C7/TL-WDR4900 v2 board support + * TP-LINK Archer C5/C7/TL-WDR4900 v2 board support * * Copyright (c) 2013 Gabor Juhos * Copyright (c) 2014 施康成 + * Copyright (c) 2014 Imre Kaloz * * Based on the Qualcomm Atheros AP135/AP136 reference board support code * Copyright (c) 2012 Qualcomm Atheros @@ -239,6 +240,14 @@ static void __init common_setup(bool pcie_slot) ath79_register_usb(); } +static void __init archer_c5_setup(void) +{ + common_setup(true); +} + +MIPS_MACHINE(ATH79_MACH_ARCHER_C5, "ARCHER-C5", "TP-LINK Archer C5", + archer_c5_setup); + static void __init archer_c7_setup(void) { common_setup(true); diff --git a/target/linux/ar71xx/generic/profiles/tp-link.mk b/target/linux/ar71xx/generic/profiles/tp-link.mk index d6516fed84..78333be0b5 100644 --- a/target/linux/ar71xx/generic/profiles/tp-link.mk +++ b/target/linux/ar71xx/generic/profiles/tp-link.mk @@ -6,12 +6,12 @@ # define Profile/ARCHERC7 - NAME:=TP-LINK Archer C7 + NAME:=TP-LINK Archer C5/C7 PACKAGES:=kmod-usb-core kmod-usb2 kmod-ledtrig-usbdev kmod-ath10k endef define Profile/ARCHERC7/Description - Package set optimized for the TP-LINK Archer C7. + Package set optimized for the TP-LINK Archer C5/C7. endef $(eval $(call Profile,ARCHERC7)) diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile index 7a08f2b89a..2377ad3d54 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -1160,6 +1160,7 @@ $(eval $(call SingleProfile,TPLINK,64kraw,TLWR941NV3,tl-wr941nd-v3,TL-WR941ND,tt $(eval $(call SingleProfile,TPLINK,64kraw,TLWR941NV4,tl-wr941nd-v4,TL-WR741ND,ttyS0,115200,0x09410004,1,4M)) $(eval $(call SingleProfile,TPLINK,64kraw,TLWR1043V1,tl-wr1043nd-v1,TL-WR1043ND,ttyS0,115200,0x10430001,1,8M)) +$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,ARCHERC5,archer-c5,ARCHER-C5,ttyS0,115200,0xc5000001,1,16Mlzma)) $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,ARCHERC7V1,archer-c7-v1,ARCHER-C7,ttyS0,115200,0x75000001,1,8Mlzma)) $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,ARCHERC7V2,archer-c7-v2,ARCHER-C7,ttyS0,115200,0xc7000002,1,16Mlzma)) $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,ELM150,el-m150,EL-M150,ttyATH0,115200,0x01500101,1,8Mlzma)) @@ -1241,7 +1242,7 @@ $(eval $(call SingleProfile,ZyXEL,64k,NBG_460N_550N_550NH,nbg460n_550n_550nh,NBG $(eval $(call MultiProfile,AP121,AP121_2M AP121_4M)) $(eval $(call MultiProfile,AP136,AP136_010 AP136_020)) -$(eval $(call MultiProfile,ARCHERC7, ARCHERC7V1 ARCHERC7V2)) +$(eval $(call MultiProfile,ARCHERC7, ARCHERC5 ARCHERC7V1 ARCHERC7V2)) $(eval $(call MultiProfile,EWDORIN, EWDORINAP EWDORINRT EWDORIN16M)) $(eval $(call MultiProfile,OPENMESH,OM2P OM5P MR600)) $(eval $(call MultiProfile,TEW652BRP,TEW652BRP_FW TEW652BRP_RECOVERY)) diff --git a/target/linux/ar71xx/patches-3.10/724-MIPS-ath79-archer_c5-support.patch b/target/linux/ar71xx/patches-3.10/724-MIPS-ath79-archer_c5-support.patch new file mode 100644 index 0000000000..0668dfef43 --- /dev/null +++ b/target/linux/ar71xx/patches-3.10/724-MIPS-ath79-archer_c5-support.patch @@ -0,0 +1,21 @@ +--- a/arch/mips/ath79/machtypes.h ++++ b/arch/mips/ath79/machtypes.h +@@ -31,6 +31,7 @@ enum ath79_mach_type { + ATH79_MACH_AP81, /* Atheros AP81 reference board */ + ATH79_MACH_AP83, /* Atheros AP83 */ + ATH79_MACH_AP96, /* Atheros AP96 */ ++ ATH79_MACH_ARCHER_C5, /* TP-LINK Archer C5 board */ + ATH79_MACH_ARCHER_C7, /* TP-LINK Archer C7 board */ + ATH79_MACH_AW_NR580, /* AzureWave AW-NR580 */ + ATH79_MACH_BHU_BXU2000N2_A1, /* BHU BXU2000n-2 A1 */ +--- a/arch/mips/ath79/Kconfig ++++ b/arch/mips/ath79/Kconfig +@@ -654,7 +654,7 @@ config ATH79_MACH_EAP7660D + select ATH79_DEV_M25P80 + + config ATH79_MACH_ARCHER_C7 +- bool "TP-LINK Archer C7/TL-WDR4900 v2 board support" ++ bool "TP-LINK Archer C5/C7/TL-WDR4900 v2 board support" + select SOC_QCA955X + select ATH79_DEV_AP9X_PCI if PCI + select ATH79_DEV_ETH -- 2.30.2