diff options
author | Andreas Böhler <dev@aboehler.at> | 2023-04-04 19:41:26 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2023-04-29 21:53:34 +0200 |
commit | 28df7f7ff251d8684caa60f07ed0ba0c4a8e71f4 (patch) | |
tree | 1e9dae9d4fc37a659ae0bcf3dd64e00af6a6423f /target/linux/ramips/image | |
parent | d256ab730910a638dc61a2ee1c01576404dab52e (diff) | |
download | upstream-28df7f7ff251d8684caa60f07ed0ba0c4a8e71f4.tar.gz upstream-28df7f7ff251d8684caa60f07ed0ba0c4a8e71f4.tar.bz2 upstream-28df7f7ff251d8684caa60f07ed0ba0c4a8e71f4.zip |
ramips: mt7621: add support for ZyXEL WSM20
The ZyXEL WSM20 aka Multy M1 is a cheap mesh router system by ZyXEL
based on the MT7621 CPU.
Specifications
==============
SoC: MediaTek MT7621AT (880MHz)
RAM: 256MiB
Flash: 128MiB NAND
Wireless: 802.11ax (2x2 MT7915E DBDC)
Ethernet: 4x 10/100/1000 (MT7530)
Button: 1x WPS, 1x Reset, 1x LED On/Off
LED: 7 LEDs (3x white, 2x red, 2x green)
MAC address assignment
======================
The MAC address assignment follows stock: The label MAC address is the LAN
MAC address, the WAN address is read from flash.
The WiFi MAC addresses are set in userspace to label MAC + 1 and label MAC
+ 2.
Installation (web interface)
============================
The device is cloud-managed, but there is a hidden local firmware upgrade
page in the OEM web interface. The device has to be registered in the
cloud in order to be able to access this page.
The system has a dual firmware design, there is no way to tell which
firmware is currently booted. Therefore, an -initramfs version is flashed
first.
1. Log into the OEM web GUI
2. Access the hidden upgrade page by navigating to
https://192.168.212.1/gui/#/main/debug/firmwareupgrade
3. Upload the -initramfs-kernel.bin file and flash it
4. Wait for OpenWrt to boot and log in via SSH
5. Transfer the sysupgrade file via SCP
6. Run sysupgrade to install the image
7. Reboot and enjoy
NB: If the initramfs version was installed in RAS2, the sysupgrade script
sets the boot number to the first partition. A backup has to be performed
manually in case the OEM firwmare should be kept.
Installation (UART method)
==========================
The UART method is more difficult, as the boot loader does not have a
timeout set. A semi-working stock firmware is required to configure it:
1. Attach UART
2. Boot the stock firmware until the message about failsafe mode appears
3. Enter failsafe mode by pressing "f" and "Enter"
4. Type "mount_root"
5. Run "fw_setenv bootmenu_delay 3"
6. Reboot, U-Boot now presents a menu
7. The -initramfs-kernel.bin image can be flashed using the menu
8. Run the regular sysupgrade for a permanent installation
Changing the partition to boot is a bit cumbersome in U-Boot, as there is
no menu to select it. It can only be checked using mstc_bootnum. To change
it, issue the following commands in U-Boot:
nand read 1800000 53c0000 800
mw.b 1800004 1 1
nand erase 53c0000 800
nand write 1800000 53c0000 800
This selects FW1. Replace "mw.b 1800004 1 1" by "mw.b 1800004 2 1" to
change to the second slot.
Back to stock
=============
It is possible to flash back to stock, but a OEM firmware upgrade is
required. ZyXEL does not provide the link on its website, but the link
can be acquired from the OEM web GUI by analyzing the transferred JSON
objects.
It is then a matter of writing the firmware to Kernel2 and setting the
boot partition to FW2:
mtd write zyxel.bin Kernel2
echo -ne "\x02" | dd of=/dev/mtdblock7 count=1 bs=1 seek=4 conv=notrunc
Signed-off-by: Andreas Böhler <dev@aboehler.at>
Credits to forum users Annick and SirLouen for their initial work on this
device
Diffstat (limited to 'target/linux/ramips/image')
-rw-r--r-- | target/linux/ramips/image/mt7621.mk | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index df89877c9a..96bfab3fef 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -62,6 +62,29 @@ define Build/iodata-mstc-header ) endef +define Build/znet-header + $(eval version=$(word 1,$(1))) + ( \ + data_size_crc="$$(dd if=$@ 2>/dev/null | gzip -c | \ + tail -c 8 | od -An -N4 -tx4 --endian big | tr -d ' \n')"; \ + payload_len="$$(dd if=$@ bs=4 count=1 skip=1 2>/dev/null | od -An -tdI --endian big | tr -d ' \n')"; \ + payload_size_crc="$$(dd if=$@ ibs=1 count=$$payload_len 2>/dev/null | gzip -c | \ + tail -c 8 | od -An -N4 -tx4 --endian big | tr -d ' \n')"; \ + echo -ne "\x5A\x4E\x45\x54" | dd bs=4 count=1 conv=sync 2>/dev/null; \ + echo -ne "$$(printf '%08x' $$(stat -c%s $@) | fold -s2 | xargs -I {} echo \\x{} | tac | tr -d '\n')" | \ + dd bs=4 count=1 conv=sync 2>/dev/null; \ + echo -ne "$$(echo $$data_size_crc | sed 's/../\\x&/g')" | \ + dd bs=4 count=1 conv=sync 2>/dev/null; \ + echo -ne "$$(echo $$payload_size_crc | sed 's/../\\x&/g')" | \ + dd bs=4 count=1 conv=sync 2>/dev/null; \ + echo -ne "\x12\x34\x56\x78" | dd bs=4 count=1 conv=sync 2>/dev/null; \ + echo -ne "$(version)" | dd bs=28 count=1 conv=sync 2>/dev/null; \ + dd if=/dev/zero bs=262096 count=1 conv=sync 2>/dev/null | tr "\000" "\377"; \ + cat $@; \ + ) > $@.new + mv $@.new $@ +endef + define Build/belkin-header $(eval magic=$(word 1,$(1))) $(eval hw_ver=$(word 2,$(1))) @@ -2875,3 +2898,19 @@ define Device/zyxel_wap6805 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef TARGET_DEVICES += zyxel_wap6805 + +define Device/zyxel_wsm20 + $(Device/dsa-migration) + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 8192k + IMAGE_SIZE := 41943040 + UBINIZE_OPTS := -E 5 + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := WSM20 + DEVICE_PACKAGES := kmod-mt7915-firmware + KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | znet-header V1.00(ABZF.0)C0 + KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | znet-header V1.00(ABZF.0)C0 + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += zyxel_wsm20 |