From patchwork Mon Nov 23 02:22:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sven Danner X-Patchwork-Id: 1404604 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmx.net 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=merlin.20170209 header.b=tPhCfWko; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=ijWmlUhM; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 4CfWFY1yFpz9sSf for ; Mon, 23 Nov 2020 13:24:43 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Subject:To:From:Message-ID:MIME-Version: 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=2k7OmQKdjAka/8IlmC6ypsoUTcOXvL7TEsQYBOSJ9Q0=; b=tPhCfWkoUkMKuIfYl6gYBdcSwr Ck5WJlSPhgiUc+VW+C9ekxs/gNUjIU7IHQ690vFIj9D2FWxWODDdapKQEO7F1AoDUFObY5I+YseOH 0nhTD0ZkDSVBV/NAhVUKD4hDaNuImKBwqzbBUoLkPwjmchTB1xxDP94E/EwtHbXDd05ZREa33eXfn a/tCA8pISNhwQMwfO5c3uNh6WKGyScHhtuvFi4SJNny/7uoodsHHme8ZjyXH4e3WZ4E0P3s9l4gZQ RmX1iwo5vZcpQlc9tNDoCn+j2QXZYZkQw3K9rV4oP0EiZvSuRDd/JClNc5uhQ+iIDwEnOuOBHOuDJ Ewt0Gd0Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kh1VB-0004RC-Ax; Mon, 23 Nov 2020 02:22:49 +0000 Received: from mout.gmx.net ([212.227.17.21]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kh1V6-0004Qo-0Q for openwrt-devel@lists.openwrt.org; Mon, 23 Nov 2020 02:22:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1606098155; bh=Q0J5xFqlCqBgnXyQcRT+jjfMRZ2Geur2F+7fX8qhnpQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=ijWmlUhMwxVryiJvPlrtlJvkIKp0FqYXgkX8OPCtuWdnN5vtNy4drKKsZxj/jtgp2 n90A7+e34kXC748RyqFyk7FPP9sDEk7V4ku0kDidwgj7ef1XdQJw3ykT4mm9gzYlPl pp4HgvTlb+6ggao9COU9aXgueQUg4g5NOtxa3NXg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [137.154.5.187] ([137.154.5.187]) by web-mail.gmx.net (3c-app-gmx-bap46.server.lan [172.19.172.116]) (via HTTP); Mon, 23 Nov 2020 03:22:35 +0100 MIME-Version: 1.0 Message-ID: From: Sven Danner To: john@phrozen.org Subject: [PATCH] Adds support for Comfast CF-E538AC Date: Mon, 23 Nov 2020 03:22:35 +0100 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:bkz8QH4g8ktDVOZ/IPgQsMVkZ64xaXvrnFydZKacfFzKhDcYPCLopnOzKCG7I4BviKwVj GFSK/X98gywAY51kpImp5ADNpYNXIA+wii5a2FqC2bp975KNJnIGRfwSChtosqvwolsae626IAWA F2vSRukeeSAo9p37/FnPDZaHXw1PM+PwZzMPpwM+31uHNfPptQ0n7uVwf7bPiPqChRCeHS3T064K QM8F8JQmgYEYQ9txuXX+8eiMTKP2r0g3kUSZmN4LGziermAwHOPEHcRMdgIznEpRBEa8rIqySftz 7g= X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:zsfV7JLK6S4=:VqiHZJK0caTu0LmBPR3oR4 9GsPEfqrXS0uYvzU+BoehZK3UkLGKUvK6Esk20IOlXdmOafIcXLVVsCRsnFhqL1FJHfPqzqGE 5V9Ugr0Pq67erBpQ6OR+H8edVBbHgynUrp4pHVJ21dI1ZXXn5taoJqpcWC6HH5b5RtbJol9qm kOqWFdQ/mSMFuiSFmxyOawbEN+cR0XoLueqQjfsIdtQaZyCoUtZqVeVyRl4lfJEsbHmoBLbUV EdTsMt5wQF1Nf0ybgOwiPa60Wx4fur8dedCXMyhloF95XEHheFjSkmAoxwtOkGddlpn6XIzij tnBKR1FTqHLJndY1JFUwddrmByAZdSioDyjD7cWItxUDa/jKIhMVpYgB2bxTvKwBC27kGmuJB 38HqbiiN0W5M5f6mLRrqOUmht4DNdr1ccueaX9uXTFqzmJHf14vmdONmpz36nABKRU3lPVqGi b2po2aiKIRoxEIEzhQc+LEw8ljd41yfecYhtNEjFTfCsmM3z6RwpRYw5nPKTstDN46feTyjc2 319pGQKOCrx0fS716MEtJEhwOdTdYUFsqT4x2Yqxbxw/cyUQKJcaKFd0RbS1wRv4RadbDCfCI /sduCTzQWD8Ww= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201122_212244_284394_9433B983 X-CRM114-Status: GOOD ( 13.79 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.21 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.21 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [sven314[at]gmx.net] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [sven314[at]gmx.net] -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 -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 X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: openwrt-devel@lists.openwrt.org Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Comfast CF-E538AC is an wall mounted access point with an additional Ethernet LAN access port. It supports 802.11AC Wave2 MU-MIMO Serial port access for debricking requires simple soldering of 4 pins. Device specifications: * SoC: MT7620DA @ 580MHz * RAM: 64MiB DDR2 * Flash: 8iB SPI * Wireless 2.4GHz (SoC): b/g/n * Wireless 5Ghz (MT7612E): n/ac, 2x2 MU-MINO * Ethernet (RTL8211F): 1× 1GbE, 802.3af PoE * Ethernet (RTL8211F): 1× 1GbE Flashing instructions: * Upgrade using web interface Debricking: * Serial port can be soldered on top PCB (marked as 1) (1: VCC, 2: GND, 3: TX, 4: RX) * Use 3.3V, 115200 baud, 8n1 * Recovery only possible via TFTP * Modified U-Boot environment does not allow recovery via serial (will not commit it to flash) * Bootloader will show a menu for 1 seconds * Select 2: Load system code then write to Flash via TFTP. --- .../ramips/dts/mt7620a_comfast_cf-e538ac.dts | 158 ++++++++++++++++++ target/linux/ramips/image/mt7620.mk | 11 ++ .../mt7620/base-files/etc/board.d/01_leds | 3 + .../mt7620/base-files/etc/board.d/02_network | 4 + 4 files changed, 176 insertions(+) create mode 100644 target/linux/ramips/dts/mt7620a_comfast_cf-e538ac.dts diff --git a/target/linux/ramips/dts/mt7620a_comfast_cf-e538ac.dts b/target/linux/ramips/dts/mt7620a_comfast_cf-e538ac.dts new file mode 100644 index 0000000000..b857c8db9c --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_comfast_cf-e538ac.dts @@ -0,0 +1,158 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7620a.dtsi" + +#include +#include + +/ { + compatible = "comfast,cf-e538ac", "ralink,mt7620a-soc"; + model = "Comfast CF-E538AC"; + + aliases { + led-boot = &led_wifi; + led-failsafe = &led_wifi; + led-running = &led_wifi; + led-upgrade = &led_wifi; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led_wifi: wifi { + label = "white:wifi"; + gpios = <&gpio3 0x00 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <0x14>; + + reset { + label = "reset"; + gpios = <&gpio0 0x0d GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + +}; + +&gpio0 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + m25p80@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"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x7b0000>; + }; + }; + }; +}; + +ðernet { + status = "okay"; + pinctrl-names = "default"; + mtd-mac-address = <&factory 0xe000>; + pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>; + mediatek,portmap = "llllw"; + + port@4 { + status = "okay"; + phy-mode = "rgmii"; + phy-handle = <&phy4>; + }; + + port@5 { + status = "okay"; + phy-mode = "rgmii"; + phy-handle = <&phy5>; + }; + + mdio-bus { + status = "okay"; + + phy4: ethernet-phy@4 { + reg = <0x04>; + phy-mode = "rgmii"; + }; + + phy5: ethernet-phy@5 { + reg = <0x05>; + phy-mode = "rgmii"; + }; + }; +}; + +&gsw { + mediatek,port4 = "gmac"; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0x0>; +}; + + +&pcie { + status = "okay"; +}; + +&state_default { + gpio { + groups = "uartf", "ephy", "wled"; + function = "gpio"; + }; +}; + +&pcie0 { + mt76@0,0 { + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index dfdb5f28d3..19b693f812 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -172,6 +172,17 @@ define Device/comfast_cf-wr800n endef TARGET_DEVICES += comfast_cf-wr800n +define Device/comfast_cf-e538ac + SOC := mt7620a + DTS := CF-E538AC + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Comfast + DEVICE_MODEL := CF-E538AC + SUPPORTED_DEVICES += cf-e538ac + DEVICE_PACKAGES := kmod-mt76x2 +endef +TARGET_DEVICES += comfast_cf-e538ac + define Device/dlink_dch-m225 $(Device/seama) SOC := mt7620a diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds index 292f310d51..22d3e0f783 100755 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds @@ -41,6 +41,9 @@ asus,rt-n14u) bdcom,wap2100-sk) ucidef_set_led_netdev "wifi_led" "wifi" "green:wlan2g" "wlan0" ;; +comfast,cf-e538ac) + ucidef_set_led_netdev "wifi_led" "wifi" "white:wifi" "wlan0" + ;; comfast,cf-wr800n) ucidef_set_led_netdev "lan" "lan" "white:ethernet" eth0.1 ucidef_set_led_netdev "wifi_led" "wifi" "white:wifi" "wlan0" diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network index e884390c31..b069fe75e7 100755 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network @@ -99,6 +99,10 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "5:wan" "6@eth0" ;; + comfast,cf-e538ac) + ucidef_add_switch "switch0" \ + "4:lan" "5:wan" "6@eth0" + ;; comfast,cf-wr800n|\ hnet,c108) ucidef_add_switch "switch0" \