From 9415d7861e687cdc18c180d8a6e42b024969a6c9 Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Tue, 10 Sep 2024 23:47:52 +0900 Subject: [PATCH] ramips: add support for ELECOM WSC-X1800GS MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ELECOM WSC-X1800GS is a 2.4/5 GHz band 11ax (Wi-Fi 6) mesh extender, based on MT7621A Specification: - SoC : MediaTek MT7621A - RAM : DDR3 512 MiB (Nanya NT5CC256M16ER-EK) - Flash : RAW-NAND 128 MiB (Winbond W29N01HVSINF) - WLAN : 2.4/5 GHz 2T2R (MediaTek MT7915D + MT7975D) - Ethernet : 2x 10/100/1000 Mbps - switch : MediaTek MT7530 (SoC) - LEDs/Keys (GPIO): 9x/2x - UART : through-hole on PCB ("J4") - arrangement : 3.3V, GND, TX, RX from tri-angle marking - settings : 115200n8 - Power : 12 VDC, 1 A (Max. 10.5 W) Flash instruction using initramfs-factory image 1. Boot WMC-X1800GST normally 2. Access to "http://192.168.2.1/" and open firmware update page ("ファームウェア更新") 3. Select the OpenWrt initramfs-factory image and click apply ("適用") button 4. On initramfs image, download sysupgrade image to the device and perform sysupgrade with that image 5. Wait ~120 seconds to complete flashing Notes: - The "firmware" partition on the stock image is only 0xF00000 (15 MiB) and it's too small for the current OpenWrt firmware with UBI format. So use the unused area at the end of NAND flash for rootfs (UBI). MAC addresses: LAN : 04:AB:18:xx:xx:6E (Factory, 0x3fff4 (hex)) 2.4 GHz: 04:AB:18:xx:xx:6F (Factory, 0x3fffa (hex)) 5 GHz : 04:AB:18:xx:xx:70 (Factory, 0x4 (hex)) Signed-off-by: INAGAKI Hiroshi Link: https://github.com/openwrt/openwrt/pull/16384 Signed-off-by: Hauke Mehrtens --- .../ramips/dts/mt7621_elecom_wsc-x1800gs.dts | 33 +++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 18 ++++++++++ .../mt7621/base-files/etc/board.d/02_network | 3 ++ .../mt7621/base-files/lib/upgrade/platform.sh | 1 + 4 files changed, 55 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_elecom_wsc-x1800gs.dts diff --git a/target/linux/ramips/dts/mt7621_elecom_wsc-x1800gs.dts b/target/linux/ramips/dts/mt7621_elecom_wsc-x1800gs.dts new file mode 100644 index 0000000000..a24edb6136 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_elecom_wsc-x1800gs.dts @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_elecom_wxc-x1800gsx.dtsi" + +/ { + compatible = "elecom,wsc-x1800gs", "mediatek,mt7621-soc"; + model = "ELECOM WSC-X1800GS"; + + aliases { + label-mac-device = &wifi_band1; + }; +}; + +&state_default { + gpio { + groups = "uart3", "uart2", "jtag", "wdt"; + function = "gpio"; + }; +}; + +&wifi { + band@0 { + reg = <0>; + nvmem-cells = <&macaddr_factory_4 (-1)>; + nvmem-cell-names = "mac-address"; + }; + + wifi_band1: band@1 { + reg = <1>; + nvmem-cells = <&macaddr_factory_4 0>; + nvmem-cell-names = "mac-address"; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index ada747e631..749d4828cd 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1315,6 +1315,24 @@ endif endef TARGET_DEVICES += elecom_wrc-x1800gs +define Device/elecom_wsc-x1800gs + $(Device/nand) + DEVICE_VENDOR := ELECOM + DEVICE_MODEL := WSC-X1800GS + KERNEL_SIZE := 15360k + KERNEL_LOADADDR := 0x82000000 + KERNEL := kernel-bin | relocate-kernel $(loadaddr-y) | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + ARTIFACTS := initramfs-factory.bin + ARTIFACT/initramfs-factory.bin := append-image-stage initramfs-kernel.bin | \ + check-size $$$$(KERNEL_SIZE) | elecom-wrc-gs-factory WMC-2LX 0.00 -N | \ + append-string MT7621_ELECOM_WMC-2LX +endif + DEVICE_PACKAGES := kmod-mt7915-firmware -uboot-envtools +endef +TARGET_DEVICES += elecom_wsc-x1800gs + define Device/etisalat_s3 $(Device/sercomm_dxx) IMAGE_SIZE := 32768k 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 1460c7e10f..0ce704e02e 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -117,6 +117,9 @@ ramips_setup_interfaces() zyxel,lte3301-plus) ucidef_set_interface_lan "lan1 lan2 lan3 lan4" ;; + elecom,wsc-x1800gs) + ucidef_set_interface_lan "lan1 lan2" + ;; gnubee,gb-pc1) ucidef_set_interface_lan "ethblack ethblue" ;; 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 8eb72aaa39..4c8276bd49 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -91,6 +91,7 @@ platform_do_upgrade() { dlink,dir-3060-a1|\ dlink,dir-853-a3|\ elecom,wmc-x1800gst|\ + elecom,wsc-x1800gs|\ etisalat,s3|\ h3c,tx1800-plus|\ h3c,tx1801-plus|\ -- 2.30.2