[OpenWrt-Devel] [PATCH] ath79: Add support of Tp_Link MR-3040 v2

Mathias Kresin dev at kresin.me
Mon Aug 13 12:34:47 EDT 2018


2018-08-13 18:28 GMT+02:00 Dmitry Tunin <hanipouspilot at gmail.com>:
> Add support for the ar71xx supported Tp_link MR-3040 v2 to ath79.
>
> Signed-off-by: Dmitry Tunin <hanipouspilot at gmail.com>
> ---
>  .../linux/ath79/base-files/etc/board.d/02_network  |   1 +
>  .../linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts | 161 +++++++++++++++++++++
>  target/linux/ath79/image/tiny-tp-link.mk           |  10 ++
>  3 files changed, 172 insertions(+)
>  create mode 100644 target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts
>
> diff --git a/target/linux/ath79/base-files/etc/board.d/02_network b/target/linux/ath79/base-files/etc/board.d/02_network
> index 9e315ee..bfbc1ac 100755
> --- a/target/linux/ath79/base-files/etc/board.d/02_network
> +++ b/target/linux/ath79/base-files/etc/board.d/02_network
> @@ -16,6 +16,7 @@ ath79_setup_interfaces()
>         tplink,re450-v2|\
>         tplink,tl-mr10u|\
>         tplink,tl-mr3020-v1|\
> +       tplink,tl-mr3040-v2|\
>         tplink,tl-wr703n|\
>         ubnt,unifiac-lite|\
>         ubnt,unifiac-mesh|\
> diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts b/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts
> new file mode 100644
> index 0000000..d72839e
> --- /dev/null
> +++ b/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts
> @@ -0,0 +1,161 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/dts-v1/;
> +
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/input/input.h>
> +
> +#include "ar9331.dtsi"
> +
> +/ {
> +       model = "TP-Link TL-MR3040 V2";
> +       compatible = "tplink,tl-mr3040-v2", "qca,ar9331";
> +
> +       leds {
> +               compatible = "gpio-leds";
> +
> +               wlan {
> +                       label = "tp-link:green:wlan";
> +                       gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
> +                       default-state = "off";
> +                       linux,default-trigger = "phy0tpt";
> +               };
> +
> +               lan {
> +                       label = "tp-link:green:lan";
> +                       gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
> +                       default-state = "off";
> +                       linux,default-trigger = "netdev:eth0";

I'm not sure if we should do it this way. I already dislike the
phy0tpt trigger in the devicetree source files, as it makes assumption
on how the interface is named in linux/in which order the wireless is
registered.

Something similar to the way the usbport triggers are handled - with
device name evaluation during runtime -  would make more sense to me.

Any opinions about it?

Mathias

_______________________________________________
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