RE: [PATCH] ramips: add support for Wavlink WL-WN578A2

2021-04-26 Thread Adrian Schmutzler
Hi,

> -Original Message-
> From: Thomas Aldrian [mailto:dev.aldr...@gmail.com]
> Sent: Montag, 26. April 2021 20:41
> To: Adrian Schmutzler ; openwrt-
> de...@lists.openwrt.org
> Subject: Re: [PATCH] ramips: add support for Wavlink WL-WN578A2
> 
> On Sun, 2021-04-25 at 22:27 +0200, Adrian Schmutzler wrote:
> > Why wlan1? Is this chosen arbitrarily (than please drop the default
> > setup), or is the vendor really also using only one specific radio for
> > the RSSI leds?
> >
> > Best
> >
> > Adrian
> 
> Hi Adrian,
> 
> The stock firmware does use some sort of RSSI LEDs, but I was unable to
> properly test this. The choice of wlan1 is rather arbitrary, yes. I would have
> changed the default config to use both radios as this makes the most sense
> to me, but I am unsure how to do so. Is there a way to set both? or should I
> drop the rssileds setup entirely?

Linking one set of LEDs to two interfaces is not possible (with usual means).

In cases like this, I typically prefer to drop the setup, since anything else 
is likely to cause confusion to the users.

Anybody who wants to configure rssileds can still do it, with the added benefit 
that he will know what he configured afterwards.

Best

Adrian

> 
> As for the other changes, I will send a new patch soon.
> 
> Best,
> Thomas
> >


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] ramips: add support for Wavlink WL-WN578A2

2021-04-26 Thread Thomas Aldrian
On Sun, 2021-04-25 at 22:27 +0200, Adrian Schmutzler wrote:
> Why wlan1? Is this chosen arbitrarily (than please drop the default
> setup), or is the vendor really also using only one specific radio
> for the RSSI leds?
> 
> Best
> 
> Adrian

Hi Adrian,

The stock firmware does use some sort of RSSI LEDs, but I was unable to
properly test this. The choice of wlan1 is rather arbitrary, yes. I
would have changed the default config to use both radios as this makes
the most sense to me, but I am unsure how to do so. Is there a way to
set both? or should I drop the rssileds setup entirely?

As for the other changes, I will send a new patch soon.

Best,
Thomas
> 


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


RE: [PATCH] ramips: add support for Wavlink WL-WN578A2

2021-04-25 Thread Adrian Schmutzler
Hi,

comments inline. Nothing really serious ...

> -Original Message-
> From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org]
> On Behalf Of dev.aldr...@gmail.com
> Sent: Donnerstag, 22. April 2021 21:24
> To: openwrt-devel@lists.openwrt.org
> Cc: Thomas Aldrian 
> Subject: [PATCH] ramips: add support for Wavlink WL-WN578A2
> 
> From: Thomas Aldrian 
> 
> This commit adds support for the Wavlink WL-WN578A2 dual-band wall-plug
> wireless router. This device is also sold under the name SilverCrest SWV 733
> A2.
> 
> Device Specifications:
> 
> - CPU: MediaTek MT7628AN (580MHz)
> - Flash: 8MB
> - RAM: 64MB
> - Bootloader: U-Boot
> - Ethernet: 2x 10/100 Mbps
> - 2.4 GHz: 802.11b/g/n SoC
> - 5 GHz: 802.11a/n/ac MT7610E
> - Antennas: internal
> - 4 green LEDs: WPS/Power, LAN, WAN, wifi-low, wifi-med, wifi-high
> - Buttons: Reset, WPS
> - Sliding mode switch: AP, repeater, client
> - Small sliding power switch
> 
> Flashing instructions:
> 
> U-Boot launches TFTP client if WPS button is pressed during power-on.
> Configure as follows:
> 
> - Server IP: 192.168.10.100
> - Filename (rename sysupgrade file to this): firmware.bin
> 
> Flashing should not take more than a minute, device will reboot
> automatically.
> 
> Signed-off-by: Thomas Aldrian 
> ---
>  .../dts/mt7628an_wavlink_wl-wn578a2.dts   | 165 ++
>  target/linux/ramips/image/mt76x8.mk   |  10 ++
>  .../mt76x8/base-files/etc/board.d/01_leds |   8 +
>  .../mt76x8/base-files/etc/board.d/02_network  |   6 +-
>  4 files changed, 187 insertions(+), 2 deletions(-)  create mode 100644
> target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts
> 
> diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts
> b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts
> new file mode 100644
> index 00..69a54c297b
> --- /dev/null
> +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts
> @@ -0,0 +1,165 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
> +
> +#include "mt7628an.dtsi"
> +
> +#include 
> +#include 
> +
> +/ {
> + compatible = "wavlink,wl-wn578a2", "mediatek,mt7628an-soc";
> + model = "Wavlink WL-WN578A2";
> +
> + aliases {
> + led-boot = _wps;
> + led-failsafe = _wps;
> + led-running = _wps;
> + led-upgrade = _wps;
> + };
> +
> + keys {
> + compatible = "gpio-keys";
> +
> + reset {
> + label = "reset";
> + gpios = < 43 GPIO_ACTIVE_LOW>;
> + linux,code = ;
> + };
> +
> + wps {
> + label = "wps";
> + gpios = < 38 GPIO_ACTIVE_LOW>;
> + linux,code = ;
> + };
> +
> + ap {
> + label = "ap";
> + gpios = < 41 GPIO_ACTIVE_LOW>;
> + linux,code = ;
> + linux,input-type = ;
> + };
> +
> + repeater {
> + label = "repeater";
> + gpios = < 42 GPIO_ACTIVE_LOW>;
> + linux,code = ;
> + linux,input-type = ;
> + };
> + };
> +
> + leds {
> + compatible = "gpio-leds";
> +
> + wifi-high {
> + label = "green:wifi-high";
> + gpios = < 37 GPIO_ACTIVE_LOW>;
> + };
> +
> + wifi-med {
> + label = "green:wifi-med";
> + gpios = < 11 GPIO_ACTIVE_LOW>;
> + };
> +
> + wifi-low {
> + label = "green:wifi-low";
> + gpios = < 44 GPIO_ACTIVE_LOW>;
> + };
> +
> + lan {
> + label = "green:lan";
> + gpios = < 40 GPIO_ACTIVE_LOW>;
> + };
> +
> + wan {
> + label = "green:wan";
> + gpios = < 39 GPIO_ACTIVE_LOW>;
> + };
> +
> + led_wps: wps {
> + label = "green:wps";
> + gpios = < 4 GPIO_ACTIVE_LOW>;
> + };
> + };
> +};
> +
> +_default {
> + gpio {
> + groups = "i2c", "wdt", "wled

[PATCH] ramips: add support for Wavlink WL-WN578A2

2021-04-22 Thread dev . aldrian
From: Thomas Aldrian 

This commit adds support for the Wavlink WL-WN578A2 dual-band wall-plug
wireless router. This device is also sold under the name SilverCrest
SWV 733 A2.

Device Specifications:

- CPU: MediaTek MT7628AN (580MHz)
- Flash: 8MB
- RAM: 64MB
- Bootloader: U-Boot
- Ethernet: 2x 10/100 Mbps
- 2.4 GHz: 802.11b/g/n SoC
- 5 GHz: 802.11a/n/ac MT7610E
- Antennas: internal
- 4 green LEDs: WPS/Power, LAN, WAN, wifi-low, wifi-med, wifi-high
- Buttons: Reset, WPS
- Sliding mode switch: AP, repeater, client
- Small sliding power switch

Flashing instructions:

U-Boot launches TFTP client if WPS button is pressed during power-on.
Configure as follows:

- Server IP: 192.168.10.100
- Filename (rename sysupgrade file to this): firmware.bin

Flashing should not take more than a minute, device will reboot
automatically.

Signed-off-by: Thomas Aldrian 
---
 .../dts/mt7628an_wavlink_wl-wn578a2.dts   | 165 ++
 target/linux/ramips/image/mt76x8.mk   |  10 ++
 .../mt76x8/base-files/etc/board.d/01_leds |   8 +
 .../mt76x8/base-files/etc/board.d/02_network  |   6 +-
 4 files changed, 187 insertions(+), 2 deletions(-)
 create mode 100644 target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts

diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts 
b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts
new file mode 100644
index 00..69a54c297b
--- /dev/null
+++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts
@@ -0,0 +1,165 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7628an.dtsi"
+
+#include 
+#include 
+
+/ {
+   compatible = "wavlink,wl-wn578a2", "mediatek,mt7628an-soc";
+   model = "Wavlink WL-WN578A2";
+
+   aliases {
+   led-boot = _wps;
+   led-failsafe = _wps;
+   led-running = _wps;
+   led-upgrade = _wps;
+   };
+
+   keys {
+   compatible = "gpio-keys";
+
+   reset {
+   label = "reset";
+   gpios = < 43 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   };
+
+   wps {
+   label = "wps";
+   gpios = < 38 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   };
+
+   ap {
+   label = "ap";
+   gpios = < 41 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   linux,input-type = ;
+   };
+
+   repeater {
+   label = "repeater";
+   gpios = < 42 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   linux,input-type = ;
+   };
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   wifi-high {
+   label = "green:wifi-high";
+   gpios = < 37 GPIO_ACTIVE_LOW>;
+   };
+
+   wifi-med {
+   label = "green:wifi-med";
+   gpios = < 11 GPIO_ACTIVE_LOW>;
+   };
+
+   wifi-low {
+   label = "green:wifi-low";
+   gpios = < 44 GPIO_ACTIVE_LOW>;
+   };
+
+   lan {
+   label = "green:lan";
+   gpios = < 40 GPIO_ACTIVE_LOW>;
+   };
+
+   wan {
+   label = "green:wan";
+   gpios = < 39 GPIO_ACTIVE_LOW>;
+   };
+
+   led_wps: wps {
+   label = "green:wps";
+   gpios = < 4 GPIO_ACTIVE_LOW>;
+   };
+   };
+};
+
+_default {
+   gpio {
+   groups = "i2c", "wdt", "wled_an", "p0led_an", "p1led_an", 
"p2_led", "p3led_an", "p4led_an", "refclk";
+   function = "gpio";
+   };
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   mt76@0,0 {
+   reg = <0x 0 0 0 0>;
+   mediatek,mtd-eeprom = < 0x8000>;
+   ieee80211-freq-limit = <500 600>;
+   };
+};
+
+ {
+   status = "okay";
+
+   flash@0 {
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <4000>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x0 0x3>;
+   read-only;
+   };
+
+   partition@3 {
+   label = "u-boot-env";
+   reg = <0x3 0x1>;
+   read-only;
+   };
+
+   factory: