From patchwork Fri Jan 27 13:57:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= X-Patchwork-Id: 1732873 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=YBKcjAmX; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Li5vmDaL; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P3K6450Klz23hr for ; Sat, 28 Jan 2023 01:02:51 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From: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=oKNuG33/YqsTCG8EthfFucPECik+dk6Q925OUEwr9nM=; b=YBKcjAmXDPYg3v YboDIz+oVv7qgbfveG1a7lN2b2iHkmJwDEdE+VpGaPNvJaVg/MjWoYM+rCPNNr/n1ULZYvyVH+ocm JDH9k/yTEpfW4Y1+N20Bu34C8OXjMG5VrbGJZOMGuSOTVdRFQ3H6qSxFZ5av/2NuwE8cUwQco7ylG TdrXLZq8a0gwKkRfgEs6tvOc/pVsDm7m6lAZIgzkiIPC84PZ6/cZ+OKj7PJCZDb4vUGj2K9ssndnB 3YWKHkRMOZ+36BSDuL/agOSA8SyWJwwsRrXDBIyklm8+7LdYeRULO13XhXg5X+Fh9/Zwh0a2Lih+X McKQLsH+uk3GsJbUJ4Nw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pLPFA-00FBES-O3; Fri, 27 Jan 2023 13:58:17 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pLPEx-00FBAd-0Y for openwrt-devel@lists.openwrt.org; Fri, 27 Jan 2023 13:58:10 +0000 Received: by mail-ej1-x62d.google.com with SMTP id k4so8448686eje.1 for ; Fri, 27 Jan 2023 05:58:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=mRI1JfDxTPNZbaJkeuEjlhJi9QLO3CZ6PULjkrISLbU=; b=Li5vmDaL25XHZ1RUGZx6TGAuIJjJ6ld+3RGNN7NZZXg4KxHNJktvXQQco47+tXVvQF +se21B0iHxEaaCSEBqX2w+u+CyLrkckd4L/FO1a9KOOCQzzVfVp7CzaAUEJj2mf2Cnr2 nUc3J4SG7MZKIMUqHBsEBIEO8fikN9c1Dii+Prd29x6vvmRLVSx6J8m9DDV7CTHmmU8P Xu/Jf59LZzBjV5bu/H/Wn7xb9Q/ORwqYrfl2jUXXNjzBy5zQjUlBfPiMrdl++n6igo1Q 2yTLko/bYorzLiBv5Iwau22DVV8H8WsxgrcRFe/Y8oxxIEq/R0+sY9ynz1+puXc/6+Vb dRdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mRI1JfDxTPNZbaJkeuEjlhJi9QLO3CZ6PULjkrISLbU=; b=vza2dc8TlvH2s90YfOuXf8maZ0bPPyD3QbXtqFYbGXhHW+vsq66oSiVKYiK3ayFAlz qN8KLAvDBYCQ3pZfZ1kV7cIQ2akEkmrMswQbRpnS5kBOFu9OLMB+sh4SIdlCwezHv/ZC d8/FMFLGiFXtZsvrtX4guQpkzkyr8qjiabwr0J46vdDI7eogxNY25gRjIezZBlh7PYM/ PWUFNqZ284Fy480wAn/yu2eP/Z8bVN4dyNmU4dnmFaGY1AES9rjpj+UWBl4gH3LFJiRe +BnJpIH0nQhWKxvmbXJrWahq55yqyF9zLvYCHmskcwSUU0q98oEdcE4r0SGBWwR/UIUx RATQ== X-Gm-Message-State: AO0yUKWXNTgQDyXHrFJxiAl8BCgZn1z9RXWPRYc9xjJ3a9k37ZHqcd9A 6S8yLbAuimBRlN7WRLHQmg/CFq5Bq8gkZVyRbK8= X-Google-Smtp-Source: AK7set8Cij5oSdOXbZBodpJwpAKWZLEFbVir0jcbgMzWrTOnOQvtBtX+5DMxhdcbMzVb7YVlwa8dAQ== X-Received: by 2002:a17:906:9258:b0:878:7833:816a with SMTP id c24-20020a170906925800b008787833816amr5224302ejx.43.1674827878666; Fri, 27 Jan 2023 05:57:58 -0800 (PST) Received: from arinc9-PC.lan ([37.120.152.236]) by smtp.gmail.com with ESMTPSA id hw19-20020a170907a0d300b0087221268e49sm2191652ejc.186.2023.01.27.05.57.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jan 2023 05:57:58 -0800 (PST) From: arinc9.unal@gmail.com X-Google-Original-From: arinc.unal@arinc9.com To: openwrt-devel@lists.openwrt.org Cc: Enrico Mioso , =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= Subject: [PATCH v2] ramips: add support for Huasifei WS1208V2 Date: Fri, 27 Jan 2023 16:57:06 +0300 Message-Id: <20230127135705.449602-1-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230127_055803_142857_AD0B6F56 X-CRM114-Status: GOOD ( 12.46 ) X-Spam-Score: -0.2 (/) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__From=3A_Ar=C4=B1n=C3=A7_=C3=9CNAL_The_?= =?unknown-8bit?q?Huasifei_WS1208V2_is_an_AC1200_router?= =?unknown-8bit?q?_featuring_5_Ethernet_ports_with_a_Quectel_RM520N-GL_cellul?= =?unknown-8bit?q?ar_modem_which?= =?unknown-8bit?q?_supports_QMI_and_MBIM_modes=2E_Specifications=3A_-_MT7621A?= =?unknown-8bit?q?T=2C_256_MiB_RAM=2C_16_MiB?= =?unknown-8bit?q?_SPI_Flash_-_MT7603EN_2=2E4_GHz_=26_MT7612EN_5_GHz_WLAN_-_Q?= =?unknown-8bit?q?uectel_RM520N-GL_Cellular?= =?unknown-8bit?q?_Modem_-_2_WLAN_=26_4_Cellular_Antennas_-_5_Gigabit_Etherne?= =?unknown-8bit?q?t_Ports_-_1_USB_=5B=2E=2E=2E=5D?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=28-0=2E2_points=2C_5=2E0_re?= =?unknown-8bit?q?quired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_a?= =?unknown-8bit?q?t_https=3A//www=2Ednswl=2Eorg/=2C?= =?unknown-8bit?q?_no_trust?= =?unknown-8bit?b?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDo2MmQgbGlzdGVkIGluXQ==?= =?unknown-8bit?b?IFtsaXN0LmRuc3dsLm9yZ10=?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_0=2E0_FREEMAIL=5FFROM__________Sender_email_is_commonly_ab?= =?unknown-8bit?q?used_enduser_mail?= =?unknown-8bit?q?_provider?= =?unknown-8bit?b?IFthcmluYzkudW5hbFthdF1nbWFpbC5jb21d?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_author=27s_domain?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily?= =?unknown-8bit?q?_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 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 From: Arınç ÜNAL The Huasifei WS1208V2 is an AC1200 router featuring 5 Ethernet ports with a Quectel RM520N-GL cellular modem which supports QMI and MBIM modes. Specifications: - MT7621AT, 256 MiB RAM, 16 MiB SPI Flash - MT7603EN 2.4 GHz & MT7612EN 5 GHz WLAN - Quectel RM520N-GL Cellular Modem - 2 WLAN & 4 Cellular Antennas - 5 Gigabit Ethernet Ports - 1 USB 2.0 port - 1 PCI-E Slot - 1 M.2 slot - 1 SIM card slot - 1 SD card slot Installation: - Install sysupgrade image via ROOter OS. TFTP Recovery: - Connect to serial console. - Boot initramfs image by choosing option 1 when U-Boot prompts. - Install sysupgrade image via OpenWrt. Link: https://www.huasifei.com/a/Products/5G%20CPE/240.html Signed-off-by: Arınç ÜNAL --- v2: Add recovery information. --- .../ramips/dts/mt7621_huasifei_ws1208v2.dts | 187 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 12 ++ .../mt7621/base-files/etc/board.d/01_leds | 3 + 3 files changed, 202 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts diff --git a/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts b/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts new file mode 100644 index 0000000000..c69f05a0f4 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts @@ -0,0 +1,187 @@ +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "huasifei,ws1208v2", "mediatek,mt7621-soc"; + model = "Huasifei WS1208V2"; + + aliases { + led-boot = &led_status; + led-failsafe = &led_status; + led-running = &led_status; + led-upgrade = &led_status; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + button-reset { + label = "Reset"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status: led-status { + label = "green:status"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + led-cellular { + label = "green:cellular"; + gpios = <&gpio 10 GPIO_ACTIVE_LOW>; + }; + + led-wlan5g { + label = "green:wlan5g"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + led-wlan2g { + label = "green:wlan2g"; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led-usb { + label = "green:usb"; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + trigger-sources = <&xhci_ehci_port1>; + linux,default-trigger = "usbport"; + }; + }; +}; + +&sdhci { + status = "okay"; +}; + +&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"; + reg = <0x50000 0xfb0000>; + label = "firmware"; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "pci14c3,7603"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "pci14c3,7662"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + + led { + led-sources = <2>; + }; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan1"; + }; + + port@1 { + status = "okay"; + label = "lan2"; + }; + + port@2 { + status = "okay"; + label = "lan3"; + }; + + port@3 { + status = "okay"; + label = "lan4"; + }; + }; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 2269833e48..bbd25e5be0 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -996,6 +996,18 @@ define Device/humax_e10 endef TARGET_DEVICES += humax_e10 +define Device/huasifei_ws1208v2 + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Huasifei + DEVICE_MODEL := WS1208V2 + DEVICE_PACKAGES := kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \ + kmod-usb3 kmod-usb-net-cdc-mbim kmod-usb-net-qmi-wwan \ + kmod-usb-serial-option -wpad-basic-wolfssl +endef +TARGET_DEVICES += huasifei_ws1208v2 + define Device/iodata_wn-ax1167gr $(Device/dsa-migration) $(Device/uimage-lzma-loader) 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 985eefb860..cce0f1ac5d 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -88,6 +88,9 @@ dlink,dir-882-r1) gnubee,gb-pc2) ucidef_set_led_netdev "ethyellow" "ethyellow" "orange:ethyellow" "ethyellow" "link tx rx" ;; +huasifei,ws1208v2) + ucidef_set_led_netdev "wwan0" "wwan0" "green:cellular" "wwan0" "link tx rx" + ;; keenetic,kn-3010) ucidef_set_led_netdev "internet" "internet" "green:internet" "wan" ;;