From patchwork Tue Sep 22 22:27:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Heppler, J. Scott" X-Patchwork-Id: 1369372 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=centurylink.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=MmYKi480; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=centurylink.net header.i=@centurylink.net header.a=rsa-sha1 header.s=ctl201402 header.b=dUJuki1o; 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 4BwwxJ0p6Rz9sSn for ; Wed, 23 Sep 2020 08:30:27 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From:Date: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Aq7nJQ1qPg/Gnt1ocQNktcCfrNUWOM+R1NAhR6+SSa8=; b=MmYKi480qc93QT bm67W/5THSlcnDDt6QiQpyLQ0hGjmW+FryBZ8D70QCUs844Y0LVc63DeO2zgDAbx8lCNwaifVm3ne 5SxnsoW2cxQC5Klmxblj2NbWiHibDrKCFqgHFcLV6AKMAz/IPdgcbkEM4ULa3aF3pKu5pdd/ts+IF zPTuJsR1si1B0hm65cXAvUmJGM+baps4qnnOMSG+qiVhUDctKEeWTnf0Hqvl5oSrndBCHRWLR41QL lDYZDN7vujUxBVW64CS//i4kWkuJD854h81Eb+dK5k/mGNsIiw67S1FYi83fgyIem2wC0uDEzohuf n77tmmYblPplAwsjy9sg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKqlV-0000c4-9C; Tue, 22 Sep 2020 22:28:01 +0000 Received: from util-01.infra.openwrt.org ([46.101.232.90]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKqlT-0000b9-25 for openwrt-devel@lists.openwrt.org; Tue, 22 Sep 2020 22:28:00 +0000 Received: from mail.onyx.syn-alias.com ([206.152.134.66] helo=smtp.centurylink.net) by util-01.infra.openwrt.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1kKqlO-0004Eo-18 for openwrt-devel@openwrt.org; Tue, 22 Sep 2020 18:27:54 -0400 DKIM-Signature: v=1; a=rsa-sha1; d=centurylink.net; s=ctl201402; c=relaxed/simple; q=dns/txt; i=@centurylink.net; t=1600813671; h=From:Subject:Date:To:MIME-Version:Content-Type; bh=WhrevG3wcfaPquO3O072y7u/oBk=; b=dUJuki1ofoCahQhBz4EN0DjfUmecOPrUCoxXB/z3+d9m57QxjMfcbKBDmKI1wFce VAvHC4wn7X1NAtWMFwypZ1ssJGVDFn8gI1AaTD3QYDP/MjnzfYXtRIu9nuLWa5x9 W6KjOgHPzzMLWogWifflrNFT3T/OEQYdOQKsVjN9SfTQWBzJVqICEb+cQQgLNwo4 0rMlaCyAgUxHpNulAMakqG6KbDmd0fSnHQKBzVJ2JJhv3waEunNcGzkcXQ96OnGN NVI3httqNWgY3KZyg3N0XzRGcStq5dJgxhrL6AmR+fOzzCJYcElUff6cthpc0Rbk eNhY37qHwrxJm1L5/esSaA==; X_CMAE_Category: , , X-CNFS-Analysis: v=2.3 cv=R7N95uZX c=1 sm=1 tr=0 a=qtwFVzWLeuLlnZwnnJ7L6A==:117 a=qtwFVzWLeuLlnZwnnJ7L6A==:17 a=KGjhK52YXX0A:10 a=IkcTkHD0fZMA:10 a=reM5J-MqmosA:10 a=AsiJWZegAdEA:10 a=eQrCS-SpgXYA:10 a=PKj5RQeBQEnCA0097WkA:9 a=QEXdDO2ut3YA:10 X-CM-Score: 0 X-Scanned-by: Cloudmark Authority Engine Feedback-ID: dfw:ctl:res:onyx X-Authed-Username: c2hlcDk3MUBjZW50dXJ5bGluay5uZXQ= Authentication-Results: smtp03.onyx.dfw.sync.lan smtp.user=shep971@centurylink.net; auth=pass (LOGIN) Received: from [71.32.13.250] ([71.32.13.250:38134] helo=centurylink.net) by smtp.centurylink.net (envelope-from ) (ecelerity 3.6.25.56547 r(Core:3.6.25.0)) with ESMTPSA (cipher=DHE-RSA-AES256-GCM-SHA384) id A6/E9-04642-66A7A6F5; Tue, 22 Sep 2020 18:27:51 -0400 Date: Tue, 22 Sep 2020 15:27:44 -0700 From: "Heppler, J. Scott" To: openwrt-devel@openwrt.org Subject: [PATCH]ramips: add support for Linksys EA7300 v2 Message-ID: <20200922222744.GA64982@centurylink.net> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Score: -1.9 (-) X-Spam-Report: Spam detection software, running on the system "util-01.infra.openwrt.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 jo@mein.io for details. Content preview: ramips: add support for Linksys EA7300 v2 This submission relied heavily on the work of Santiago Rodriguez-Papa Specifications: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: centurylink.net] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [206.152.134.66 listed in wl.mailspike.net] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (shep971[at]centurylink.net) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (shep971[at]centurylink.net) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -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_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200922_182759_231813_8A985E31 X-CRM114-Status: GOOD ( 73.28 ) X-Spam-Score: -1.3 (-) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-1.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [46.101.232.90 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [shep971[at]centurylink.net] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [shep971[at]centurylink.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -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.29 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 ramips: add support for Linksys EA7300 v2 This submission relied heavily on the work of Santiago Rodriguez-Papa Specifications: * SoC: MediaTek MT7621A (880 MHz 2c/4t) * RAM: Nanya NT5CC128M16IP-DIT (256M DDR3-1600) * Flash: Macronix MX30LF1G18AC-TI (128M NAND) * Eth: MediaTek MT7621A (10/100/1000 Mbps x5) * Radio: MT7603E/MT7615N (2.4 GHz & 5 GHz) 4 antennae: 1 internal and 3 non-deatachable * USB: 3.0 (x1) * LEDs: White (x1 logo) Green (x6 eth + wps) Orange (x5, hardware-bound) * Buttons: Reset (x1) WPS (x1) Installation: Flash factory image through GUI. This might fail due to the A/B nature of this device. When flashing, OEM firmware writes over the non-booted partition. If booted from 'A', flashing over 'B' won't work. To get around this, you should flash the OEM image over itself. This will then boot the router from 'B' and allow you to flash OpenWRT without problems. Reverting to factory firmware: Hard-reset the router three times to force it to boot from 'B.' This is where the stock firmware resides. To remove any traces of OpenWRT from your router simply flash the OEM image at this point. --- package/boot/uboot-envtools/files/ramips | 1 + .../ramips/dts/mt7621_linksys_ea7300-v2.dts | 55 +++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 9 +++ .../mt7621/base-files/etc/board.d/01_leds | 1 + .../mt7621/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 1 + .../mt7621/base-files/etc/init.d/bootcount | 1 + .../mt7621/base-files/lib/upgrade/platform.sh | 1 + 8 files changed, 70 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_linksys_ea7300-v2.dts diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 6ff04b26e8..14c12bbf09 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -40,6 +40,7 @@ ravpower,rp-wd03) ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000" ;; linksys,ea7300-v1|\ +linksys,ea7300-v2|\ linksys,ea7500-v2|\ xiaomi,mi-router-ac2100|\ xiaomi,mir3p|\ diff --git a/target/linux/ramips/dts/mt7621_linksys_ea7300-v2.dts b/target/linux/ramips/dts/mt7621_linksys_ea7300-v2.dts new file mode 100644 index 0000000000..f7330d1c86 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_linksys_ea7300-v2.dts @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7621_linksys_ea7xxx.dtsi" + +/ { + compatible = "linksys,ea7300-v2", "mediatek,mt7621-soc"; + model = "Linksys EA7300 v2"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + leds { + compatible = "gpio-leds"; + + wan_green { + label = "ea7300-v2:green:wan"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + + lan1_green { + label = "ea7300-v2:green:lan1"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + lan2_green { + label = "ea7300-v2:green:lan2"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + + lan3_green { + label = "ea7300-v2:green:lan3"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + lan4_green { + label = "ea7300-v2:green:lan4"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + led_power: power { + label = "ea7300-v2:white:power"; + gpios = <&gpio 10 GPIO_ACTIVE_HIGH>; + }; + + wps { + label = "ea7300-v2:green:wps"; + gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; + }; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 78629563ee..274d9f7158 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -655,6 +655,15 @@ define Device/linksys_ea7300-v1 endef TARGET_DEVICES += linksys_ea7300-v1 +define Device/linksys_ea7300-v2 + $(Device/linksys_ea7xxx) + DEVICE_MODEL := EA7300 + DEVICE_VARIANT := v2 + LINKSYS_HWNAME := EA7300v2 + DEVICE_PACKAGES += kmod-mt7603 +endef +TARGET_DEVICES += linksys_ea7300-v2 + define Device/linksys_ea7500-v2 $(Device/linksys_ea7xxx) DEVICE_MODEL := EA7500 diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index c5cd446809..8c3be541b0 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -42,6 +42,7 @@ gnubee,gb-pc2) ucidef_set_led_netdev "lan2" "lan2" "$boardname:green:lan2" "lan2" ;; linksys,ea7300-v1|\ +linksys,ea7300-v2|\ linksys,ea7500-v2) ucidef_set_led_netdev "lan1" "lan1 link" "$boardname:green:lan1" "lan1" "link" ucidef_set_led_netdev "lan2" "lan2 link" "$boardname:green:lan2" "lan2" "link" diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 1c1d0e4ab7..26063470e8 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -105,6 +105,7 @@ ramips_setup_macs() label_mac=$wan_mac ;; linksys,ea7300-v1|\ + linksys,ea7300-v2|\ linksys,ea7500-v2) lan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr) wan_mac=$lan_mac diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 3f7fdc1a79..b7a41f038c 100644 --- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -11,6 +11,7 @@ board=$(board_name) case "$board" in linksys,ea7300-v1|\ + linksys,ea7300-v2|\ linksys,ea7500-v2) hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr) [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress diff --git a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount index b17161a50a..7ef0053e67 100755 --- a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount +++ b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount @@ -9,6 +9,7 @@ boot() { echo -e "bootcount\nbootchanged\n" | /usr/sbin/fw_setenv -s - ;; linksys,ea7300-v1|\ + linksys,ea7300-v2|\ linksys,ea7500-v2) mtd resetbc s_env || true ;; diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index b1feea7ae6..442e78df3c 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -49,6 +49,7 @@ platform_do_upgrade() { dlink,dir-2660-a1|\ hiwifi,hc5962|\ linksys,ea7300-v1|\ + linksys,ea7300-v2|\ linksys,ea7500-v2|\ netgear,r6220|\ netgear,r6260|\