ar71xx/cpe510: split profile into 2 profiles cpe210 and cpe510
authorAlexander Couzens <lynxis@fe80.eu>
Mon, 23 May 2016 01:17:00 +0000 (03:17 +0200)
committerFelix Fietkau <nbd@nbd.name>
Mon, 23 May 2016 11:39:49 +0000 (13:39 +0200)
Split profile into 2GHz and 5GHz. The 5GHz devices are
quite "special". The 2 GHz works perfect.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
target/linux/ar71xx/base-files/etc/board.d/01_leds
target/linux/ar71xx/base-files/etc/board.d/02_network
target/linux/ar71xx/base-files/etc/board.d/03_gpio_switches
target/linux/ar71xx/base-files/lib/ar71xx.sh
target/linux/ar71xx/base-files/lib/upgrade/platform.sh
target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
target/linux/ar71xx/image/tp-link.mk

index 8ba08ddf25a9a5b637105efe3979d61554a3e491..bee2fb80c1119f8d7dd2a0f87c2edd3c329f4048 100755 (executable)
@@ -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"
index 27c8980b08eb7f4920614320eca28cc9a27bdf39..916bed960aadd59b13c5473a25db455b72a52e29 100755 (executable)
@@ -72,6 +72,7 @@ bsb)
        ucidef_set_interface_wlan
        ;;
 
+cpe210|\
 cpe510)
        ucidef_add_switch "switch0" \
                "0@eth0" "5:lan" "4:wan"
index 8abcfc0db05276fe622ee71c8852c11592e85ee1..00cc16725405c7168e2ba3727b24194d934f2acb 100755 (executable)
@@ -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"
        ;;
index 4318818cd285e4ffeed183ff2cbabbb8401ea381..b06c60ed70d5c34cb5b64eaef9850c7b9f0e4e23 100755 (executable)
@@ -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
                ;;
index ace039210b1f4238b7a9a7d5738d66626a2457ec..2505b7575c239eb354a5f210b282eb09e342df86 100755 (executable)
@@ -280,6 +280,7 @@ platform_check_image() {
                return 0
                ;;
 
+       cpe210|\
        cpe510)
                tplink_pharos_check_image "$1" && return 0
                return 1
index 5cb052a84aee451b9fbd449910acfde80dcf8aa7..74daf434e611d1f9d05f7d7516ae918d334b32b7 100644 (file)
@@ -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);
index a74d0df152476f7dfc6faa90d3ed2e4fda59c6ee..65b1d79019309ec108e6550238390b705742fd08 100644 (file)
@@ -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 */
index bcaa4ba10eacb521a7f2c9ba6e8cb220cd604bfa..a3af519efe33c4bfd0f6e95e2858738ef245f352 100644 (file)
@@ -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)