[From nobody Thu Jun 25 05:55:40 2020
Received: from hosting.moc6.cz ([2a02:c60:c70:8900::1] helo=moc6.cz)
 by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
 id 1ixdvA-0003Pu-Gs
 for openwrt-devel@lists.openwrt.org; Fri, 31 Jan 2020 21:33:50 +0000
Received: by moc6.cz (Postfix, from userid 1025)
 id CAC8E2320020; Fri, 31 Jan 2020 22:33:33 +0100 (CET)
Date: Fri, 31 Jan 2020 22:33:33 +0100
From: Filip Moc &lt;lede@moc6.cz&gt;
To: Adrian Schmutzler &lt;freifunk@adrianschmutzler.de&gt;
Cc: openwrt-devel@lists.openwrt.org, Enrico Mioso &lt;mrkiko.rs@gmail.com&gt;
Subject: Re: [PATCH v4] ath79: add support for TP-Link TL-MR6400
Message-ID: &lt;20200131213333.GA441@moc6.cz&gt;
References: &lt;20200117121552.2225-1-freifunk@adrianschmutzler.de&gt;
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: &lt;20200117121552.2225-1-freifunk@adrianschmutzler.de&gt;
User-Agent: Mutt/1.10.1 (2018-07-13)
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
X-CRM114-CacheID: sfid-20200131_133348_719935_E8516D91 
X-CRM114-Status: GOOD (  18.79  )
X-Spam-Score: -0.0 (/)
X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary:
 Content analysis details:   (-0.0 points)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 -0.0 SPF_PASS               SPF: sender matches SPF record

Hi,

I tested snapshot build from &quot;Fri Jan 31 00:17:40 2020&quot; and except for problems
mentioned in known issues it seems to be working fine.

Filip


On Fri, Jan 17, 2020 at 01:15:52PM +0100, Adrian Schmutzler wrote:
&gt; From: Enrico Mioso &lt;mrkiko.rs@gmail.com&gt;
&gt; 
&gt; This device is an LTE router supported in ar71xx so far.
&gt; As per original commit, hardware specifications (v1.0 EU):
&gt; - SoC: QCA9531
&gt; - Flash: Winbond W25Q64FV (8MiB)
&gt; - RAM: EtronTech EM6AB160TSE-5G (64MiB)
&gt; - Wireless: SoC platform only (2.4GHz b/g/n, 2x internal antenna)
&gt; - Ethernet: 2NIC (3x100M + 1x100M)
&gt; - WWAN: TP-LINK LTE MODULE (2x external detachable antenna)
&gt; - Power: DC 12V 1A
&gt; 
&gt; Flashing instructions:
&gt; You can flash via tftp recovery (serve factory image as /mr6400_tp_recovery.bin
&gt; on 192.168.0.66/24, connect to any ethernet port and power on device while
&gt; holding the reset button). Flashing via OEM web interface does not work.
&gt; 
&gt; Known issues:
&gt; - LTE module does not always come up during boot. This can be fixed by turning
&gt;   it off and on again.
&gt; - As it happened occasionally in ar71xx, during bursty flash activity, LTE
&gt;   module init will fail, with USB enumeration errors.
&gt; - eth1 (LAN) always shows carrier as 1 even if no cable is plugged in (this
&gt;   works &quot;correctly&quot; on ar71xx)
&gt; 
&gt; Signed-off-by: Enrico Mioso &lt;mrkiko.rs@gmail.com&gt;
&gt; [rebase and several adjustments]
&gt; Signed-off-by: Adrian Schmutzler &lt;freifunk@adrianschmutzler.de&gt;
&gt; Tested-by: Filip Moc &lt;lede@moc6.cz&gt;
&gt; ---
&gt;  .../ath79/dts/qca9531_tplink_tl-mr6400-v1.dts | 167 ++++++++++++++++++
&gt;  .../generic/base-files/etc/board.d/01_leds    |   5 +
&gt;  .../generic/base-files/etc/board.d/02_network |   5 +
&gt;  target/linux/ath79/image/generic-tp-link.mk   |  12 ++
&gt;  4 files changed, 189 insertions(+)
&gt;  create mode 100644 target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts
&gt; 
&gt; diff --git a/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts b/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts
&gt; new file mode 100644
&gt; index 0000000000..7299257cda
&gt; --- /dev/null
&gt; +++ b/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts
&gt; @@ -0,0 +1,167 @@
&gt; +// SPDX-License-Identifier: GPL-2.0-or-later
&gt; +/dts-v1/;
&gt; +
&gt; +#include &lt;dt-bindings/gpio/gpio.h&gt;
&gt; +#include &lt;dt-bindings/input/input.h&gt;
&gt; +
&gt; +#include &quot;qca953x.dtsi&quot;
&gt; +
&gt; +/ {
&gt; +	compatible = &quot;tplink,tl-mr6400-v1&quot;, &quot;qca,qca9531&quot;;
&gt; +	model = &quot;TP-Link TL-MR6400 v1&quot;;
&gt; +
&gt; +	aliases {
&gt; +		led-boot = &amp;led_power;
&gt; +		led-failsafe = &amp;led_power;
&gt; +		led-running = &amp;led_power;
&gt; +		led-upgrade = &amp;led_power;
&gt; +		label-mac-device = &wmac;
&gt; +	};
&gt; +
&gt; +	leds {
&gt; +		compatible = &quot;gpio-leds&quot;;
&gt; +
&gt; +		/* D12 */
&gt; +		wan {
&gt; +			label = &quot;tp-link:white:wan&quot;;
&gt; +			gpios = &lt;&amp;gpio 0 GPIO_ACTIVE_HIGH&gt;;
&gt; +		};
&gt; +
&gt; +		/* D11 */
&gt; +		4g {
&gt; +			label = &quot;tp-link:white:4g&quot;;
&gt; +			gpios = &lt;&amp;gpio 1 GPIO_ACTIVE_HIGH&gt;;
&gt; +		};
&gt; +
&gt; +		/* D5 */
&gt; +		wps {
&gt; +			label = &quot;tp-link:white:wps&quot;;
&gt; +			gpios = &lt;&amp;gpio 3 GPIO_ACTIVE_HIGH&gt;;
&gt; +		};
&gt; +
&gt; +		/* D3 */
&gt; +		wlan {
&gt; +			label = &quot;tp-link:white:wlan&quot;;
&gt; +			gpios = &lt;&amp;gpio 11 GPIO_ACTIVE_HIGH&gt;;
&gt; +			linux,default-trigger = &quot;phy0tpt&quot;;
&gt; +		};
&gt; +
&gt; +		/* D2 */
&gt; +		led_power: power {
&gt; +			label = &quot;tp-link:white:power&quot;;
&gt; +			gpios = &lt;&amp;gpio 13 GPIO_ACTIVE_HIGH&gt;;
&gt; +		};
&gt; +
&gt; +		/* D4 */
&gt; +		lan {
&gt; +			label = &quot;tp-link:white:lan&quot;;
&gt; +			gpios = &lt;&amp;gpio 16 GPIO_ACTIVE_HIGH&gt;;
&gt; +		};
&gt; +	};
&gt; +
&gt; +	keys {
&gt; +		compatible = &quot;gpio-keys&quot;;
&gt; +
&gt; +		/* SW2 */
&gt; +		reset {
&gt; +			label = &quot;Reset button&quot;;
&gt; +			linux,code = &lt;KEY_RESTART&gt;;
&gt; +			gpios = &lt;&amp;gpio 12 GPIO_ACTIVE_LOW&gt;;
&gt; +			debounce-interval = &lt;60&gt;;
&gt; +		};
&gt; +
&gt; +		/* SW3 */
&gt; +		rfkill {
&gt; +			label = &quot;RF kill button&quot;;
&gt; +			linux,code = &lt;KEY_RFKILL&gt;;
&gt; +			gpios = &lt;&amp;gpio 14 GPIO_ACTIVE_LOW&gt;;
&gt; +			debounce-interval = &lt;60&gt;;
&gt; +		};
&gt; +	};
&gt; +
&gt; +	gpio-export {
&gt; +		compatible = &quot;gpio-export&quot;;
&gt; +
&gt; +		gpio_usb_power {
&gt; +			gpio-export,name = &quot;tp-link:power:lte&quot;;
&gt; +			gpio-export,output = &lt;0&gt;;
&gt; +			gpios = &lt;&amp;gpio 4 GPIO_ACTIVE_LOW&gt;;
&gt; +		};
&gt; +	};
&gt; +};
&gt; +
&gt; +&amp;uart {
&gt; +	status = &quot;okay&quot;;
&gt; +};
&gt; +
&gt; +&amp;spi {
&gt; +	status = &quot;okay&quot;;
&gt; +
&gt; +	num-cs = &lt;1&gt;;
&gt; +
&gt; +	flash@0 {
&gt; +		compatible = &quot;jedec,spi-nor&quot;;
&gt; +		reg = &lt;0&gt;;
&gt; +		spi-max-frequency = &lt;25000000&gt;;
&gt; +
&gt; +		partitions {
&gt; +			compatible = &quot;fixed-partitions&quot;;
&gt; +			#address-cells = &lt;1&gt;;
&gt; +			#size-cells = &lt;1&gt;;
&gt; +
&gt; +			uboot: partition@0 {
&gt; +				label = &quot;u-boot&quot;;
&gt; +				reg = &lt;0x000000 0x020000&gt;;
&gt; +				read-only;
&gt; +			};
&gt; +
&gt; +			partition@20000 {
&gt; +				compatible = &quot;tplink,firmware&quot;;
&gt; +				label = &quot;firmware&quot;;
&gt; +				reg = &lt;0x020000 0x7d0000&gt;;
&gt; +			};
&gt; +
&gt; +			art: partition@7f0000 {
&gt; +				label = &quot;art&quot;;
&gt; +				reg = &lt;0x7f0000 0x010000&gt;;
&gt; +				read-only;
&gt; +			};
&gt; +		};
&gt; +	};
&gt; +};
&gt; +
&gt; +&amp;eth0 {
&gt; +	status = &quot;okay&quot;;
&gt; +
&gt; +	phy-handle = &lt;&amp;swphy0&gt;;
&gt; +
&gt; +	mtd-mac-address = &lt;&amp;uboot 0x1fc00&gt;;
&gt; +	mtd-mac-address-increment = &lt;1&gt;;
&gt; +};
&gt; +
&gt; +&amp;eth1 {
&gt; +	mtd-mac-address = &lt;&amp;uboot 0x1fc00&gt;;
&gt; +	mtd-mac-address-increment = &lt;(-1)&gt;;
&gt; +};
&gt; +
&gt; +&amp;wmac {
&gt; +	status = &quot;okay&quot;;
&gt; +
&gt; +	mtd-cal-data = &lt;&amp;art 0x1000&gt;;
&gt; +	mtd-mac-address = &lt;&amp;uboot 0x1fc00&gt;;
&gt; +};
&gt; +
&gt; +&amp;usb0 {
&gt; +	#address-cells = &lt;1&gt;;
&gt; +	#size-cells = &lt;0&gt;;
&gt; +	status = &quot;okay&quot;;
&gt; +
&gt; +	hub_port: port@1 {
&gt; +		reg = &lt;1&gt;;
&gt; +		#trigger-source-cells = &lt;0&gt;;
&gt; +	};
&gt; +};
&gt; +
&gt; +&amp;usb_phy {
&gt; +	status = &quot;okay&quot;;
&gt; +};
&gt; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
&gt; index de4e8b4a7f..1023ba7a39 100755
&gt; --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds
&gt; +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
&gt; @@ -215,6 +215,11 @@ tplink,re450-v2)
&gt;  	ucidef_set_led_netdev &quot;lan_data&quot; &quot;LAN Data&quot; &quot;tp-link:green:lan_data&quot; &quot;eth0&quot; &quot;tx rx&quot;
&gt;  	ucidef_set_led_netdev &quot;lan_link&quot; &quot;LAN Link&quot; &quot;tp-link:green:lan_link&quot; &quot;eth0&quot; &quot;link&quot;
&gt;  	;;
&gt; +tplink,tl-mr6400-v1)
&gt; +	ucidef_set_led_switch &quot;lan&quot; &quot;LAN&quot; &quot;tp-link:white:lan&quot; &quot;switch0&quot; &quot;0x0e&quot;
&gt; +	ucidef_set_led_netdev &quot;wan&quot; &quot;WAN&quot; &quot;tp-link:white:wan&quot; &quot;eth1&quot;
&gt; +	ucidef_set_led_netdev &quot;4g&quot; &quot;4G&quot; &quot;tp-link:white:4g&quot; &quot;usb0&quot;
&gt; +	;;
&gt;  tplink,tl-wr842n-v2)
&gt;  	ucidef_set_led_netdev &quot;wan&quot; &quot;WAN&quot; &quot;tp-link:green:wan&quot; &quot;eth1&quot;
&gt;  	ucidef_set_led_switch &quot;lan1&quot; &quot;LAN1&quot; &quot;tp-link:green:lan1&quot; &quot;switch0&quot; &quot;0x04&quot;
&gt; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
&gt; index a96b504d5a..0bae9dc384 100755
&gt; --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
&gt; +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
&gt; @@ -236,6 +236,11 @@ ath79_setup_interfaces()
&gt;  		ucidef_add_switch &quot;switch0&quot; \
&gt;  			&quot;0@eth0&quot; &quot;2:lan:3&quot; &quot;3:lan:2&quot; &quot;4:lan:1&quot; &quot;1:wan&quot;
&gt;  		;;
&gt; +	tplink,tl-mr6400-v1)
&gt; +		ucidef_set_interfaces_lan_wan &quot;eth0.1 eth1&quot; &quot;usb0&quot;
&gt; +		ucidef_add_switch &quot;switch0&quot; \
&gt; +			&quot;0@eth0&quot; &quot;1:lan:1&quot; &quot;2:lan:3&quot; &quot;3:lan:2&quot;
&gt; +		;;
&gt;  	tplink,tl-wr842n-v2)
&gt;  		ucidef_set_interface_wan &quot;eth1&quot;
&gt;  		ucidef_add_switch &quot;switch0&quot; \
&gt; diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk
&gt; index a7266f05a9..53138e343b 100644
&gt; --- a/target/linux/ath79/image/generic-tp-link.mk
&gt; +++ b/target/linux/ath79/image/generic-tp-link.mk
&gt; @@ -374,6 +374,18 @@ define Device/tplink_re450-v2
&gt;  endef
&gt;  TARGET_DEVICES += tplink_re450-v2
&gt;  
&gt; +define Device/tplink_tl-mr6400-v1
&gt; +  $(Device/tplink-8mlzma)
&gt; +  SOC := qca9531
&gt; +  DEVICE_MODEL := TL-MR6400
&gt; +  DEVICE_VARIANT := v1
&gt; +  TPLINK_HWID := 0x64000001
&gt; +  DEVICE_PACKAGES := kmod-usb2 kmod-usb-net kmod-usb-net-rndis kmod-usb-serial \
&gt; +	kmod-usb-serial-option adb-enablemodem
&gt; +  SUPPORTED_DEVICES += tl-mr6400
&gt; +endef
&gt; +TARGET_DEVICES += tplink_tl-mr6400-v1
&gt; +
&gt;  define Device/tplink_tl-wdr3500-v1
&gt;    $(Device/tplink-8mlzma)
&gt;    SOC := ar9344
&gt; -- 
&gt; 2.20.1
&gt; 

]