瀏覽代碼

ar71xx/cpe510: split profile into 2 profiles cpe210 and cpe510

Split profile into 2GHz and 5GHz. The 5GHz devices are
quite "special". The 2 GHz works perfect.

Signed-off-by: Alexander Couzens <[email protected]>
Alexander Couzens 9 年之前
父節點
當前提交
c5ff273d85

+ 1 - 0
target/linux/ar71xx/base-files/etc/board.d/01_leds

@@ -127,6 +127,7 @@ cf-e316n-v2)
 	ucidef_set_led_wlan "wlan" "WLAN" "$board:blue:wlan" "phy0tpt"
 	;;
 
+cpe210|\
 cpe510)
 	ucidef_set_led_switch "lan0" "LAN0" "tp-link:green:lan0" "switch0" "0x20"
 	ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"

+ 1 - 0
target/linux/ar71xx/base-files/etc/board.d/02_network

@@ -72,6 +72,7 @@ bsb)
 	ucidef_set_interface_wlan
 	;;
 
+cpe210|\
 cpe510)
 	ucidef_add_switch "switch0" \
 		"0@eth0" "5:lan" "4:wan"

+ 1 - 0
target/linux/ar71xx/base-files/etc/board.d/03_gpio_switches

@@ -17,6 +17,7 @@ nanostation-m)
 nanostation-m-xw)
 	ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "2"
 	;;
+cpe210|\
 cpe510)
 	ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "20"
 	;;

+ 5 - 1
target/linux/ar71xx/base-files/lib/ar71xx.sh

@@ -446,7 +446,11 @@ ar71xx_board_detect() {
 	*"COMFAST CF-E316N v2")
 		name="cf-e316n-v2"
 		;;
-	*"CPE210/220/510/520")
+	*"CPE210/220")
+		name="cpe210"
+		tplink_pharos_board_detect
+		;;
+	*"CPE510/520")
 		name="cpe510"
 		tplink_pharos_board_detect
 		;;

+ 1 - 0
target/linux/ar71xx/base-files/lib/upgrade/platform.sh

@@ -280,6 +280,7 @@ platform_check_image() {
 		return 0
 		;;
 
+	cpe210|\
 	cpe510)
 		tplink_pharos_check_image "$1" && return 0
 		return 1

+ 24 - 6
target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c

@@ -78,12 +78,8 @@ static struct gpio_keys_button cpe510_gpio_keys[] __initdata = {
 	}
 };
 
-
-static void __init cpe510_setup(void)
+static void __init cpe_setup(u8 *mac)
 {
-	u8 *mac = (u8 *) KSEG1ADDR(0x1f830008);
-	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
-
 	/* Disable JTAG, enabling GPIOs 0-3 */
 	/* Configure OBS4 line, for GPIO 4*/
 	ath79_gpio_function_setup(AR934X_GPIO_FUNC_JTAG_DISABLE,
@@ -105,9 +101,31 @@ static void __init cpe510_setup(void)
 	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
 	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
 	ath79_register_eth(1);
+}
+
+
+static void __init cpe210_setup(void)
+{
+	u8 *mac = (u8 *) KSEG1ADDR(0x1f830008);
+	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+
+	cpe_setup(mac);
 
 	ath79_register_wmac(ee, mac);
 }
 
-MIPS_MACHINE(ATH79_MACH_CPE510, "CPE510", "TP-LINK CPE210/220/510/520",
+static void __init cpe510_setup(void)
+{
+	u8 *mac = (u8 *) KSEG1ADDR(0x1f830008);
+	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+
+	cpe_setup(mac);
+
+	ath79_register_wmac(ee, mac);
+}
+
+MIPS_MACHINE(ATH79_MACH_CPE210, "CPE210", "TP-LINK CPE210/220",
+	     cpe210_setup);
+
+MIPS_MACHINE(ATH79_MACH_CPE510, "CPE510", "TP-LINK CPE510/520",
 	     cpe510_setup);

+ 1 - 0
target/linux/ar71xx/files/arch/mips/ath79/machtypes.h

@@ -51,6 +51,7 @@ enum ath79_mach_type {
 	ATH79_MACH_CAP4200AG,		/* Senao CAP4200AG */
 	ATH79_MACH_CARAMBOLA2,		/* 8devices Carambola2 */
 	ATH79_MACH_CF_E316N_V2,		/* COMFAST CF-E316N v2 */
+	ATH79_MACH_CPE210,		/* TP-LINK CPE210 */
 	ATH79_MACH_CPE510,		/* TP-LINK CPE510 */
 	ATH79_MACH_CR3000,		/* PowerCloud CR3000 */
 	ATH79_MACH_CR5000,		/* PowerCloud CR5000 */

+ 9 - 3
target/linux/ar71xx/image/tp-link.mk

@@ -97,18 +97,24 @@ $(Device/tplink)
   IMAGE_SIZE := 15872k
 endef
 
-define Device/cpe210-220-510-520
+define Device/cpe210-220
   MTDPARTS := spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k@0x40000(firmware)
   IMAGE_SIZE := 7680k
-  BOARDNAME := CPE510
+  BOARDNAME := CPE210
   TPLINK_BOARD_NAME := CPE510
+  DEVICE_PROFILE := CPE510
   LOADER_TYPE := elf
   KERNEL := kernel-bin | patch-cmdline | lzma | loader-kernel
   IMAGES := sysupgrade.bin factory.bin
   IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade
   IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
 endef
-TARGET_DEVICES += cpe210-220-510-520
+
+define Device/cpe510-520
+$(Device/cpe210-220)
+  BOARDNAME := CPE510
+endef
+TARGET_DEVICES += cpe210-220 cpe510-520
 
 define Device/tl-wdr4300-v1
 $(Device/tplink-8mlzma)