[OpenWrt-Devel] [PATCH V2] ath79: add support for TP-Link TL-MR6400
Adrian Schmutzler
mail at adrianschmutzler.de
Mon Oct 14 11:37:17 EDT 2019
Hi,
I had a look into ar71xx mach files. Find some additional comments below.
> diff --git a/target/linux/ath79/base-files/etc/board.d/01_leds
> b/target/linux/ath79/base-files/etc/board.d/01_leds
> index 778316e450..385ac8d9ca 100755
> --- a/target/linux/ath79/base-files/etc/board.d/01_leds
> +++ b/target/linux/ath79/base-files/etc/board.d/01_leds
> @@ -130,6 +130,11 @@ tplink,archer-c7-v5)
> ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0"
> "0x10"
> ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0"
> "0x20"
> ;;
> +tplink,tl-mr6400-v1)
> + ucidef_set_led_netdev "lan" "LAN" "tp-link:white:lan" "eth0"
> + ucidef_set_led_netdev "wan" "WAN" "tp-link:white:wan" "eth1"
netdev triggers won't work for LAN and WAN. You will need to change one of them to ucidef_set_led_switch (have a look at other ath79 devices in 01_leds for reference).
Unfortunately, I can never recall which of them it is. You will know when the LED is on although no cable is connected ...
> --- /dev/null
> +++ b/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts
> @@ -0,0 +1,172 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/dts-v1/;
> +
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/input/input.h>
> +
> +#include "qca953x.dtsi"
> +
> +/ {
> + compatible = "tplink,tl-mr6400-v1", "qca,qca9531";
> + model = "TP-Link TL-MR6400 v1";
> +
> + aliases {
> + led-boot = &led_power;
> + led-failsafe = &led_power;
> + led-running = &led_power;
> + led-upgrade = &led_power;
> + };
> +
> + gpio_leds: leds {
Do you need the gpio_leds label somewhere? If not, remove it.
[...]
> +ð0 {
> + status = "okay";
> + phy-mode = "mii";
Those two lines can be removed. eth0 is not disabled before, and phy-mode is already set in parent DTSI.
> + phy-handle = <&swphy0>;
> +
> + mtd-mac-address = <&uboot 0x1fc00>;
> + mtd-mac-address-increment = <1>;
> +
> + gmac-config {
> + device = <&gmac>;
> + switch-phy-swap = <1>;
> + switch-phy-addr-swap = <1>;
> + };
Hmm, I do not see a phy-swap in mr6400 mach files. But if all ports are working, it might still be okay ...
> +};
> +
> +ð1 {
> + status = "okay";
Remove status, it's already set in parent dtsi.
> + mtd-mac-address = <&uboot 0x1fc00>;
> + mtd-mac-address-increment = <(-1)>;
> +};
> +
> +&wmac {
> + status = "okay";
> + mtd-cal-data = <&art 0x1000>;
> + mtd-mac-address = <&uboot 0x1fc00>;
> +};
> +
> +&usb0 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + status = "okay";
> +
> + hub_port: port at 1 {
> + reg = <1>;
> + #trigger-source-cells = <0>;
> + };
> +};
> +
> +&usb_phy {
> + status = "okay";
> +};
> +
> +&gpio {
> + lte_power {
> + gpio-hog;
> + gpios = <4 GPIO_ACTIVE_HIGH>;
Is GPIO_ACTIVE_HIGH correct here?
ar71xx mach files have:
gpio_request_one(TL_MR6400_GPIO_LTE_POWER,
GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED | GPIOF_ACTIVE_LOW,
"LTE power");
> + output-low;
> + line-name = "tp-link:power:LTE";
> + };
> +};
> diff --git a/target/linux/ath79/image/generic-tp-link.mk
> b/target/linux/ath79/image/generic-tp-link.mk
> index 5519e9c960..78d7810f29 100644
> --- a/target/linux/ath79/image/generic-tp-link.mk
> +++ b/target/linux/ath79/image/generic-tp-link.mk
> @@ -393,6 +393,16 @@ define Device/tplink_tl-wr810n-v1
> endef
> TARGET_DEVICES += tplink_tl-wr810n-v1
>
> +define Device/tplink_tl-mr6400-v1
> + $(Device/tplink-8mlzma)
> + ATH_SOC := qca9531
> + DEVICE_MODEL := TL-MR6400
> + DEVICE_VARIANT := v1
> + TPLINK_HWID := 0x64000001
You need to add
SUPPORTED_DEVICES := tl-mr6400
here.
> + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-net
> kmod-usb-net-rndis kmod-usb-serial kmod-usb-serial-option adb
You can remove the following, as those are inherited by the others:
kmod-usb-core kmod-usb-net kmod-usb-serial
Best
Adrian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20191014/995d78c3/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list