From patchwork Wed Nov 11 05:04:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sven Danner X-Patchwork-Id: 1397929 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=XnF/LkuL; 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=dzia7Fuk; 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 4CWCQb0zfJz9s1l for ; Wed, 11 Nov 2020 16:07:17 +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=KgE3diwEdEeqOZQdwp/rl2ibKAC1sH1c5bXgmkJzbmk=; b=XnF/LkuLsyQJ7OFN8P1RAmU6iu Se3BFKlOvZvRrKGvXjbXl0tHFMajJnq8fj5XGCwAXeq6MZ9h3Bg+3JgYkiFa+SuF5o9twDQrcR4Mp XTlpcJjMiw24gHTyYulr25SILy4VTT5FXbrNCLe8+iYMDZXXqU1K5f+TomWGpDyLTM5a6cU4L/2cu YqLpwrH91bPLTGTj3gJOwlMLzclgYyYB/U4SbzvDmU17/7fROgy8g7Pa79I4p5L2XyAxbQZDp2yiS aVE1wYCpMgBMye7YIPlaRhwAU1rRWFp3VgcWRfCOVRsHSiQQcbbTdtpgEuUoQ5+IBpVoLVKXb6SD0 mPsZAWfw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kciJX-0003fe-Gv; Wed, 11 Nov 2020 05:04:59 +0000 Received: from mout.gmx.net ([212.227.15.18]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kciJU-0003eU-IH for openwrt-devel@lists.openwrt.org; Wed, 11 Nov 2020 05:04:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1605071091; bh=eBHBwH4Awd+jWiIo1kIpv9XvBUKsHABYpFXnC45OHN0=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=dzia7FukbO5aexQ0m6RrA17V4nVRBJEvld2EmaR3O76k6uJ3sw1IKeoW4c46OnFte A45s9zlObec4UE4amKLVToWYZdWJYxsx6yiX2W3Sxnd6XjG2SlXwO4wG6m9y47r9oz 1W4JMMC9W8XjJLgL+FI0ZI+Q2tqIRwpjYs+DJuqw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [137.154.7.48] ([137.154.7.48]) by web-mail.gmx.net (3c-app-gmx-bs32.server.lan [172.19.170.84]) (via HTTP); Wed, 11 Nov 2020 06:04:51 +0100 MIME-Version: 1.0 Message-ID: From: Sven Danner To: john@phrozen.org Subject: [PATCH] Adds support for Comfast CF-E538AC Date: Wed, 11 Nov 2020 06:04:51 +0100 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:bKW5AdK7mcHv3oOTOem7BN476XdjI1iGCzqKcs5A3JarS2ltKBW0DGCqut+QGGkKoYYF9 6yvSIppYUcA5/Lu3o5in6wsAKBdEoGD7oO4n1jay6YkifEoKkMRuNKtnMjjJpyeny0RJJXBwlhPm ATifHBWPVT+TfKa4o5fmQgcuw6tFHRm+NhFcPXm0yOBk7f4w+bBmOT/nzgZ7iiLuCkKDwde/ldVf tTWXAxYVuH+WTBR2qHLKd1XRvW+HDfs6DTWUppepyibrfN5CAIq9ZcrDXx5q7N0MSPeSVrogrdtS iA= X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:bptcKiIbRgQ=:HyQLl6M5UJTUy63Y29N1bG tX9SG6THPHzySw5O/qtWbabUjiF/0qzRg/CH2M6IsDjI8qV+sCTB4hWUCDCtV4EI6j63fWKc+ zIsn7xYdf664hxwDaglKwefqVc7TIHjU53fg8OW3OYY5lwNkUTnRZ/hFoh7ddXYK03tRoc58F pQQCfDQ6eF42OQgkyLrm2A+OQirx7lUfSzVjWB5nphIqV/0Mod2jC7Pt+4p3Iz5dMdltz18hf C0ObOeShiTEfoaY/1jU7qt9wb/WtCX5n0ENCSZasQApFYAhx3GGQ4MrlC/XfRQuee8jQI3b59 n8tZfKWioIzW3nfB/OJYvLppQ0PcGQVXzdOXzdh1KXWoYtv36npTgKaepAFpyaf7B7XycXqaC vI7dE0mJ2I/JN2CdevX8aSrXmZzeiomrAXCc+oXORdnVPcSJy1zfZPCO2qWt0telA+D0SySGb aKMzJSfYVRhcJT4rz6eIgexEDuGm3AjSUcH1CXvxvezSOZvwxRj6i+pL0gBgcyTztSzPhtW7j OmMNAJc5cQzETMbxxQ3uWm2AA4dxChjL3fJGf7aQnkB5JcByZFbVV9AsdDncang7oWX7OfWJb Pt1GWmY+Wdq2A= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201111_000456_948819_1C462962 X-CRM114-Status: GOOD ( 14.16 ) 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.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.15.18 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [sven314[at]gmx.net] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.15.18 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [sven314[at]gmx.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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_VALID Message has at least one valid DKIM or DK signature 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/base-files/etc/board.d/01_leds | 3 + .../ramips/base-files/etc/board.d/02_network | 9 + target/linux/ramips/base-files/lib/ramips.sh | 3 + target/linux/ramips/dts/CF-E538AC.dts | 161 ++++++++++++++++++ target/linux/ramips/image/mt7620.mk | 7 + 5 files changed, 183 insertions(+) create mode 100644 target/linux/ramips/dts/CF-E538AC.dts 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 5c005db0c1..16c012d827 100755 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/base-files/etc/board.d/01_leds @@ -88,6 +88,9 @@ c50) ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e" ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" ;; +cf-e538ac) + set_wifi_led "$boardname:white:wifi" + ;; cf-wr800n) ucidef_set_led_netdev "lan" "lan" "$boardname:white:ethernet" eth0.1 set_wifi_led "$boardname:white:wifi" 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 8ca1831afe..637a4fd6a1 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -310,6 +310,11 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "4:lan" "6t@eth0" ;; + cf-e538ac) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ucidef_add_switch "switch0" \ + "4:wan" "5:lan" "6@eth0" + ;; cudy,wr1000) ucidef_add_switch "switch0" \ "2:lan:2" "3:lan:1" "4:wan" "6@eth0" @@ -548,6 +553,10 @@ ramips_setup_macs() lan_mac=$(cat /sys/class/net/eth0/address) wan_mac=$(mtd_get_mac_binary devdata 7) ;; + cf-e538ac) + lan_mac=$(mtd_get_mac_binary factory 57344) + wan_mac=$(macaddr_add "$lan_mac" 1) + ;; cy-swr1100|\ dir-645) lan_mac=$(mtd_get_mac_ascii nvram lanmac) diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 093303892c..5e9b8fdb09 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -97,6 +97,9 @@ ramips_board_detect() { *"CF-WR800N") name="cf-wr800n" ;; + *"CF-E538AC") + name="cf-e538ac" + ;; *"CS-QR10") name="cs-qr10" ;; diff --git a/target/linux/ramips/dts/CF-E538AC.dts b/target/linux/ramips/dts/CF-E538AC.dts new file mode 100644 index 0000000000..9a2504203b --- /dev/null +++ b/target/linux/ramips/dts/CF-E538AC.dts @@ -0,0 +1,161 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7620a.dtsi" + +#include +#include + +/ { + compatible = "comfast,cf-e538ac", "ralink,mt7620n-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 = "cf-e538ac:white:wifi"; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio0 13 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 = < 0x09 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 0>; + reg = < 0x10180000 0x9c40 >; +}; + + +&pcie { + status = "okay"; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "uartf", "nd_sd", "wled"; + ralink,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 89723fbb52..d16704a55e 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -155,6 +155,13 @@ define Device/cf-wr800n endef TARGET_DEVICES += cf-wr800n +define Device/cf-e538ac + DTS := CF-E538AC + DEVICE_TITLE := Comfast CF-E538AC + DEVICE_PACKAGES := kmod-mt76x2 +endef +TARGET_DEVICES += cf-e538ac + define Device/cs-qr10 DTS := CS-QR10 DEVICE_TITLE := Planex CS-QR10