[LEDE-DEV] [PATCH] ramips: MiWiFi Nano dts fix up.

L. D. Pinney ldpinney at gmail.com
Wed Dec 28 23:43:08 PST 2016


This patch updates the MIWIFI-NANO.dts using dt-bindings, sets the MAC from eeprom, and sets the LEDs

Signed-off-by: L. D. Pinney <ldpinney at gmail.com>
---

target/linux/ramips/base-files/etc/board.d/01_leds |  6 +++---
 target/linux/ramips/dts/MIWIFI-NANO.dts            | 34 ++++++++++++++++++++++++++--------
 2 files changed, 29 insertions(+), 11 deletions(-)

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 e6664bd..68fd136 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -226,9 +226,9 @@ miwifi-mini)
 	ucidef_set_led_default "power" "power" "$board:red:status" "1"
 	;;
 miwifi-nano)
-	ucidef_set_led_default "power" "power" "$board:red:status" "1"
-	ucidef_set_led_wlan "radio_led" "radio" "$board:amber:radio" "phy0radio"
-	ucidef_set_led_wlan "wifi_led" "wifi" "$board:blue:wifi" "phy0assoc"
+	ucidef_set_led_default "status" "status" "$board:red:status"
+	ucidef_set_led_netdev "network" "network" "$board:amber:network" "br-lan" "tx rx"
+	ucidef_set_led_netdev "wifi" "wifi" "$board:blue:wifi" "wlan0" "tx rx"
 	;;
 mlw221|\
 mlwg2)
diff --git a/target/linux/ramips/dts/MIWIFI-NANO.dts b/target/linux/ramips/dts/MIWIFI-NANO.dts
index 6906ef3..e0ff9c6 100644
--- a/target/linux/ramips/dts/MIWIFI-NANO.dts
+++ b/target/linux/ramips/dts/MIWIFI-NANO.dts
@@ -2,6 +2,9 @@
 
 #include "mt7628an.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
 / {
 	compatible = "xiaomi,MiWifi Nano", "mediatek,mt7628an-soc";
 	model = "MiWiFi Nano";
@@ -15,23 +18,33 @@
 		reg = <0x0 0x4000000>;
 	};
 
-	gpio-leds {
+	leds {
 		compatible = "gpio-leds";
 
 		wifi {
 			label = "miwifi-nano:blue:wifi";
-			gpios = <&gpio0 11 1>;
-			default-state = "1";
+			gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
 		};
 		status {
 			label = "miwifi-nano:red:status";
-			gpios = <&gpio1 5 1>;
-			default-state = "on";
+			gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
 		};
 		radio {
-			label = "miwifi-nano:amber:radio";
-			gpios = <&gpio1 12 1>;
-			default-state = "1";
+			label = "miwifi-nano:amber:network";
+			gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio1 6 1>;
+			linux,code = <KEY_RESTART>;
 		};
 	};
 };
@@ -47,6 +60,11 @@
 
 &wmac {
 	status = "okay";
+	ralink,mtd-eeprom = <&factory 0x4>;
+};
+
+&ethernet {
+	mtd-mac-address = <&factory 0x28>;
 };
 
 &spi0 {



More information about the Lede-dev mailing list