From patchwork Tue May 4 15:28:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: eric@daloft.com X-Patchwork-Id: 1473897 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; helo=desiato.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=d59ybCzR; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=daloft.com header.i=@daloft.com header.a=rsa-sha256 header.s=default header.b=DSE8qaz7; dkim-atps=neutral Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FZP2W31Z8z9sPf for ; Wed, 5 May 2021 01:31:31 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=TXdJinBLw/+4p6YDab/QhFwXrahgti99taEI52DZQPM=; b=d59ybCzRPvdtu9b+ZquzZEotdz oi1LMcwvX0j/6sRe+wP4GLJRSGmkmWwI0b2J6I+bQU2ydWbmWYw9Nl6iT91wqN4yrvDrOV9JKhDiB ZppyAu/Gfu4w5WMvtT//I0qLjkavKcSJxetucMExPzSREf2IkxC9SFMj6+oJpxEc9PqkAsPuRp5SC /mpMhw1hHd/2L8XTGubdkLMMpRUCehZ/R7TKvabhHh91QOrMse0plc6j2lcotKDNl6Nd3aEaBwTJ8 kbKNSPMWVCalRe/f+/mptnGf+RIRj0rQQDTsLND0HK2zuOZ8wQZS4hNzWoqTBr3PiAyizn2kIHn9w yAiWn7eg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1ldwzK-00GRAn-NR; Tue, 04 May 2021 15:29:30 +0000 Received: from gateway20.websitewelcome.com ([192.185.59.4]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ldwzG-00GR8X-IW for openwrt-devel@lists.openwrt.org; Tue, 04 May 2021 15:29:28 +0000 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 55861400F00D7 for ; Tue, 4 May 2021 10:16:41 -0500 (CDT) Received: from box5218.bluehost.com ([162.241.224.227]) by cmsmtp with SMTP id dwyFlybhsw11MdwyFlGNfz; Tue, 04 May 2021 10:28:24 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daloft.com; s=default; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=y6vRygxibFAMjuEXcL9yv9ILjKlf+7/DtzMN/guQKvA=; b=DSE8qaz7puHIkWwn2ErMxmjuqY cg3NZoQFCrDfhijQXx0zlHHvm607DmQ/PCek7qdCageoHHmIfFL8S1YBJjaN9bV+DXSCJQwWHOiDX PTe69NvQbhz1uShQ0rPAhkZf05RDnfPcL1vn61Y+uLVZffoNmksQ6398rNrfRBgDVCC16555jjctr HKIQaiY7deTD9NgBZtIFKcFge5p6GVINocUMZPOiE6DPQ3UsZwksfkZ8Lsl+ovBmOFZXHsyaQOVRp 49Ik4reWR+4zALHdRzcYRvXBP74egipOd383Ztla7YYW/gL1Ghnr9KYS/xc3/FyMypzHGvQnPfLXb +WmpyhFw==; Received: from [24.49.67.65] (port=39414 helo=office-nuc.lan) by box5218.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1ldwyF-001zY7-GS; Tue, 04 May 2021 09:28:23 -0600 Received: by office-nuc.lan (Postfix, from userid 1000) id BDFAE1018E5; Tue, 4 May 2021 11:28:22 -0400 (EDT) From: eric@daloft.com To: openwrt-devel@lists.openwrt.org Cc: eric Subject: [PATCH] added support for comfast jw-ew74 Date: Tue, 4 May 2021 11:28:20 -0400 Message-Id: <20210504152820.3987371-1-eric@daloft.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5218.bluehost.com X-AntiAbuse: Original Domain - lists.openwrt.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - daloft.com X-BWhitelist: no X-Source-IP: 24.49.67.65 X-Source-L: No X-Exim-ID: 1ldwyF-001zY7-GS X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (office-nuc.lan) [24.49.67.65]:39414 X-Source-Auth: eric@daloft.com X-Email-Count: 1 X-Source-Cap: ZGFsb2Z0Y287ZGFsb2Z0Y287Ym94NTIxOC5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210504_162927_005831_E2131CE1 X-CRM114-Status: UNSURE ( 9.29 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: eric --- .../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 [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [192.185.59.4 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: eric --- .../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 +#include + +/ { + #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 = ; + }; + }; + + 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@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + + partition@0 { + label = "u-boot"; + read-only; + reg = <0x00 0x30000>; + }; + + + partition@30000 { + label = "u-boot-env"; + read-only; + reg = <0x30000 0x10000>; + }; + + factory: partition@40000 { + label = "factory"; + read-only; + reg = <0x40000 0x10000>; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x770000>; + }; + + partition@7c0000 { + label = "configs"; + reg = <0x7c0000 0x40000>; + }; + partition@1000000 { + label = "reserve"; + reg = <0x1000000 0x1000000>; + }; + + }; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0xe00 >; + }; + + +&wmac { + + status = "okay"; + mtd-mac-address = <&factory 0xe00>; + mtd-mac-address-increment = <1>; + +}; + + +&pcie { + status = "okay"; +}; + + +&pcie0 { + wifi: mt76@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@eth0" + ;; d-team,pbr-d1|\ glinet,microuter-n300|\ glinet,vixmini|\