[OpenWrt-Devel,8/9] ramips: add Devolo WiFi Repeater (mt2681)

Message ID 1508703687-25650-9-git-send-email-wigyori@uid0.hu
State New
Headers show
Series
  • merge: add missing devices / commits into LEDE
Related show

Commit Message

Zoltan HERPAI Oct. 22, 2017, 8:21 p.m.
This is pretty much the same as the ALL0256N-8M but with different LED settings.

Based on Matt Jenkins' patch, with additional reworks.
https://github.com/openwrt/openwrt/pull/491

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>

---
 target/linux/ramips/base-files/etc/board.d/01_leds |   7 ++
 .../linux/ramips/base-files/etc/board.d/02_network |   1 +
 target/linux/ramips/base-files/lib/ramips.sh       |   3 +
 .../ramips/base-files/lib/upgrade/platform.sh      |   1 +
 target/linux/ramips/dts/MT2681.dts                 | 106 +++++++++++++++++++++
 target/linux/ramips/image/rt305x.mk                |   7 ++
 6 files changed, 125 insertions(+)
 create mode 100644 target/linux/ramips/dts/MT2681.dts

Comments

Mathias Kresin Oct. 23, 2017, 6:14 a.m. | #1
22.10.2017 22:21, Zoltan HERPAI:
> This is pretty much the same as the ALL0256N-8M but with different LED settings.
> 
> Based on Matt Jenkins' patch, with additional reworks.
> https://github.com/openwrt/openwrt/pull/491
> 
> Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>

Hey Zoltan,

I'm not sure how proceed with the patch. It has bunch of issues and if 
someone else would send this patch I wouldn't merge it as it is.

Some of the issues are:

- missing hardware description in the commit message
- missing initial install instructions in the commit message
- bad board naming (the name looks like a mediatek reference board)
- wrong use of wifi led
- outdated syntax in the dts

Since you most likely do not have this board, I'm not sure if it does 
make any sense to do the full review => request changes cycle.

Any suggestions how to proceed with this one?

Mathias
Zoltan HERPAI Oct. 23, 2017, 8:13 a.m. | #2
Hi Mathias,

On Mon, 23 Oct 2017, Mathias Kresin wrote:

> 22.10.2017 22:21, Zoltan HERPAI:
>> This is pretty much the same as the ALL0256N-8M but with different LED 
>> settings.
>> 
>> Based on Matt Jenkins' patch, with additional reworks.
>> https://github.com/openwrt/openwrt/pull/491
>> 
>> Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
>
> Hey Zoltan,
>
> I'm not sure how proceed with the patch. It has bunch of issues and if 
> someone else would send this patch I wouldn't merge it as it is.
>
> Some of the issues are:
>
> - missing hardware description in the commit message
> - missing initial install instructions in the commit message
> - bad board naming (the name looks like a mediatek reference board)
> - wrong use of wifi led
> - outdated syntax in the dts
>
> Since you most likely do not have this board, I'm not sure if it does make 
> any sense to do the full review => request changes cycle.
>
> Any suggestions how to proceed with this one?

Correct, I don't have the hardware, and the HW descriptions I've found on 
google are misleading. I'm leaning more towards dropping this, and if 
someone wants support for it, he/she can prep the patch correctly.

-w-

Patch

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index 75ab0da..525c32b 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -55,6 +55,13 @@  air3gii)
 	set_wifi_led "$board:green:wlan"
 	set_usb_led "$board:green:mobile"
 	;;
+mt2681)
+	ucidef_set_rssimon "wlan0" "40000" "1"
+	ucidef_set_led_rssi "rssilow" "RSSILOW" "$board:green:rssilow" "wlan0" "1" "40" "0" "6"
+	ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "$board:green:rssimed" "wlan0" "30" "80" "-29" "5"
+	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$board:green:rssihigh" "wlan0" "70" "100" "-69" "8"
+	set_wifi_led "rt2800pci-phy0::radio"
+	;;
 all0256n-4M|\
 all0256n-8M)
 	ucidef_set_rssimon "wlan0" "200000" "1"
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 1c8505e..101c97e 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -53,6 +53,7 @@  ramips_setup_interfaces()
 	m2m|\
 	microwrt|\
 	mpr-a2|\
+	mt2681|\
 	ncs601w|\
 	omega2 | \
 	omega2p | \
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 07e776c..e451b0e 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -331,6 +331,9 @@  ramips_board_detect() {
 	*"MR200")
 		name="mr200"
 		;;
+	*"MT2681")
+		name="mt2681"
+		;;
 	*"MT7620a + MT7530 evaluation"*)
 		name="mt7620a_mt7530"
 		;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 99ebe35..5430be7 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -98,6 +98,7 @@  platform_check_image() {
 	mpr-a1|\
 	mpr-a2|\
 	mr-102n|\
+	mt2681|\
 	mt7628|\
 	mzk-750dhp|\
 	mzk-dp150n|\
diff --git a/target/linux/ramips/dts/MT2681.dts b/target/linux/ramips/dts/MT2681.dts
new file mode 100644
index 0000000..634e8c8
--- /dev/null
+++ b/target/linux/ramips/dts/MT2681.dts
@@ -0,0 +1,106 @@ 
+/dts-v1/;
+
+#include "rt3050.dtsi"
+
+/ {
+	compatible = "ralink,rt3050-soc";
+	model = "Devolo WiFi Extender MT2681";
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		rssilow {
+			label = "mt2681:green:rssilow";
+			gpios = <&gpio0 7 1>;
+		};
+
+		rssimed {
+			label = "mt2681:green:rssimed";
+			gpios = <&gpio0 11 1>;
+		};
+
+		rssihigh {
+			label = "mt2681:green:rssihigh";
+			gpios = <&gpio0 12 1>;
+		};
+
+		wifi {
+			label = "mt2681:red:wifi";
+			gpios = <&gpio0 9 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 10 1>;
+			linux,code = <0x198>;
+		};
+	};
+};
+
+&gpio0 {
+	status = "okay";
+};
+
+&spi0 {
+	status = "okay";
+
+	m25p80@0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		linux,modalias = "m25p80", "mx25l3205d";
+		spi-max-frequency = <10000000>;
+
+		partition@0 {
+			label = "u-boot";
+			reg = <0x0 0x30000>;
+			read-only;
+		};
+
+		partition@30000 {
+			label = "u-boot-env";
+			reg = <0x30000 0x10000>;
+			read-only;
+		};
+
+		factory: partition@40000 {
+			label = "factory";
+			reg = <0x40000 0x10000>;
+			read-only;
+		};
+
+		partition@50000 {
+			label = "firmware";
+			reg = <0x50000 0x7b0000>;
+		};
+	};
+};
+
+&pinctrl {
+	state_default: pinctrl0 {
+		gpio {
+			ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+			ralink,function = "gpio";
+		};
+	};
+};
+
+&ethernet {
+	mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+	mediatek,portmap = <0x3f>;
+};
+
+&wmac {
+	ralink,mtd-eeprom = <&factory 0>;
+};
\ No newline at end of file
diff --git a/target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk
index 4e82eb4..d7093fb 100644
--- a/target/linux/ramips/image/rt305x.mk
+++ b/target/linux/ramips/image/rt305x.mk
@@ -485,6 +485,13 @@  define Device/mpr-a2
 endef
 TARGET_DEVICES += mpr-a2
 
+define Device/mt2681
+  DTS := MT2681
+  DEVICE_TITLE := Devolo WiFi Extender MT2681
+  DEVICE_PACKAGES := rssileds
+endef
+TARGET_DEVICES += mt2681
+
 define Device/mr-102n
   DTS := MR-102N
   DEVICE_TITLE := AXIMCom MR-102N