[PATCH] added support for comfast jw-ew74

eric at daloft.com eric at daloft.com
Tue May 4 16:28:20 BST 2021


From: eric <eric at daloft.com>

---
 .../ramips/dts/mt7628an_comfast_jw-ew74.dts   | 147 ++++++++++++++++++
 target/linux/ramips/image/mt76x8.mk           |   9 ++
 .../mt76x8/base-files/etc/board.d/01_leds     |   7 +
 .../mt76x8/base-files/etc/board.d/02_network  |   4 +
 4 files changed, 167 insertions(+)
 create mode 100644 target/linux/ramips/dts/mt7628an_comfast_jw-ew74.dts

diff --git a/target/linux/ramips/dts/mt7628an_comfast_jw-ew74.dts b/target/linux/ramips/dts/mt7628an_comfast_jw-ew74.dts
new file mode 100644
index 0000000000..dc6aaeb4fe
--- /dev/null
+++ b/target/linux/ramips/dts/mt7628an_comfast_jw-ew74.dts
@@ -0,0 +1,147 @@
+/dts-v1/;
+
+#include "mt7628an.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	#address-cells = <0x01>;
+	#size-cells = <0x01>;
+	compatible = "comfast,jw-ew74\0mediatek,mt7628an-soc";
+	model = "Comfast JW-EW74";
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+	};
+
+
+
+	gpio-keys-polled {
+		#address-cells = <0x01>;
+		#size-cells = <0x00>;
+		compatible = "gpio-keys-polled";
+		poll-interval = <0x14>;
+
+		reset {
+			gpios = <&gpio 0x06 0x01>;
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		wifi {
+			gpios = <&gpio 0x0c 0x01>;
+			label = "comfast:blue:wifi";
+		};
+
+		wifi0 {
+			gpios = <&gpio 0x0b 0x01>;
+			label = "comfast:blue:wifi0";
+		};
+
+		wifi1 {
+			gpios = <&gpio 0x05 0x01>;
+			label = "comfast:blue:wifi1";
+		};
+
+		wifi2 {
+			gpios = <&gpio 0x0d 0x01>;
+			label = "comfast:blue:wifi2";
+		};
+	};
+
+};
+
+
+
+
+
+&spi0 {
+  	 status = "okay";
+
+     	 flash at 0 {
+       	         compatible = "jedec,spi-nor";
+       	         reg = <0>;
+       	         spi-max-frequency = <10000000>;
+
+		partitions {
+       	          compatible = "fixed-partitions";
+       	          #address-cells = <1>;
+     	          #size-cells = <1>;
+
+
+			partition at 0 {
+				label = "u-boot";
+				read-only;
+				reg = <0x00 0x30000>;
+			};
+
+
+			partition at 30000 {
+				label = "u-boot-env";
+				read-only;
+				reg = <0x30000 0x10000>;
+			};
+
+			factory: partition at 40000 {
+				label = "factory";
+				read-only;
+				reg = <0x40000 0x10000>;
+			};
+
+			partition at 50000 {
+  				compatible = "denx,uimage";
+				label = "firmware";
+				reg = <0x50000 0x770000>;
+			};
+
+			partition at 7c0000 {
+				label = "configs";
+				reg = <0x7c0000 0x40000>;
+			};
+			partition at 1000000 {
+                                        label = "reserve";
+                                        reg = <0x1000000 0x1000000>;
+                                };
+
+		};
+	};
+};
+
+&ethernet {
+	mtd-mac-address = <&factory 0xe00 >;
+        };
+
+
+&wmac {
+
+       status = "okay";
+	mtd-mac-address = <&factory 0xe00>;
+	mtd-mac-address-increment = <1>;
+
+};
+
+
+&pcie {
+       status = "okay";
+};
+
+
+&pcie0 {
+        wifi: mt76 at 0,0 {
+                reg = <0x0000 0 0 0 0>;
+		mediatek,5ghz = <0x00>;
+                mediatek,mtd-eeprom = <&factory 0x8000>;
+		ieee80211-freq-limit = <5000000 6000000>;
+		mtd-mac-address = <&factory 0xe00>;
+		mtd-mac-address-increment = <2>;
+				
+        };
+};
+&i2c 	{
+	status = "okay";
+};
diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk
index d5a9684dba..35402edc3b 100644
--- a/target/linux/ramips/image/mt76x8.mk
+++ b/target/linux/ramips/image/mt76x8.mk
@@ -78,6 +78,15 @@ define Device/buffalo_wcr-1166ds
 endef
 TARGET_DEVICES += buffalo_wcr-1166ds
 
+define Device/comfast_jw-ew74
+  IMAGE_SIZE := 7798784
+  DEVICE_VENDOR := Comfast
+  DEVICE_MODEL := JW-EW74
+  DEVICE_PACKAGES := kmod-mt76x2
+  SUPPORTED_DEVICES += comfast_jw-ew74
+endef
+TARGET_DEVICES += comfast_jw-ew74
+
 define Device/cudy_wr1000
   IMAGE_SIZE := 7872k
   IMAGES += factory.bin
diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds
index fdef158ea8..4fc820520a 100644
--- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds
@@ -19,6 +19,13 @@ netgear,r6120)
 	ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0xf"
 	ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10"
 	;;
+comfast,jw-ew74)
+	ucidef_set_rssimon "wlan0" "200000" "1"
+	ucidef_set_led_rssi "wifi-low" "wifi-low" "comfast:blue:wifi0" "wlan0" "1" "49"
+	ucidef_set_led_rssi "wifi-med" "wifi-med" "comfast:blue:wifi1" "wlan0" "50" "84"
+	ucidef_set_led_rssi "wifi-high" "wifi-high" "comfast:blue:wifi2" "wlan0" "85" "100"
+	ucidef_set_led_netdev "wifi_led" "wifi" "comfast:blue:wifi" "wlan0"
+	;;
 cudy,wr1000)
 	ucidef_set_led_switch "wan" "wan" "blue:wan" "switch0" "0x10"
 	ucidef_set_led_switch "lan1" "lan1" "blue:lan1" "switch0" "0x08"
diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
index 5ce44d0e9b..6340a39414 100644
--- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
@@ -9,6 +9,10 @@ ramips_setup_interfaces()
 
 	case $board in
 	alfa-network,awusfree1|\
+	comfast,jw-ew74)
+        ucidef_add_switch "switch0"  \
+                       "4:lan" "6 at eth0"
+		;;
 	d-team,pbr-d1|\
 	glinet,microuter-n300|\
 	glinet,vixmini|\
-- 
2.27.0




More information about the openwrt-devel mailing list