From 634997ec87dfb32bc4b6ac63e81c96a9dec47780 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 3 Jul 2016 20:37:25 +0200 Subject: [PATCH] Add target ramips-mt7621 with model D-Link DIR-860L B1 Needs more testing, high packet loss at the moment. --- ...s-Support-LEDs-on-D-Link-DIR-860L-B1.patch | 41 ++++++++++++++ ...s-known-to-userspace-for-DIR-860L-B1.patch | 56 +++++++++++++++++++ ...LAN-WAN-MAC-addresses-on-DIR-860L-B1.patch | 22 ++++++++ targets/ramips-mt7621/profiles.mk | 4 ++ targets/targets.mk | 1 + 5 files changed, 124 insertions(+) create mode 100644 patches/openwrt/0106-ramips-Support-LEDs-on-D-Link-DIR-860L-B1.patch create mode 100644 patches/openwrt/0107-ramips-add-button-support-and-make-LEDs-known-to-userspace-for-DIR-860L-B1.patch create mode 100644 patches/openwrt/0108-ramips-set-correct-LAN-WAN-MAC-addresses-on-DIR-860L-B1.patch create mode 100644 targets/ramips-mt7621/profiles.mk diff --git a/patches/openwrt/0106-ramips-Support-LEDs-on-D-Link-DIR-860L-B1.patch b/patches/openwrt/0106-ramips-Support-LEDs-on-D-Link-DIR-860L-B1.patch new file mode 100644 index 00000000..8f2dd5e3 --- /dev/null +++ b/patches/openwrt/0106-ramips-Support-LEDs-on-D-Link-DIR-860L-B1.patch @@ -0,0 +1,41 @@ +From: Matthias Schiffer +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 + +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 { diff --git a/patches/openwrt/0107-ramips-add-button-support-and-make-LEDs-known-to-userspace-for-DIR-860L-B1.patch b/patches/openwrt/0107-ramips-add-button-support-and-make-LEDs-known-to-userspace-for-DIR-860L-B1.patch new file mode 100644 index 00000000..cd023dce --- /dev/null +++ b/patches/openwrt/0107-ramips-add-button-support-and-make-LEDs-known-to-userspace-for-DIR-860L-B1.patch @@ -0,0 +1,56 @@ +From: Matthias Schiffer +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 + +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>; ++ }; + }; + }; diff --git a/patches/openwrt/0108-ramips-set-correct-LAN-WAN-MAC-addresses-on-DIR-860L-B1.patch b/patches/openwrt/0108-ramips-set-correct-LAN-WAN-MAC-addresses-on-DIR-860L-B1.patch new file mode 100644 index 00000000..c6b941f5 --- /dev/null +++ b/patches/openwrt/0108-ramips-set-correct-LAN-WAN-MAC-addresses-on-DIR-860L-B1.patch @@ -0,0 +1,22 @@ +From: Matthias Schiffer +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 + +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) + ;; diff --git a/targets/ramips-mt7621/profiles.mk b/targets/ramips-mt7621/profiles.mk new file mode 100644 index 00000000..6a7ea1e1 --- /dev/null +++ b/targets/ramips-mt7621/profiles.mk @@ -0,0 +1,4 @@ +# List of hardware profiles + +$(eval $(call GluonProfile,Default)) +$(eval $(call GluonModel,Default,dir-860l-b1,d-link-dir-860l-b1)) diff --git a/targets/targets.mk b/targets/targets.mk index 4924db92..c5fd657e 100644 --- a/targets/targets.mk +++ b/targets/targets.mk @@ -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