From patchwork Tue Nov 24 09:01:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Filip Moc X-Patchwork-Id: 1405345 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=moc6.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=YEP0gBOA; dkim=fail reason="signature verification failed" (4096-bit key; secure) header.d=moc6.cz header.i=@moc6.cz header.a=rsa-sha256 header.s=mail20201116 header.b=br4fvCLv; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CgJ3V4nBDz9sSf for ; Tue, 24 Nov 2020 20:03:50 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:Message-ID:Subject:To:From:Date: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=qavSbPxrHADmGPv0P7KtNyS5d4WAf9ABywSFOAskCQE=; b=YEP0gBOAU/RY7LGhEgvqP+Oz4v Ew7aqE/7jHK4xKq7aHbwXrvVUZJNzi7CMhRhbH7vdkJRxHtLTAeo8d/PEBgA2pXZtZGH7IaNKsfii S8WcaW/K9wJSy8O9RJZ9RyuI4+HsZw5dqMTZsQBmh084M1WNdY/lzdH0RCfZxIo6oZzpy8ceIbZo7 idkqGw3/ZbEJK8S6zX0mv6WsvfaO6jyaB3ICWllFiz9UC2yofCJ6TLtaRROXKG2Ft8NX/SW+rLtKf ZNQhx2xPifIM3ayvO6SoKVPWrOTHH1k4bzyATL9Am8hXmM1vgGCDpepQkUfdlIyhtICLpbiDAKcl7 C1Me/OTQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khUCE-0000Gb-TW; Tue, 24 Nov 2020 09:01:10 +0000 Received: from hosting.moc6.cz ([2a02:c60:c70:8900::1] helo=moc6.cz) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khUCB-0000FP-OK for openwrt-devel@lists.openwrt.org; Tue, 24 Nov 2020 09:01:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=moc6.cz; s=mail20201116; h=Message-ID:Subject:To:From:Date:Cc:Reply-To:In-Reply-To; bh=y4X3ecRkTNVkPHYRQ+kjjYTubKEPtXSA5mgwU2kiN0A=; b=br4fvCLvkTlSR8EiDBYcmVqEs3 HZZAN2YymdWEeLSUxR2EkS3DEiWVakQny0zSTiEorIBaQ60ozd1LlgzdjiKeahYDOVR2dLKkjS60t MhUCVBmoViFWDXtv1xqVuULd9QxE6ABmDMpYf+RqmzNhUoQXGhHbEV+1aLg6i6QsqHIw3kQwiRt1E Z5+JIL+mwlZ0bPk6ucXrrGPoLRhqCUTDYndizkV3oRZB15kn5BR/BYE7G4cSMDl69sJFT2lWAoZnj Vib5eXDG+4JdkZ76FE5gf61e0+BE9Dsduke6RBK9ruCSv3YJO5/vN+6ng54qP5S3nkqPdGcss3hFy b3Xa8D4vsZ1TJURVMXpCZAg7jPQtbO402k68bo8elwAqg8bbB7ZCrwcAYMMrgp/6wq/rMUH0spR4o CiyjNVhEPDQqdxHF8afYIOmCd6tguzd3D4UKPsAonetTROGfrcF6UoVZoZM+roXv7G9JtlkrLf0Ak iBLSwxiPRrwU4tr/HpQg4AtK35VYS26yxe+zzd1FLFF56XG2PFMK5L9dy4i5gRoEIS9I4m/t5zHMW MtGC6YPZRXIrsJ6veXDJ2G5XHjk7yqd+yTvdIjHhaLrVELslQWNBYuZUj14fT/zDnEfed5h9ULyuI 6HkBrgROwjXLWCO7bIppgUTZpCTcEXEi7hYwdEhW4=; Received: from Debian-exim by moc6.cz with local (Exim 4.94) (envelope-from ) authenticated: Debian-exim id 1khUC5-002by5-AN for openwrt-devel@lists.openwrt.org; Tue, 24 Nov 2020 10:01:01 +0100 Date: Tue, 24 Nov 2020 10:01:01 +0100 From: Filip Moc To: openwrt-devel@lists.openwrt.org Subject: [PATCH] ramips: add support for TP-Link MR6400 v5 Message-ID: <20201124090101.GA622562@moc6.cz> MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201124_040107_936285_F0811754 X-CRM114-Status: GOOD ( 16.99 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org You can flash via tftp recovery: - serve tftp-recovery image as /tp_recovery.bin on 192.168.0.225/24 - connect to any ethernet port - power on the device while holding the reset button - wait at least 8 seconds before releasing reset button Flashing via OEM web interface does not work. LTE module does not support DHCP so it must be configured via QMI. Hardware Specification (v5.0 EU): - SoC: MT7628NN - Flash: Winbond W25Q64JVS (8MiB) - RAM: ESMT M14D5121632A (64MiB) - Wireless: SoC platform only (2.4GHz b/g/n, 2x internal antenna) - Ethernet: 1NIC (4x100M) - WWAN: TP-LINK LTE MODULE (2x external detachable antenna) - Power: DC 9V 0.85A Signed-off-by: Filip Moc --- Notes: Bugs: This device is affected by first uqmi command hang. This causes qmi proto to hang sometimes when setting up wwan connection for the first time after boot. There is already a patch [1] applied which aims to fix this. But update of qmi.sh is still needed to make use of it. So far it can be manually restarted or workarounded by editing qmi.sh. [1] https://git.openwrt.org/?p=project/uqmi.git;a=commitdiff;h=0a19b5b77140465c29e2afa7d611fe93abc9672f .../dts/mt7628an_tplink_tl-mr6400-v5.dts | 97 +++++++++++++++++++ target/linux/ramips/image/mt76x8.mk | 16 +++ .../mt76x8/base-files/etc/board.d/01_leds | 4 + .../mt76x8/base-files/etc/board.d/02_network | 4 + 4 files changed, 121 insertions(+) create mode 100644 target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v5.dts diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v5.dts new file mode 100644 index 0000000000..09e8be9547 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v5.dts @@ -0,0 +1,97 @@ +#include "mt7628an_tplink_8m.dtsi" + +/ { + compatible = "tplink,tl-mr6400-v5", "mediatek,mt7628an-soc"; + model = "TP-Link TL-MR6400 v5"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + rfkill { + label = "rfkill"; + gpios = <&gpio 46 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + wlan { + label = "white:wlan"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + lan { + label = "white:lan"; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + }; + + led_power: power { + label = "white:power"; + gpios = <&gpio 39 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "white:wan"; + gpios = <&gpio 40 GPIO_ACTIVE_LOW>; + }; + + signal1 { + label = "white:signal1"; + gpios = <&gpio 41 GPIO_ACTIVE_LOW>; + }; + + signal2 { + label = "white:signal2"; + gpios = <&gpio 42 GPIO_ACTIVE_LOW>; + }; + + signal3 { + label = "white:signal3"; + gpios = <&gpio 43 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +&state_default { + gpio { + groups = "i2c", "i2s", "p0led_an", "p1led_an", "p2led_an", "p3led_an", "p4led_an", "uart1", "wdt"; + function = "gpio"; + }; +}; + +&esw { + mediatek,portmap = <0x37>; + mediatek,portdisable = <0x30>; +}; + +&wmac { + mtd-mac-address = <&factory 0x1f100>; +}; + +ðernet { + mtd-mac-address = <&factory 0x1f100>; +}; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 30c41420aa..72539f7a14 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -498,6 +498,22 @@ define Device/tplink_tl-mr6400-v4 endef TARGET_DEVICES += tplink_tl-mr6400-v4 +define Device/tplink_tl-mr6400-v5 + $(Device/tplink-v2) + IMAGE_SIZE := 7808k + DEVICE_MODEL := TL-MR6400 + DEVICE_VARIANT := v5 + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0x64000005 + TPLINK_HWREV := 0x5 + TPLINK_HWREVADD := 0x5 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport \ + kmod-usb-serial kmod-usb-serial-option kmod-usb-net-qmi-wwan uqmi + IMAGES := sysupgrade.bin tftp-recovery.bin + IMAGE/tftp-recovery.bin := pad-extra 128k | $$(IMAGE/factory.bin) +endef +TARGET_DEVICES += tplink_tl-mr6400-v5 + define Device/tplink_tl-wa801nd-v5 $(Device/tplink-v2) IMAGE_SIZE := 7808k diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds index 4ed38bf5f2..31bd9e05b1 100755 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds @@ -79,6 +79,10 @@ tplink,tl-mr6400-v4) ucidef_set_led_switch "lan" "lan" "white:lan" "switch0" "0x0e" ucidef_set_led_switch "wan" "wan" "white:wan" "switch0" "0x10" ;; +tplink,tl-mr6400-v5) + ucidef_set_led_switch "lan" "lan" "white:lan" "switch0" "0x07" + ucidef_set_led_switch "wan" "wan" "white:wan" "switch0" "0x08" + ;; tplink,tl-wr841n-v13) ucidef_set_led_wlan "wlan2g" "wlan2g" "green:wlan" "phy0tpt" ucidef_set_led_switch "lan1" "lan1" "green:lan1" "switch0" "0x2" diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index a7e978a2e2..f4e3fcacb5 100755 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -116,6 +116,10 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0" ;; + tplink,tl-mr6400-v5) + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "3:wan" "6@eth0" + ;; tplink,tl-wr902ac-v3) ucidef_add_switch "switch0" \ "4:lan" "6@eth0"