ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "51" "100" "-50" "13"
ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
;;
+cpe210v2|\
+cpe510v2)
+ ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan0" "eth0"
+ ucidef_set_rssimon "wlan0" "200000" "1"
+ ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:green:link1" "wlan0" "1" "100" "0" "13"
+ ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:green:link2" "wlan0" "26" "100" "-25" "13"
+ ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "51" "100" "-50" "13"
+ ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
+ ;;
cr3000)
ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
ucidef_set_led_switch "lan1" "LAN1" "pcs:blue:lan1" "switch0" "0x04"
cap4200ag|\
cf-e380ac-v1|\
cf-e380ac-v2|\
+ cpe210v2|\
+ cpe510v2|\
eap120|\
eap300v2|\
eap7660d|\
name="cpe210"
tplink_pharos_board_detect
;;
+ *"CPE210 v2")
+ name="cpe210v2"
+ tplink_pharos_board_detect
+ ;;
+ *"CPE510 v2")
+ name="cpe510v2"
+ tplink_pharos_board_detect
+ ;;
+ *"CPE510/520 v2")
+ name="cpe510v2"
+ tplink_pharos_board_detect
+ ;;
*"CPE505N")
name="cpe505n"
;;
tplink_pharos_check_image "$1" "7f454c46" && return 0
return 1
;;
+ cpe210v2|\
+ cpe510v2)
+ # magic = mktplinkfw v1 header
+ tplink_pharos_check_image "$1" "01000000" && return 0
+ return 1
+ ;;
a40|\
a60|\
mr1750v2|\
#define CPE510_GPIO_EXTERNAL_LNA1 19
#define CPE510_GPIO_BTN_RESET 4
+#define CPE510V2_GPIO_BTN_RESET 17
#define CPE510_KEYS_POLL_INTERVAL 20 /* msecs */
#define CPE510_KEYS_DEBOUNCE_INTERVAL (3 * CPE510_KEYS_POLL_INTERVAL)
+#define CPE510V2_KEYS_DEBOUNCE_INTERVAL (5 * CPE510_KEYS_POLL_INTERVAL)
static struct gpio_led cpe510_leds_gpio[] __initdata = {
},
};
+static struct gpio_led cpe510v2_leds_gpio[] __initdata = {
+ {
+ .name = "tp-link:green:lan0",
+ .gpio = CPE510_GPIO_LED_LAN0,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:link1",
+ .gpio = CPE510_GPIO_LED_L1,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:link2",
+ .gpio = CPE510_GPIO_LED_L2,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:link3",
+ .gpio = CPE510_GPIO_LED_L3,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:link4",
+ .gpio = CPE510_GPIO_LED_L4,
+ .active_low = 1,
+ },
+};
+
+
static struct gpio_led wbs510_leds_gpio[] __initdata = {
{
.name = "tp-link:green:lan0",
}
};
+static struct gpio_keys_button cpe510v2_gpio_keys[] __initdata = {
+ {
+ .desc = "Reset button",
+ .type = EV_KEY,
+ .code = KEY_RESTART,
+ .debounce_interval = CPE510V2_KEYS_DEBOUNCE_INTERVAL,
+ .gpio = CPE510V2_GPIO_BTN_RESET,
+ .active_low = 1,
+ }
+};
+
static void __init cpe_setup(u8 *mac)
{
/* Disable JTAG, enabling GPIOs 0-3 */
}
+static void __init cpe510v2_setup(void)
+{
+ void __iomem *reg;
+
+ u8 *mac = (u8 *) KSEG1ADDR(0x1f830008);
+ u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+
+ ath79_gpio_direction_select(8, 0);
+ ath79_gpio_direction_select(9, 0);
+
+ ath79_gpio_direction_select(10, 1); /* SOUT */
+ ath79_gpio_direction_select(5, 1);
+ ath79_gpio_direction_select(6, 1);
+ ath79_gpio_direction_select(7, 1);
+
+ ath79_gpio_output_select(10, 0x16); /* SOUT */
+ ath79_gpio_output_select(5, 0x09); /* CS0 */
+ ath79_gpio_output_select(6, 0x08); /* CLK */
+ ath79_gpio_output_select(7, 0x0c); /* MOSI */
+
+ ath79_gpio_function_setup(AR934X_GPIO_FUNC_JTAG_DISABLE | AR934X_GPIO_FUNC_CLK_OBS3_EN,
+ AR934X_GPIO_FUNC_CLK_OBS4_EN);
+
+ reg = (void *)KSEG1ADDR(AR71XX_GPIO_BASE + QCA953X_GPIO_REG_IN_ENABLE0);
+ /* set in register */
+ __raw_writel(0x908, reg); /* pin 8 + pin 9 = SIN + MISO */
+ /* flush write */
+ __raw_readl(reg);
+
+ ath79_register_leds_gpio(-1, ARRAY_SIZE(cpe510v2_leds_gpio),
+ cpe510v2_leds_gpio);
+ ath79_register_gpio_keys_polled(1, CPE510_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(cpe510v2_gpio_keys),
+ cpe510v2_gpio_keys);
+
+ ath79_register_m25p80(NULL);
+
+ /* ethernet */
+ ath79_register_mdio(0, 0);
+ ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
+
+ ath79_switch_data.phy4_mii_en = 1;
+ ath79_eth0_data.duplex = DUPLEX_FULL;
+ ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
+ ath79_eth0_data.phy_mask = BIT(4);
+ ath79_eth0_data.speed = SPEED_100;
+
+ ath79_register_eth(0);
+
+ /* wmac */
+ ath79_register_wmac(ee, mac);
+}
+
static void __init cpe510_setup(void)
{
u8 *mac = (u8 *) KSEG1ADDR(0x1f830008);
MIPS_MACHINE(ATH79_MACH_CPE510, "CPE510", "TP-LINK CPE510/520",
cpe510_setup);
+MIPS_MACHINE(ATH79_MACH_CPE210V2, "CPE210V2", "TP-LINK CPE210 v2",
+ cpe510v2_setup);
+
+MIPS_MACHINE(ATH79_MACH_CPE510V2, "CPE510V2", "TP-LINK CPE510 v2",
+ cpe510v2_setup);
+
MIPS_MACHINE(ATH79_MACH_WBS210, "WBS210", "TP-LINK WBS210",
wbs_setup);
ATH79_MACH_CF_E520N, /* COMFAST CF-E520N */
ATH79_MACH_CF_E530N, /* COMFAST CF-E530N */
ATH79_MACH_CPE210, /* TP-LINK CPE210 */
+ ATH79_MACH_CPE210V2, /* TP-LINK CPE210 v2 */
ATH79_MACH_CPE505N, /* P&W CPE505N */
ATH79_MACH_CPE510, /* TP-LINK CPE510 */
+ ATH79_MACH_CPE510V2, /* TP-LINK CPE510 v2 */
ATH79_MACH_CPE830, /* YunCore CPE830 */
ATH79_MACH_CPE870, /* YunCore CPE870 */
ATH79_MACH_CR3000, /* PowerCloud CR3000 */
$(Device/cpe510-520-v1)
DEVICE_TITLE := TP-LINK CPE210/220 v1
BOARDNAME := CPE210
- TPLINK_BOARD_ID := CPE210
+ TPLINK_BOARD_ID := CPE210V2
+endef
+
+define Device/cpe210-220-v2
+ DEVICE_TITLE := TP-LINK CPE210/220 v2
+ DEVICE_PACKAGES := rssileds
+ 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 := CPE210V2
+ TPLINK_BOARD_ID := CPE210V2
+ KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header
+ IMAGES := sysupgrade.bin factory.bin
+ IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade
+ IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
+ TPLINK_HWID := 0x0
+ TPLINK_HWREV := 0
+ TPLINK_HEADER_VERSION := 1
endef
define Device/wbs210-v1
BOARDNAME := WBS510
TPLINK_BOARD_ID := WBS510
endef
-TARGET_DEVICES += cpe210-220-v1 cpe510-520-v1 wbs210-v1 wbs510-v1
+TARGET_DEVICES += cpe210-220-v1 cpe510-520-v1 cpe210-220-v2 wbs210-v1 wbs510-v1
define Device/eap120-v1
DEVICE_TITLE := TP-LINK EAP120 v1
--- /dev/null
+--- a/arch/mips/ath79/clock.c
++++ b/arch/mips/ath79/clock.c
+@@ -365,10 +365,7 @@ static void __init qca953x_clocks_init(v
+ u32 bootstrap;
+
+ bootstrap = ath79_reset_rr(QCA953X_RESET_REG_BOOTSTRAP);
+- if (bootstrap & QCA953X_BOOTSTRAP_REF_CLK_40)
+- ref_rate = 40 * 1000 * 1000;
+- else
+- ref_rate = 25 * 1000 * 1000;
++ ref_rate = 25 * 1000 * 1000;
+
+ pll = ath79_pll_rr(QCA953X_PLL_CPU_CONFIG_REG);
+ out_div = (pll >> QCA953X_PLL_CPU_CONFIG_OUTDIV_SHIFT) &
+--- a/arch/mips/ath79/dev-wmac.c
++++ b/arch/mips/ath79/dev-wmac.c
+@@ -162,10 +162,7 @@ static void qca953x_wmac_setup(void)
+ ath79_wmac_resources[1].end = ATH79_IP2_IRQ(1);
+
+ t = ath79_reset_rr(QCA953X_RESET_REG_BOOTSTRAP);
+- if (t & QCA953X_BOOTSTRAP_REF_CLK_40)
+- ath79_wmac_data.is_clk_25mhz = false;
+- else
+- ath79_wmac_data.is_clk_25mhz = true;
++ ath79_wmac_data.is_clk_25mhz = true;
+
+ ath79_wmac_data.get_mac_revision = ar93xx_get_soc_revision;
+ }
.last_sysupgrade_partition = "file-system",
},
+ /** Firmware layout for the CPE210/220 v2 */
+ {
+ .id = "CPE210V2",
+ .vendor = "CPE210(TP-LINK|UN|N300-2|00000000):2.0\r\n",
+ .support_list =
+ "SupportList:\r\n"
+ "CPE210(TP-LINK|EU|N300-2):2.0\r\n"
+ "CPE210(TP-LINK|UN|N300-2):2.0\r\n"
+ "CPE210(TP-LINK|UN|N300-2|00000000):2.0\r\n"
+ "CPE210(TP-LINK|US|N300-2|55530000):2.0\r\n"
+ "CPE210(TP-LINK|EU|N300-2|45550000):2.0\r\n",
+ .support_trail = '\xff',
+ .soft_ver = NULL,
+
+ .partitions = {
+ {"fs-uboot", 0x00000, 0x20000},
+ {"partition-table", 0x20000, 0x02000},
+ {"default-mac", 0x30000, 0x00020},
+ {"product-info", 0x31100, 0x00100},
+ {"device-info", 0x31400, 0x00400},
+ {"signature", 0x32000, 0x00400},
+ {"device-id", 0x33000, 0x00100},
+ {"os-image", 0x40000, 0x170000},
+ {"soft-version", 0x1b0000, 0x00100},
+ {"support-list", 0x1b1000, 0x01000},
+ {"file-system", 0x1c0000, 0x600000},
+ {"user-config", 0x7c0000, 0x10000},
+ {"default-config", 0x7d0000, 0x10000},
+ {"log", 0x7e0000, 0x10000},
+ {"radio", 0x7f0000, 0x10000},
+ {NULL, 0, 0}
+ },
+
+ .first_sysupgrade_partition = "os-image",
+ .last_sysupgrade_partition = "file-system",
+ },
+
/** Firmware layout for the CPE510/520 */
{
.id = "CPE510",