From patchwork Tue Sep 24 10:47:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kristian Evensen X-Patchwork-Id: 1166494 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.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=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SDzdFAL6"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fNmtxOy7"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 46cyZP3cmLz9sPD for ; Tue, 24 Sep 2019 20:47:41 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cWcQmFZ/T0P4kKlD5PmsrrvLltyDu2k/Vn6vpO4V430=; b=SDzdFAL6UE3Bd2 TX+kX94VLaSIGatMBz+HcS63A4ExxyPv4wfMBAX/eXY2CT56c9obspK3oG5xWxgNcfVNY1gCOF7DU +5kMz8ShNm7Jy4sdkXVQp0IPMr5qjjLAgr5RyMErFMwZ7L98mES4/L7xghO5qn1lntQ1UMv2fnkIE MNSQ8vMSJTNIsWtkNRLMvV7Rha1uVbNn/97QY5It3Qb2rO6nfd8fHGRpAVzc4ldpJo0IJEHaK2Zsv zEqZ892Sd+iNbME5wFWImUThkU5XJkgJTwRTIiRnccULEXsWiOMMYeswif7GGwa1MtmYZ0RmLMxrV VXgANZL4ZP2t8R9U6Ohw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iCiLu-00089q-0b; Tue, 24 Sep 2019 10:47:26 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iCiLl-00080w-SY for openwrt-devel@lists.openwrt.org; Tue, 24 Sep 2019 10:47:19 +0000 Received: by mail-wm1-x343.google.com with SMTP id a6so1660257wma.5 for ; Tue, 24 Sep 2019 03:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Zsz6GcP/IUkkJY4HEna4vJak5auBQKSYE5ZjpKI/zp4=; b=fNmtxOy7X+pA51ycx3vHPQyH1FN+jRfWK9ogYaYJ/xRYyHeuJfGdbgaZGuDo3g6Sva Qji5GL1+/mIlWpi1qQ09WUIQS/RmN8aF2/Xezso0uPPGBHv3E/Eqk5dV0cgqd6RNxdtG 2OTg4DxiiWIcjomrMsrhShg/uZnjuGwKHuh45Y0qde0WQ1lgd1zekuaAkcyguzCHq4y5 11wfynQgcf2ZbGyf/EmEoksn2JGxTEQNeZ7fYetSbKXPtfL9Uz2B6MClNYpsOanXoS5G ejcRZWpZDEuwjN2i33GJA31t3SorbaDWgNa9+nHvPExUILcQd6WKKB9Gua6GMLJLEeP4 EBTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Zsz6GcP/IUkkJY4HEna4vJak5auBQKSYE5ZjpKI/zp4=; b=DOTyl94hM/cxQ6HJJALHszwhCLBbKnq2YRtS0exUYRzHj4+H6yqSSGcLmEEfDYVb0K Rejo2JANd8LsBUFLDdjuhHNgm5NR+du7CJ5PXNLWOTqBtaq012fZoHefivSbyN+a2pCe 9OWhw1tQknfKvRL5t1f0b3j1P4a9JpiCKD+mcNKTJOOAzrGEOXOACnFMmob+w623fuQ8 +0e9H4IfBFlew/SiLZON3OkcNQDXyx9y7o0nJoViWyeuzokptlzMdCaecrNaxFUK7Mna 36BX7RIG1nlCMrnnsjiWlLHtA9L7zc+HQhCcno7ImVFBMq8ogU+Uv9JLiBG8YzuWsGwH y2pg== X-Gm-Message-State: APjAAAV5KupXG+ccx9ZIw44BCpuZQNBJxaVWJBV60oVL/i3l6IXHXh47 yyUoPl2Y1YceE8WwZ2QYALQFITk8Zf0= X-Google-Smtp-Source: APXvYqyyxY2RYKrXN0JTlseL08HvzgOwUQFYYPdRjo1YshajrmSDlct0cdTnImoR6rfN/dFKpA8FHw== X-Received: by 2002:a05:600c:2049:: with SMTP id p9mr2134317wmg.30.1569322035833; Tue, 24 Sep 2019 03:47:15 -0700 (PDT) Received: from kristrev-XPS-15-9570.lan ([193.213.155.210]) by smtp.gmail.com with ESMTPSA id f8sm1681490wmb.37.2019.09.24.03.47.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2019 03:47:15 -0700 (PDT) From: Kristian Evensen To: openwrt-devel@lists.openwrt.org, dev@kresin.me, monkeh@monkeh.net, musashino.open@gmail.com, ynezz@true.cz Date: Tue, 24 Sep 2019 12:47:11 +0200 Message-Id: <20190924104712.19812-2-kristian.evensen@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190924104712.19812-1-kristian.evensen@gmail.com> References: <20190924104712.19812-1-kristian.evensen@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190924_034717_927983_E2AC3DF4 X-CRM114-Status: GOOD ( 18.19 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:343 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (kristian.evensen[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -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_EF Message has a valid DKIM or DK signature from envelope-from domain -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 Subject: [OpenWrt-Devel] [PATCH v2 1/2] ramips: Update ZBT WE1026 DTS-files X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kristian Evensen Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This commit makes the following changes to the WE1026 DTS-files: * The parts that are unique to the -5G-version (LED and 5GHz wifi) are moved to a separate file, so that WE1026.dtsi can be referenced also by the DTS for the -H version. * Changed button from polled to interrupt. * Use the generic "flash"-name for the spi-nor node. All changes have been tested on the WE1026-5G-16M and work fine. I.e., the device works as before the DTS-changes. v1->v2: * Added missing acked-bys. Signed-off-by: Kristian Evensen Acked-by: Mathias Kresin Acked-by: Alex Maclean Acked-by: INAGAKI Hiroshi Acked-by: Petr Štetiar Acked-by: Adrian Schmutzler --- .../dts/mt7620a_zbtlink_we1026-5g-16m.dts | 77 +-------------- .../ramips/dts/mt7620a_zbtlink_we1026-5g.dtsi | 93 +---------------- .../ramips/dts/mt7620a_zbtlink_we1026.dtsi | 99 +++++++++++++++++++ 3 files changed, 108 insertions(+), 161 deletions(-) create mode 100644 target/linux/ramips/dts/mt7620a_zbtlink_we1026.dtsi diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_we1026-5g-16m.dts b/target/linux/ramips/dts/mt7620a_zbtlink_we1026-5g-16m.dts index e2eb5b6329..0bb6812fcf 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_we1026-5g-16m.dts +++ b/target/linux/ramips/dts/mt7620a_zbtlink_we1026-5g-16m.dts @@ -1,81 +1,14 @@ -/* - * BSD LICENSE - * - * Copyright(c) 2017 Kristian Evensen . - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Broadcom Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; #include "mt7620a_zbtlink_we1026-5g.dtsi" / { - compatible = "zbtlink,we1026-5g-16m", "ralink,mt7620a-soc"; + compatible = "zbtlink,we1026-5g-16m", "zbtlink,we1026-5g", + "zbtlink,we1026", "ralink,mt7620a-soc"; model = "ZBT WE1026-5G (16M)"; }; -&spi0 { - status = "okay"; - - en25q128@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; - }; - - firmware: partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0xfb0000>; - }; - }; - }; +&firmware { + reg = <0x50000 0xfb0000>; }; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_we1026-5g.dtsi b/target/linux/ramips/dts/mt7620a_zbtlink_we1026-5g.dtsi index e7e64e251a..b90179fe1f 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_we1026-5g.dtsi +++ b/target/linux/ramips/dts/mt7620a_zbtlink_we1026-5g.dtsi @@ -1,47 +1,9 @@ -/* - * BSD LICENSE - * - * Copyright(c) 2017 Kristian Evensen . - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Broadcom Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "mt7620a.dtsi" - -#include -#include +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "mt7620a_zbtlink_we1026.dtsi" / { - compatible = "zbtlink,we1026-5g", "ralink,mt7620a-soc"; - - chosen { - bootargs = "console=ttyS0,115200"; - }; + compatible = "zbtlink,we1026-5g", "zbtlink,we1026", + "ralink,mt7620a-soc"; leds { compatible = "gpio-leds"; @@ -62,53 +24,6 @@ gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; }; }; - - keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; - reset { - label = "reset"; - gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; -}; - -&gpio2 { - status = "okay"; -}; - -&gpio3 { - status = "okay"; -}; - -&sdhci { - status = "okay"; -}; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - -ðernet { - mtd-mac-address = <&factory 0x28>; -}; - -&wmac { - ralink,mtd-eeprom = <&factory 0>; -}; - -&pinctrl { - state_default: pinctrl0 { - default { - ralink,group = "i2c", "uartf", "spi refclk", "ephy", "wled"; - ralink,function = "gpio"; - }; - }; }; &pcie { diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_we1026.dtsi b/target/linux/ramips/dts/mt7620a_zbtlink_we1026.dtsi new file mode 100644 index 0000000000..522a354305 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_zbtlink_we1026.dtsi @@ -0,0 +1,99 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "mt7620a.dtsi" + +#include +#include + +/ { + compatible = "zbtlink,we1026", "ralink,mt7620a-soc"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&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"; + 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; + }; + + firmware: partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + }; + }; + }; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&sdhci { + status = "okay"; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x28>; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0>; +}; + +&pinctrl { + state_default: pinctrl0 { + default { + ralink,group = "i2c", "uartf", "spi refclk", "ephy", "wled"; + ralink,function = "gpio"; + }; + }; +}; From patchwork Tue Sep 24 10:47:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kristian Evensen X-Patchwork-Id: 1166493 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.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=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="G8qTYHha"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="oV0SfWQZ"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 46cyZP11shz9sNF for ; Tue, 24 Sep 2019 20:47:41 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=k+G0ukU3YJNF1+Hs4MIJkcnYARLb/Esz+gt4nuV9x5A=; b=G8qTYHhayDF+ND VniL9ndimXxRVeqfw29ftSJtjg5kMFBSfs5HR0ln1AC9xa27ZkuIUBib9it99TNYXT/BRBE2bQ1wr +T4mjj6epDajYsop0qedjoCqWsGTvyrG5Ts8jZGk8yzDDolDwzWxKq0FlFoLA04NCarxIrlEVqUKw iwV4YcXbbaG/zuNAOY0FSbnTtOy0KwUYWya3rsSlahRVcrEZdU2fzK0CjJbYI6xqzO9MWaMT4jKBN q7H4c8/yNzLXyGAgb6BzQMDayN1r67XCzwwXXl9c+dTTC9l1C8jiyGRCSvJBfOulfKcmlozC1g+y5 Md3BMUVlBq2qsGGkR3+w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iCiM4-0008Re-7a; Tue, 24 Sep 2019 10:47:36 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iCiLn-00081P-7n for openwrt-devel@lists.openwrt.org; Tue, 24 Sep 2019 10:47:20 +0000 Received: by mail-wm1-x32d.google.com with SMTP id v17so1489258wml.4 for ; Tue, 24 Sep 2019 03:47:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CmIIgZtacVpIp3orqHx8kKbk2/jfMK8onKmcRKGbqSo=; b=oV0SfWQZzn0L06spCAcpn8dmqcK5qTu+XiZfab9S52xVAOL2z6nzxm17Ilo4+lc5Fe ujWJSZFEY50xGMqzZQRYdREqGjcAZz24NObPXDvtWIGqbBweB3uQBwOqkDvAGfyTe5WQ IM1rePS5AVzFA2QgXI0ofR6pRAWyqmLSs6Xz3Jfv1ItewxkUWBXe3PwSM/ip4+R9TIJy wI5lJ10qbOYBRO5U8IhqKLYFwJUUVdBIbfSMprJKJ4aEqyGAl8OYjJIWgV8YbrSUk9O9 Hx+H0GPaFH/Ujrj2rQZOS5yT2Nygu+0NP/SoKvtXmPGOFQV8idmjsjePhCWUAb6qcfrm DxUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CmIIgZtacVpIp3orqHx8kKbk2/jfMK8onKmcRKGbqSo=; b=Mpjm2a2Wi0xz58JwbuZ3XC68wuypW+dUYjVX2F309oIIZ07YwK7TEhkVJdUioM84N/ kvzzZw4QUsp+zPZ8/vIiqAay1IpgfLMmr5/U5qsBiRtDYh3F+vsy6LbuKxaKoTCGXdKd WRim9SIJvXStH6C2w6KeC1kDREbo1RQnPRpVZqd4Z3FQtzD27kmWrZFPYvuDN5gJwBpY XrapJFhNuMxv0zoCxW92+Y8bh1Y7rKnVhp9vqUx+6VcWYPzDj3RaAE7bcH1/X2XdXMT9 rBfnBxU0idTPlKHsZtT+58qVWGbvDAbF/wxA0mEKuOf2UkoHY0TpXm8NpMDSctfkl/rX LPZA== X-Gm-Message-State: APjAAAU609pxJ1a9UlzfzhqUHgxH5x3kM6TYPReyi4o/OI3ud8Ieos0V o7o1HXPGWDPI8SSVeNN+sIRZrkn5K9c= X-Google-Smtp-Source: APXvYqxna2MNr1TEGQ8d3g2vG3N9BUB/YP4rIITFsgPa/QTLOHhCldkl7SybHSn/uPkZRJGKuOmFbQ== X-Received: by 2002:a1c:9e0b:: with SMTP id h11mr2067845wme.144.1569322037241; Tue, 24 Sep 2019 03:47:17 -0700 (PDT) Received: from kristrev-XPS-15-9570.lan ([193.213.155.210]) by smtp.gmail.com with ESMTPSA id f8sm1681490wmb.37.2019.09.24.03.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2019 03:47:16 -0700 (PDT) From: Kristian Evensen To: openwrt-devel@lists.openwrt.org, dev@kresin.me, monkeh@monkeh.net, musashino.open@gmail.com, ynezz@true.cz Date: Tue, 24 Sep 2019 12:47:12 +0200 Message-Id: <20190924104712.19812-3-kristian.evensen@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190924104712.19812-1-kristian.evensen@gmail.com> References: <20190924104712.19812-1-kristian.evensen@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190924_034719_277991_65FEB88D X-CRM114-Status: GOOD ( 16.28 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:32d listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (kristian.evensen[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -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_EF Message has a valid DKIM or DK signature from envelope-from domain -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 Subject: [OpenWrt-Devel] [PATCH v2 2/2] ramips: Add support for ZBT WE1026-H X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kristian Evensen Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This commit adds support for the ZBT WE1026-H, an outdoor AP with support for adding an internal LTE modem. The detailed specs are: * CPU: MT7620A * 2x 10/100Mbps Ethernet (LAN port has passive PoE support). * 16/32 MB Flash. * 128/256 MB RAM. * 1x USB 2.0 port. * 1x mini-PCIe slot (only USB2.0 bus). * 1x SIM slot (standard size). * 1x 2.4Ghz WIFI (rt2800). * 1x button. * 6x LEDS (4 GPIO-controlled). * 1x micro-SD reader. The following have been tested and working: - Ethernet switch - Wifi - Mini-PCIe slot + SIM slot - USB port - microSD slot - sysupgrade - reset button Installation and recovery: In order to install OpenWRT the first time or ito recover the router, you can use the web-based recovery system. Keep the reset button pressed during boot and access 192.168.1.1 in your browser when your machine obtains an IP address. Upload the firmware to start the recovery process. Notes: * The LED labeled "USB" is used as the power LED. When binding this LED to a usbport, the LED is switched on all the time due to the presence of an internal hub. Thus, it does not really signal any USB-information. * I only have the 32MB version and have only added support for this device. However, the files are structured so that adding support for the 16MB version should be easy. * Only the LAN port is accessible from the outside of the casing and LEDs are not visible. v1->v2: * Rebased on top of master. * Read correct WAN address from flash (thanks Adrian Schmutzler). Signed-off-by: Kristian Evensen --- .../ramips/base-files/etc/board.d/01_leds | 5 +++ .../ramips/base-files/etc/board.d/02_network | 6 ++- .../dts/mt7620a_zbtlink_we1026-h-32m.dts | 14 +++++++ .../ramips/dts/mt7620a_zbtlink_we1026-h.dtsi | 42 +++++++++++++++++++ target/linux/ramips/image/mt7620.mk | 12 ++++++ 5 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 target/linux/ramips/dts/mt7620a_zbtlink_we1026-h-32m.dts create mode 100644 target/linux/ramips/dts/mt7620a_zbtlink_we1026-h.dtsi 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 46202b4117..3e12c2a947 100755 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/base-files/etc/board.d/01_leds @@ -461,6 +461,11 @@ zbtlink,zbt-we826-16m|\ zbtlink,zbt-we826-32m) set_wifi_led "zbt-we826:green:wifi" ;; +zbtlink,we1026-h-32m) + set_wifi_led "we1026-h:green:wifi" + ucidef_set_led_switch "lan" "lan" "we1026-h:green:lan" "switch0" "0x8" + ucidef_set_led_switch "wan" "wan" "we1026-h:green:wan" "switch0" "0x10" + ;; zbtlink,zbt-we1226) set_wifi_led "$boardname:green:wlan" ucidef_set_led_switch "lan1" "LAN1" "$boardname:green:lan1" "switch0" "0x01" 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 63644331e5..d94cd5fa98 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -272,7 +272,8 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0" ;; - buffalo,wcr-1166ds) + buffalo,wcr-1166ds|\ + zbtlink,we1026-h-32m) ucidef_add_switch "switch0" \ "3:lan" "4:wan" "6@eth0" ;; @@ -721,6 +722,9 @@ ramips_setup_macs() wan_mac=$(mtd_get_mac_binary factory 0xe006) label_mac=$(cat /sys/class/ieee80211/phy0/macaddress) ;; + zbtlink,we1026-h-32m) + wan_mac=$(mtd_get_mac_binary factory 0x2e) + ;; *) wan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 1) ;; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_we1026-h-32m.dts b/target/linux/ramips/dts/mt7620a_zbtlink_we1026-h-32m.dts new file mode 100644 index 0000000000..ca62ccfc84 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_zbtlink_we1026-h-32m.dts @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7620a_zbtlink_we1026-h.dtsi" + +/ { + compatible = "zbtlink,we1026-h-32m", "zbtlink,we1026-h", + "zbtlink,we1026","ralink,mt7620a-soc"; + model = "ZBT WE1026-H (32M)"; +}; + +&firmware { + reg = <0x50000 0x1fb0000>; +}; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_we1026-h.dtsi b/target/linux/ramips/dts/mt7620a_zbtlink_we1026-h.dtsi new file mode 100644 index 0000000000..fed79c2809 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_zbtlink_we1026-h.dtsi @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7620a_zbtlink_we1026.dtsi" + +/ { + compatible = "zbtlink,we1026-h", "zbtlink,we1026", + "ralink,mt7620a-soc"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = &wmac; + }; + + leds { + compatible = "gpio-leds"; + + led_power: usb { + label = "we1026-h:green:usb"; + gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "we1026-h:green:lan"; + gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "we1026-h:green:wan"; + gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; + }; + + wifi { + label = "we1026-h:green:wifi"; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + }; + }; + +}; diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index 320d4abd1f..3011e08af7 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -973,6 +973,18 @@ define Device/zbtlink_we1026-5g-16m endef TARGET_DEVICES += zbtlink_we1026-5g-16m +define Device/zbtlink_we1026-h-32m + MTK_SOC := mt7620a + DTS := WE1026-H-32M + IMAGE_SIZE := 32448k + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-WE1026-H + DEVICE_VARIANT := 32M + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 \ + kmod-ledtrig-netdev +endef +TARGET_DEVICES += zbtlink_we1026-h-32m + define Device/zbtlink_zbt-ape522ii MTK_SOC := mt7620a IMAGE_SIZE := 15872k