OpenWrt for Zyxel WSM20 (Multy M1) development discussion

it's described earlier in the thread ...

I've lost the track in multiple aspects of this thread
I'm trying to do a compilation of discoveries but the right way, not the "forced partition rewriting method"

Still I'm unable to interpret this to make a viable DTS with such. For me this is a dead end. I will have to research on mappings and all this because I'm completely lost on this part of the DTS.

this is getting ridiculus,even the mt7622 target is not working on the way it is, so i'm not sure why here this device is the bad sheep

I'm assuming that this is what happens when you play blind without an official DTS that openly displays the mem locations for things within the device.

I was writting this trying to put in order my brain and I thought: why I don't build a DTS with that exactly NAND structure I've posted there?

And WIFI driver loaded!! Let's f******g gooooooo!!!!!!!!!!! OpenWrt Wifi is on da house!!!!!

01:00.0 Unclassified device [0002]: MEDIATEK Corp. Device 7916 (prog-if 80)
        Subsystem: MEDIATEK Corp. Device 7916
        Flags: bus master, fast devsel, latency 0, IRQ 29
        Memory at 60000000 (64-bit, prefetchable) [size=1M]
        Memory at 60100000 (64-bit, prefetchable) [size=16K]
        Memory at 60104000 (64-bit, prefetchable) [size=4K]
        Capabilities: [80] Express Endpoint, MSI 00
        Capabilities: [e0] MSI: Enable- Count=1/32 Maskable+ 64bit+
        Capabilities: [f8] Power Management version 3
        Capabilities: [100] Vendor Specific Information: ID=1556 Rev=1 Len=008 <?>
        Capabilities: [108] Latency Tolerance Reporting
        Capabilities: [110] L1 PM Substates
        Capabilities: [200] Advanced Error Reporting
        Kernel driver in use: mt7915e_hif

02:00.0 Unclassified device [0002]: MEDIATEK Corp. MT7915E 802.11ax PCI Express Wireless Network Adapter (prog-if 80)
        Subsystem: MEDIATEK Corp. MT7915E 802.11ax PCI Express Wireless Network Adapter
        Device tree node: /sys/firmware/devicetree/base/pcie@1e140000/pcie@1,0/wifi@0,0
        Flags: bus master, fast devsel, latency 0, IRQ 30
        Memory at 60200000 (64-bit, prefetchable) [size=1M]
        Memory at 60300000 (64-bit, prefetchable) [size=16K]
        Memory at 60304000 (64-bit, prefetchable) [size=4K]
        Capabilities: [80] Express Endpoint, MSI 00
        Capabilities: [e0] MSI: Enable- Count=1/32 Maskable+ 64bit+
        Capabilities: [f8] Power Management version 3
        Capabilities: [100] Vendor Specific Information: ID=1556 Rev=1 Len=008 <?>
        Capabilities: [108] Latency Tolerance Reporting
        Capabilities: [110] L1 PM Substates
        Capabilities: [200] Advanced Error Reporting
        Kernel driver in use: mt7915e

Ok, now time to go to bed. Tomorrow I will see how I could be flashing this firmware

1 Like

SirLoen

thanks for infos for partitions in dts

For make quickly the tests i have used with x-wrt for the same product that i use the bootloader : HUASIFEI-AX-1800 or mt7621_xwrt_wr1800k-ax-nand

do so that the official openwrt takes care of it that does not interest me because
1 - OpenWrt offical cannot do STA/AP directly with my internet box
openwrt passes tv streams with cuts in WPS <---> WPS
2 - WPS <---> WPS does not allow me to run minidlna server as well as samba
3 - the DSA no longer allows the use of multiple CPUs
and probably many other problems not resolved since the old version 17.1

  • At this time i am using a 22.03 version with M-T-K drivers
    it's a shame that the DSA makes me lose performance in WIFI but everything works very well

SirLoen

next steps

create in mt7621.mk a part for zyxel WSM20

also in platform.sh , 01_leds & 02_network

1 - i have only modified my dts with your mtd infos & using OEM bootloader , FW1 not start

2 - with my new bootloader hang-up

  1. First of all I need to find a way to flash the device comfortably, without UART.

  2. What is FW1?

tried the physical buttons, see what they do, if keep pressed during power on ?

Ouu yeah, I found the hidden gem in the Zyxel UI interface

You know what is Down here in the deep blue sea? Sponge Bob!

Shall I be brave and flash my firmware? :dizzy_face: :dizzy_face:

How did you get there ?

If it's within the webui, there's a bigger risk they do proper checks on the files you upload, and there's always a risk of creating a soft brick, but if you've backed everything up ...

I was inspired by another device info page. I start checking the JS code (the UI is based on AngularJS) and I found this route.

From what I've read on other ZyXEL devices, it seems to go well when you flash through UI.

This part is very tricky. I'm going to snif with a MITM through wireshark the auto-upload process from the UI to see if I can get the official latest firmware URL instead of dumping from failsafe mode as Annick suggested. Not sure to which extent those dumps could be useful at all in case of brick. Anyway, I have access to U-Boot so theorically I could be flashing from there OpenWRT new builds until I get with good one right?

I've tried hard pressing all the 3 hardware buttons in the device, and any of the really enters a recovery mode.

also check after upgrade if the firmware stay on the same partition or if is on partition firmware2.
some zyxel device can flash openwrt only on firmware1 partition.

if you have the initramfs up and running, you can always dd the mtds, then scp those dumps off the router.

yes, u-boot it always an option, and it's usually less strict when it comes to "sanity" checks of the images it get fed with.

Do you think that a cat command for all mtd could be sufficient as Annick suggested or you will backup full-metal dd is required?

it should be enough, or dd, instead of cat.

if you ever need to recover the full flash, you'll need a flash writer.

hum , a flash writer for a nand "fakir"

cat /proc:mtd
cat /dev/devx > devx.bin
full is not possible in ram too big

you could mount a network drive on the router, and write it directly to the share.

or something like https://unix.stackexchange.com/questions/34273/can-i-pipe-stdout-on-one-server-to-stdin-on-another-server but with cat or dd, instead of tar.

try it with mtds 1st, then compare the checksums, so you know they're identical on both sides.

Yes that is a problem, I don't have a flash writer, and I don't really have the electronic skills as I mentioned before... this is a little risky for me though, so I'm going to try to pick the OG firmware from the servers

This said, I don't find useful to backup ALL MTD dude. I think you are killing flees with cannons.
The only partition that is going to be overwritted with a flash is mtd4 OR mtd5 (I'm not 100% confident). And maybe factory mtd3 (I'm not 100% sure). These are barely a couple of MB (81.8MB to be precise)

ZyXEL has exact size firmware partitions, firmware1 and firmware2. According to @ercolino ZyXEL flashes external firmwares on firmware1, leaving their firmware2 untouched.

Bootloader, u-boot-env, and factory

# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 07f80000 00020000 "All"
mtd1: 00100000 00020000 "Bootloader"
mtd2: 00100000 00020000 "Ubootenv"
mtd3: 001c0000 00020000 "Factory"
mtd4: 02800000 00020000 "firmware"
mtd5: 02800000 00020000 "firmware_now"
mtd6: 00380000 00020000 "kernel"
mtd7: 02440000 00020000 "rootfs"
mtd8: 00100000 00020000 "persist"
mtd9: 00400000 00020000 "rootfs_data"
mtd10: 025c0000 00020000 "app"
mtd11: 00100000 00020000 "crt"
mtd12: 02800000 00020000 "RAS1"
mtd13: 02800000 00020000 "RAS2"

So the command I might issue
dd if=/dev/mtd5 of=mtd5.bin

# ls -lh
-rw-r--r--    1 root     root        1.8M Jan  1 00:12 mtd3.bin
-rw-r--r--    1 root     root       40.0M Jan  1 00:12 mtd4.bin
-rw-r--r--    1 root     root       40.0M Jan  1 00:13 mtd5.bin

First thing Is to save what You can in case of failure.
cat /dev/mtd0 |gzip > /tmp/mtd0.gz
and rest mtd's same way . One by one if RAM storage on /tmp is low.

then md5sum from mtd part
md5sum /dev/mtd* > /tmp/mtd.md5
then cat /proc/mtd > /tmp/proc.mtd

then scp everything into safe place.
Such full backup will allow to merge it in single file and program flash memory if bad thing happen