From patchwork Mon Oct 30 19:32:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bizon X-Patchwork-Id: 832150 X-Patchwork-Delegate: pepe2k@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZM6kNmOQ"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="tBrKg/w4"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yQl5P46Mkz9t6X for ; Tue, 31 Oct 2017 06:33:29 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:To:Message-ID:Date:From: MIME-Version:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=/T/+IX6tIALGDPSbq9ryeiBF2E/g72mvSuT81ngELgI=; b=ZM6 kNmOQT01g5aqzK4TUrLdwaEQT7QQ1HbCtltGoRAUzbsc2ua8GqfhwotExv2TNbe7BdebykF5tMBrg WCZ/MLXByBsmTYqVDp+jewOWFdUVMXTIxiZhc9NhbUJk9Es30tf9HomMNkm/arfE/6dPZTQ4GuFCJ ZSO7wVfIZimrAjqK8dsFz6J7DWCbqwZKXRwVBdLW/c8E752Vpdhr4dqWzwSx5I+1BEhrAUC4+B4+C S/sDaQC7rAnpdv/8nMxCTU4aE0+t9K1cqtlKuSNafgtK25d8Wj8Tzm3ImIvSThhrYStub/DQbw3Ko HfvoSTs8cScJeAh0oVl3rZbLTPxqVBg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e9FoD-0006n4-Ns; Mon, 30 Oct 2017 19:33:17 +0000 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e9Fnu-0006RC-Q7 for lede-dev@lists.infradead.org; Mon, 30 Oct 2017 19:33:15 +0000 Received: by mail-lf0-x241.google.com with SMTP id a132so16266230lfa.7 for ; Mon, 30 Oct 2017 12:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=5DKBTfumpcEBDfY7gh9AYj+S482GOxIvbMsUEDn7VbI=; b=tBrKg/w4alGY+S5lRG6hPFBs2FAMB6XUPp7P8WpmcmPoExCkv8X3NNx3T3O0gpx2Nq 8y9eyQjlFE+54X9YJ2d1XEFjwOf0vtAqR9YbNHAaLBlSVdatpNnGLhfLDbeutm1opkO6 wMFDIQy0oyqT2LDFkoaqbii8ziB0x7lmJl2I6UUq0OdfHHe/MSpEglSK2M7Ib3A1QGI/ 6RQJosahMPTvlK/u8gMjtthLzbMuQkmtS+LgYHjQ5p2o+Uk1VeTlM8+5BjP2qW3SVBUy UqtaITBRSeguFu1WACvLBLsCQjNQcxCittS4017lu4JICXs1zCWUumdYNxkBDJ2kgGgZ P5xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=5DKBTfumpcEBDfY7gh9AYj+S482GOxIvbMsUEDn7VbI=; b=MWOlGLeRLB6mpGt8z2vilaKavGC6kGZ4YU31m5ZJ2JV6/eRsilsycpLryI33VHwC3Z gQcqPx1JYVOm4420sF2jc+vs9oO1BeD0aepjsDQEsFxAdJ1jAsVataHg93bAiRAHtlFV Ja4R8Yy3hbBOqhXyJKO4NnZi0C/Kw2Hj25Gm/EaemHJ7kA3CiNafRjay24CjsmySUzEH GwzGaCMGQlp9bGLwYmWu3lPpQ4QfiwCEmREDroTkhp7uZ3th0SqPm7aME87Av0S/3gJq HPR3usfgnGBrwVWZaUvP3GdoAHI3ws+KLH4mUD0hJwKVINVlVNI6eW2fA38Tk17b3DC7 emUw== X-Gm-Message-State: AMCzsaUdUEHTvmrCQ3/DC/IHm9DWeTMfhgyJHl566HXcnVO1oaYvHCfx RBkepOruf0rcoOUkVPwvXAwDGPBAaDKCjm7pe6wkmg== X-Google-Smtp-Source: ABhQp+QBDk/5th/MjHj6ew/OVPUaGIjvl1TYrRIrnqvyUuKPYJvAQYx5KqhlbbYV2DOq2hgmlgENw0U/YGw002L662g= X-Received: by 10.25.59.210 with SMTP id d79mr3173590lfl.207.1509391955497; Mon, 30 Oct 2017 12:32:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.20.76 with HTTP; Mon, 30 Oct 2017 12:32:34 -0700 (PDT) From: Bizon Date: Mon, 30 Oct 2017 20:32:34 +0100 Message-ID: To: lede-dev@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171030_123259_713844_D64BE8F1 X-CRM114-Status: GOOD ( 16.29 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4010:c07:0:0:0:241 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (bizongod[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain Subject: [LEDE-DEV] [PATCH] ar71xx: add support for TP-Link TL-WDR7500v6 X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Add support for TP-Link TL-WDR7500 V6. Specifications: - WiSoC: QCA9563 - 3x3 2.4GHz - Radio2: QCA9880 - 3x3 5GHz - RAM: 64MB DDR2 - Storage: 8MB NOR SPI flash, can be replaced with 16M - Switch: RTL8367S, now unmanaged - Ethernet: 5x1G - Misc: 2x button, 2x LED Signed-off-by: Karol Bizewski --- package/boot/uboot-envtools/files/ar71xx | 2 ++ target/linux/ar71xx/base-files/etc/board.d/02_network | 2 ++ target/linux/ar71xx/base-files/etc/diag.sh | 4 ++++ .../base-files/etc/hotplug.d/firmware/11-ath10k-caldata | 5 +++++ target/linux/ar71xx/base-files/lib/ar71xx.sh | 6 ++++++ target/linux/ar71xx/config-4.4 | 1 + target/linux/ar71xx/config-4.9 | 1 + .../linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt | 10 ++++++++++ target/linux/ar71xx/files/arch/mips/ath79/Makefile | 1 + target/linux/ar71xx/files/arch/mips/ath79/machtypes.h | 1 + target/linux/ar71xx/image/generic.mk | 17 +++++++++++++++++ .../files/arch/mips/ath79/mach-tl-wdr7500-v6.c | 112 +++++++++++++++++++++ 12 files changed, 162 insertions(+) create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr7500-v6.c diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx index 0bdb6de..789c317 100644 TL-WDR7500 v6", tl_wdr7500_v6_setup); --- a/package/boot/uboot-envtools/files/ar71xx +++ b/package/boot/uboot-envtools/files/ar71xx @@ -46,6 +46,8 @@ om5p-acv2|\ om5p-an|\ sr3200|\ tube2h|\ +tl-wdr7500-v6|\ +tl-wdr7500-v6-16M|\ wndr3700|\ xd3200) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network index d838352..6cdd2fe 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/02_network +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network @@ -122,6 +122,8 @@ ar71xx_setup_interfaces() tl-wa901nd-v2|\ tl-wa901nd-v3|\ tl-wa901nd-v4|\ + tl-wdr7500-v6|\ + tl-wdr7500-v6-16M|\ tl-wr703n|\ tl-wr802n-v1|\ tl-wr802n-v2|\ diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index ade726f..f0ec9e6 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -20,6 +20,10 @@ get_status_led() { all0305) status_led="eap7660d:green:ds4" ;; + tl-wdr7500-v6|\ + tl-wdr7500-v6-16M) + status_led="$board:blue:system" + ;; antminer-s1|\ antminer-s3|\ antminer-r1|\ diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 85a2a63..bd0cf2e 100644 --- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -98,6 +98,11 @@ case "$FIRMWARE" in rb-952ui-5ac2nd) ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 2116 ;; + tl-wdr7500-v6|\ + tl-wdr7500-v6-16M) + ath10kcal_extract "art" 8192 2116 + ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +2) + ;; re450|\ tl-wr902ac-v1) ath10kcal_extract "art" 20480 2116 diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index 835ced6..dbf132b 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -1109,6 +1109,12 @@ ar71xx_board_detect() { *"TL-WDR6500 v2") name="tl-wdr6500-v2" ;; + *"TL-WDR7500 v6") + local size="$(mtd_get_part_size 'firmware')" + + [ "$size" = "8060928" ] && name="tl-wdr7500-v6" + [ "$size" = "16449536" ] && name="tl-wdr7500-v6-16M" + ;; *"TL-WPA8630") name="tl-wpa8630" ;; diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4 index 0e77560..32b7fbe 100644 --- a/target/linux/ar71xx/config-4.4 +++ b/target/linux/ar71xx/config-4.4 @@ -196,6 +196,7 @@ CONFIG_ATH79_MACH_TL_WDR3320_V2=y CONFIG_ATH79_MACH_TL_WDR3500=y CONFIG_ATH79_MACH_TL_WDR4300=y CONFIG_ATH79_MACH_TL_WDR6500_V2=y +CONFIG_ATH79_MACH_TL_WDR7500_V6=y CONFIG_ATH79_MACH_TL_WPA8630=y CONFIG_ATH79_MACH_TL_WR1041N_V2=y CONFIG_ATH79_MACH_TL_WR1043ND=y diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9 index c5b8908..5f74076 100644 --- a/target/linux/ar71xx/config-4.9 +++ b/target/linux/ar71xx/config-4.9 @@ -194,6 +194,7 @@ CONFIG_ATH79_MACH_TL_WDR3320_V2=y CONFIG_ATH79_MACH_TL_WDR3500=y CONFIG_ATH79_MACH_TL_WDR4300=y CONFIG_ATH79_MACH_TL_WDR6500_V2=y +CONFIG_ATH79_MACH_TL_WDR7500_V6=y CONFIG_ATH79_MACH_TL_WPA8630=y CONFIG_ATH79_MACH_TL_WR1041N_V2=y CONFIG_ATH79_MACH_TL_WR1043ND=y diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt index 454aee6..c6e75db 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt @@ -1613,6 +1613,16 @@ config ATH79_MACH_TL_WDR6500_V2 select ATH79_DEV_USB select ATH79_DEV_WMAC +config ATH79_MACH_TL_WDR7500_V6 + bool "TP-LINK TL-WDR7500 v6 board support" + select SOC_QCA956X + select ATH79_DEV_AP9X_PCI if PCI + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_WMAC + config ATH79_MACH_TL_WR703N bool "TP-LINK TL-WR703N/TL-WR710N/TL-MR10U support" select SOC_AR933X diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile index 0975aac..49686ed 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile @@ -201,6 +201,7 @@ obj-$(CONFIG_ATH79_MACH_TL_WDR3320_V2) += mach-tl-wdr3320-v2.o obj-$(CONFIG_ATH79_MACH_TL_WDR3500) += mach-tl-wdr3500.o obj-$(CONFIG_ATH79_MACH_TL_WDR4300) += mach-tl-wdr4300.o obj-$(CONFIG_ATH79_MACH_TL_WDR6500_V2) += mach-tl-wdr6500-v2.o +obj-$(CONFIG_ATH79_MACH_TL_WDR7500_V6) += mach-tl-wdr7500-v6.o obj-$(CONFIG_ATH79_MACH_TL_WPA8630) += mach-tl-wpa8630.o obj-$(CONFIG_ATH79_MACH_TL_WR1041N_V2) += mach-tl-wr1041n-v2.o obj-$(CONFIG_ATH79_MACH_TL_WR1043ND) += mach-tl-wr1043nd.o diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h index 756d406..fb27498 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h @@ -241,6 +241,7 @@ enum ath79_mach_type { ATH79_MACH_TL_WDR4300, /* TP-LINK TL-WDR4300 */ ATH79_MACH_TL_WDR4900_V2, /* TP-LINK TL-WDR4900 v2 */ ATH79_MACH_TL_WDR6500_V2, /* TP-LINK TL-WDR6500 v2 */ + ATH79_MACH_TL_WDR7500_V6, /* TP-LINK TL-WDR7500 v6 */ ATH79_MACH_TL_WPA8630, /* TP-Link TL-WPA8630 */ ATH79_MACH_TL_WR1041N_V2, /* TP-LINK TL-WR1041N v2 */ ATH79_MACH_TL_WR1043ND, /* TP-LINK TL-WR1043ND */ diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk index 6f5a701..39be043 100644 --- a/target/linux/ar71xx/image/generic.mk +++ b/target/linux/ar71xx/image/generic.mk @@ -713,6 +713,23 @@ define Device/tellstick-znet-lite endef TARGET_DEVICES += tellstick-znet-lite +define Device/tl-wdr7500-v6 + DEVICE_TITLE := TP-LINK WDR7500 v6 + DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x + BOARDNAME := TL-WDR7500-V6 + IMAGE_SIZE := 7872k + MTDPARTS := spi0.0:192k(u-boot)ro,64k(u-boot-env),7872k(firmware),64k(art)ro +endef +TARGET_DEVICES += tl-wdr7500-v6 + +define Device/tl-wdr7500-v6-16M + $(Device/tl-wdr7500-v6) + DEVICE_TITLE := TP-LINK WDR7500 v6 16M + IMAGE_SIZE := 16064k + MTDPARTS := spi0.0:192k(u-boot)ro,64k(u-boot-env),16064k(firmware),64k(art)ro +endef +TARGET_DEVICES += tl-wdr7500-v6-16M + define Device/oolite $(Device/tplink-16mlzma) DEVICE_TITLE := Gainstrong OOLITE diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr7500-v6.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr7500-v6.c new file mode 100644 index 0000000..8c1c989 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr7500-v6.c @@ -0,0 +1,112 @@ +/* + * Support for TP-Link TL-WDR7500 v6 board + * + * Copyright (C) 2017 Karol Bizewski + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include +#include +#include +#include + +#include +#include + +#include "common.h" +#include "dev-ap9x-pci.h" +#include "dev-eth.h" +#include "dev-gpio-buttons.h" +#include "dev-leds-gpio.h" +#include "dev-m25p80.h" +#include "dev-usb.h" +#include "dev-wmac.h" +#include "machtypes.h" + +#define WDR7500V6_GPIO_LED_SYSTEM 21 +#define WDR7500V6_GPIO_LED_TURBO 6 + +#define WDR7500V6_GPIO_BTN_RESET 1 +#define WDR7500V6_GPIO_BTN_TURBO 5 + +#define WDR7500V6_KEYS_POLL_INTERVAL 20 +#define WDR7500V6_KEYS_DEBOUNCE_INTERVAL \ + (3 * WDR7500V6_KEYS_POLL_INTERVAL) + + +static struct gpio_led wdr7500v6_leds_gpio[] __initdata = { + { + .name = "wdr7500v6:blue:system", + .gpio = WDR7500V6_GPIO_LED_SYSTEM, + .active_low = 1, + }, + { + .name = "wdr7500v6:green:turbo", + .gpio = WDR7500V6_GPIO_LED_TURBO, + .active_low = 1, + }, +}; + +static struct gpio_keys_button wdr7500v6_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = WDR7500V6_KEYS_DEBOUNCE_INTERVAL, + .gpio = WDR7500V6_GPIO_BTN_RESET, + .active_low = 1, + }, + { + .desc = "turbo", + .type = EV_KEY, + .debounce_interval = WDR7500V6_KEYS_DEBOUNCE_INTERVAL, + .gpio = WDR7500V6_GPIO_BTN_TURBO, + .active_low = 1, + }, +}; + +static void __init tl_wdr7500_v6_setup(void) +{ + u8 *mac = (u8 *) KSEG1ADDR(0x1fff0000); + + ath79_register_m25p80(NULL); + + ath79_register_mdio(0, 0x0); + + /* GMAC0 is connected to RTL8367S switch */ + ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII; + ath79_eth0_data.speed = SPEED_1000; + ath79_eth0_data.duplex = DUPLEX_FULL; + + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0); + ath79_register_eth(0); + + ath79_register_wmac(mac + 0x1000, NULL); + + ap91_pci_init(mac + 0x2000, NULL); + + ath79_gpio_direction_select(WDR7500V6_GPIO_LED_SYSTEM, true); + ath79_gpio_direction_select(WDR7500V6_GPIO_LED_TURBO , true); + + /* Turn off LEDs on boot */ + gpio_set_value(WDR7500V6_GPIO_LED_SYSTEM, 1); + gpio_set_value(WDR7500V6_GPIO_LED_TURBO , 1); + + ath79_gpio_output_select(WDR7500V6_GPIO_LED_SYSTEM, 0); + ath79_gpio_output_select(WDR7500V6_GPIO_LED_TURBO , 0); + + ath79_register_gpio_keys_polled(-1, WDR7500V6_KEYS_POLL_INTERVAL, + ARRAY_SIZE(wdr7500v6_gpio_keys), + wdr7500v6_gpio_keys); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(wdr7500v6_leds_gpio), + wdr7500v6_leds_gpio); + + +} + +MIPS_MACHINE(ATH79_MACH_TL_WDR7500_V6, "TL-WDR7500-V6", "TP-LINK