From patchwork Sat Nov 28 09:41:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: INAGAKI Hiroshi X-Patchwork-Id: 1407496 X-Patchwork-Delegate: freifunk@adrianschmutzler.de 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=gmail.com 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=BI2O8FhV; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=QvnzMeHp; 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 4Cjmml6X1Cz9sRR for ; Sat, 28 Nov 2020 20:44:39 +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:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fQndgDhLdppHtH9tbRUHsGPORyuUcWP0NY+aN8GJhEY=; b=BI2O8FhV1WJkZ0ZoulBx5caiJ 1ekDZ2D0BMeMBBCP8H7AKr70QfTu2W1/nMghVWOgUJVglbMfW4gEYvPt+RJhuw1TiAfDuBTV+ieki kyArFeAPqGeWxeUVMMqjNAWqOjqVk4SKdU92KShp8nyMA0GuNCC631ykm0dYljH7gYnssDfiOeKbi Cin6k0HPv457EKacde/+FV0ixuaVJOaAFpAM3jRRoQAhdgM/GtUgOvArR5V4abCe4/cXt23QupZ+o S7nCebmO/gIr5CamXOlQj8oe+7l3vIq7aVZLVWhylkEMXKOKAp9sZKuin0Wf1bcuuCDgNUewgOBEU BgI71bmgw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kiwjY-00041Y-Ec; Sat, 28 Nov 2020 09:41:37 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kiwjS-00040O-Rv for openwrt-devel@lists.openwrt.org; Sat, 28 Nov 2020 09:41:32 +0000 Received: by mail-pg1-x543.google.com with SMTP id k11so6238199pgq.2 for ; Sat, 28 Nov 2020 01:41:30 -0800 (PST) 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=hShQPRrk5A37Y/JSfus/LACluOXs38SfwbtQkqutfvQ=; b=QvnzMeHpc0pq+7kYBcgOhaQJiwpRIReupFwOvQShOXMW6GbucYH7G70htVRd3Qz1Q2 /j6ziEdYNKT0Cwz3kFZP1X8YM5R3W5h0LUd9kByhv/V0mDz2NHrMw15rcY/4LGWE5XQD bpGQarZH6s1MeaVSFI9aYLIX7oDCxsA8yLVVOKP5IaX3LafbgoMbKBLm2IS4ilarVC7u R8hd1Ov0l5eMDt7d74nFob2WFLsPPtfXRCEMtzepYgYmvgjk7c0y+x5h8H4riO115D+P rMGIA1PRFoE7SQqJGm+eLS69Cdum4KKv7wesloSOFXDXk/46CW0rqgGOXg9g206i2Qh9 qnlQ== 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=hShQPRrk5A37Y/JSfus/LACluOXs38SfwbtQkqutfvQ=; b=Po7wdfmnCaIXlLpfFXiiash6GwMr0APnc+fi3DXGhbQUILWCoVA7eqSsU3Mu/v2NEb LqEz3G60XRpUcKqp5OJg6bvMeZ1APeahN3Aa9kR3k61+GsfkyAnfmPfPao72H1GkcqWc /y7yvq7LcW/FnDu/hlHqRNubYCRvcTwghQlb0oUGD/4RZqHmheBCtvH355VV/MvPr4My PxWdFuPL8sCHeCQZzh3HrJVfh77XdDcC6Blis73Vc4PX5LL7Zr2MsOVSiFQHu4o6s+xb 0ay2iS1pjQe1uSdo0SDwX8NimE2qPve/bIgw1S3d1RAXIDOtLB/+kn1k5Gc1IQwORMUz 8QFA== X-Gm-Message-State: AOAM531FAaX5hXe5Dorno+SjgxgwYpCt7uohsHwGCnIipEMNA4BcUG/j QAL1bd1D1K/B8lvijbcZB+8FcKXhga09Ng== X-Google-Smtp-Source: ABdhPJw1SzqytKmOK2n8u2mEAzRUJTvMeLIPVNh53vEX0WxPMjL+d6D4FMkVxnCZJQvT1tCkuI7pRg== X-Received: by 2002:a63:4d07:: with SMTP id a7mr10153980pgb.274.1606556488394; Sat, 28 Nov 2020 01:41:28 -0800 (PST) Received: from localhost.localdomain (M014008005000.v4.enabler.ne.jp. [14.8.5.0]) by smtp.gmail.com with ESMTPSA id mv5sm13956644pjb.42.2020.11.28.01.41.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Nov 2020 01:41:27 -0800 (PST) From: INAGAKI Hiroshi To: openwrt-devel@lists.openwrt.org Subject: [PATCH 1/2] ramips: add support for ELECOM WRC-1167GS2-B Date: Sat, 28 Nov 2020 18:41:12 +0900 Message-Id: <20201128094113.1109-2-musashino.open@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201128094113.1109-1-musashino.open@gmail.com> References: <20201128094113.1109-1-musashino.open@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201128_044131_037551_F8DCB157 X-CRM114-Status: GOOD ( 17.49 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.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 [2607:f8b0:4864:20:0:0:0:543 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [musashino.open[at]gmail.com] 0.0 NUMERIC_HTTP_ADDR URI: Uses a numeric IP address in URL 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 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: INAGAKI Hiroshi Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org ELECOM WRC-1167GS2-B is a 2.4/5 GHz band 11ac (Wi-Fi 5) router, based on MT7621A. Specification: - SoC : MediaTek MT7621A - RAM : DDR3 128 MiB - Flash : SPI-NOR 16 MiB - WLAN : 2.4/5 GHz 2T2R (MediaTek MT7615D) - Ethernet : 10/100/1000 Mbps x5 - Switch : MediaTek MT7530 (SoC) - LED/keys : 6x/6x (2x buttons, 1x slide-switch) - UART : through-hole on PCB - J4: 3.3V, GND, TX, RX from ethernet port side - 57600n8 - Power : 12VDC, 1A MAC addresses: LAN : 04:AB:18:**:**:13 (Factory, 0xFFF4 (hex)) WAN : 04:AB:18:**:**:14 (Factory, 0xFFFA (hex)) 2.4 GHz : 04:AB:18:**:**:15 (none) 5 GHz : 04:AB:18:**:**:16 (Factory, 0x4 (hex)) Flash instruction using factory image: 1. Boot WRC-1167GS2-B normally 2. Access to "http://192.168.2.1/" and open firmware update page ("ファームウェア更新") 3. Select the OpenWrt factory image and click apply ("適用") button 4. Wait ~120 seconds to complete flashing Notes: - there is no way to configure the correct MAC address for secondary phy (5GHz) on MT7615D - Wi-Fi band on primary phy (2.4GHz) cannot be limitted by specifying ieee80211-freq-limit (fail to register secondary phy due to error) - mtd-mac-address in the wifi node is required for using mtd-mac-address-increment Signed-off-by: INAGAKI Hiroshi --- .../dts/mt7621_elecom_wrc-1167gs2-b.dts | 57 ++++++ .../dts/mt7621_elecom_wrc-1167gsxx.dtsi | 179 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 8 + 3 files changed, 244 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts create mode 100644 target/linux/ramips/dts/mt7621_elecom_wrc-1167gsxx.dtsi diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts new file mode 100644 index 0000000000..af0c580c64 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_elecom_wrc-1167gsxx.dtsi" + +/ { + compatible = "elecom,wrc-1167gs2-b", "mediatek,mt7621-soc"; + model = "ELECOM WRC-1167GS2-B"; + + aliases { + label-mac-device = &wan; + }; +}; + +&gmac0 { + mtd-mac-address = <&factory 0xfff4>; +}; + +&wan { + mtd-mac-address = <&factory 0xfffa>; +}; + +&partitions { + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xb00000>; + }; + + partition@b50000 { + label = "tm_pattern"; + reg = <0xb50000 0x380000>; + read-only; + }; + + partition@ed0000 { + label = "tm_key"; + reg = <0xed0000 0x80000>; + read-only; + }; + + partition@f50000 { + label = "nvram"; + reg = <0xf50000 0x30000>; + read-only; + }; + + partition@f80000 { + label = "user_data"; + reg = <0xf80000 0x80000>; + read-only; + }; +}; + +&wifi { + mtd-mac-address = <&factory 0x4>; + mtd-mac-address-increment = <(-1)>; +}; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1167gsxx.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gsxx.dtsi new file mode 100644 index 0000000000..a13ddc963f --- /dev/null +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gsxx.dtsi @@ -0,0 +1,179 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_green; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + leds { + compatible = "gpio-leds"; + + wlan2g { + label = "white:wlan2g"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + wlan5g { + label = "white:wlan5g"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + led_power_green: power_green { + label = "green:power"; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; + }; + + power_blue { + label = "blue:power"; + gpios = <&gpio 8 GPIO_ACTIVE_HIGH>; + }; + + wps { + label = "red:wps"; + gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; + }; + + power_red { + label = "red:power"; + gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + client { + label = "client"; + gpios = <&gpio 41 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + + ap { + label = "ap"; + gpios = <&gpio 42 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + + extender { + label = "extender"; + gpios = <&gpio 43 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + + router { + label = "router"; + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + }; +}; + +&switch0 { + ports { + wan: port@0 { + status = "okay"; + label = "wan"; + }; + + port@1 { + status = "okay"; + label = "lan4"; + }; + + port@2 { + status = "okay"; + label = "lan3"; + }; + + port@3 { + status = "okay"; + label = "lan2"; + }; + + port@4 { + status = "okay"; + label = "lan1"; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions: 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; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi: wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uart3", "jtag", "wdt", "sdhci"; + function = "gpio"; + }; +}; + +&xhci { + status = "disabled"; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index ce9a3ae3d2..468c6ad4da 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -404,6 +404,14 @@ define Device/elecom_wrc-gs DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware endef +define Device/elecom_wrc-1167gs2-b + $(Device/elecom_wrc-gs) + IMAGE_SIZE := 11264k + DEVICE_MODEL := WRC-1167GS2-B + ELECOM_HWNAME := WRC-1167GS2 +endef +TARGET_DEVICES += elecom_wrc-1167gs2-b + define Device/elecom_wrc-1750gs $(Device/elecom_wrc-gs) IMAGE_SIZE := 11264k