Add target ramips-mt7621 with model D-Link DIR-860L B1

Needs more testing, high packet loss at the moment.
This commit is contained in:
Matthias Schiffer 2016-07-03 20:37:25 +02:00
parent fd237f6f43
commit 634997ec87
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C
5 changed files with 124 additions and 0 deletions

View File

@ -0,0 +1,41 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 30 Jun 2016 15:34:32 +0200
Subject: ramips: Support LEDs on D-Link DIR-860L B1
Adds the required gpio definitions.
Signed-off-by: Johannes Wienke <languitar@semipol.de>
Backport of OpenWrt r48715
diff --git a/target/linux/ramips/dts/DIR-860L-B1.dts b/target/linux/ramips/dts/DIR-860L-B1.dts
index 23ec114..2582b3d 100644
--- a/target/linux/ramips/dts/DIR-860L-B1.dts
+++ b/target/linux/ramips/dts/DIR-860L-B1.dts
@@ -97,6 +97,26 @@
gpio-leds {
compatible = "gpio-leds";
+
+ power {
+ label = "d-link:orange:power";
+ gpios = <&gpio0 13 1>;
+ };
+
+ power2 {
+ label = "d-link:green:power";
+ gpios = <&gpio0 15 1>;
+ };
+
+ net {
+ label = "d-link:orange:net";
+ gpios = <&gpio0 14 1>;
+ };
+
+ net2 {
+ label = "d-link:green:net";
+ gpios = <&gpio0 16 1>;
+ };
};
gpio-keys-polled {

View File

@ -0,0 +1,56 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 30 Jun 2016 15:18:03 +0200
Subject: ramips: add button support and make LEDs known to userspace for DIR-860L B1
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
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 5327d00..5fb28a5 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -114,6 +114,9 @@ case $board in
esr-9753)
set_wifi_led "rt2800pci-phy0::radio"
;;
+ dir-860l-b1)
+ ucidef_set_led_netdev "wan" "wan" "d-link:green:net" "eth0.2"
+ ;;
ex2700)
ucidef_set_led_default "power_r" "POWER (red)" "ex2700:red:power" "0"
set_wifi_led "ex2700:green:router"
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index 6474ebd..37360a4 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -54,6 +54,9 @@ get_status_led() {
dir-645)
status_led="d-link:green:wps"
;;
+ dir-860l-b1)
+ status_led="d-link:green:power"
+ ;;
dap-1350)
status_led="d-link:blue:power"
;;
diff --git a/target/linux/ramips/dts/DIR-860L-B1.dts b/target/linux/ramips/dts/DIR-860L-B1.dts
index 2582b3d..c0bcc86 100644
--- a/target/linux/ramips/dts/DIR-860L-B1.dts
+++ b/target/linux/ramips/dts/DIR-860L-B1.dts
@@ -124,5 +124,17 @@
#address-cells = <1>;
#size-cells = <0>;
poll-interval = <20>;
+
+ reset {
+ label = "reset";
+ gpios = <&gpio0 7 1>;
+ linux,code = <0x198>;
+ };
+
+ wps {
+ label = "wps";
+ gpios = <&gpio0 18 1>;
+ linux,code = <0x211>;
+ };
};
};

View File

@ -0,0 +1,22 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 30 Jun 2016 16:16:30 +0200
Subject: ramips: set correct LAN/WAN MAC addresses on DIR-860L B1
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
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 a78912d..4e6e507 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -346,6 +346,11 @@ ramips_setup_macs()
wan_mac=$(mtd_get_mac_ascii nvram wanmac)
;;
+ dir-860l-b1)
+ lan_mac=$(mtd_get_mac_ascii factory lanmac)
+ wan_mac=$(mtd_get_mac_ascii factory wanmac)
+ ;;
+
e1700)
wan_mac=$(mtd_get_mac_ascii config WAN_MAC_ADDR)
;;

View File

@ -0,0 +1,4 @@
# List of hardware profiles
$(eval $(call GluonProfile,Default))
$(eval $(call GluonModel,Default,dir-860l-b1,d-link-dir-860l-b1))

View File

@ -10,6 +10,7 @@ $(eval $(call GluonTarget,x86,xen_domu))
ifneq ($(BROKEN),)
$(eval $(call GluonTarget,ar71xx,mikrotik)) # BROKEN: no sysupgrade support
$(eval $(call GluonTarget,ramips,mt7621)) # BROKEN: No AP+IBSS support, 11s has high packet loss
$(eval $(call GluonTarget,ramips,rt305x)) # BROKEN: No AP+IBSS support
$(eval $(call GluonTarget,sunxi)) # BROKEN: Untested, no sysupgrade support
endif